diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 31a2526b2..5f724a916 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 = "1864"; + public const string Revision = "1865"; 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 b2405bc37..2e49c1efb 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=4 -%REVISION%=1864 %COREVERSION%=2 +%REVISION%=1865 +%MINOR%=4 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 8d294d88f..ea653e93f 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.4.2.1864' +!define VERSION '3.4.2.1865' diff --git a/SyntaxTree/tree/WalkingVisitorNew.cs b/SyntaxTree/tree/WalkingVisitorNew.cs index bd420ddc7..6e71e9305 100644 --- a/SyntaxTree/tree/WalkingVisitorNew.cs +++ b/SyntaxTree/tree/WalkingVisitorNew.cs @@ -56,8 +56,8 @@ namespace PascalABCCompiler.SyntaxTree public void ReplaceStatementUsingParent(statement from, IEnumerable to, Desc d = Desc.DirectDescendants) { var fp = from.Parent; // SSM 02.10.18 - запомним, т.к. from.Parent может быть одним из x.Parent - foreach (var x in to) - x.Parent = fp; + //foreach (var x in to) // Это и так делается по обоим веткам! + // x.Parent = fp; var sl = fp as statement_list; if (sl != null) { @@ -69,6 +69,7 @@ namespace PascalABCCompiler.SyntaxTree l.AddMany(to); l.source_context = from.source_context; fp.ReplaceDescendant(from, l, d); + l.Parent = fp; // на всякий случай } } } diff --git a/TestSuite/foreach_foreach.pas b/TestSuite/foreach_foreach.pas new file mode 100644 index 000000000..305c45249 --- /dev/null +++ b/TestSuite/foreach_foreach.pas @@ -0,0 +1,15 @@ +begin + + foreach var a1 in Arr& do + foreach var a2 in Arr&.Select(o->o as object) do + begin + + var p: procedure := ()-> + begin + var o: object; + var f := o is byte(var b); + end; + + end; + Assert(1=1); +end. \ No newline at end of file