}
}
- public static class Scope extends JS.Obj {
- private final JS parent;
- private final Hash declared = new Hash();
- public Scope(JS parent) { this.parent = parent; }
- public JS get(JS key) throws JSExn {
- if (declared.get(key)!=null) return super.get(key);
- return parent.get(key);
- }
- public void put(JS key, JS val) throws JSExn {
- if (declared.get(key)!=null) super.put(key, val);
- else parent.put(key, val);
- }
- public void declare(JS key) { declared.put(key, Boolean.TRUE); }
- public void declare(String key) { declare(JSU.S(key)); }
- public void undeclare(JS key) { declared.remove(key); }
- public void undeclare(String key) { undeclare(JSU.S(key)); }
- }
-
private class DropTag implements Node.Stream.Functor {
public Node.Stream wrap(Node.Stream kids) {
return kids;