Fix name scope resolution
This commit is contained in:
@@ -42,7 +42,7 @@ public class NameScope {
|
|||||||
validateIsNotKeyword(name);
|
validateIsNotKeyword(name);
|
||||||
for ( NameScope n = this; n!=null; n=n.outerScope )
|
for ( NameScope n = this; n!=null; n=n.outerScope )
|
||||||
if ( n.namedVariables.containsKey(name) )
|
if ( n.namedVariables.containsKey(name) )
|
||||||
return namedVariables.get(name);
|
return n.namedVariables.get(name);
|
||||||
NamedVariable value = new NamedVariable(name);
|
NamedVariable value = new NamedVariable(name);
|
||||||
this.namedVariables.put(name, value);
|
this.namedVariables.put(name, value);
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
Reference in New Issue
Block a user