diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 25bde5283..4f5f91bef 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 = "7"; public const string Build = "1"; - public const string Revision = "2792"; + public const string Revision = "2794"; 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 1cdfb1d8c..b7973cb81 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %COREVERSION%=1 -%REVISION%=2792 +%REVISION%=2794 %MINOR%=7 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 8815880ab..e023f62c9 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.7.1.2792 +3.7.1.2794 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index e1010bf1c..62e5db2f7 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.7.1.2792' +!define VERSION '3.7.1.2794' diff --git a/SyntaxTreeConverters/StandardSyntaxConverter.cs b/SyntaxTreeConverters/StandardSyntaxConverter.cs index 2aace3afa..4e501116f 100644 --- a/SyntaxTreeConverters/StandardSyntaxConverter.cs +++ b/SyntaxTreeConverters/StandardSyntaxConverter.cs @@ -34,7 +34,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters UnnamedRecordsCheckVisitor.New.ProcessNode(root); // Выносим выражения с лямбдами из заголовка foreach + считаем максимум 10 вложенных лямбд - StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root); + StandOutExprWithLambdaInForeachSequenceAndNestedLambdasVisitor.New.ProcessNode(root); VarNamesInMethodsWithSameNameAsClassGenericParamsReplacer.New.ProcessNode(root); // SSM bug fix #1147 FindOnExceptVarsAndApplyRenameVisitor.New.ProcessNode(root); #if DEBUG diff --git a/SyntaxVisitors/VisitorsForLambdas/StandOutExprWithLambdaInForeachSequenceVisitor.cs b/SyntaxVisitors/VisitorsForLambdas/StandOutExprWithLambdaInForeachSequenceVisitor.cs index 18b29a423..f95481e95 100644 --- a/SyntaxVisitors/VisitorsForLambdas/StandOutExprWithLambdaInForeachSequenceVisitor.cs +++ b/SyntaxVisitors/VisitorsForLambdas/StandOutExprWithLambdaInForeachSequenceVisitor.cs @@ -10,13 +10,13 @@ namespace PascalABCCompiler.SyntaxTreeConverters // Первое предназначение - вынести последовательность из заголовка в foreach до foreach как отдельное присваивание // Второе предназначение - переименовать все переменные, совпадающие по имени с типом T обобщенного класса, в котором находится метод, содержащий лямбду - public class StandOutExprWithLambdaInForeachSequenceVisitor : BaseChangeVisitor + public class StandOutExprWithLambdaInForeachSequenceAndNestedLambdasVisitor : BaseChangeVisitor { - public static StandOutExprWithLambdaInForeachSequenceVisitor New + public static StandOutExprWithLambdaInForeachSequenceAndNestedLambdasVisitor New { get { - return new StandOutExprWithLambdaInForeachSequenceVisitor(); + return new StandOutExprWithLambdaInForeachSequenceAndNestedLambdasVisitor(); } } diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index e9dec3ea0..3fc6f1755 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -17050,11 +17050,14 @@ namespace PascalABCCompiler.TreeConverter { if ((context.converting_block() == block_type.function_block) && (context.top_function.return_variable != null)) { - List sil = context.top_function.scope.FindOnlyInScope(_ident.name);//context.find_only_in_namespace(_ident.name); + List sil = context.top_function.scope.FindOnlyInScope(_ident.name); // почему-то не находит локальную переменную с этим именем + // тут баг #2401 + // context.find_only_in_namespace(_ident.name); // это было закомментировано 10.01.21 if (sil == null) { int comp = SystemLibrary.SystemLibrary.string_comparer.Compare(_ident.name, context.top_function.name); - if (comp == 0) + List mysi = context.find(_ident.name); + if (comp == 0 && mysi != null && mysi[0].sym_info is function_node) // мы нашли функцию и ее имя совпадает с ident { local_variable lv = context.top_function.return_variable; return new local_variable_reference(lv, 0, get_location(_ident));