public StaticScope newLocalScope(StaticScope parent, String[] names) { return new LocalStaticScope(parent, names); }
public int isDefined(String name, int depth) { return (depth << 16) | exists(name); }
/** * @see org.jruby.parser.StaticScope#getAllNamesInScope() */ public String[] getAllNamesInScope() { return getVariables(); }
public AssignableNode assign(ISourcePosition position, String name, Node value, StaticScope topScope, int depth) { int slot = exists(name); // We can assign if we already have variable of that name here or we are the only // scope in the chain (which Local scopes always are). if (slot >= 0) { return new LocalAsgnNode(position, name, ((depth << 16) | slot), value); } else if (topScope == this) { slot = addVariable(name); return new LocalAsgnNode(position, name, slot , value); } // We know this is a block scope because a local scope cannot be within a local scope // If topScope was itself it would have created a LocalAsgnNode above. return ((BlockStaticScope) topScope).addAssign(position, name, value); }
public AssignableNode assign(ISourcePosition position, String name, Node value, StaticScope topScope, int depth) { int slot = exists(name); // We can assign if we already have variable of that name here or we are the only // scope in the chain (which Local scopes always are). if (slot >= 0) { return new LocalAsgnNode(position, name, ((depth << 16) | slot), value); } else if (topScope == this) { slot = addVariable(name); return new LocalAsgnNode(position, name, slot , value); } // We know this is a block scope because a local scope cannot be within a local scope // If topScope was itself it would have created a LocalAsgnNode above. return ((BlockStaticScope) topScope).addAssign(position, name, value); }
public StaticScope newLocalScope(StaticScope parent, String[] names) { return new LocalStaticScope(parent, names); }
public int isDefined(String name, int depth) { return (depth << 16) | exists(name); }
/** * @see org.jruby.parser.StaticScope#getAllNamesInScope() */ public String[] getAllNamesInScope() { return getVariables(); }
public StaticScope newLocalScope(StaticScope parent) { return new LocalStaticScope(parent); }
public Node declare(ISourcePosition position, String name, int depth) { int slot = exists(name); if (slot >= 0) return new LocalVarNode(position, ((depth << 16) | slot), name); return new VCallNode(position, name); }
public StaticScope newLocalScope(StaticScope parent) { return new LocalStaticScope(parent); }
public Node declare(ISourcePosition position, String name, int depth) { int slot = exists(name); if (slot >= 0) return new LocalVarNode(position, ((depth << 16) | slot), name); return new VCallNode(position, name); }
public StaticScopeFactory(Ruby runtime) { dummyScope = new LocalStaticScope(null); dummyScope.setModule(runtime.getObject()); }
public StaticScopeFactory(Ruby runtime) { dummyScope = new LocalStaticScope(null); dummyScope.setModule(runtime.getObject()); }