В syntax_tree_visitor добавлено свойство CurrentScope, отображающее текущую область видимости, если она есть.
This commit is contained in:
parent
b54e020b41
commit
93fe1fd63c
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue