Refactored declaration code.
This commit is contained in:
parent
fd21da0982
commit
de28ee84f9
1 changed files with 2 additions and 12 deletions
|
@ -57,21 +57,11 @@ namespace arookas
|
||||||
}
|
}
|
||||||
sunVariableSymbol DeclareGlobal(string name)
|
sunVariableSymbol DeclareGlobal(string name)
|
||||||
{
|
{
|
||||||
var variableInfo = Top.DeclareVariable(name, 0, GlobalCount);
|
return Top.DeclareVariable(name, 0, GlobalCount);
|
||||||
if (variableInfo == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return variableInfo;
|
|
||||||
}
|
}
|
||||||
sunVariableSymbol DeclareLocal(string name)
|
sunVariableSymbol DeclareLocal(string name)
|
||||||
{
|
{
|
||||||
var variableInfo = Top.DeclareVariable(name, 1, LocalCount);
|
return Top.DeclareVariable(name, 1, LocalCount);
|
||||||
if (variableInfo == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return variableInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerator<sunScope> GetEnumerator() { return Stack.GetEnumerator(); }
|
public IEnumerator<sunScope> GetEnumerator() { return Stack.GetEnumerator(); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue