1 package jfun.yan.xml; 2 3 import jfun.util.dict.Dict; 4 5 final class Bound extends Located implements Stmt { 6 private final Object key; 7 Bound(Object var, Location loc) { 8 super(loc); 9 this.key = var; 10 } 11 12 public Object run(Dict frame, Runtime runtime) { 13 final Object r = frame.get(key); 14 if(r instanceof Closure){ 15 final Closure c = (Closure)r; 16 return c.get(); 17 } 18 else return r; 19 } 20 21 public Class getType() { 22 return null; 23 } 24 public String toString(){ 25 return key.toString(); 26 } 27 } 28 | Popular Tags |