Added DeclareConstant.

This commit is contained in:
arookas 2015-12-27 22:57:06 -05:00
parent c8056ac960
commit 0794267ff0
2 changed files with 5 additions and 1 deletions

View file

@ -195,7 +195,7 @@ namespace arookas
{ {
throw new sunRedeclaredVariableException(node); throw new sunRedeclaredVariableException(node);
} }
return Scopes.Top.DeclareConstant(node.Value, expression); return Scopes.DeclareConstant(node.Value, expression);
} }
public sunStorableSymbol ResolveStorable(sunIdentifier node) public sunStorableSymbol ResolveStorable(sunIdentifier node)
{ {

View file

@ -48,6 +48,10 @@ namespace arookas
} }
return null; return null;
} }
public sunConstantSymbol DeclareConstant(string name, sunExpression expression)
{
return Top.DeclareConstant(name, expression);
}
sunVariableSymbol DeclareGlobal(string name) sunVariableSymbol DeclareGlobal(string name)
{ {
var variableInfo = Top.DeclareVariable(name, 0, GlobalCount); var variableInfo = Top.DeclareVariable(name, 0, GlobalCount);