Refactored declaration code.

This commit is contained in:
arookas 2015-12-28 01:22:54 -05:00
parent fd21da0982
commit de28ee84f9

View file

@ -57,21 +57,11 @@ namespace arookas
}
sunVariableSymbol DeclareGlobal(string name)
{
var variableInfo = Top.DeclareVariable(name, 0, GlobalCount);
if (variableInfo == null)
{
return null;
}
return variableInfo;
return Top.DeclareVariable(name, 0, GlobalCount);
}
sunVariableSymbol DeclareLocal(string name)
{
var variableInfo = Top.DeclareVariable(name, 1, LocalCount);
if (variableInfo == null)
{
return null;
}
return variableInfo;
return Top.DeclareVariable(name, 1, LocalCount);
}
public IEnumerator<sunScope> GetEnumerator() { return Stack.GetEnumerator(); }