From 0794267ff04f3189daf41d28f35d16f650c6f349 Mon Sep 17 00:00:00 2001 From: arookas Date: Sun, 27 Dec 2015 22:57:06 -0500 Subject: [PATCH] Added DeclareConstant. --- ssc/context.cs | 2 +- ssc/scope stack.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ssc/context.cs b/ssc/context.cs index 61e9d57..2a2b46e 100644 --- a/ssc/context.cs +++ b/ssc/context.cs @@ -195,7 +195,7 @@ namespace arookas { throw new sunRedeclaredVariableException(node); } - return Scopes.Top.DeclareConstant(node.Value, expression); + return Scopes.DeclareConstant(node.Value, expression); } public sunStorableSymbol ResolveStorable(sunIdentifier node) { diff --git a/ssc/scope stack.cs b/ssc/scope stack.cs index 725db8d..56dbbb9 100644 --- a/ssc/scope stack.cs +++ b/ssc/scope stack.cs @@ -48,6 +48,10 @@ namespace arookas } return null; } + public sunConstantSymbol DeclareConstant(string name, sunExpression expression) + { + return Top.DeclareConstant(name, expression); + } sunVariableSymbol DeclareGlobal(string name) { var variableInfo = Top.DeclareVariable(name, 0, GlobalCount);