From 308da7ab5c791047901ef485c73692f7d3ca6b2b Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Thu, 4 Aug 2022 11:19:54 +0300 Subject: [PATCH] =?UTF-8?q?UnknownID=20=D0=B2=20yield=5Funknown=5Fident=20?= =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B3=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D1=80=D0=B8=D1=80=D1=83=D0=B5=D0=BC=D1=8B=D0=BC=20=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- Localization/DefaultLang.resources | Bin 100541 -> 100784 bytes Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- SyntaxTree/tree/HierarchyVisitor.cs | 1 + SyntaxTree/tree/SyntaxTreeStreamReader.cs | 1 + SyntaxTree/tree/SyntaxTreeStreamWriter.cs | 9 +++ SyntaxTree/tree/Tree.cs | 74 +++++++++++++++++-- SyntaxTree/tree/TreeHelper.cs | 6 +- SyntaxTree/tree/tree.xml | 5 +- TestSuite/CompilationSamples/DMTaskMaker.pas | 4 +- 12 files changed, 91 insertions(+), 19 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 1d2e35657..6a82daa57 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 = "8"; public const string Build = "3"; - public const string Revision = "3147"; + public const string Revision = "3150"; 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 b6dfc4340..dd4605542 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=8 -%REVISION%=3147 %COREVERSION%=3 +%REVISION%=3150 +%MINOR%=8 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index e83f41b676d08c6847d2eeac5b47254b22237e25..be043f15947b2881477b2b8b04f900556837f80e 100644 GIT binary patch delta 230 zcmdlxk!{0dwh0fI&U9>iw9r>PH9fPqB(=yfFU2`OucRnHCm^RZJu`2*p#`I`NDx$3 zAu%sS0V+S)pHZSd$kp95IK(w5-qFt`-r3(TB*@< ///Конструктор с параметрами. /// - public yield_unknown_ident(string _name) + public yield_unknown_ident(ident _UnknownID) { - this._name=_name; + this._UnknownID=_UnknownID; FillParentsInDirectChilds(); } /// ///Конструктор с параметрами. /// - public yield_unknown_ident(string _name,SourceContext sc) + public yield_unknown_ident(ident _UnknownID,SourceContext sc) { - this._name=_name; + this._UnknownID=_UnknownID; source_context = sc; FillParentsInDirectChilds(); } + + /// + ///Конструктор с параметрами. + /// + public yield_unknown_ident(string _name,ident _UnknownID) + { + this._name=_name; + this._UnknownID=_UnknownID; + FillParentsInDirectChilds(); + } + + /// + ///Конструктор с параметрами. + /// + public yield_unknown_ident(string _name,ident _UnknownID,SourceContext sc) + { + this._name=_name; + this._UnknownID=_UnknownID; + source_context = sc; + FillParentsInDirectChilds(); + } + protected ident _UnknownID; + + /// + /// + /// + public ident UnknownID + { + get + { + return _UnknownID; + } + set + { + _UnknownID=value; + if (_UnknownID != null) + _UnknownID.Parent = this; + } + } + + /// Создает копию узла public override syntax_tree_node Clone() { yield_unknown_ident copy = new yield_unknown_ident(); copy.Parent = this.Parent; - copy.UnknownID = this.UnknownID; if (source_context != null) copy.source_context = new SourceContext(source_context); if (attributes != null) @@ -46383,6 +46422,11 @@ namespace PascalABCCompiler.SyntaxTree copy.attributes.Parent = copy; } copy.name = name; + if (UnknownID != null) + { + copy.UnknownID = (ident)UnknownID.Clone(); + copy.UnknownID.Parent = copy; + } return copy; } @@ -46397,6 +46441,8 @@ namespace PascalABCCompiler.SyntaxTree { if (attributes != null) attributes.Parent = this; + if (UnknownID != null) + UnknownID.Parent = this; } /// Заполняет поля Parent во всем поддереве @@ -46404,6 +46450,7 @@ namespace PascalABCCompiler.SyntaxTree { FillParentsInDirectChilds(); attributes?.FillParentsInAllChilds(); + UnknownID?.FillParentsInAllChilds(); } /// @@ -46413,7 +46460,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 0; + return 1; } } /// @@ -46423,7 +46470,7 @@ namespace PascalABCCompiler.SyntaxTree { get { - return 0; + return 1; } } /// @@ -46435,12 +46482,23 @@ namespace PascalABCCompiler.SyntaxTree { if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1) throw new IndexOutOfRangeException(); + switch(ind) + { + case 0: + return UnknownID; + } return null; } set { if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1) throw new IndexOutOfRangeException(); + switch(ind) + { + case 0: + UnknownID = (ident)value; + break; + } } } /// diff --git a/SyntaxTree/tree/TreeHelper.cs b/SyntaxTree/tree/TreeHelper.cs index 608ed9740..97accf960 100644 --- a/SyntaxTree/tree/TreeHelper.cs +++ b/SyntaxTree/tree/TreeHelper.cs @@ -1588,15 +1588,15 @@ namespace PascalABCCompiler.SyntaxTree public partial class yield_unknown_ident : ident { - protected ident _UnknownID; + //protected ident _UnknownID; protected ident _ClassName; protected bool _IsYieldInStaticMethod; - public ident UnknownID + /*public ident UnknownID { get { return _UnknownID; } set { _UnknownID = value; } - } + }*/ public ident ClassName { diff --git a/SyntaxTree/tree/tree.xml b/SyntaxTree/tree/tree.xml index e0a1b1dc9..831e78740 100644 --- a/SyntaxTree/tree/tree.xml +++ b/SyntaxTree/tree/tree.xml @@ -2757,7 +2757,9 @@ - + + + @@ -4944,6 +4946,7 @@ + diff --git a/TestSuite/CompilationSamples/DMTaskMaker.pas b/TestSuite/CompilationSamples/DMTaskMaker.pas index 12667df47..e01376997 100644 --- a/TestSuite/CompilationSamples/DMTaskMaker.pas +++ b/TestSuite/CompilationSamples/DMTaskMaker.pas @@ -1,8 +1,8 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) +// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) unit DMTaskMaker; -interface +interface uses System.Collections.Generic;