diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 7e853f697..37acdc649 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -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 = "1848"; + public const string Revision = "1851"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 1f15727f6..38153eec7 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=4 -%REVISION%=1848 %COREVERSION%=2 +%REVISION%=1851 +%MINOR%=4 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 67317be98..93e65e410 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.2.1848' +!define VERSION '3.4.2.1851' diff --git a/SyntaxTree/tree/SyntaxTreeStreamReader.cs b/SyntaxTree/tree/SyntaxTreeStreamReader.cs index 108676206..4386b14d8 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamReader.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamReader.cs @@ -1698,6 +1698,7 @@ namespace PascalABCCompiler.SyntaxTree _simple_property.parameter_list = _read_node() as property_parameter_list; _simple_property.attr = (definition_attribute)br.ReadByte(); _simple_property.virt_over_none_attr = (proc_attribute)br.ReadByte(); + _simple_property.is_auto = br.ReadBoolean(); } diff --git a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs index 6e2b19889..08e9106bc 100644 --- a/SyntaxTree/tree/SyntaxTreeStreamWriter.cs +++ b/SyntaxTree/tree/SyntaxTreeStreamWriter.cs @@ -2221,6 +2221,7 @@ namespace PascalABCCompiler.SyntaxTree } bw.Write((byte)_simple_property.attr); bw.Write((byte)_simple_property.virt_over_none_attr); + bw.Write(_simple_property.is_auto); } diff --git a/SyntaxTree/tree/Tree.cs b/SyntaxTree/tree/Tree.cs index 71f2d0f72..3bc6046ae 100644 --- a/SyntaxTree/tree/Tree.cs +++ b/SyntaxTree/tree/Tree.cs @@ -16294,7 +16294,7 @@ namespace PascalABCCompiler.SyntaxTree /// ///Конструктор с параметрами. /// - public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr) + public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,bool _is_auto) { this._property_name=_property_name; this._property_type=_property_type; @@ -16304,13 +16304,14 @@ namespace PascalABCCompiler.SyntaxTree this._parameter_list=_parameter_list; this._attr=_attr; this._virt_over_none_attr=_virt_over_none_attr; + this._is_auto=_is_auto; FillParentsInDirectChilds(); } /// ///Конструктор с параметрами. /// - public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,SourceContext sc) + public simple_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,bool _is_auto,SourceContext sc) { this._property_name=_property_name; this._property_type=_property_type; @@ -16320,6 +16321,7 @@ namespace PascalABCCompiler.SyntaxTree this._parameter_list=_parameter_list; this._attr=_attr; this._virt_over_none_attr=_virt_over_none_attr; + this._is_auto=_is_auto; source_context = sc; FillParentsInDirectChilds(); } @@ -16331,6 +16333,7 @@ namespace PascalABCCompiler.SyntaxTree protected property_parameter_list _parameter_list; protected definition_attribute _attr; protected proc_attribute _virt_over_none_attr; + protected bool _is_auto; /// /// @@ -16464,6 +16467,21 @@ namespace PascalABCCompiler.SyntaxTree } } + /// + /// + /// + public bool is_auto + { + get + { + return _is_auto; + } + set + { + _is_auto=value; + } + } + /// Создает копию узла public override syntax_tree_node Clone() @@ -16509,6 +16527,7 @@ namespace PascalABCCompiler.SyntaxTree } copy.attr = attr; copy.virt_over_none_attr = virt_over_none_attr; + copy.is_auto = is_auto; return copy; } @@ -16675,7 +16694,7 @@ namespace PascalABCCompiler.SyntaxTree /// ///Конструктор с параметрами. /// - public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,formal_parameters _property_parametres,default_indexer_property_node _is_default) + public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,bool _is_auto,formal_parameters _property_parametres,default_indexer_property_node _is_default) { this._property_name=_property_name; this._property_type=_property_type; @@ -16685,6 +16704,7 @@ namespace PascalABCCompiler.SyntaxTree this._parameter_list=_parameter_list; this._attr=_attr; this._virt_over_none_attr=_virt_over_none_attr; + this._is_auto=_is_auto; this._property_parametres=_property_parametres; this._is_default=_is_default; FillParentsInDirectChilds(); @@ -16693,7 +16713,7 @@ namespace PascalABCCompiler.SyntaxTree /// ///Конструктор с параметрами. /// - public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,formal_parameters _property_parametres,default_indexer_property_node _is_default,SourceContext sc) + public index_property(ident _property_name,type_definition _property_type,expression _index_expression,property_accessors _accessors,property_array_default _array_default,property_parameter_list _parameter_list,definition_attribute _attr,proc_attribute _virt_over_none_attr,bool _is_auto,formal_parameters _property_parametres,default_indexer_property_node _is_default,SourceContext sc) { this._property_name=_property_name; this._property_type=_property_type; @@ -16703,6 +16723,7 @@ namespace PascalABCCompiler.SyntaxTree this._parameter_list=_parameter_list; this._attr=_attr; this._virt_over_none_attr=_virt_over_none_attr; + this._is_auto=_is_auto; this._property_parametres=_property_parametres; this._is_default=_is_default; source_context = sc; @@ -16790,6 +16811,7 @@ namespace PascalABCCompiler.SyntaxTree } copy.attr = attr; copy.virt_over_none_attr = virt_over_none_attr; + copy.is_auto = is_auto; if (property_parametres != null) { copy.property_parametres = (formal_parameters)property_parametres.Clone(); diff --git a/SyntaxTree/tree/TreeHelper.cs b/SyntaxTree/tree/TreeHelper.cs index b7464f3de..72ce775f5 100644 --- a/SyntaxTree/tree/TreeHelper.cs +++ b/SyntaxTree/tree/TreeHelper.cs @@ -1073,7 +1073,7 @@ namespace PascalABCCompiler.SyntaxTree public partial class simple_property { public simple_property(ident name, type_definition type, property_accessors accessors, SourceContext sc = null) - : this(name, type, null, accessors, null, null, definition_attribute.None,proc_attribute.attr_none,sc) + : this(name, type, null, accessors, null, null, definition_attribute.None,proc_attribute.attr_none,false,sc) { } } diff --git a/SyntaxTree/tree/tree.xml b/SyntaxTree/tree/tree.xml index 92b1e9192..07315f2e5 100644 --- a/SyntaxTree/tree/tree.xml +++ b/SyntaxTree/tree/tree.xml @@ -1021,6 +1021,7 @@ + @@ -4228,6 +4229,7 @@ + diff --git a/TestSuite/IncludeFuncCallParameter.pas b/TestSuite/IncludeFuncCallParameter.pas new file mode 100644 index 000000000..186c31ea7 --- /dev/null +++ b/TestSuite/IncludeFuncCallParameter.pas @@ -0,0 +1,7 @@ +function MyReadInteger := 1; + +begin + var s: Set of Integer; + Include(s, MyReadInteger); + Assert(s=[1]); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 37c7cf394..b9dd22b4d 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -6473,6 +6473,7 @@ namespace PascalABCCompiler.TreeConverter { expression_node param0 = convert_strong(_method_call.parameters.expressions[0]); expression_node param1 = convert_strong(_method_call.parameters.expressions[1]); + param1 = convert_if_typed_expression_to_function_call(param1); expressions_list args = new expressions_list(); args.AddElement(param0); args.AddElement(param1);