В syntax_tree_visitor добавлено свойство CurrentScope, отображающее текущую область видимости, если она есть.

This commit is contained in:
andrewlord607 2018-05-27 02:11:04 +03:00
parent b54e020b41
commit 93fe1fd63c
2 changed files with 12 additions and 2 deletions

View file

@ -558,9 +558,9 @@ namespace SymbolTable
real_scope = sc;
if(real_scope is BlockScope)
{
int deep = -1;
int deep = 0;
Scope Top = real_scope.TopScope;
while(Top != null && !(Top is BlockScope))
while(Top != null && (Top is BlockScope))
{
deep++;
Top = Top.TopScope;

View file

@ -52,6 +52,16 @@ namespace PascalABCCompiler.TreeConverter
}
}
public SymbolTable.PrimaryScope CurrentScope
{
get
{
if(context.CurrentScope != null)
return new SymbolTable.PrimaryScope(context.CurrentScope);
return null;
}
}
public convertion_data_and_alghoritms convertion_data_and_alghoritms;
internal returner ret;