From d9094a5c22faf1789cfbb8370910d014bf7abc16 Mon Sep 17 00:00:00 2001 From: Terky Date: Fri, 17 May 2019 22:40:01 +0300 Subject: [PATCH] fixed build issue related to ?System --- TreeConverter/SymbolTable/DSST/SymbolTable.cs | 21 ++++++++++++------- .../TreeConversion/compilation_context.cs | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/TreeConverter/SymbolTable/DSST/SymbolTable.cs b/TreeConverter/SymbolTable/DSST/SymbolTable.cs index d7c0bbfc1..2ba1f34ee 100644 --- a/TreeConverter/SymbolTable/DSST/SymbolTable.cs +++ b/TreeConverter/SymbolTable/DSST/SymbolTable.cs @@ -1035,8 +1035,17 @@ namespace SymbolTable // Нет. Как-то найти глобальное ПИ модуля while (scope != null && !(scope is UnitInterfaceScope)) { - if (scope is ClassMethodScope) - scope = (scope as ClassMethodScope).DefScope; + if (scope is ClassMethodScope) + { + // aab 17.05.19 begin + // Поправил приоритет поиска для ?System + var classMethodScope = scope as ClassMethodScope; + if (classMethodScope.DefScope != null) + scope = classMethodScope.DefScope; + else + scope = classMethodScope.CurrentLambdaDefScope; + // aab 17.05.19 end + } else scope = scope.TopScope; } if (scope != null) @@ -1155,12 +1164,8 @@ namespace SymbolTable var defScope = (CurrentArea as ClassMethodScope).DefScope; if (defScope != null) { - var defScopeRes = FindAll(defScope, Name, OnlyInType, OnlyInThisClass, defScope); - - if (defScopeRes != null && defScopeRes.Count > 0) - { - return defScopeRes; - } + CurrentArea = defScope; + continue; } } } diff --git a/TreeConverter/TreeConversion/compilation_context.cs b/TreeConverter/TreeConversion/compilation_context.cs index 143c46d0e..74f1978e8 100644 --- a/TreeConverter/TreeConversion/compilation_context.cs +++ b/TreeConverter/TreeConversion/compilation_context.cs @@ -1179,7 +1179,7 @@ namespace PascalABCCompiler.TreeConverter // aab 26.04.19 // Здесь topScope записывается именно в CurrentLambdaDefScope, а не в DefScope // Во всех остальных случаях записывается в DefScope - SymbolTable.Scope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_ctn.Scope, topScope, null, "lambda " + name); // aab 09.05.19 Временно вернул обратно + SymbolTable.Scope scope = convertion_data_and_alghoritms.symbol_table.CreateClassMethodScope(_ctn.Scope, null, topScope, "lambda " + name); //TODO:сделать static и virtual. //TODO: interface and implementation scopes.