bug fix #1128
This commit is contained in:
parent
aa453fb155
commit
eab0f36b15
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "4";
|
||||
public const string Build = "2";
|
||||
public const string Revision = "1803";
|
||||
public const string Revision = "1804";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=2
|
||||
%REVISION%=1803
|
||||
%MINOR%=4
|
||||
%REVISION%=1804
|
||||
%COREVERSION%=2
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.4.2.1803'
|
||||
!define VERSION '3.4.2.1804'
|
||||
|
|
|
|||
|
|
@ -750,6 +750,8 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
if (parameters != null)
|
||||
sb.Append("(" + parameters.ToString() + ")");
|
||||
sb.Append(";");
|
||||
foreach (var pa in this.proc_attributes.proc_attributes)
|
||||
sb.Append(" " + pa.ToString() + " ");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
|||
cv.ProcessNode(root);
|
||||
cv.Output(@"Light1.txt");*/
|
||||
|
||||
/*try
|
||||
try
|
||||
{
|
||||
//root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz4.txt"));
|
||||
root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz4.txt"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
#endif
|
||||
return root;
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ namespace SyntaxVisitors
|
|||
//function_header nfh = ObjectCopier.Clone(fh);
|
||||
|
||||
function_header nfh = fh.TypedClone();
|
||||
nfh.proc_attributes.proc_attributes.RemoveAll(pat => pat.attribute_type == proc_attribute.attr_override);
|
||||
|
||||
//function_header nfh = new function_header();
|
||||
//nfh.name = new method_name(fh.name.meth_name.name);
|
||||
|
|
@ -614,6 +615,8 @@ namespace SyntaxVisitors
|
|||
//var pdCloned = ObjectCopier.Clone(pd);
|
||||
var pdCloned = (procedure_definition)pd.Clone();
|
||||
|
||||
pdCloned.proc_header.proc_attributes.proc_attributes.RemoveAll(pat => pat.attribute_type == proc_attribute.attr_override);
|
||||
|
||||
pdCloned.has_yield = false;
|
||||
|
||||
|
||||
|
|
@ -658,6 +661,8 @@ namespace SyntaxVisitors
|
|||
// frninja 05/06/16 - фиксим source_context
|
||||
pd.proc_header.name.meth_name.source_context); // = new method_name("<yield_helper_locals_type_detector>" + pd.proc_header.className.meth_name.className);
|
||||
|
||||
//pdCloned.proc_header.proc_attributes.proc_attributes.RemoveAll(pat => pat.attribute_type == proc_attribute.attr_override);
|
||||
|
||||
InsertHelperMethod(pd, pdCloned); // SSM 13.07.16 - вызов этого метода можно не добавлять
|
||||
}
|
||||
|
||||
|
|
@ -915,7 +920,7 @@ namespace SyntaxVisitors
|
|||
|
||||
public override void visit(procedure_definition pd)
|
||||
{
|
||||
// frninja 14/06/16 - проверяем наличие yield у вложенных методов (и запрещаем )
|
||||
// frninja 14/06/16 - проверяем наличие yield у вложенных методов (и запрещаем)
|
||||
CheckInnerMethodsWithYield(pd);
|
||||
|
||||
if (!pd.has_yield)
|
||||
|
|
|
|||
17
TestSuite/yield_override.pas
Normal file
17
TestSuite/yield_override.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
type
|
||||
t1=abstract class
|
||||
public
|
||||
//i: integer := 1;
|
||||
function f1:sequence of t1; abstract;
|
||||
end;
|
||||
t2=class(t1)
|
||||
public
|
||||
function f1:sequence of t1; override;
|
||||
begin
|
||||
yield nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
Assert(t2.Create.f1.First = nil);
|
||||
end.
|
||||
|
|
@ -13228,7 +13228,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
case SyntaxTree.proc_attribute.attr_forward:
|
||||
{
|
||||
if (with_class_name) AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
if (with_class_name)
|
||||
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
//(ssyy) В интерфейсах аттрибуты недопустимы
|
||||
if (context.converted_type != null && context.converted_type.IsInterface)
|
||||
{
|
||||
|
|
@ -13246,7 +13247,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
case SyntaxTree.proc_attribute.attr_virtual:
|
||||
{
|
||||
|
||||
if (with_class_name) AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
if (with_class_name)
|
||||
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
//(ssyy) В интерфейсах аттрибуты недопустимы
|
||||
if (context.converted_type != null && context.converted_type.IsInterface)
|
||||
{
|
||||
|
|
@ -13286,7 +13288,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
case SyntaxTree.proc_attribute.attr_override:
|
||||
case SyntaxTree.proc_attribute.attr_reintroduce:
|
||||
{
|
||||
if (with_class_name) AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
if (with_class_name)
|
||||
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
//(ssyy) В интерфейсах аттрибуты недопустимы
|
||||
if (context.converted_type != null && context.converted_type.IsInterface)
|
||||
{
|
||||
|
|
@ -13365,7 +13368,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
case SyntaxTree.proc_attribute.attr_abstract:
|
||||
{
|
||||
if (with_class_name) AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
if (with_class_name)
|
||||
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "DIRECTIVE_{0}_NOT_ALLOWED", _procedure_attributes_list.proc_attributes[i].name);
|
||||
if (context.converted_type != null && context.converted_type.IsInterface)
|
||||
{
|
||||
AddError(get_location(_procedure_attributes_list.proc_attributes[i]), "ATTRIBUTES_IN_INTERFACE_MEMBER");
|
||||
|
|
|
|||
Loading…
Reference in a new issue