@SuppressWarnings("deprecation") public static StaticScope preLoad(ThreadContext context, String[] varNames) { StaticScope staticScope = context.runtime.getStaticScopeFactory().newLocalScope(null, varNames); preLoadCommon(context, staticScope, false); return staticScope; }
public static StaticScope preLoad(ThreadContext context, String[] varNames) { StaticScope staticScope = context.runtime.getStaticScopeFactory().newLocalScope(null, varNames); preLoadCommon(context, staticScope, false); return staticScope; }
public static StaticScope preLoad(ThreadContext context, String[] varNames) { StaticScope staticScope = context.runtime.getStaticScopeFactory().newLocalScope(null, varNames); preLoadCommon(context, staticScope, false); return staticScope; }
@SuppressWarnings("deprecation") public static StaticScope preLoad(ThreadContext context, String[] varNames) { StaticScope staticScope = context.runtime.getStaticScopeFactory().newLocalScope(null, varNames); preLoadCommon(context, staticScope, false); return staticScope; }
public void pushLocalScope() { currentScope = configuration.getRuntime().getStaticScopeFactory().newLocalScope(currentScope); }
public void pushLocalScope() { currentScope = configuration.getRuntime().getStaticScopeFactory().newLocalScope(currentScope); }
/** * This method returns the appropriate first scope for the parser. * * @return correct top scope for source to be parsed */ public DynamicScope getScope(String file) { if (asBlock) return existingScope; // FIXME: We should really not be creating the dynamic scope for the root // of the AST before parsing. This makes us end up needing to readjust // this dynamic scope coming out of parse (and for local static scopes it // will always happen because of $~ and $_). // FIXME: Because we end up adjusting this after-the-fact, we can't use // any of the specific-size scopes. return new ManyVarsDynamicScope(runtime.getStaticScopeFactory().newLocalScope(null, file), existingScope); }
/** * This method returns the appropriate first scope for the parser. * * @return correct top scope for source to be parsed */ public DynamicScope getScope() { if (asBlock) return existingScope; // FIXME: We should really not be creating the dynamic scope for the root // of the AST before parsing. This makes us end up needing to readjust // this dynamic scope coming out of parse (and for local static scopes it // will always happen because of $~ and $_). // FIXME: Because we end up adjusting this after-the-fact, we can't use // any of the specific-size scopes. return new ManyVarsDynamicScope(runtime.getStaticScopeFactory().newLocalScope(null), existingScope); }
/** * This method returns the appropriate first scope for the parser. * * @return correct top scope for source to be parsed */ public DynamicScope getScope() { if (asBlock) return existingScope; // FIXME: We should really not be creating the dynamic scope for the root // of the AST before parsing. This makes us end up needing to readjust // this dynamic scope coming out of parse (and for local static scopes it // will always happen because of $~ and $_). // FIXME: Because we end up adjusting this after-the-fact, we can't use // any of the specific-size scopes. return new ManyVarsDynamicScope(runtime.getStaticScopeFactory().newLocalScope(null), existingScope); }
public void preBsfApply(String[] names) { // FIXME: I think we need these pushed somewhere? StaticScope staticScope = runtime.getStaticScopeFactory().newLocalScope(null); staticScope.setVariables(names); pushFrame(); }
public void preBsfApply(String[] names) { // FIXME: I think we need these pushed somewhere? StaticScope staticScope = runtime.getStaticScopeFactory().newLocalScope(null); staticScope.setVariables(names); pushFrame(); }
public void preBsfApply(String[] names) { // FIXME: I think we need these pushed somewhere? StaticScope staticScope = runtime.getStaticScopeFactory().newLocalScope(null); staticScope.setVariables(names); pushFrame(); }
public void preBsfApply(String[] names) { // FIXME: I think we need these pushed somewhere? StaticScope staticScope = runtime.getStaticScopeFactory().newLocalScope(null); staticScope.setVariables(names); pushFrame(); }
public void pushLocalScope() { currentScope = getRuntime().getStaticScopeFactory().newLocalScope(currentScope); getCmdArgumentState().reset(); }
public void pushLocalScope() { currentScope = getRuntime().getStaticScopeFactory().newLocalScope(currentScope); getCmdArgumentState().reset(); }
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); }
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 void pushLocalScope() { currentScope = configuration.getRuntime().getStaticScopeFactory().newLocalScope(currentScope, lexer.getFile()); currentScope.setCommandArgumentStack(lexer.getCmdArgumentState().getStack()); lexer.getCmdArgumentState().reset(0); }
public void pushLocalScope() { currentScope = configuration.getRuntime().getStaticScopeFactory().newLocalScope(currentScope, lexer.getFile()); currentScope.setCommandArgumentStack(lexer.getCmdArgumentState().getStack()); lexer.getCmdArgumentState().reset(0); }
static ManyVarsDynamicScope getManyVarsDynamicScope(ScriptingContainer container, int depth) { ManyVarsDynamicScope scope; StaticScopeFactory scopeFactory = container.getProvider().getRuntime().getStaticScopeFactory(); // root our parsing scope with a dummy scope StaticScope topStaticScope = scopeFactory.newLocalScope(null); topStaticScope.setModule(container.getProvider().getRuntime().getObject()); DynamicScope currentScope = new ManyVarsDynamicScope(topStaticScope, null); String[] names4Injection = container.getVarMap().getLocalVarNames(); StaticScope evalScope = names4Injection == null || names4Injection.length == 0 ? scopeFactory.newEvalScope(currentScope.getStaticScope()) : scopeFactory.newEvalScope(currentScope.getStaticScope(), names4Injection); scope = new ManyVarsDynamicScope(evalScope, currentScope); // JRUBY-5501: ensure we've set up a cref for the scope too scope.getStaticScope().determineModule(); return scope; }