Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

release v0.2.0

  • Loading branch information...
commit e723e914099c184a93b1b353c6dc68b22d4c5890 1 parent 9a268e8
akdubya authored
View
4 dist/dust-core-0.1.0.js → dist/dust-core-0.2.0.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.1.0
+// Dust - Asynchronous Templating v0.2.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -23,7 +23,7 @@ dust.render = function(name, context, callback) {
dust.stream = function(name, context) {
var stream = new Stream();
- setTimeout(function() {
+ dust.nextTick(function() {
dust.load(name, stream.head, Context.wrap(context)).end();
});
return stream;
View
4 dist/dust-core-0.1.0.min.js → dist/dust-core-0.2.0.min.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.1.0
+// Dust - Asynchronous Templating v0.2.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -8,7 +8,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.load(a,c,g.wrap(b)).end()};d.stream=function(a,b){var c=new k;d.nextTick(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};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",
View
59 dist/dust-full-0.1.0.min.js
@@ -1,59 +0,0 @@
-//
-// 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
81 dist/dust-full-0.1.0.js → dist/dust-full-0.2.0.js
@@ -1,5 +1,5 @@
//
-// Dust - Asynchronous Templating v0.1.0
+// Dust - Asynchronous Templating v0.2.0
// http://akdubya.github.com/dustjs
//
// Copyright (c) 2010, Aleksander Williams
@@ -23,7 +23,7 @@ dust.render = function(name, context, callback) {
dust.stream = function(name, context) {
var stream = new Stream();
- setTimeout(function() {
+ dust.nextTick(function() {
dust.load(name, stream.head, Context.wrap(context)).end();
});
return stream;
@@ -516,24 +516,11 @@ dust.filterNode = function(context, node) {
return dust.optimizers[node[0]](context, node);
}
-function visit(context, node) {
- var out = [node[0]];
- for (var i=1, len=node.length; i<len; i++) {
- var res = dust.filterNode(context, node[i]);
- if (res) out.push(res);
- }
- return out;
-}
-
-function noop(context, node) { return node }
-
-function nullify(){}
-
dust.optimizers = {
- body: visit,
+ body: compactBuffers,
buffer: noop,
- special: noop,
- format: nullify,
+ special: convertSpecial,
+ format: nullify, // TODO: convert format
reference: visit,
"#": visit,
"?": visit,
@@ -553,6 +540,49 @@ dust.optimizers = {
comment: nullify
}
+function visit(context, node) {
+ var out = [node[0]];
+ for (var i=1, len=node.length; i<len; i++) {
+ var res = dust.filterNode(context, node[i]);
+ if (res) out.push(res);
+ }
+ return out;
+}
+
+// Compacts consecutive buffer nodes into a single node
+function compactBuffers(context, node) {
+ var out = [node[0]], memo;
+ for (var i=1, len=node.length; i<len; i++) {
+ var res = dust.filterNode(context, node[i]);
+ if (res) {
+ if (res[0] === 'buffer') {
+ if (memo) {
+ memo[1] += res[1];
+ } else {
+ memo = res;
+ out.push(res);
+ }
+ } else {
+ memo = null;
+ out.push(res);
+ }
+ }
+ }
+ return out;
+}
+
+var specialChars = {
+ "s": " ",
+ "n": "\n",
+ "r": "\r",
+ "lb": "{",
+ "rb": "}"
+};
+
+function convertSpecial(context, node) { return ['buffer', specialChars[node[1]]] }
+function noop(context, node) { return node }
+function nullify(){}
+
function compile(ast, name) {
var context = {
name: name,
@@ -618,10 +648,6 @@ dust.nodes = {
return ".write(" + escape(node[1]) + ")";
},
- special: function(context, node) {
- return ".write(\"" + escapeSpecial(node[1]) + "\")";
- },
-
format: function(context, node) {
return ".write(" + escape(node[1] + node[2]) + ")";
},
@@ -752,17 +778,6 @@ var escape = (typeof JSON === "undefined")
? function(str) { return "\"" + dust.escapeJs(str) + "\"" }
: JSON.stringify;
-function escapeSpecial(ch) {
- var chars = {
- "s": " ",
- "n": "\\n",
- "r": "\\r",
- "lb": "{",
- "rb": "}"
- }
- return chars[ch];
-}
-
})(typeof exports !== 'undefined' ? exports : window.dust);
(function(dust){
View
59 dist/dust-full-0.2.0.min.js
@@ -0,0 +1,59 @@
+//
+// Dust - Asynchronous Templating v0.2.0
+// http://akdubya.github.com/dustjs
+//
+// Copyright (c) 2010, Aleksander Williams
+// Released under the MIT License.
+//
+
+var dust={};
+(function(q){function z(f,j,k){this.stack=f;this.global=j;this.blocks=k}function H(f,j,k,w){this.tail=j;this.isObject=!q.isArray(f)&&f&&typeof f==="object";this.head=f;this.index=k;this.of=w}function p(f){this.head=new l(this);this.callback=f;this.out=""}function J(){this.head=new l(this)}function l(f,j,k){this.root=f;this.next=j;this.data="";this.flushable=false;this.taps=k}function G(f,j){this.head=f;this.tail=j}q.cache={};q.register=function(f,j){q.cache[f]=j};q.render=function(f,j,k){k=(new p(k)).head;
+q.load(f,k,z.wrap(j)).end()};q.stream=function(f,j){var k=new J;q.nextTick(function(){q.load(f,k.head,z.wrap(j)).end()});return k};q.load=function(f,j,k){return(tmpl=q.cache[f])?tmpl(j,k):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,k){for(var w=k.length,B=0;B<w;B++){var F=k[B];if(F==="s")j=null;else f=q.filters[F](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 z(new H,f)};z.wrap=function(f){if(f instanceof z)return f;return new z(new H(f))};z.prototype.get=function(f){for(var j=this.stack,k;j;){if(j.isObject){k=j.head[f];if(k!==undefined)return k}j=j.tail}return this.global?
+this.global[f]:undefined};z.prototype.getPath=function(f,j){var k=this.stack,w=j.length;if(f&&w===0)return k.head;if(k.isObject){k=k.head;for(var B=0;k&&B<w;){k=k[j[B]];B++}return k}};z.prototype.push=function(f,j,k){return new z(new H(f,this.stack,j,k),this.global,this.blocks)};z.prototype.rebase=function(f){return new z(new H(f),this.global,this.blocks)};z.prototype.current=function(){return this.stack.head};z.prototype.getBlock=function(f){var j=this.blocks;if(j)for(var k=j.length,w;k--;)if(w=
+j[k][f])return w};z.prototype.shiftBlocks=function(f){var j=this.blocks;if(f){newBlocks=j?j.concat([f]):[f];return new z(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)};J.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")};J.prototype.emit=function(f,j){var k=this.events;k&&k[f]&&k[f](j)};J.prototype.on=function(f,j){if(!this.events)this.events={};this.events[f]=j;return this};l.prototype.write=function(f){var j=this.taps;if(j)f=j.go(f);this.data+=f;return this};l.prototype.end=function(f){f&&this.write(f);this.flushable=true;this.root.flush();return this};l.prototype.map=function(f){var j=new l(this.root,this.next,this.taps),k=new l(this.root,
+j,this.taps);this.next=k;this.flushable=true;f(k);return j};l.prototype.tap=function(f){var j=this.taps;this.taps=j?j.push(f):new G(f);return this};l.prototype.untap=function(){this.taps=this.taps.tail;return this};l.prototype.render=function(f,j){return f(this,j)};l.prototype.reference=function(f,j,k,w){if(typeof f==="function"){f=f(this,j,null,{auto:k,filters:w});if(f instanceof l)return f}return q.isEmpty(f)?this:this.write(q.filter(f,k,w))};l.prototype.section=function(f,j,k,w){if(typeof f===
+"function"){f=f(this,j,k,w);if(f instanceof l)return f}var B=k.block;k=k["else"];if(w)j=j.push(w);if(q.isArray(f)){if(B){w=f.length;k=this;for(var F=0;F<w;F++)k=B(k,j.push(f[F],F,w));return k}}else if(f===true){if(B)return B(this,j)}else if(f||f===0){if(B)return B(this,j.push(f))}else if(k)return k(this,j);return this};l.prototype.exists=function(f,j,k){var w=k.block;k=k["else"];if(q.isEmpty(f)){if(k)return k(this,j)}else if(w)return w(this,j);return this};l.prototype.notexists=function(f,j,k){var w=
+k.block;k=k["else"];if(q.isEmpty(f)){if(w)return w(this,j)}else if(k)return k(this,j);return this};l.prototype.block=function(f,j,k){k=k.block;if(f)k=f;if(k)return k(this,j);return this};l.prototype.partial=function(f,j){if(typeof f==="function")return this.capture(f,j,function(k,w){q.load(k,w,j).end()});return q.load(f,this,j)};l.prototype.helper=function(f,j,k,w){return q.helpers[f](this,j,k,w)};l.prototype.capture=function(f,j,k){return this.map(function(w){var B=new p(function(F,N){F?w.setError(F):
+k(N,w)});f(B.head,j).end()})};l.prototype.setError=function(f){this.error=f;this.root.flush();return this};q.helpers={sep:function(f,j,k){if(j.stack.index===j.stack.of-1)return f;return k.block(f,j)},idx:function(f,j,k){return k.block(f,j.push(j.stack.index))}};G.prototype.push=function(f){return new G(f,this)};G.prototype.go=function(f){for(var j=this;j;){f=j.head(f);j=j.tail}return f};var r=/[&<>\"]/,n=/&/g,x=/</g,v=/>/g,y=/\"/g;q.escapeHtml=function(f){if(typeof f==="string"){if(!r.test(f))return f;
+return f.replace(n,"&amp;").replace(x,"&lt;").replace(v,"&gt;").replace(y,"&quot;")}return f};var C=/\\/g,D=/\r/g,O=/\u2028/g,K=/\u2029/g,U=/\n/g,I=/\f/g,P=/'/g,S=/"/g,T=/\t/g;q.escapeJs=function(f){if(typeof f==="string")return f.replace(C,"\\\\").replace(S,'\\"').replace(P,"\\'").replace(D,"\\r").replace(O,"\\u2028").replace(K,"\\u2029").replace(U,"\\n").replace(I,"\\f").replace(T,"\\t");return f}})(dust);if(typeof exports!=="undefined"){require("./server")(dust);module.exports=dust}
+(function(q){function z(r,n){for(var x=[n[0]],v=1,y=n.length;v<y;v++){var C=q.filterNode(r,n[v]);C&&x.push(C)}return x}function H(r,n){return n}function p(){}function J(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 y;var C=[],D=v.blocks;for(y in D)C.push(y+
+":"+D[y]);if(C.length){v.blocks="ctx=ctx.shiftBlocks(blocks);";y="var blocks={"+C.join(",")+"};"}else y=v.blocks="";y=x+y;x=[];C=v.bodies;v=v.blocks;D=0;for(var O=C.length;D<O;D++)x[D]="function body_"+D+"(chk,ctx){"+v+"return chk"+C[D]+";}";v=x.join("");return y+v+"})();"};q.filterNode=function(r,n){return q.optimizers[n[0]](r,n)};q.optimizers={body:function(r,n){for(var x=[n[0]],v,y=1,C=n.length;y<C;y++){var D=q.filterNode(r,n[y]);if(D)if(D[0]==="buffer")if(v)v[1]+=D[1];else{v=D;x.push(D)}else{v=
+null;x.push(D)}}return x},buffer:H,special:function(r,n){return["buffer",l[n[1]]]},format:p,reference:z,"#":z,"?":z,"^":z,"<":z,"+":z,"@":z,partial:z,context:z,params:z,bodies:z,param:z,filters:H,key:H,path:H,literal:H,comment:p};var l={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};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,y="",C=1,D=n.length;C<D;C++)y+=q.compileNode(r,n[C]);r.bodies[x]=y;return v},buffer:function(r,n){return".write("+
+G(n[1])+")"},format:function(r,n){return".write("+G(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 J(r,n,"section")},"?":function(r,n){return J(r,n,"exists")},"^":function(r,n){return J(r,n,"notexists")},"<":function(r,n){for(var x=n[4],v=1,y=x.length;v<y;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("+G(n[1].text)+
+"),"+q.compileNode(r,n[2])+","+q.compileNode(r,n[4])+","+q.compileNode(r,n[3])+")"},"@":function(r,n){return".helper("+G(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,y=n.length;v<y;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,y=n.length;v<y;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,y=n.length;v<y;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],y=[],C=0,D=v.length;C<D;C++)y.push('"'+v[C]+'"');return"ctx.getPath("+x+",["+
+y.join(",")+"])"},literal:function(r,n){return G(n[1])}};var G=typeof JSON==="undefined"?function(r){return'"'+q.escapeJs(r)+'"'}:JSON.stringify})(typeof exports!=="undefined"?exports:window.dust);
+(function(q){var z=function(){var H={parse:function(p){function J(o){return'"'+o.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\n/g,"\\n")+'"'}function l(o){if(!(a<Q)){if(a>Q){Q=a;V=[]}V.push(o)}}function G(){var o="body@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=[];for(var c=r();c!==null;){b.push(c);c=r()}b=b!==null?["body"].concat(b):null;u[o]={nextPos:a,result:b};return b}function r(){var o="part@"+a,b=u[o];
+if(b){a=b.nextPos;return b.result}b=j();if(b!==null)b=b;else{b=n();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&&l('">"')}if(e!==null){var i=I();i=i!==null?["literal",i]:null;if(i!==null)i=i;else{i=P();i=i!==null?i:null}if(i!==null){var m=y();if(m!==null){if(p.substr(a,1)==="/"){var s="/";a+=1}else{s=null;h&&l('"/"')}if(s!==null){var t=B();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&&l("partial");u[b]={nextPos:a,result:d};b=d}if(b!==null)b=b;else{b=O();if(b!==null)b=b;else{b=D();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=F();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=k();h=e;if(m===null)e="";else{e=null;a=i}if(e!==null){m=a;i=h;h=false;s=F();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&&l("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=k();h=e;if(m===null)e="";else{e=
+null;a=i}if(e!==null){m=a;i=h;h=false;s=F();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&&l("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&&l("buffer");u[b]={nextPos:a,result:d};b=d}b=b!==null?b:null}}}}}u[o]={nextPos:a,
+result:b};return b}function n(){var o="section@"+a,b=u[o];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=x();if(d!==null){var g=B();if(g!==null){var e=G();if(e!==null){var i=C();if(i!==null){var m=v();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,A,L){L.push(["param",["literal","block"],A]);t.push(L);return t}(d[0],d[2],d[3],d[4]):null;if(c!==
+null)c=c;else{c=a;d=x();if(d!==null){if(p.substr(a,1)==="/"){g="/";a+=1}else{g=null;h&&l('"/"')}if(g!==null){e=B();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&&l("section");u[o]={nextPos:a,result:c};return c}function x(){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&&l("[#?^<+@]")}if(d!==null){var g=K();if(g!==null){var e=y();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,A=N();if(A!==null){var L=I();if(L!==null){if(p.substr(a,1)==="="){var M="=";a+=1}else{M=null;h&&l('"="')}if(M!==null){var E=K();if(E!==null)E=E;else{E=P();E=E!==null?E:null}if(E!==null)A=[A,L,M,E];else{A=null;a=t}}else{A=null;a=t}}else{A=null;a=t}}else{A=null;a=t}for(t=A!==null?["param",["literal",A[1]],A[3]]:null;t!==null;){s.push(t);
+t=a;A=N();if(A!==null){L=I();if(L!==null){if(p.substr(a,1)==="="){M="=";a+=1}else{M=null;h&&l('"="')}if(M!==null){E=K();if(E!==null)E=E;else{E=P();E=E!==null?E:null}if(E!==null)A=[A,L,M,E];else{A=null;a=t}}else{A=null;a=t}}else{A=null;a=t}}else{A=null;a=t}t=A!==null?["param",["literal",A[1]],A[3]]:null}s=s!==null?["params"].concat(s):null;(h=m)&&s===null&&l("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 v(){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&&l('"/"')}if(g!==null){var e=K();if(e!==null){var i=B();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&&l("end tag");u[o]={nextPos:a,result:c};return c}function y(){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&&l('":"')}if(c!==null){var d=K();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 C(){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&&l('":"')}if(e!==null){var i=I();
+if(i!==null){var m=B();if(m!==null){var s=G();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&&l('":"')}if(e!==null){i=I();if(i!==null){m=B();if(m!==null){s=G();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&&l("bodies");u[o]={nextPos:a,result:c};return c}function D(){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=K();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&&l('"|"')}if(t!==null){var A=I();if(A!==null)t=[t,A];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&&l('"|"')}if(t!==null){A=I();if(A!==null)t=[t,A];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&&l("filters");u[e]={nextPos:a,result:m};e=m}if(e!==null){i=B();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&&l("reference");u[o]={nextPos:a,result:c};return c}function O(){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&&l('"~"')}if(g!==null){var e=I();if(e!==null){var i=B();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&&l("special");u[o]={nextPos:a,result:c};return c}function K(){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=I();c=c!==null?W(["key",c],o):null;c=c!==null?c:null}(h=b)&&c===null&&l("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=I();d=d!==null?d:"";if(d!==null){var g=a;if(p.substr(a,1)==="."){var e=".";a+=1}else{e=null;h&&l('"."')}if(e!==null){var i=I();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&&l('"."')}if(e!==null){i=I();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&&l('"."')}c=c!==null?[true,[]]:null;c=c!==null?c:null}(h=b)&&c===null&&l("path");u[o]={nextPos:a,result:c};return c}function I(){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&&l("[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&&l("[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&&l("[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&&l("key");u[o]={nextPos:a,result:c};return c}function P(){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&&l('"\\""')}if(d!==null){if(p.substr(a,1)==='"'){var g='"';a+=1}else{g=null;h&&l('"\\""')}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&&l('"\\""')}if(d!==null){g=T();if(g!==null){if(p.substr(a,
+1)==='"'){var e='"';a+=1}else{e=null;h&&l('"\\""')}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&&l('"\\""')}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&&l('"\\""')}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&&l("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=O();if(b!==null)b=b;else{b=D();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=k();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;var i=F();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&&l('[^"]')}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=k();h=g;if(e===null)g="";else{g=null;a=d}if(g!==null){e=a;d=h;h=false;i=F();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&&l('[^"]')}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&&l("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&&l('"\\\\\\""')}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&&l('"{!"')}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&&l('"!}"')}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&&l("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&&l('"!}"')}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&&l("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&&l('"!}"')}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&&l("comment");u[o]={nextPos:a,result:c};return c}function k(){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&&l("[#?^><+%:@\\/~]")}if(d!==null){var g=a,e=a,i=h;h=false;var m=B();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;var s=F();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&&l("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=B();h=i;if(m===null)i="";else{i=null;a=e}if(i!==null){e=a;m=h;h=false;s=F();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&&l("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=B();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=D();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&&l('"{"')}u[o]={nextPos:a,result:b};return b}function B(){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&&l('"}"')}u[o]={nextPos:a,result:b};return b}function F(){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&&l('"\\n"')}if(b!==null)b=b;else{if(p.substr(a,2)==="\r\n"){b="\r\n";a+=2}else{b=
+null;h&&l('"\\r\\n"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\r"){b="\r";a+=1}else{b=null;h&&l('"\\r"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2028"){b="\u2028";a+=1}else{b=null;h&&l('"\\u2028"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2029"){b="\u2029";a+=1}else{b=null;h&&l('"\\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&&l("[\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,Q);b=b<p.length?J(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<Q;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,Q=0,V=[],u={},R=G();if(R===null||a!==p.length){R=Y();throw new SyntaxError(X(),R.line,R.column);}return R},toSource:function(){return this._source}};H.SyntaxError=function(p,J,l){this.name="SyntaxError";this.message=p;this.line=J;this.column=l};H.SyntaxError.prototype=Error.prototype;return H}();
+q.parse=z.parse})(typeof exports!=="undefined"?exports:window.dust);
View
4 index.html
@@ -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.1.0.min.js"&gt;&lt;/script&gt;
+<pre><code>&lt;script src="dust-core-0.2.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.1.0.min.js"&gt;&lt;/script&gt;
+<pre><code>&lt;script src="dust-full-0.2.0.min.js"&gt;&lt;/script&gt;
</code></pre>
<p>Precompilation is the recommended approach for general use.</p>
Please sign in to comment.
Something went wrong with that request. Please try again.