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)
|
||||
{
|
||||
for (int i = Scopes.Count - 1; i >= 0; --i)
|
||||
{
|
||||
var symbol = Scopes[i].ResolveVariable(node.Value);
|
||||
if (symbol != null)
|
||||
{
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return ResolveStorable(node) as sunVariableSymbol;
|
||||
}
|
||||
public sunConstantSymbol ResolveConstant(sunIdentifier node)
|
||||
{
|
||||
for (int i = Scopes.Count - 1; i >= 0; --i)
|
||||
{
|
||||
var symbol = Scopes[i].ResolveConstant(node.Value);
|
||||
if (symbol != null)
|
||||
{
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return ResolveStorable(node) as sunConstantSymbol;
|
||||
}
|
||||
public sunStorableSymbol MustResolveStorable(sunIdentifier node)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue