Fixed: variables were always declared global

This commit is contained in:
arookas 2016-02-01 05:34:22 -05:00
parent b3a347936e
commit 7fca910e8e

View file

@ -98,7 +98,7 @@ namespace arookas {
return DeclareVariable(node.Name, node.Modifiers);
}
sunVariableSymbol DeclareVariable(sunIdentifier node, sunSymbolModifiers modifiers) {
var name = MangleSymbolName(node.Value, false, false);
var name = MangleSymbolName(node.Value, false, (modifiers & sunSymbolModifiers.Local) != 0);
#if SSC_PACK_VARS
if (Scopes.Top.GetIsDeclared(name)) {
throw new sunRedeclaredVariableException(node);