@Test public void leavingScopeShouldGiveParent() { assertThat(childScope.leaveScope(), sameInstance(parentScope)); assertThat(childScope.enterScope().leaveScope(), sameInstance(childScope)); }
@Override public Scope enterScope() { ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName); children.add(child); return child; }
ChildScope extends BlockScope { @Override public Scope enterScope() { ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName); children.add(child); return child; } }
ChildScope extends BlockScope { @Override public Scope enterScope() { ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName); children.add(child); return child; } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); }
ChildScope extends BlockScope { @Override public Scope enterScope() { ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName); children.add(child); return child; } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); @Override void addLocal(String argument); @Override void capture(String argument); @Override Scope enterScope(); @Override List<String> getCaptures(); @Override Set<Symbol> getContext(Type type); @Override List<String> getLocals(); @Override Optional<TypeClassDescriptor> getMemberOf(ValueReference valueRef); @Override Optional<Operator> getOperator(Symbol symbol); @Override Optional<Type> getRawValue(Symbol symbol); @Override void insertChild(Scope newChild); @Override boolean isDefined(Symbol symbol); @Override void prependLocals(List<String> locals); @Override Optional<Symbol> qualify(Symbol symbol); @Override void setParent(Scope newParent); }
ChildScope extends BlockScope { @Override public Scope enterScope() { ChildScope child = scope(this, types, resolver, symbolGenerator, moduleName); children.add(child); return child; } ChildScope(Scope parent, TypeScope types, SymbolResolver resolver, SymbolGenerator symbolGenerator, String moduleName); @Override void addLocal(String argument); @Override void capture(String argument); @Override Scope enterScope(); @Override List<String> getCaptures(); @Override Set<Symbol> getContext(Type type); @Override List<String> getLocals(); @Override Optional<TypeClassDescriptor> getMemberOf(ValueReference valueRef); @Override Optional<Operator> getOperator(Symbol symbol); @Override Optional<Type> getRawValue(Symbol symbol); @Override void insertChild(Scope newChild); @Override boolean isDefined(Symbol symbol); @Override void prependLocals(List<String> locals); @Override Optional<Symbol> qualify(Symbol symbol); @Override void setParent(Scope newParent);  }