Permalink
Browse files

release v0.1.0

  • Loading branch information...
1 parent b94ce62 commit 45624f2618b2c2362fb8ba815203ac00f2b16eba akdubya committed Nov 1, 2010
View
2 README.md
@@ -43,7 +43,7 @@ In Node:
To render compiled templates in the browser:
- <script src="dust-core-0.0.1.min.js"></script>
+ <script src="dust-core-0.1.0.min.js"></script>
Demo & Guide
------------
View
2 benchmark/index.html
@@ -74,7 +74,7 @@
<script src="../vendor/jquery.min.js"></script>
<script src="uubench.js"></script>
- <script src="../dist/dust-full-0.0.1.min.js"></script>
+ <script src="../dist/dust-full-0.1.0.min.js"></script>
<script src="suites/dust_suite.js"></script>
<script src="suites/mustache_suite.js"></script>
<script src="suites/handlebars_suite.js"></script>
View
4 dist/dust-core-0.0.1.js → dist/dust-core-0.1.0.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.0.1
+// Dust - Asynchronous Templating v0.1.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -97,7 +97,7 @@ function Context(stack, global, blocks) {
this.blocks = blocks;
}
-Context.base = function(global) {
+dust.makeBase = function(global) {
return new Context(new Stack(), global);
}
View
4 dist/dust-core-0.0.1.min.js → dist/dust-core-0.1.0.min.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.0.1
+// Dust - Asynchronous Templating v0.1.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -9,7 +9,7 @@
var dust={};
(function(d){function g(a,b,c){this.stack=a;this.global=b;this.blocks=c}function j(a,b,c,e){this.tail=b;this.isObject=!d.isArray(a)&&a&&typeof a==="object";this.head=a;this.index=c;this.of=e}function m(a){this.head=new f(this);this.callback=a;this.out=""}function k(){this.head=new f(this)}function f(a,b,c){this.root=a;this.next=b;this.data="";this.flushable=false;this.taps=c}function l(a,b){this.head=a;this.tail=b}d.cache={};d.register=function(a,b){d.cache[a]=b};d.render=function(a,b,c){c=(new m(c)).head;
d.load(a,c,g.wrap(b)).end()};d.stream=function(a,b){var c=new k;setTimeout(function(){d.load(a,c.head,g.wrap(b)).end()});return c};d.load=function(a,b,c){return(tmpl=d.cache[a])?tmpl(b,c):b.setError(Error("Template Not Found: "+a))};d.loadSource=function(a){eval(a)};d.isArray=Array.isArray?Array.isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"};d.nextTick=function(a){setTimeout(a,0)};d.isEmpty=function(a){if(d.isArray(a)&&!a.length)return true;if(a===0)return false;return!a};
-d.filter=function(a,b,c){for(var e=c.length,h=0;h<e;h++){var i=c[h];if(i==="s")b=null;else a=d.filters[i](a)}if(b)a=d.filters[b](a);return a};d.filters={h:function(a){return d.escapeHtml(a)},j:function(a){return d.escapeJs(a)},u:encodeURI,uc:encodeURIComponent};g.base=function(a){return new g(new j,a)};g.wrap=function(a){if(a instanceof g)return a;return new g(new j(a))};g.prototype.get=function(a){for(var b=this.stack,c;b;){if(b.isObject){c=b.head[a];if(c!==undefined)return c}b=b.tail}return this.global?
+d.filter=function(a,b,c){for(var e=c.length,h=0;h<e;h++){var i=c[h];if(i==="s")b=null;else a=d.filters[i](a)}if(b)a=d.filters[b](a);return a};d.filters={h:function(a){return d.escapeHtml(a)},j:function(a){return d.escapeJs(a)},u:encodeURI,uc:encodeURIComponent};d.makeBase=function(a){return new g(new j,a)};g.wrap=function(a){if(a instanceof g)return a;return new g(new j(a))};g.prototype.get=function(a){for(var b=this.stack,c;b;){if(b.isObject){c=b.head[a];if(c!==undefined)return c}b=b.tail}return this.global?
this.global[a]:undefined};g.prototype.getPath=function(a,b){var c=this.stack,e=b.length;if(a&&e===0)return c.head;if(c.isObject){c=c.head;for(var h=0;c&&h<e;){c=c[b[h]];h++}return c}};g.prototype.push=function(a,b,c){return new g(new j(a,this.stack,b,c),this.global,this.blocks)};g.prototype.rebase=function(a){return new g(new j(a),this.global,this.blocks)};g.prototype.current=function(){return this.stack.head};g.prototype.getBlock=function(a){var b=this.blocks;if(b)for(var c=b.length,e;c--;)if(e=
b[c][a])return e};g.prototype.shiftBlocks=function(a){var b=this.blocks;if(a){newBlocks=b?b.concat([a]):[a];return new g(this.stack,this.global,newBlocks)}return this};m.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.out+=a.data;else{if(a.error){this.callback(a.error);this.flush=function(){}}return}this.head=a=a.next}this.callback(null,this.out)};k.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.emit("data",a.data);else{if(a.error){this.emit("error",
a.error);this.flush=function(){}}return}this.head=a=a.next}this.emit("end")};k.prototype.emit=function(a,b){var c=this.events;c&&c[a]&&c[a](b)};k.prototype.on=function(a,b){if(!this.events)this.events={};this.events[a]=b;return this};f.prototype.write=function(a){var b=this.taps;if(b)a=b.go(a);this.data+=a;return this};f.prototype.end=function(a){a&&this.write(a);this.flushable=true;this.root.flush();return this};f.prototype.map=function(a){var b=new f(this.root,this.next,this.taps),c=new f(this.root,
View
57 dist/dust-full-0.0.1.min.js
@@ -1,57 +0,0 @@
-//
-// Dust - Asynchronous Templating v0.0.1
-// http://akdubya.github.com/dustjs
-//
-// Copyright (c) 2010, Aleksander Williams
-// Released under the MIT License.
-//
-
-var dust={};
-(function(r){function y(f,j,l){this.stack=f;this.global=j;this.blocks=l}function F(f,j,l,v){this.tail=j;this.isObject=!r.isArray(f)&&f&&typeof f==="object";this.head=f;this.index=l;this.of=v}function p(f){this.head=new k(this);this.callback=f;this.out=""}function H(){this.head=new k(this)}function k(f,j,l){this.root=f;this.next=j;this.data="";this.flushable=false;this.taps=l}function q(f,j){this.head=f;this.tail=j}r.cache={};r.register=function(f,j){r.cache[f]=j};r.render=function(f,j,l){l=(new p(l)).head;
-r.load(f,l,y.wrap(j)).end()};r.stream=function(f,j){var l=new H;setTimeout(function(){r.load(f,l.head,y.wrap(j)).end()});return l};r.load=function(f,j,l){return(tmpl=r.cache[f])?tmpl(j,l):j.setError(Error("Template Not Found: "+f))};r.loadSource=function(f){eval(f)};r.isArray=Array.isArray?Array.isArray:function(f){return Object.prototype.toString.call(f)=="[object Array]"};r.nextTick=function(f){setTimeout(f,0)};r.isEmpty=function(f){if(r.isArray(f)&&!f.length)return true;if(f===0)return false;return!f};
-r.filter=function(f,j,l){for(var v=l.length,A=0;A<v;A++){var E=l[A];if(E==="s")j=null;else f=r.filters[E](f)}if(j)f=r.filters[j](f);return f};r.filters={h:function(f){return r.escapeHtml(f)},j:function(f){return r.escapeJs(f)},u:encodeURI,uc:encodeURIComponent};y.base=function(f){return new y(new F,f)};y.wrap=function(f){if(f instanceof y)return f;return new y(new F(f))};y.prototype.get=function(f){for(var j=this.stack,l;j;){if(j.isObject){l=j.head[f];if(l!==undefined)return l}j=j.tail}return this.global?
-this.global[f]:undefined};y.prototype.getPath=function(f,j){var l=this.stack,v=j.length;if(f&&v===0)return l.head;if(l.isObject){l=l.head;for(var A=0;l&&A<v;){l=l[j[A]];A++}return l}};y.prototype.push=function(f,j,l){return new y(new F(f,this.stack,j,l),this.global,this.blocks)};y.prototype.rebase=function(f){return new y(new F(f),this.global,this.blocks)};y.prototype.current=function(){return this.stack.head};y.prototype.getBlock=function(f){var j=this.blocks;if(j)for(var l=j.length,v;l--;)if(v=
-j[l][f])return v};y.prototype.shiftBlocks=function(f){var j=this.blocks;if(f){newBlocks=j?j.concat([f]):[f];return new y(this.stack,this.global,newBlocks)}return this};p.prototype.flush=function(){for(var f=this.head;f;){if(f.flushable)this.out+=f.data;else{if(f.error){this.callback(f.error);this.flush=function(){}}return}this.head=f=f.next}this.callback(null,this.out)};H.prototype.flush=function(){for(var f=this.head;f;){if(f.flushable)this.emit("data",f.data);else{if(f.error){this.emit("error",
-f.error);this.flush=function(){}}return}this.head=f=f.next}this.emit("end")};H.prototype.emit=function(f,j){var l=this.events;l&&l[f]&&l[f](j)};H.prototype.on=function(f,j){if(!this.events)this.events={};this.events[f]=j;return this};k.prototype.write=function(f){var j=this.taps;if(j)f=j.go(f);this.data+=f;return this};k.prototype.end=function(f){f&&this.write(f);this.flushable=true;this.root.flush();return this};k.prototype.map=function(f){var j=new k(this.root,this.next,this.taps),l=new k(this.root,
-j,this.taps);this.next=l;this.flushable=true;f(l);return j};k.prototype.tap=function(f){var j=this.taps;this.taps=j?j.push(f):new q(f);return this};k.prototype.untap=function(){this.taps=this.taps.tail;return this};k.prototype.render=function(f,j){return f(this,j)};k.prototype.reference=function(f,j,l,v){if(typeof f==="function"){f=f(this,j,null,{auto:l,filters:v});if(f instanceof k)return f}return r.isEmpty(f)?this:this.write(r.filter(f,l,v))};k.prototype.section=function(f,j,l,v){if(typeof f===
-"function"){f=f(this,j,l,v);if(f instanceof k)return f}var A=l.block;l=l["else"];if(v)j=j.push(v);if(r.isArray(f)){if(A){v=f.length;l=this;for(var E=0;E<v;E++)l=A(l,j.push(f[E],E,v));return l}}else if(f===true){if(A)return A(this,j)}else if(f||f===0){if(A)return A(this,j.push(f))}else if(l)return l(this,j);return this};k.prototype.exists=function(f,j,l){var v=l.block;l=l["else"];if(r.isEmpty(f)){if(l)return l(this,j)}else if(v)return v(this,j);return this};k.prototype.notexists=function(f,j,l){var v=
-l.block;l=l["else"];if(r.isEmpty(f)){if(v)return v(this,j)}else if(l)return l(this,j);return this};k.prototype.block=function(f,j,l){l=l.block;if(f)l=f;if(l)return l(this,j);return this};k.prototype.partial=function(f,j){if(typeof f==="function")return this.capture(f,j,function(l,v){r.load(l,v,j).end()});return r.load(f,this,j)};k.prototype.helper=function(f,j,l,v){return r.helpers[f](this,j,l,v)};k.prototype.capture=function(f,j,l){return this.map(function(v){var A=new p(function(E,M){E?v.setError(E):
-l(M,v)});f(A.head,j).end()})};k.prototype.setError=function(f){this.error=f;this.root.flush();return this};r.helpers={sep:function(f,j,l){if(j.stack.index===j.stack.of-1)return f;return l.block(f,j)},idx:function(f,j,l){return l.block(f,j.push(j.stack.index))}};q.prototype.push=function(f){return new q(f,this)};q.prototype.go=function(f){for(var j=this;j;){f=j.head(f);j=j.tail}return f};var n=/[&<>\"]/,x=/&/g,w=/</g,B=/>/g,C=/\"/g;r.escapeHtml=function(f){if(typeof f==="string"){if(!n.test(f))return f;
-return f.replace(x,"&amp;").replace(w,"&lt;").replace(B,"&gt;").replace(C,"&quot;")}return f};var I=/\\/g,N=/\r/g,R=/\u2028/g,J=/\u2029/g,U=/\n/g,G=/\f/g,O=/'/g,S=/"/g,T=/\t/g;r.escapeJs=function(f){if(typeof f==="string")return f.replace(I,"\\\\").replace(S,'\\"').replace(O,"\\'").replace(N,"\\r").replace(R,"\\u2028").replace(J,"\\u2029").replace(U,"\\n").replace(G,"\\f").replace(T,"\\t");return f}})(dust);if(typeof exports!=="undefined"){require("./server")(dust);module.exports=dust}
-(function(r){function y(q,n){for(var x=[n[0]],w=1,B=n.length;w<B;w++){var C=r.filterNode(q,n[w]);C&&x.push(C)}return x}function F(q,n){return n}function p(){}function H(q,n,x){return"."+x+"("+r.compileNode(q,n[1])+","+r.compileNode(q,n[2])+","+r.compileNode(q,n[4])+","+r.compileNode(q,n[3])+")"}r.compile=function(q,n){var x,w=r.parse(q);x=r.filterNode({},w);w={name:n,bodies:[],blocks:{},index:0,auto:"h"};x='(function(){dust.register("'+n+'",'+r.compileNode(w,x)+");";var B;var C=[],I=w.blocks;for(B in I)C.push(B+
-":"+I[B]);B=C.length?"var blocks={"+C.join(",")+"};":"var blocks=null;";return x+B+w.bodies.join("")+"})();"};r.filterNode=function(q,n){return r.optimizers[n[0]](q,n)};r.optimizers={body:y,buffer:F,special:F,format:p,reference:y,"#":y,"?":y,"^":y,"<":y,"+":y,"@":y,partial:y,context:y,params:y,bodies:y,param:y,filters:F,key:F,path:F,literal:F,comment:p};r.compileNode=function(q,n){return r.nodes[n[0]](q,n)};r.nodes={body:function(q,n){var x=q.index++,w="body_"+x,B="",C="";if(x===0)B="ctx=ctx.shiftBlocks(blocks);";
-x=1;for(var I=n.length;x<I;x++)C+=r.compileNode(q,n[x]);q.bodies.push("function "+w+"(chk,ctx){"+B+"return chk"+C+";}");return w},buffer:function(q,n){return".write("+k(n[1])+")"},special:function(q,n){return'.write("'+{s:" ",n:"\\n",r:"\\r",lb:"{",rb:"}"}[n[1]]+'")'},format:function(q,n){return".write("+k(n[1]+n[2])+")"},reference:function(q,n){return".reference("+r.compileNode(q,n[1])+",ctx,"+r.compileNode(q,n[2])+")"},"#":function(q,n){return H(q,n,"section")},"?":function(q,n){return H(q,n,"exists")},
-"^":function(q,n){return H(q,n,"notexists")},"<":function(q,n){for(var x=n[4],w=1,B=x.length;w<B;w++){var C=x[w];if(C[1][1]==="block"){q.blocks[n[1].text]=r.compileNode(q,C[2]);break}}return""},"+":function(q,n){return".block(ctx.getBlock("+k(n[1].text)+"),"+r.compileNode(q,n[2])+","+r.compileNode(q,n[4])+","+r.compileNode(q,n[3])+")"},"@":function(q,n){return".helper("+k(n[1].text)+","+r.compileNode(q,n[2])+","+r.compileNode(q,n[4])+","+r.compileNode(q,n[3])+")"},partial:function(q,n){return".partial("+
-r.compileNode(q,n[1])+","+r.compileNode(q,n[2])+")"},context:function(q,n){if(n[1])return"ctx.rebase("+r.compileNode(q,n[1])+")";return"ctx"},params:function(q,n){for(var x=[],w=1,B=n.length;w<B;w++)x.push(r.compileNode(q,n[w]));if(x.length)return"{"+x.join(",")+"}";return"null"},bodies:function(q,n){for(var x=[],w=1,B=n.length;w<B;w++)x.push(r.compileNode(q,n[w]));return"{"+x.join(",")+"}"},param:function(q,n){return r.compileNode(q,n[1])+":"+r.compileNode(q,n[2])},filters:function(q,n){for(var x=
-[],w=1,B=n.length;w<B;w++)x.push('"'+n[w]+'"');return'"'+q.auto+'",['+x.join(",")+"]"},key:function(q,n){return'ctx.get("'+n[1]+'")'},path:function(q,n){for(var x=n[1],w=n[2],B=[],C=0,I=w.length;C<I;C++)B.push('"'+w[C]+'"');return"ctx.getPath("+x+",["+B.join(",")+"])"},literal:function(q,n){return k(n[1])}};var k=typeof JSON==="undefined"?function(q){return'"'+r.escapeJs(q)+'"'}:JSON.stringify})(typeof exports!=="undefined"?exports:window.dust);
-(function(r){var y=function(){var F={parse:function(p){function H(o){return'"'+o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\n/g,"\\n")+'"'}function k(o){if(!(a<P)){if(a>P){P=a;V=[]}V.push(o)}}function q(){var o="body@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=[];for(var c=n();c!==null;){b.push(c);c=n()}b=b!==null?["body"].concat(b):null;u[o]={nextPos:a,result:b};return b}function n(){var o="part@"+a,b=u[o];
-if(b){a=b.nextPos;return b.result}b=j();if(b!==null)b=b;else{b=x();if(b!==null)b=b;else{b="partial@"+a;var c=u[b];if(c){a=c.nextPos;b=c.result}else{c=h;h=false;var d=a,g=v();if(g!==null){if(p.substr(a,1)===">"){var e=">";a+=1}else{e=null;h&&k('">"')}if(e!==null){var i=G();i=i!==null?["literal",i]:null;if(i!==null)i=i;else{i=O();i=i!==null?i:null}if(i!==null){var m=C();if(m!==null){if(p.substr(a,1)==="/"){var s="/";a+=1}else{s=null;h&&k('"/"')}if(s!==null){var t=A();if(t!==null)g=[g,e,i,m,s,t];else{g=
-null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["partial",g[2],g[3]]:null;(h=c)&&d===null&&k("partial");u[b]={nextPos:a,result:d};b=d}if(b!==null)b=b;else{b=R();if(b!==null)b=b;else{b=N();if(b!==null)b=b;else{b="buffer@"+a;if(c=u[b]){a=c.nextPos;b=c.result}else{c=h;h=false;d=a;g=E();if(g!==null){e=[];for(i=M();i!==null;){e.push(i);i=M()}if(e!==null)g=[g,e];else{g=null;a=d}}else{g=null;a=d}d=g!==null?["format",g[0],g[1].join("")]:null;if(d!==
-null)d=d;else{i=g=a;e=h;h=false;m=l();h=e;if(m===null)e="";else{e=null;a=i}if(e!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&k("any character")}if(m!==null)e=[e,i,s,m];else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[3]:null;if(g!==null)for(d=[];g!==null;){d.push(g);i=g=a;e=h;h=false;m=l();h=e;if(m===null)e="";else{e=
-null;a=i}if(e!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&k("any character")}if(m!==null)e=[e,i,s,m];else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[3]:null}else d=null;d=d!==null?["buffer",d.join("")]:null;d=d!==null?d:null}(h=c)&&d===null&&k("buffer");u[b]={nextPos:a,result:d};b=d}b=b!==null?b:null}}}}}u[o]={nextPos:a,
-result:b};return b}function x(){var o="section@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=w();if(d!==null){var g=A();if(g!==null){var e=q();if(e!==null){var i=I();if(i!==null){var m=B();if(m!==null){var s=d[1].text===m.text?"":null;if(s!==null)d=[d,g,e,i,m,s];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t,z,K){K.push(["param",["literal","block"],z]);t.push(K);return t}(d[0],d[2],d[3],d[4]):null;if(c!==
-null)c=c;else{c=a;d=w();if(d!==null){if(p.substr(a,1)==="/"){g="/";a+=1}else{g=null;h&&k('"/"')}if(g!==null){e=A();if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t){t.push(["bodies"]);return t}(d[0]):null;c=c!==null?c:null}(h=b)&&c===null&&k("section");u[o]={nextPos:a,result:c};return c}function w(){var o="sec_tag_start@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=a;var c=v();if(c!==null){if(p.substr(a).match(/^[#?^<+@]/)!==null){var d=p.charAt(a);a++}else{d=
-null;h&&k("[#?^<+@]")}if(d!==null){var g=J();if(g!==null){var e=C();if(e!==null){var i;i="params@"+a;var m=u[i];if(m){a=m.nextPos;i=m.result}else{m=h;h=false;var s=[],t=a,z=M();if(z!==null){var K=G();if(K!==null){if(p.substr(a,1)==="="){var L="=";a+=1}else{L=null;h&&k('"="')}if(L!==null){var D=J();if(D!==null)D=D;else{D=O();D=D!==null?D:null}if(D!==null)z=[z,K,L,D];else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}for(t=z!==null?["param",["literal",z[1]],z[3]]:null;t!==null;){s.push(t);
-t=a;z=M();if(z!==null){K=G();if(K!==null){if(p.substr(a,1)==="="){L="=";a+=1}else{L=null;h&&k('"="')}if(L!==null){D=J();if(D!==null)D=D;else{D=O();D=D!==null?D:null}if(D!==null)z=[z,K,L,D];else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}t=z!==null?["param",["literal",z[1]],z[3]]:null}s=s!==null?["params"].concat(s):null;(h=m)&&s===null&&k("params");u[i]={nextPos:a,result:s};i=s}if(i!==null)c=[c,d,g,e,i];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=
-null;a=b}b=c!==null?[c[1],c[2],c[3],c[4]]:null;u[o]={nextPos:a,result:b};return b}function B(){var o="end_tag@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){if(p.substr(a,1)==="/"){var g="/";a+=1}else{g=null;h&&k('"/"')}if(g!==null){var e=J();if(e!==null){var i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[2]:null;(h=b)&&c===null&&k("end tag");u[o]={nextPos:a,result:c};return c}function C(){var o="context@"+
-a,b=u[o];if(b){a=b.nextPos;return b.result}b=a;if(p.substr(a,1)===":"){var c=":";a+=1}else{c=null;h&&k('":"')}if(c!==null){var d=J();if(d!==null)c=[c,d];else{c=null;a=b}}else{c=null;a=b}b=c!==null?c[1]:null;b=b!==null?b:"";b=b!==null?b?["context",b]:["context"]:null;u[o]={nextPos:a,result:b};return b}function I(){var o="bodies@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=[],d=a,g=v();if(g!==null){if(p.substr(a,1)===":"){var e=":";a+=1}else{e=null;h&&k('":"')}if(e!==null){var i=G();
-if(i!==null){var m=A();if(m!==null){var s=q();if(s!==null)g=[g,e,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}for(d=g!==null?["param",["literal",g[2]],g[4]]:null;d!==null;){c.push(d);d=a;g=v();if(g!==null){if(p.substr(a,1)===":"){e=":";a+=1}else{e=null;h&&k('":"')}if(e!==null){i=G();if(i!==null){m=A();if(m!==null){s=q();if(s!==null)g=[g,e,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["param",["literal",
-g[2]],g[4]]:null}c=c!==null?["bodies"].concat(c):null;(h=b)&&c===null&&k("bodies");u[o]={nextPos:a,result:c};return c}function N(){var o="reference@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){var g=J();if(g!==null){var e;e="filters@"+a;var i=u[e];if(i){a=i.nextPos;e=i.result}else{i=h;h=false;var m=[],s=a;if(p.substr(a,1)==="|"){var t="|";a+=1}else{t=null;h&&k('"|"')}if(t!==null){var z=G();if(z!==null)t=[t,z];else{t=null;a=s}}else{t=null;a=s}for(s=t!==null?t[1]:
-null;s!==null;){m.push(s);s=a;if(p.substr(a,1)==="|"){t="|";a+=1}else{t=null;h&&k('"|"')}if(t!==null){z=G();if(z!==null)t=[t,z];else{t=null;a=s}}else{t=null;a=s}s=t!==null?t[1]:null}m=m!==null?["filters"].concat(m):null;(h=i)&&m===null&&k("filters");u[e]={nextPos:a,result:m};e=m}if(e!==null){i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["reference",d[1],d[2]]:null;(h=b)&&c===null&&k("reference");u[o]={nextPos:a,result:c};return c}function R(){var o=
-"special@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){if(p.substr(a,1)==="~"){var g="~";a+=1}else{g=null;h&&k('"~"')}if(g!==null){var e=G();if(e!==null){var i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["special",d[2]]:null;(h=b)&&c===null&&k("special");u[o]={nextPos:a,result:c};return c}function J(){var o="identifier@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=U();c=c!==null?W(["path"].concat(c),
-o):null;if(c!==null)c=c;else{c=G();c=c!==null?W(["key",c],o):null;c=c!==null?c:null}(h=b)&&c===null&&k("identifier");u[o]={nextPos:a,result:c};return c}function U(){var o="path@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=G();d=d!==null?d:"";if(d!==null){var g=a;if(p.substr(a,1)==="."){var e=".";a+=1}else{e=null;h&&k('"."')}if(e!==null){var i=G();if(i!==null)e=[e,i];else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[1]:null;if(g!==null)for(var m=[];g!==null;){m.push(g);g=a;if(p.substr(a,
-1)==="."){e=".";a+=1}else{e=null;h&&k('"."')}if(e!==null){i=G();if(i!==null)e=[e,i];else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[1]:null}else m=null;if(m!==null)d=[d,m];else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(s,t){if(s){t.unshift(s);return[false,t]}return[true,t]}(d[0],d[1]):null;if(c!==null)c=c;else{if(p.substr(a,1)==="."){c=".";a+=1}else{c=null;h&&k('"."')}c=c!==null?[true,[]]:null;c=c!==null?c:null}(h=b)&&c===null&&k("path");u[o]={nextPos:a,result:c};return c}function G(){var o="key@"+
-a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;if(p.substr(a).match(/^[a-zA-Z_]/)!==null){var c=p.charAt(a);a++}else{c=null;h&&k("[a-zA-Z_]")}if(c!==null)for(var d=[];c!==null;){d.push(c);if(p.substr(a).match(/^[a-zA-Z_]/)!==null){c=p.charAt(a);a++}else{c=null;h&&k("[a-zA-Z_]")}}else d=null;c=d!==null?d.join(""):null;(h=b)&&c===null&&k("key");u[o]={nextPos:a,result:c};return c}function O(){var o="inline@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,1)==='"'){var d=
-'"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){if(p.substr(a,1)==='"'){var g='"';a+=1}else{g=null;h&&k('"\\""')}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",""]:null;if(c!==null)c=c;else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){g=T();if(g!==null){if(p.substr(a,1)==='"'){var e='"';a+=1}else{e=null;h&&k('"\\""')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",d[1]]:null;if(c!==null)c=c;
-else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){e=S();if(e!==null)for(g=[];e!==null;){g.push(e);e=S()}else g=null;if(g!==null){if(p.substr(a,1)==='"'){e='"';a+=1}else{e=null;h&&k('"\\""')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["body"].concat(d[1]):null;c=c!==null?c:null}}(h=b)&&c===null&&k("inline");u[o]={nextPos:a,result:c};return c}function S(){var o="inline_part@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=R();if(b!==
-null)b=b;else{b=N();if(b!==null)b=b;else{b=T();b=b!==null?["buffer",b]:null;b=b!==null?b:null}}u[o]={nextPos:a,result:b};return b}function T(){var o="literal@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=a,g=h;h=false;var e=l();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;var i=E();h=d;if(i===null)d="";else{d=null;a=e}if(d!==null){e=f();if(e!==null)e=e;else{if(p.substr(a).match(/^[^"]/)!==null){e=p.charAt(a);a++}else{e=null;h&&k('[^"]')}e=e!==null?e:null}if(e!==
-null)g=[g,d,e];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null;if(c!==null)for(var m=[];c!==null;){m.push(c);d=c=a;g=h;h=false;e=l();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;i=E();h=d;if(i===null)d="";else{d=null;a=e}if(d!==null){e=f();if(e!==null)e=e;else{if(p.substr(a).match(/^[^"]/)!==null){e=p.charAt(a);a++}else{e=null;h&&k('[^"]')}e=e!==null?e:null}if(e!==null)g=[g,d,e];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null}else m=
-null;m=m!==null?m.join(""):null;(h=b)&&m===null&&k("literal");u[o]={nextPos:a,result:m};return m}function f(){var o="esc@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,2)==='\\"'){b='\\"';a+=2}else{b=null;h&&k('"\\\\\\""')}b=b!==null?'"':null;u[o]={nextPos:a,result:b};return b}function j(){var o="comment@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,2)==="{!"){var d="{!";a+=2}else{d=null;h&&k('"{!"')}if(d!==null){var g=[],e=a,i=a,m=h;h=false;if(p.substr(a,
-2)==="!}"){var s="!}";a+=2}else{s=null;h&&k('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);a++}else{i=null;h&&k("any character")}if(i!==null)i=[m,i];else{i=null;a=e}}else{i=null;a=e}for(e=i!==null?i[1]:null;e!==null;){g.push(e);i=e=a;m=h;h=false;if(p.substr(a,2)==="!}"){s="!}";a+=2}else{s=null;h&&k('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);a++}else{i=null;h&&k("any character")}if(i!==null)i=[m,i];else{i=null;a=e}}else{i=
-null;a=e}e=i!==null?i[1]:null}if(g!==null){if(p.substr(a,2)==="!}"){e="!}";a+=2}else{e=null;h&&k('"!}"')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["comment",d[1].join("")]:null;(h=b)&&c===null&&k("comment");u[o]={nextPos:a,result:c};return c}function l(){var o="tag@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=a;var c=v();if(c!==null){if(p.substr(a).match(/^[#?^><+%:@\/~]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&k("[#?^><+%:@\\/~]")}if(d!==null){var g=
-a,e=a,i=h;h=false;var m=A();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;var s=E();h=m;if(s===null)m="";else{m=null;a=e}if(m!==null){if(p.length>a){e=p.charAt(a);a++}else{e=null;h&&k("any character")}if(e!==null)i=[i,m,e];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}if(i!==null)for(var t=[];i!==null;){t.push(i);e=g=a;i=h;h=false;m=A();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;s=E();h=m;if(s===null)m="";else{m=null;a=e}if(m!==null){if(p.length>a){e=
-p.charAt(a);a++}else{e=null;h&&k("any character")}if(e!==null)i=[i,m,e];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}}else t=null;if(t!==null){g=A();if(g!==null)c=[c,d,t,g];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}if(c!==null)b=c;else{b=N();b=b!==null?b:null}u[o]={nextPos:a,result:b};return b}function v(){var o="ld@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="{"){b="{";a+=1}else{b=null;h&&k('"{"')}u[o]={nextPos:a,result:b};return b}function A(){var o=
-"rd@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="}"){b="}";a+=1}else{b=null;h&&k('"}"')}u[o]={nextPos:a,result:b};return b}function E(){var o="eol@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="\n"){b="\n";a+=1}else{b=null;h&&k('"\\n"')}if(b!==null)b=b;else{if(p.substr(a,2)==="\r\n"){b="\r\n";a+=2}else{b=null;h&&k('"\\r\\n"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\r"){b="\r";a+=1}else{b=null;h&&k('"\\r"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2028"){b=
-"\u2028";a+=1}else{b=null;h&&k('"\\u2028"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2029"){b="\u2029";a+=1}else{b=null;h&&k('"\\u2029"')}b=b!==null?b:null}}}}u[o]={nextPos:a,result:b};return b}function M(){var o="ws@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a).match(/^[\t\u000b\u000c \u00a0\ufeff]/)!==null){b=p.charAt(a);a++}else{b=null;h&&k("[\t\u000b\u000c \u00a0\ufeff]")}u[o]={nextPos:a,result:b};return b}function X(){var o=function(c){c.sort();for(var d=null,g=[],e=0;e<c.length;e++)if(c[e]!==
-d){g.push(c[e]);d=c[e]}switch(g.length){case 0:return"end of input";case 1:return g[0];default:return g.slice(0,g.length-1).join(", ")+" or "+g[g.length-1]}}(V),b=Math.max(a,P);b=b<p.length?H(p.charAt(b)):"end of input";return"Expected "+o+" but "+b+" found."}function Y(){for(var o=1,b=1,c=false,d=0;d<P;d++){var g=p.charAt(d);if(g==="\n"){c||o++;b=1;c=false}else if(g==="\r"|g==="\u2028"||g==="\u2029"){o++;b=1;c=true}else{b++;c=false}}return{line:o,column:b}}function W(o,b){o.text=p.substring(b.split("@")[1],
-a);return o}var a=0,h=true,P=0,V=[],u={},Q=q();if(Q===null||a!==p.length){Q=Y();throw new SyntaxError(X(),Q.line,Q.column);}return Q},toSource:function(){return this._source}};F.SyntaxError=function(p,H,k){this.name="SyntaxError";this.message=p;this.line=H;this.column=k};F.SyntaxError.prototype=Error.prototype;return F}();r.parse=y.parse})(typeof exports!=="undefined"?exports:window.dust);
View
350 dist/dust-full-0.0.1.js → dist/dust-full-0.1.0.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.0.1
+// Dust - Asynchronous Templating v0.1.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -97,7 +97,7 @@ function Context(stack, global, blocks) {
this.blocks = blocks;
}
-Context.base = function(global) {
+dust.makeBase = function(global) {
return new Context(new Stack(), global);
}
@@ -567,7 +567,7 @@ function compile(ast, name) {
+ dust.compileNode(context, ast)
+ ");"
+ compileBlocks(context)
- + context.bodies.join('')
+ + compileBodies(context)
+ "})();";
}
@@ -579,9 +579,22 @@ function compileBlocks(context) {
out.push(name + ":" + blocks[name]);
}
if (out.length) {
+ context.blocks = "ctx=ctx.shiftBlocks(blocks);";
return "var blocks={" + out.join(',') + "};";
}
- return "var blocks=null;";
+ return context.blocks = "";
+}
+
+function compileBodies(context) {
+ var out = [],
+ bodies = context.bodies,
+ blx = context.blocks;
+
+ for (var i=0, len=bodies.length; i<len; i++) {
+ out[i] = "function body_" + i + "(chk,ctx){"
+ + blx + "return chk" + bodies[i] + ";}";
+ }
+ return out.join('');
}
dust.compileNode = function(context, node) {
@@ -592,20 +605,12 @@ dust.nodes = {
body: function(context, node) {
var id = context.index++,
name = "body_" + id,
- blx = '',
parts = '';
- if (id === 0) {
- blx = "ctx=ctx.shiftBlocks(blocks);"
- }
-
for (var i=1, len=node.length; i<len; i++) {
parts += dust.compileNode(context, node[i]);
}
-
- context.bodies.push("function " + name + "(chk,ctx){"
- + blx + "return chk" + parts + ";}");
-
+ context.bodies[id] = parts;
return name;
},
@@ -763,7 +768,7 @@ function escapeSpecial(ch) {
var parser = (function(){
/* Generated by PEG.js (http://pegjs.majda.cz/). */
-
+
var result = {
/*
* Parses the input with a generated parser. If the parsing is successfull,
@@ -777,7 +782,7 @@ var parser = (function(){
var rightmostMatchFailuresPos = 0;
var rightmostMatchFailuresExpected = [];
var cache = {};
-
+
function quote(s) {
/*
* ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a
@@ -794,29 +799,29 @@ var parser = (function(){
.replace(/\n/g, '\\n') // line feed
+ '"';
}
-
+
function matchFailed(failure) {
if (pos < rightmostMatchFailuresPos) {
return;
}
-
+
if (pos > rightmostMatchFailuresPos) {
rightmostMatchFailuresPos = pos;
rightmostMatchFailuresExpected = [];
}
-
+
rightmostMatchFailuresExpected.push(failure);
}
-
+
function parse_body() {
var cacheKey = "body" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var result1 = [];
var result2 = parse_part();
while (result2 !== null) {
@@ -826,25 +831,25 @@ var parser = (function(){
var result0 = result1 !== null
? (function(p) { return ["body"].concat(p) })(result1)
: null;
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_part() {
var cacheKey = "part" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var result6 = parse_comment();
if (result6 !== null) {
var result0 = result6;
@@ -876,24 +881,24 @@ var parser = (function(){
};
};
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_section() {
var cacheKey = "section" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos1 = pos;
@@ -981,23 +986,23 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("section");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_sec_tag_start() {
var cacheKey = "sec_tag_start" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var savedPos0 = pos;
var result2 = parse_ld();
if (result2 !== null) {
@@ -1041,24 +1046,24 @@ var parser = (function(){
var result0 = result1 !== null
? (function(t, n, c, p) { return [t, n, c, p] })(result1[1], result1[2], result1[3], result1[4])
: null;
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_end_tag() {
var cacheKey = "end_tag" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -1102,23 +1107,23 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("end tag");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_context() {
var cacheKey = "context" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var savedPos0 = pos;
if (input.substr(pos, 1) === ":") {
var result4 = ":";
@@ -1148,24 +1153,24 @@ var parser = (function(){
var result0 = result1 !== null
? (function(n) { return n ? ["context", n] : ["context"] })(result1)
: null;
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_params() {
var cacheKey = "params" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var result1 = [];
@@ -1273,22 +1278,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("params");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_bodies() {
var cacheKey = "bodies" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var result1 = [];
@@ -1388,22 +1393,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("bodies");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_reference() {
var cacheKey = "reference" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -1439,22 +1444,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("reference");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_partial() {
var cacheKey = "partial" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -1531,22 +1536,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("partial");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_filters() {
var cacheKey = "filters" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var result1 = [];
@@ -1610,22 +1615,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("filters");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_special() {
var cacheKey = "special" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -1669,22 +1674,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("special");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_identifier() {
var cacheKey = "identifier" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var result4 = parse_path();
@@ -1708,22 +1713,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("identifier");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_path() {
var cacheKey = "path" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -1829,73 +1834,90 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("path");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_key() {
var cacheKey = "key" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
- if (input.substr(pos).match(/^[a-zA-Z_]/) !== null) {
+ var savedPos0 = pos;
+ if (input.substr(pos).match(/^[a-zA-Z_$]/) !== null) {
var result2 = input.charAt(pos);
pos++;
} else {
var result2 = null;
if (reportMatchFailures) {
- matchFailed("[a-zA-Z_]");
+ matchFailed("[a-zA-Z_$]");
}
}
if (result2 !== null) {
- var result1 = [];
- while (result2 !== null) {
- result1.push(result2);
- if (input.substr(pos).match(/^[a-zA-Z_]/) !== null) {
- var result2 = input.charAt(pos);
+ var result3 = [];
+ if (input.substr(pos).match(/^[0-9a-zA-Z_$]/) !== null) {
+ var result4 = input.charAt(pos);
+ pos++;
+ } else {
+ var result4 = null;
+ if (reportMatchFailures) {
+ matchFailed("[0-9a-zA-Z_$]");
+ }
+ }
+ while (result4 !== null) {
+ result3.push(result4);
+ if (input.substr(pos).match(/^[0-9a-zA-Z_$]/) !== null) {
+ var result4 = input.charAt(pos);
pos++;
} else {
- var result2 = null;
+ var result4 = null;
if (reportMatchFailures) {
- matchFailed("[a-zA-Z_]");
+ matchFailed("[0-9a-zA-Z_$]");
}
}
}
+ if (result3 !== null) {
+ var result1 = [result2, result3];
+ } else {
+ var result1 = null;
+ pos = savedPos0;
+ }
} else {
var result1 = null;
+ pos = savedPos0;
}
var result0 = result1 !== null
- ? (function(c) { return c.join('') })(result1)
+ ? (function(h, t) { return h + t.join('') })(result1[0], result1[1])
: null;
reportMatchFailures = savedReportMatchFailures;
if (reportMatchFailures && result0 === null) {
matchFailed("key");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_inline() {
var cacheKey = "inline" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos2 = pos;
@@ -2035,23 +2057,23 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("inline");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_inline_part() {
var cacheKey = "inline_part" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var result4 = parse_special();
if (result4 !== null) {
var result0 = result4;
@@ -2071,24 +2093,24 @@ var parser = (function(){
};
};
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_buffer() {
var cacheKey = "buffer" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos4 = pos;
@@ -2271,22 +2293,22 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("buffer");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_literal() {
var cacheKey = "literal" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -2426,23 +2448,23 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("literal");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_esc() {
var cacheKey = "esc" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
if (input.substr(pos, 2) === "\\\"") {
var result1 = "\\\"";
pos += 2;
@@ -2455,24 +2477,24 @@ var parser = (function(){
var result0 = result1 !== null
? (function() { return '"' })()
: null;
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_comment() {
var cacheKey = "comment" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
+
var savedReportMatchFailures = reportMatchFailures;
reportMatchFailures = false;
var savedPos0 = pos;
@@ -2607,23 +2629,23 @@ var parser = (function(){
if (reportMatchFailures && result0 === null) {
matchFailed("comment");
}
-
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_tag() {
var cacheKey = "tag" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
var savedPos0 = pos;
var result3 = parse_ld();
if (result3 !== null) {
@@ -2771,25 +2793,25 @@ var parser = (function(){
var result0 = null;;
};
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_ld() {
var cacheKey = "ld" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
if (input.substr(pos, 1) === "{") {
var result0 = "{";
pos += 1;
@@ -2799,25 +2821,25 @@ var parser = (function(){
matchFailed("\"{\"");
}
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_rd() {
var cacheKey = "rd" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
if (input.substr(pos, 1) === "}") {
var result0 = "}";
pos += 1;
@@ -2827,25 +2849,25 @@ var parser = (function(){
matchFailed("\"}\"");
}
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_eol() {
var cacheKey = "eol" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
if (input.substr(pos, 1) === "\n") {
var result5 = "\n";
pos += 1;
@@ -2912,25 +2934,25 @@ var parser = (function(){
};
};
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function parse_ws() {
var cacheKey = "ws" + '@' + pos;
var cachedResult = cache[cacheKey];
if (cachedResult) {
pos = cachedResult.nextPos;
return cachedResult.result;
}
-
-
+
+
if (input.substr(pos).match(/^[  ]/) !== null) {
var result0 = input.charAt(pos);
pos++;
@@ -2940,20 +2962,20 @@ var parser = (function(){
matchFailed("[  ]");
}
}
-
-
-
+
+
+
cache[cacheKey] = {
nextPos: pos,
result: result0
};
return result0;
}
-
+
function buildErrorMessage() {
function buildExpected(failuresExpected) {
failuresExpected.sort();
-
+
var lastFailure = null;
var failuresExpectedUnique = [];
for (var i = 0; i < failuresExpected.length; i++) {
@@ -2962,7 +2984,7 @@ var parser = (function(){
lastFailure = failuresExpected[i];
}
}
-
+
switch (failuresExpectedUnique.length) {
case 0:
return 'end of input';
@@ -2974,28 +2996,28 @@ var parser = (function(){
+ failuresExpectedUnique[failuresExpectedUnique.length - 1];
}
}
-
+
var expected = buildExpected(rightmostMatchFailuresExpected);
var actualPos = Math.max(pos, rightmostMatchFailuresPos);
var actual = actualPos < input.length
? quote(input.charAt(actualPos))
: 'end of input';
-
+
return 'Expected ' + expected + ' but ' + actual + ' found.';
}
-
+
function computeErrorPosition() {
/*
* The first idea was to use |String.split| to break the input up to the
* error position along newlines and derive the line and column from
* there. However IE's |split| implementation is so broken that it was
* enough to prevent it.
*/
-
+
var line = 1;
var column = 1;
var seenCR = false;
-
+
for (var i = 0; i < rightmostMatchFailuresPos; i++) {
var ch = input.charAt(i);
if (ch === '\n') {
@@ -3011,24 +3033,24 @@ var parser = (function(){
seenCR = false;
}
}
-
+
return { line: line, column: column };
}
-
-
-
+
+
+
function wrap(node, ck) {
-
+
node['text'] = input.substring(ck.split('@')[1], pos);
-
+
return node;
-
+
}
-
-
-
+
+
+
var result = parse_body();
-
+
/*
* The parser is now in one of the following three states:
*
@@ -3061,25 +3083,25 @@ var parser = (function(){
errorPosition.column
);
}
-
+
return result;
},
-
+
/* Returns the parser source code. */
toSource: function() { return this._source; }
};
-
+
/* Thrown when a parser encounters a syntax error. */
-
+
result.SyntaxError = function(message, line, column) {
this.name = 'SyntaxError';
this.message = message;
this.line = line;
this.column = column;
};
-
+
result.SyntaxError.prototype = Error.prototype;
-
+
return result;
})();
View
59 dist/dust-full-0.1.0.min.js
@@ -0,0 +1,59 @@
+//
+// Dust - Asynchronous Templating v0.1.0
+// http://akdubya.github.com/dustjs
+//
+// Copyright (c) 2010, Aleksander Williams
+// Released under the MIT License.
+//
+
+var dust={};
+(function(q){function y(f,j,l){this.stack=f;this.global=j;this.blocks=l}function G(f,j,l,w){this.tail=j;this.isObject=!q.isArray(f)&&f&&typeof f==="object";this.head=f;this.index=l;this.of=w}function p(f){this.head=new k(this);this.callback=f;this.out=""}function I(){this.head=new k(this)}function k(f,j,l){this.root=f;this.next=j;this.data="";this.flushable=false;this.taps=l}function r(f,j){this.head=f;this.tail=j}q.cache={};q.register=function(f,j){q.cache[f]=j};q.render=function(f,j,l){l=(new p(l)).head;
+q.load(f,l,y.wrap(j)).end()};q.stream=function(f,j){var l=new I;setTimeout(function(){q.load(f,l.head,y.wrap(j)).end()});return l};q.load=function(f,j,l){return(tmpl=q.cache[f])?tmpl(j,l):j.setError(Error("Template Not Found: "+f))};q.loadSource=function(f){eval(f)};q.isArray=Array.isArray?Array.isArray:function(f){return Object.prototype.toString.call(f)=="[object Array]"};q.nextTick=function(f){setTimeout(f,0)};q.isEmpty=function(f){if(q.isArray(f)&&!f.length)return true;if(f===0)return false;return!f};
+q.filter=function(f,j,l){for(var w=l.length,A=0;A<w;A++){var E=l[A];if(E==="s")j=null;else f=q.filters[E](f)}if(j)f=q.filters[j](f);return f};q.filters={h:function(f){return q.escapeHtml(f)},j:function(f){return q.escapeJs(f)},u:encodeURI,uc:encodeURIComponent};q.makeBase=function(f){return new y(new G,f)};y.wrap=function(f){if(f instanceof y)return f;return new y(new G(f))};y.prototype.get=function(f){for(var j=this.stack,l;j;){if(j.isObject){l=j.head[f];if(l!==undefined)return l}j=j.tail}return this.global?
+this.global[f]:undefined};y.prototype.getPath=function(f,j){var l=this.stack,w=j.length;if(f&&w===0)return l.head;if(l.isObject){l=l.head;for(var A=0;l&&A<w;){l=l[j[A]];A++}return l}};y.prototype.push=function(f,j,l){return new y(new G(f,this.stack,j,l),this.global,this.blocks)};y.prototype.rebase=function(f){return new y(new G(f),this.global,this.blocks)};y.prototype.current=function(){return this.stack.head};y.prototype.getBlock=function(f){var j=this.blocks;if(j)for(var l=j.length,w;l--;)if(w=
+j[l][f])return w};y.prototype.shiftBlocks=function(f){var j=this.blocks;if(f){newBlocks=j?j.concat([f]):[f];return new y(this.stack,this.global,newBlocks)}return this};p.prototype.flush=function(){for(var f=this.head;f;){if(f.flushable)this.out+=f.data;else{if(f.error){this.callback(f.error);this.flush=function(){}}return}this.head=f=f.next}this.callback(null,this.out)};I.prototype.flush=function(){for(var f=this.head;f;){if(f.flushable)this.emit("data",f.data);else{if(f.error){this.emit("error",
+f.error);this.flush=function(){}}return}this.head=f=f.next}this.emit("end")};I.prototype.emit=function(f,j){var l=this.events;l&&l[f]&&l[f](j)};I.prototype.on=function(f,j){if(!this.events)this.events={};this.events[f]=j;return this};k.prototype.write=function(f){var j=this.taps;if(j)f=j.go(f);this.data+=f;return this};k.prototype.end=function(f){f&&this.write(f);this.flushable=true;this.root.flush();return this};k.prototype.map=function(f){var j=new k(this.root,this.next,this.taps),l=new k(this.root,
+j,this.taps);this.next=l;this.flushable=true;f(l);return j};k.prototype.tap=function(f){var j=this.taps;this.taps=j?j.push(f):new r(f);return this};k.prototype.untap=function(){this.taps=this.taps.tail;return this};k.prototype.render=function(f,j){return f(this,j)};k.prototype.reference=function(f,j,l,w){if(typeof f==="function"){f=f(this,j,null,{auto:l,filters:w});if(f instanceof k)return f}return q.isEmpty(f)?this:this.write(q.filter(f,l,w))};k.prototype.section=function(f,j,l,w){if(typeof f===
+"function"){f=f(this,j,l,w);if(f instanceof k)return f}var A=l.block;l=l["else"];if(w)j=j.push(w);if(q.isArray(f)){if(A){w=f.length;l=this;for(var E=0;E<w;E++)l=A(l,j.push(f[E],E,w));return l}}else if(f===true){if(A)return A(this,j)}else if(f||f===0){if(A)return A(this,j.push(f))}else if(l)return l(this,j);return this};k.prototype.exists=function(f,j,l){var w=l.block;l=l["else"];if(q.isEmpty(f)){if(l)return l(this,j)}else if(w)return w(this,j);return this};k.prototype.notexists=function(f,j,l){var w=
+l.block;l=l["else"];if(q.isEmpty(f)){if(w)return w(this,j)}else if(l)return l(this,j);return this};k.prototype.block=function(f,j,l){l=l.block;if(f)l=f;if(l)return l(this,j);return this};k.prototype.partial=function(f,j){if(typeof f==="function")return this.capture(f,j,function(l,w){q.load(l,w,j).end()});return q.load(f,this,j)};k.prototype.helper=function(f,j,l,w){return q.helpers[f](this,j,l,w)};k.prototype.capture=function(f,j,l){return this.map(function(w){var A=new p(function(E,N){E?w.setError(E):
+l(N,w)});f(A.head,j).end()})};k.prototype.setError=function(f){this.error=f;this.root.flush();return this};q.helpers={sep:function(f,j,l){if(j.stack.index===j.stack.of-1)return f;return l.block(f,j)},idx:function(f,j,l){return l.block(f,j.push(j.stack.index))}};r.prototype.push=function(f){return new r(f,this)};r.prototype.go=function(f){for(var j=this;j;){f=j.head(f);j=j.tail}return f};var n=/[&<>\"]/,x=/&/g,v=/</g,B=/>/g,C=/\"/g;q.escapeHtml=function(f){if(typeof f==="string"){if(!n.test(f))return f;
+return f.replace(x,"&amp;").replace(v,"&lt;").replace(B,"&gt;").replace(C,"&quot;")}return f};var F=/\\/g,L=/\r/g,R=/\u2028/g,J=/\u2029/g,U=/\n/g,H=/\f/g,O=/'/g,S=/"/g,T=/\t/g;q.escapeJs=function(f){if(typeof f==="string")return f.replace(F,"\\\\").replace(S,'\\"').replace(O,"\\'").replace(L,"\\r").replace(R,"\\u2028").replace(J,"\\u2029").replace(U,"\\n").replace(H,"\\f").replace(T,"\\t");return f}})(dust);if(typeof exports!=="undefined"){require("./server")(dust);module.exports=dust}
+(function(q){function y(r,n){for(var x=[n[0]],v=1,B=n.length;v<B;v++){var C=q.filterNode(r,n[v]);C&&x.push(C)}return x}function G(r,n){return n}function p(){}function I(r,n,x){return"."+x+"("+q.compileNode(r,n[1])+","+q.compileNode(r,n[2])+","+q.compileNode(r,n[4])+","+q.compileNode(r,n[3])+")"}q.compile=function(r,n){var x,v=q.parse(r);x=q.filterNode({},v);v={name:n,bodies:[],blocks:{},index:0,auto:"h"};x='(function(){dust.register("'+n+'",'+q.compileNode(v,x)+");";var B;var C=[],F=v.blocks;for(B in F)C.push(B+
+":"+F[B]);if(C.length){v.blocks="ctx=ctx.shiftBlocks(blocks);";B="var blocks={"+C.join(",")+"};"}else B=v.blocks="";B=x+B;x=[];C=v.bodies;v=v.blocks;F=0;for(var L=C.length;F<L;F++)x[F]="function body_"+F+"(chk,ctx){"+v+"return chk"+C[F]+";}";v=x.join("");return B+v+"})();"};q.filterNode=function(r,n){return q.optimizers[n[0]](r,n)};q.optimizers={body:y,buffer:G,special:G,format:p,reference:y,"#":y,"?":y,"^":y,"<":y,"+":y,"@":y,partial:y,context:y,params:y,bodies:y,param:y,filters:G,key:G,path:G,literal:G,
+comment:p};q.compileNode=function(r,n){return q.nodes[n[0]](r,n)};q.nodes={body:function(r,n){for(var x=r.index++,v="body_"+x,B="",C=1,F=n.length;C<F;C++)B+=q.compileNode(r,n[C]);r.bodies[x]=B;return v},buffer:function(r,n){return".write("+k(n[1])+")"},special:function(r,n){return'.write("'+{s:" ",n:"\\n",r:"\\r",lb:"{",rb:"}"}[n[1]]+'")'},format:function(r,n){return".write("+k(n[1]+n[2])+")"},reference:function(r,n){return".reference("+q.compileNode(r,n[1])+",ctx,"+q.compileNode(r,n[2])+")"},"#":function(r,
+n){return I(r,n,"section")},"?":function(r,n){return I(r,n,"exists")},"^":function(r,n){return I(r,n,"notexists")},"<":function(r,n){for(var x=n[4],v=1,B=x.length;v<B;v++){var C=x[v];if(C[1][1]==="block"){r.blocks[n[1].text]=q.compileNode(r,C[2]);break}}return""},"+":function(r,n){return".block(ctx.getBlock("+k(n[1].text)+"),"+q.compileNode(r,n[2])+","+q.compileNode(r,n[4])+","+q.compileNode(r,n[3])+")"},"@":function(r,n){return".helper("+k(n[1].text)+","+q.compileNode(r,n[2])+","+q.compileNode(r,
+n[4])+","+q.compileNode(r,n[3])+")"},partial:function(r,n){return".partial("+q.compileNode(r,n[1])+","+q.compileNode(r,n[2])+")"},context:function(r,n){if(n[1])return"ctx.rebase("+q.compileNode(r,n[1])+")";return"ctx"},params:function(r,n){for(var x=[],v=1,B=n.length;v<B;v++)x.push(q.compileNode(r,n[v]));if(x.length)return"{"+x.join(",")+"}";return"null"},bodies:function(r,n){for(var x=[],v=1,B=n.length;v<B;v++)x.push(q.compileNode(r,n[v]));return"{"+x.join(",")+"}"},param:function(r,n){return q.compileNode(r,
+n[1])+":"+q.compileNode(r,n[2])},filters:function(r,n){for(var x=[],v=1,B=n.length;v<B;v++)x.push('"'+n[v]+'"');return'"'+r.auto+'",['+x.join(",")+"]"},key:function(r,n){return'ctx.get("'+n[1]+'")'},path:function(r,n){for(var x=n[1],v=n[2],B=[],C=0,F=v.length;C<F;C++)B.push('"'+v[C]+'"');return"ctx.getPath("+x+",["+B.join(",")+"])"},literal:function(r,n){return k(n[1])}};var k=typeof JSON==="undefined"?function(r){return'"'+q.escapeJs(r)+'"'}:JSON.stringify})(typeof exports!=="undefined"?exports:
+window.dust);
+(function(q){var y=function(){var G={parse:function(p){function I(o){return'"'+o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\n/g,"\\n")+'"'}function k(o){if(!(a<P)){if(a>P){P=a;V=[]}V.push(o)}}function r(){var o="body@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=[];for(var c=n();c!==null;){b.push(c);c=n()}b=b!==null?["body"].concat(b):null;u[o]={nextPos:a,result:b};return b}function n(){var o="part@"+a,b=u[o];
+if(b){a=b.nextPos;return b.result}b=j();if(b!==null)b=b;else{b=x();if(b!==null)b=b;else{b="partial@"+a;var c=u[b];if(c){a=c.nextPos;b=c.result}else{c=h;h=false;var d=a,g=w();if(g!==null){if(p.substr(a,1)===">"){var e=">";a+=1}else{e=null;h&&k('">"')}if(e!==null){var i=H();i=i!==null?["literal",i]:null;if(i!==null)i=i;else{i=O();i=i!==null?i:null}if(i!==null){var m=C();if(m!==null){if(p.substr(a,1)==="/"){var s="/";a+=1}else{s=null;h&&k('"/"')}if(s!==null){var t=A();if(t!==null)g=[g,e,i,m,s,t];else{g=
+null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["partial",g[2],g[3]]:null;(h=c)&&d===null&&k("partial");u[b]={nextPos:a,result:d};b=d}if(b!==null)b=b;else{b=R();if(b!==null)b=b;else{b=L();if(b!==null)b=b;else{b="buffer@"+a;if(c=u[b]){a=c.nextPos;b=c.result}else{c=h;h=false;d=a;g=E();if(g!==null){e=[];for(i=N();i!==null;){e.push(i);i=N()}if(e!==null)g=[g,e];else{g=null;a=d}}else{g=null;a=d}d=g!==null?["format",g[0],g[1].join("")]:null;if(d!==
+null)d=d;else{i=g=a;e=h;h=false;m=l();h=e;if(m===null)e="";else{e=null;a=i}if(e!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&k("any character")}if(m!==null)e=[e,i,s,m];else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[3]:null;if(g!==null)for(d=[];g!==null;){d.push(g);i=g=a;e=h;h=false;m=l();h=e;if(m===null)e="";else{e=
+null;a=i}if(e!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&k("any character")}if(m!==null)e=[e,i,s,m];else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[3]:null}else d=null;d=d!==null?["buffer",d.join("")]:null;d=d!==null?d:null}(h=c)&&d===null&&k("buffer");u[b]={nextPos:a,result:d};b=d}b=b!==null?b:null}}}}}u[o]={nextPos:a,
+result:b};return b}function x(){var o="section@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){var g=A();if(g!==null){var e=r();if(e!==null){var i=F();if(i!==null){var m=B();if(m!==null){var s=d[1].text===m.text?"":null;if(s!==null)d=[d,g,e,i,m,s];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t,z,K){K.push(["param",["literal","block"],z]);t.push(K);return t}(d[0],d[2],d[3],d[4]):null;if(c!==
+null)c=c;else{c=a;d=v();if(d!==null){if(p.substr(a,1)==="/"){g="/";a+=1}else{g=null;h&&k('"/"')}if(g!==null){e=A();if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t){t.push(["bodies"]);return t}(d[0]):null;c=c!==null?c:null}(h=b)&&c===null&&k("section");u[o]={nextPos:a,result:c};return c}function v(){var o="sec_tag_start@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=a;var c=w();if(c!==null){if(p.substr(a).match(/^[#?^<+@]/)!==null){var d=p.charAt(a);a++}else{d=
+null;h&&k("[#?^<+@]")}if(d!==null){var g=J();if(g!==null){var e=C();if(e!==null){var i;i="params@"+a;var m=u[i];if(m){a=m.nextPos;i=m.result}else{m=h;h=false;var s=[],t=a,z=N();if(z!==null){var K=H();if(K!==null){if(p.substr(a,1)==="="){var M="=";a+=1}else{M=null;h&&k('"="')}if(M!==null){var D=J();if(D!==null)D=D;else{D=O();D=D!==null?D:null}if(D!==null)z=[z,K,M,D];else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}for(t=z!==null?["param",["literal",z[1]],z[3]]:null;t!==null;){s.push(t);
+t=a;z=N();if(z!==null){K=H();if(K!==null){if(p.substr(a,1)==="="){M="=";a+=1}else{M=null;h&&k('"="')}if(M!==null){D=J();if(D!==null)D=D;else{D=O();D=D!==null?D:null}if(D!==null)z=[z,K,M,D];else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}}else{z=null;a=t}t=z!==null?["param",["literal",z[1]],z[3]]:null}s=s!==null?["params"].concat(s):null;(h=m)&&s===null&&k("params");u[i]={nextPos:a,result:s};i=s}if(i!==null)c=[c,d,g,e,i];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=
+null;a=b}b=c!==null?[c[1],c[2],c[3],c[4]]:null;u[o]={nextPos:a,result:b};return b}function B(){var o="end_tag@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=w();if(d!==null){if(p.substr(a,1)==="/"){var g="/";a+=1}else{g=null;h&&k('"/"')}if(g!==null){var e=J();if(e!==null){var i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[2]:null;(h=b)&&c===null&&k("end tag");u[o]={nextPos:a,result:c};return c}function C(){var o="context@"+
+a,b=u[o];if(b){a=b.nextPos;return b.result}b=a;if(p.substr(a,1)===":"){var c=":";a+=1}else{c=null;h&&k('":"')}if(c!==null){var d=J();if(d!==null)c=[c,d];else{c=null;a=b}}else{c=null;a=b}b=c!==null?c[1]:null;b=b!==null?b:"";b=b!==null?b?["context",b]:["context"]:null;u[o]={nextPos:a,result:b};return b}function F(){var o="bodies@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=[],d=a,g=w();if(g!==null){if(p.substr(a,1)===":"){var e=":";a+=1}else{e=null;h&&k('":"')}if(e!==null){var i=H();
+if(i!==null){var m=A();if(m!==null){var s=r();if(s!==null)g=[g,e,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}for(d=g!==null?["param",["literal",g[2]],g[4]]:null;d!==null;){c.push(d);d=a;g=w();if(g!==null){if(p.substr(a,1)===":"){e=":";a+=1}else{e=null;h&&k('":"')}if(e!==null){i=H();if(i!==null){m=A();if(m!==null){s=r();if(s!==null)g=[g,e,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["param",["literal",
+g[2]],g[4]]:null}c=c!==null?["bodies"].concat(c):null;(h=b)&&c===null&&k("bodies");u[o]={nextPos:a,result:c};return c}function L(){var o="reference@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=w();if(d!==null){var g=J();if(g!==null){var e;e="filters@"+a;var i=u[e];if(i){a=i.nextPos;e=i.result}else{i=h;h=false;var m=[],s=a;if(p.substr(a,1)==="|"){var t="|";a+=1}else{t=null;h&&k('"|"')}if(t!==null){var z=H();if(z!==null)t=[t,z];else{t=null;a=s}}else{t=null;a=s}for(s=t!==null?t[1]:
+null;s!==null;){m.push(s);s=a;if(p.substr(a,1)==="|"){t="|";a+=1}else{t=null;h&&k('"|"')}if(t!==null){z=H();if(z!==null)t=[t,z];else{t=null;a=s}}else{t=null;a=s}s=t!==null?t[1]:null}m=m!==null?["filters"].concat(m):null;(h=i)&&m===null&&k("filters");u[e]={nextPos:a,result:m};e=m}if(e!==null){i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["reference",d[1],d[2]]:null;(h=b)&&c===null&&k("reference");u[o]={nextPos:a,result:c};return c}function R(){var o=
+"special@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=w();if(d!==null){if(p.substr(a,1)==="~"){var g="~";a+=1}else{g=null;h&&k('"~"')}if(g!==null){var e=H();if(e!==null){var i=A();if(i!==null)d=[d,g,e,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["special",d[2]]:null;(h=b)&&c===null&&k("special");u[o]={nextPos:a,result:c};return c}function J(){var o="identifier@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=U();c=c!==null?W(["path"].concat(c),
+o):null;if(c!==null)c=c;else{c=H();c=c!==null?W(["key",c],o):null;c=c!==null?c:null}(h=b)&&c===null&&k("identifier");u[o]={nextPos:a,result:c};return c}function U(){var o="path@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=H();d=d!==null?d:"";if(d!==null){var g=a;if(p.substr(a,1)==="."){var e=".";a+=1}else{e=null;h&&k('"."')}if(e!==null){var i=H();if(i!==null)e=[e,i];else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[1]:null;if(g!==null)for(var m=[];g!==null;){m.push(g);g=a;if(p.substr(a,
+1)==="."){e=".";a+=1}else{e=null;h&&k('"."')}if(e!==null){i=H();if(i!==null)e=[e,i];else{e=null;a=g}}else{e=null;a=g}g=e!==null?e[1]:null}else m=null;if(m!==null)d=[d,m];else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(s,t){if(s){t.unshift(s);return[false,t]}return[true,t]}(d[0],d[1]):null;if(c!==null)c=c;else{if(p.substr(a,1)==="."){c=".";a+=1}else{c=null;h&&k('"."')}c=c!==null?[true,[]]:null;c=c!==null?c:null}(h=b)&&c===null&&k("path");u[o]={nextPos:a,result:c};return c}function H(){var o="key@"+
+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a).match(/^[a-zA-Z_$]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&k("[a-zA-Z_$]")}if(d!==null){var g=[];if(p.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){var e=p.charAt(a);a++}else{e=null;h&&k("[0-9a-zA-Z_$]")}for(;e!==null;){g.push(e);if(p.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){e=p.charAt(a);a++}else{e=null;h&&k("[0-9a-zA-Z_$]")}}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[0]+d[1].join(""):null;(h=
+b)&&c===null&&k("key");u[o]={nextPos:a,result:c};return c}function O(){var o="inline@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,1)==='"'){var d='"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){if(p.substr(a,1)==='"'){var g='"';a+=1}else{g=null;h&&k('"\\""')}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",""]:null;if(c!==null)c=c;else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){g=T();if(g!==null){if(p.substr(a,
+1)==='"'){var e='"';a+=1}else{e=null;h&&k('"\\""')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",d[1]]:null;if(c!==null)c=c;else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&k('"\\""')}if(d!==null){e=S();if(e!==null)for(g=[];e!==null;){g.push(e);e=S()}else g=null;if(g!==null){if(p.substr(a,1)==='"'){e='"';a+=1}else{e=null;h&&k('"\\""')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["body"].concat(d[1]):null;
+c=c!==null?c:null}}(h=b)&&c===null&&k("inline");u[o]={nextPos:a,result:c};return c}function S(){var o="inline_part@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=R();if(b!==null)b=b;else{b=L();if(b!==null)b=b;else{b=T();b=b!==null?["buffer",b]:null;b=b!==null?b:null}}u[o]={nextPos:a,result:b};return b}function T(){var o="literal@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=a,g=h;h=false;var e=l();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;var i=E();h=d;
+if(i===null)d="";else{d=null;a=e}if(d!==null){e=f();if(e!==null)e=e;else{if(p.substr(a).match(/^[^"]/)!==null){e=p.charAt(a);a++}else{e=null;h&&k('[^"]')}e=e!==null?e:null}if(e!==null)g=[g,d,e];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null;if(c!==null)for(var m=[];c!==null;){m.push(c);d=c=a;g=h;h=false;e=l();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;i=E();h=d;if(i===null)d="";else{d=null;a=e}if(d!==null){e=f();if(e!==null)e=e;else{if(p.substr(a).match(/^[^"]/)!==
+null){e=p.charAt(a);a++}else{e=null;h&&k('[^"]')}e=e!==null?e:null}if(e!==null)g=[g,d,e];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null}else m=null;m=m!==null?m.join(""):null;(h=b)&&m===null&&k("literal");u[o]={nextPos:a,result:m};return m}function f(){var o="esc@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,2)==='\\"'){b='\\"';a+=2}else{b=null;h&&k('"\\\\\\""')}b=b!==null?'"':null;u[o]={nextPos:a,result:b};return b}function j(){var o="comment@"+a,b=u[o];if(b){a=
+b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,2)==="{!"){var d="{!";a+=2}else{d=null;h&&k('"{!"')}if(d!==null){var g=[],e=a,i=a,m=h;h=false;if(p.substr(a,2)==="!}"){var s="!}";a+=2}else{s=null;h&&k('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);a++}else{i=null;h&&k("any character")}if(i!==null)i=[m,i];else{i=null;a=e}}else{i=null;a=e}for(e=i!==null?i[1]:null;e!==null;){g.push(e);i=e=a;m=h;h=false;if(p.substr(a,2)==="!}"){s="!}";a+=2}else{s=null;
+h&&k('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);a++}else{i=null;h&&k("any character")}if(i!==null)i=[m,i];else{i=null;a=e}}else{i=null;a=e}e=i!==null?i[1]:null}if(g!==null){if(p.substr(a,2)==="!}"){e="!}";a+=2}else{e=null;h&&k('"!}"')}if(e!==null)d=[d,g,e];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["comment",d[1].join("")]:null;(h=b)&&c===null&&k("comment");u[o]={nextPos:a,result:c};return c}function l(){var o="tag@"+a,b=u[o];if(b){a=
+b.nextPos;return b.result}b=a;var c=w();if(c!==null){if(p.substr(a).match(/^[#?^><+%:@\/~]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&k("[#?^><+%:@\\/~]")}if(d!==null){var g=a,e=a,i=h;h=false;var m=A();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;var s=E();h=m;if(s===null)m="";else{m=null;a=e}if(m!==null){if(p.length>a){e=p.charAt(a);a++}else{e=null;h&&k("any character")}if(e!==null)i=[i,m,e];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}if(i!==null)for(var t=[];i!==null;){t.push(i);
+e=g=a;i=h;h=false;m=A();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;s=E();h=m;if(s===null)m="";else{m=null;a=e}if(m!==null){if(p.length>a){e=p.charAt(a);a++}else{e=null;h&&k("any character")}if(e!==null)i=[i,m,e];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}}else t=null;if(t!==null){g=A();if(g!==null)c=[c,d,t,g];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}if(c!==null)b=c;else{b=L();b=b!==null?b:null}u[o]={nextPos:a,result:b};return b}function w(){var o=
+"ld@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="{"){b="{";a+=1}else{b=null;h&&k('"{"')}u[o]={nextPos:a,result:b};return b}function A(){var o="rd@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="}"){b="}";a+=1}else{b=null;h&&k('"}"')}u[o]={nextPos:a,result:b};return b}function E(){var o="eol@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="\n"){b="\n";a+=1}else{b=null;h&&k('"\\n"')}if(b!==null)b=b;else{if(p.substr(a,2)==="\r\n"){b="\r\n";a+=2}else{b=
+null;h&&k('"\\r\\n"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\r"){b="\r";a+=1}else{b=null;h&&k('"\\r"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2028"){b="\u2028";a+=1}else{b=null;h&&k('"\\u2028"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2029"){b="\u2029";a+=1}else{b=null;h&&k('"\\u2029"')}b=b!==null?b:null}}}}u[o]={nextPos:a,result:b};return b}function N(){var o="ws@"+a,b=u[o];if(b){a=b.nextPos;return b.result}if(p.substr(a).match(/^[\t\u000b\u000c \u00a0\ufeff]/)!==null){b=p.charAt(a);a++}else{b=
+null;h&&k("[\t\u000b\u000c \u00a0\ufeff]")}u[o]={nextPos:a,result:b};return b}function X(){var o=function(c){c.sort();for(var d=null,g=[],e=0;e<c.length;e++)if(c[e]!==d){g.push(c[e]);d=c[e]}switch(g.length){case 0:return"end of input";case 1:return g[0];default:return g.slice(0,g.length-1).join(", ")+" or "+g[g.length-1]}}(V),b=Math.max(a,P);b=b<p.length?I(p.charAt(b)):"end of input";return"Expected "+o+" but "+b+" found."}function Y(){for(var o=1,b=1,c=false,d=0;d<P;d++){var g=p.charAt(d);if(g===
+"\n"){c||o++;b=1;c=false}else if(g==="\r"|g==="\u2028"||g==="\u2029"){o++;b=1;c=true}else{b++;c=false}}return{line:o,column:b}}function W(o,b){o.text=p.substring(b.split("@")[1],a);return o}var a=0,h=true,P=0,V=[],u={},Q=r();if(Q===null||a!==p.length){Q=Y();throw new SyntaxError(X(),Q.line,Q.column);}return Q},toSource:function(){return this._source}};G.SyntaxError=function(p,I,k){this.name="SyntaxError";this.message=p;this.line=I;this.column=k};G.SyntaxError.prototype=Error.prototype;return G}();
+q.parse=y.parse})(typeof exports!=="undefined"?exports:window.dust);
View
4 docs/api.md
@@ -12,12 +12,12 @@ Then, within your Node script or the REPL:
This will import everything needed to parse, compile and render templates. To render Dust templates in the browser, grab the runtime distribution and include it in your script tags along with your compiled templates:
- <script src="dust-core-0.0.1.min.js"></script>
+ <script src="dust-core-0.1.0.min.js"></script>
<script src="compiled_templates.js"></script>
Include the full distribution if you want to compile templates within the browser (as in the online demo):
- <script src="dust-full-0.0.1.min.js"></script>
+ <script src="dust-full-0.1.0.min.js"></script>
Precompilation is the recommended approach for general use.
View
6 index.html
@@ -200,7 +200,7 @@
code .string, code .regexp { color: #669933 }
code .class, code .special { }
code .number { color: #eddd3d }
-code .comment { color: grey }</style><script src="vendor/ecma.js"></script><script src="vendor/jquery.min.js"></script><script src="vendor/jsdump.js"></script><script src="vendor/beautify.js"></script><script src="lib/dust.js"></script><script src="lib/parser.js"></script><script src="lib/compiler.js"></script><script src="test/examples.js"></script><script src="test/uutest.js"></script><script src="test/core.js"></script><script type="text/javascript">(function(){dust.register("select",body_0);var blocks=null;function body_2(chk,ctx){return chk.reference(ctx.getPath(true,[]),ctx,"h",[]);}function body_1(chk,ctx){return chk.write("<option ").reference(ctx.get("selected"),ctx,"h",[]).write(" value=\"").helper("idx",ctx,{"block":body_2},null).write("\">").reference(ctx.get("name"),ctx,"h",[]).write("</option>");}function body_0(chk,ctx){ctx=ctx.shiftBlocks(blocks);return chk.write("<select style=\"clear: both;\">").section(ctx.get("examples"),ctx,{"block":body_1},null).write("</select>");}})();</script><script type="text/javascript">jsDump.parsers['function'] = function(fn) {
+code .comment { color: grey }</style><script src="vendor/ecma.js"></script><script src="vendor/jquery.min.js"></script><script src="vendor/jsdump.js"></script><script src="vendor/beautify.js"></script><script src="lib/dust.js"></script><script src="lib/parser.js"></script><script src="lib/compiler.js"></script><script src="test/examples.js"></script><script src="test/uutest.js"></script><script src="test/core.js"></script><script type="text/javascript">(function(){dust.register("select",body_0);function body_0(chk,ctx){return chk.write("<select style=\"clear: both;\">").section(ctx.get("examples"),ctx,{"block":body_1},null).write("</select>");}function body_1(chk,ctx){return chk.write("<option ").reference(ctx.get("selected"),ctx,"h",[]).write(" value=\"").helper("idx",ctx,{"block":body_2},null).write("\">").reference(ctx.get("name"),ctx,"h",[]).write("</option>");}function body_2(chk,ctx){return chk.reference(ctx.getPath(true,[]),ctx,"h",[]);}})();</script><script type="text/javascript">jsDump.parsers['function'] = function(fn) {
return fn.toString();
}
@@ -721,13 +721,13 @@
<p>This will import everything needed to parse, compile and render templates. To render Dust templates in the browser, grab the runtime distribution and include it in your script tags along with your compiled templates:</p>
-<pre><code>&lt;script src="dust-core-0.0.1.min.js"&gt;&lt;/script&gt;
+<pre><code>&lt;script src="dust-core-0.1.0.min.js"&gt;&lt;/script&gt;
&lt;script src="compiled_templates.js"&gt;&lt;/script&gt;
</code></pre>
<p>Include the full distribution if you want to compile templates within the browser (as in the online demo):</p>
-<pre><code>&lt;script src="dust-full-0.0.1.min.js"&gt;&lt;/script&gt;
+<pre><code>&lt;script src="dust-full-0.1.0.min.js"&gt;&lt;/script&gt;
</code></pre>
<p>Precompilation is the recommended approach for general use.</p>

0 comments on commit 45624f2

Please sign in to comment.