Refactored variable- and constant- resolution.
This commit is contained in:
parent
61e0b220b4
commit
237c6f746f
1 changed files with 2 additions and 18 deletions
|
@ -211,27 +211,11 @@ namespace arookas
|
||||||
}
|
}
|
||||||
public sunVariableSymbol ResolveVariable(sunIdentifier node)
|
public sunVariableSymbol ResolveVariable(sunIdentifier node)
|
||||||
{
|
{
|
||||||
for (int i = Scopes.Count - 1; i >= 0; --i)
|
return ResolveStorable(node) as sunVariableSymbol;
|
||||||
{
|
|
||||||
var symbol = Scopes[i].ResolveVariable(node.Value);
|
|
||||||
if (symbol != null)
|
|
||||||
{
|
|
||||||
return symbol;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
public sunConstantSymbol ResolveConstant(sunIdentifier node)
|
public sunConstantSymbol ResolveConstant(sunIdentifier node)
|
||||||
{
|
{
|
||||||
for (int i = Scopes.Count - 1; i >= 0; --i)
|
return ResolveStorable(node) as sunConstantSymbol;
|
||||||
{
|
|
||||||
var symbol = Scopes[i].ResolveConstant(node.Value);
|
|
||||||
if (symbol != null)
|
|
||||||
{
|
|
||||||
return symbol;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
public sunStorableSymbol MustResolveStorable(sunIdentifier node)
|
public sunStorableSymbol MustResolveStorable(sunIdentifier node)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue