X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FTemplate.java;h=2f3e2acef89baddfa7cbe2619bb22bcead772540;hb=d892b1ff73b696e37812afd7d78c2eaae3342a0b;hp=c7a9acbda8a55c4e8392559ed17369fe6ceb2431;hpb=5de2077b86a41f6debd45ca1dd71666bf78b3975;p=org.ibex.core.git diff --git a/src/org/ibex/Template.java b/src/org/ibex/Template.java index c7a9acb..2f3e2ac 100644 --- a/src/org/ibex/Template.java +++ b/src/org/ibex/Template.java @@ -32,7 +32,9 @@ public class Template { private Vec children = new Vec(); ///< during XML parsing, this holds the list of currently-parsed children; null otherwise private JS script = null; ///< the script on this node Template prev; + Template prev2; JSScope staticScope = null; ///< the scope in which the static block is executed + JS staticObject = null; // Only used during parsing ///////////////////////////////////////////////////////////////// @@ -75,11 +77,12 @@ public class Template { private void apply(Box b, PerInstantiationScope parentPis) throws JSExn, IOException { if (prev != null) prev.apply(b, null); + if (prev2 != null) prev2.apply(b, null); // FIXME this dollar stuff is all wrong if (id != null) parentPis.putDollar(id, b); - PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticScope); + PerInstantiationScope pis = new PerInstantiationScope(b, ibex, parentPis, staticObject); for(int i=0; i i; i++) t.content.append('\n'); } } @@ -325,13 +328,13 @@ public class Template { private static class PerInstantiationScope extends JSScope { Ibex ibex = null; PerInstantiationScope parentBoxPis = null; - JSScope myStatic = null; + JS myStatic = null; void putDollar(String key, Box target) throws JSExn { if (parentBoxPis != null) parentBoxPis.putDollar(key, target); declare("$" + key); put("$" + key, target); } - public PerInstantiationScope(JSScope parentScope, Ibex ibex, PerInstantiationScope parentBoxPis, JSScope myStatic) { + public PerInstantiationScope(JSScope parentScope, Ibex ibex, PerInstantiationScope parentBoxPis, JS myStatic) { super(parentScope); this.parentBoxPis = parentBoxPis; this.ibex = ibex;