This commit is contained in:
Ivan Bondarev 2023-04-02 11:23:08 +02:00
parent 96d449bfd8
commit ef6a3a6d83
4 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,4 @@
begin
//!Встречена неправильная форматная строка
begin
var s := $'{{{';
end.

View file

@ -0,0 +1,12 @@
//!Совместное использование модификаторов override и reintroduce недопустимо
type
c1 = abstract class
procedure p1; abstract;
end;
c2 = class (c1)
procedure p1; reintroduce; override;
begin end;
end;
begin end.

View file

@ -0,0 +1,12 @@
//!Совместное использование модификаторов override и reintroduce недопустимо
type
c1 = abstract class
procedure p1; abstract;
end;
c2 = class (c1)
procedure p1; override;reintroduce;
begin end;
end;
begin end.

View file

@ -14078,9 +14078,11 @@ namespace PascalABCCompiler.TreeConverter
bool is_override = false;
bool is_virtual = false;
bool is_abstract = false;
bool is_reintroduce = false;
string override_proc_attr=null;
string virtual_proc_attr=null;
string abstract_proc_attr = null;
string reintroduce_proc_attr = null;
for (int i = 0; i < _procedure_attributes_list.proc_attributes.Count; i++)
{
switch (_procedure_attributes_list.proc_attributes[i].attribute_type)
@ -14103,6 +14105,12 @@ namespace PascalABCCompiler.TreeConverter
virtual_proc_attr = _procedure_attributes_list.proc_attributes[i].name;
}
break;
case SyntaxTree.proc_attribute.attr_reintroduce:
{
is_reintroduce = true;
reintroduce_proc_attr = _procedure_attributes_list.proc_attributes[i].name;
}
break;
}
}
context.top_function.is_overload = true; // SSM 12/08/15
@ -14221,6 +14229,10 @@ namespace PascalABCCompiler.TreeConverter
{
AddError(get_location(_procedure_attributes_list.proc_attributes[i]),"USING_MODIFIERS{0}_{1}_TOGETHER_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name,virtual_proc_attr);
}
if (_procedure_attributes_list.proc_attributes[i].attribute_type == SyntaxTree.proc_attribute.attr_override && is_reintroduce)
{
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "USING_MODIFIERS{0}_{1}_TOGETHER_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name, reintroduce_proc_attr);
}
if (_procedure_attributes_list.proc_attributes[i].attribute_type == SyntaxTree.proc_attribute.attr_override)
{
is_override = true;