Ejemplo n.º 1
0
  public boolean isNestedInClosure(IRClosure closure) {
    for (IRScope s = this; s != null && !s.isTopLocalVariableScope(); s = s.getLexicalParent()) {
      if (s == closure) return true;
    }

    return false;
  }
Ejemplo n.º 2
0
  public IRScope getNearestTopLocalVariableScope() {
    IRScope current = this;

    while (current != null && !current.isTopLocalVariableScope()) {
      current = current.getLexicalParent();
    }

    return current;
  }