lib/nydp/symbol_lookup.rb in nydp-0.4.3 vs lib/nydp/symbol_lookup.rb in nydp-0.4.5

- old
+ new

@@ -9,20 +9,20 @@ bindings = bindings.cdr end bindings end - def self.build name, bindings - bindings = skip_empty bindings - depth = 0 - while NIL != bindings - here = bindings.car + def self.build name, original_bindings + effective_bindings = skip_empty original_bindings + depth = 0 + while NIL != effective_bindings + here = effective_bindings.car if here.key? name binding_index = here[name] - return ContextSymbol.build(depth, name, binding_index) + return ContextSymbol.build(depth, name, binding_index, original_bindings.index_of(here)) else depth += 1 - bindings = skip_empty bindings.cdr + effective_bindings = skip_empty effective_bindings.cdr end end name end end