private void wrapWithModule(RubyBasicObject self, ParseResult result) { // toss an anonymous module into the search path RubyModule wrapper = RubyModule.newModule(this); self.extend(new IRubyObject[] {wrapper}); StaticScope top = result.getStaticScope(); StaticScope newTop = staticScopeFactory.newLocalScope(null); top.setPreviousCRefScope(newTop); top.setModule(wrapper); }
public StaticScope duplicate() { StaticScope dupe = new StaticScope(type, enclosingScope, variableNames == null ? NO_NAMES : variableNames); // irScope is not guaranteed to be set onto StaticScope until it is executed for the first time. // We can call duplicate before its first execution. if (irScope != null) dupe.setIRScope(irScope); dupe.setScopeType(scopeType); dupe.setPreviousCRefScope(previousCRefScope); dupe.setModule(cref); dupe.setSignature(signature); return dupe; }
public StaticScope duplicate() { StaticScope dupe = new StaticScope(type, enclosingScope, variableNames == null ? NO_NAMES : variableNames); // irScope is not guaranteed to be set onto StaticScope until it is executed for the first time. // We can call duplicate before its first execution. if (irScope != null) dupe.setIRScope(irScope); dupe.setScopeType(scopeType); dupe.setPreviousCRefScope(previousCRefScope); dupe.setModule(cref); dupe.setSignature(signature); return dupe; }
private void wrapWithModule(RubyBasicObject self, ParseResult result) { // toss an anonymous module into the search path RubyModule wrapper = RubyModule.newModule(this); self.extend(new IRubyObject[] {wrapper}); StaticScope top = result.getStaticScope(); StaticScope newTop = staticScopeFactory.newLocalScope(null); top.setPreviousCRefScope(newTop); top.setModule(wrapper); }
newScope.setPreviousCRefScope(oldScope.getPreviousCRefScope()); newScope.setModule(oldScope.getModule()); block.getBody().setStaticScope(newScope);
newScope.setPreviousCRefScope(oldScope.getPreviousCRefScope()); newScope.setModule(oldScope.getModule()); block.getBody().setStaticScope(newScope);