Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crox

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crox - npm Package Compare versions

Comparing version 1.2.6 to 1.2.7

43

build/crox-all-min.js

@@ -1,7 +0,36 @@

/*!
* Crox v1.2.6
* https://github.com/thx/crox
*
* Released under the MIT license
*/
!function(root){var Crox=function(){function Class(a,b,c){function d(){}d.prototype=a.prototype;var e=new d;if(c)for(var f in c)e[f]=c[f];return b||(b=d),b.prototype=e,b}function Position(a,b){this.row=a,this.col=b}function getPos(a,b){var c=a.substring(0,b),d=/\r\n?|\n/g,e=c.match(d),f=1;e&&(f+=e.length);var g=1+/[^\r\n]*$/.exec(c)[0].length;return new Position(f,g)}function Enum(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=a[c];return b}function inArr(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function inArr_strict(a,b){for(var c=0;c<a.length;++c)if(a[c]===b)return c;return-1}function nodup(a,b){b||(b=function(a,b){return a===b});for(var c=[],d=a.length,e=0;d>e;e++){for(var f=e+1;d>f;f++)b(a[e],a[f])&&(f=++e);c.push(a[e])}return c}function htmlEncode(a){return String(a).replace(/[&<>"]/g,function(a){switch(a){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";default:return"&quot;"}})}function quote(a){return'"'+a.replace(/[\x00-\x1f"\\\u2028\u2029]/g,function(a){switch(a){case'"':return'\\"';case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"'}function singleQuote(a){return"'"+a.replace(/[\x00-\x1f'\\\u2028\u2029]/g,function(a){switch(a){case"'":return"\\'";case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+"'"}function phpQuote(a){return"'"+String(a).replace(/['\\]/g,"\\$&")+"'"}function createLexer(a){function b(a,b,c,d){this.tag=a,this.text=b,this.index=c,this.subMatches=d}function c(){}function d(a){for(var b=1,d=[],e=[1],f=[],g=0;g<a.length;++g)e.push(b+=RegExp("|"+a[g][0].source).exec("").length),f.push(a[g][1]||c),d.push("("+a[g][0].source+")");var h=RegExp(d.join("|")+"|","g");return[h,e,f]}function e(a){function c(){var c=h[h.length-1],j=g[c],k=j[0];k.lastIndex=e;var l=k.exec(a);if(""==l[0]){if(d>e)throw Error("lexer error: "+getPos(a,e)+"\n"+a.slice(e,e+50));return new b(f,"",e)}i.index=e,e=k.lastIndex;for(var m=j[1],n=0;n<m.length;++n)if(l[m[n]]){var o=j[2][n].apply(i,l.slice(m[n],m[n+1]));return new b(o,l[0],i.index,l.slice(m[n]+1,m[n+1]))}}var d=a.length,e=0,h=[""],i={text:"",index:0,source:a,pushState:function(a){h.push(a)},popState:function(){h.pop()},retract:function(a){e-=a}};return{scan:function(){do var a=c();while(null==a.tag);return a},getPos:function(b){return getPos(a,b)},reset:function(){e=0,h=[""]}}}b.prototype.toString=function(){return this.text};var f=a.$||"$",g={};for(var h in a)"$"!=h.charAt(0)&&(g[h]=d(a[h]));return e}function isAtom(a){switch(a){case"id":case"lit":return!0}return!1}function isMember(a){return isAtom(a)||"."==a||"[]"==a}function isUnary(a){return isMember(a)||"!"==a||"u-"==a}function isMul(a){if(isUnary(a))return!0;switch(a){case"*":case"/":case"%":return!0}return!1}function isAdd(a){if(isMul(a))return!0;switch(a){case"+":case"-":return!0}return!1}function isRel(a){if(isAdd(a))return!0;switch(a){case"<":case">":case"<=":case">=":return!0}return!1}function isEquality(a){if(isRel(a))return!0;switch(a){case"eq":case"ne":return!0}return!1}function isLogicalAnd(a){return isEquality(a)||"&&"==a}function isLogicalOr(a){return isLogicalAnd(a)||"||"==a}function changeExt(a,b){return a.replace(/\.\w+$/,"."+b)}function codegen_js_tran(a,b){function c(){j+=" "}function d(){j=j.slice(0,-1)}function e(a){k+=j+a+"\n"}function f(a){switch(a[0]){case"if":e("if("+i(a[1])+"){"),c(),g(a[2]),d(),e("}"),a[3]&&(e("else{"),c(),g(a[3]),d(),e("}"));break;case"each":var f=a[3]||"$i";e("var $list = "+i(a[1])+";"),e("for(var "+f+" in $list) {"),c(),e("var "+a[4]+" = $list["+f+"];"),g(a[2]),d(),e("}");break;case"set":e("var "+a[1]+"="+i(a[2])+";");break;case"eval":var h=i(a[1]);a[2]&&(h=b+"("+h+")"),e("$s += "+h+";");break;case"text":e("$s += "+quote(a[1])+";");break;case"inc":break;default:throw Error("unknown stmt: "+a[0])}}function g(a){for(var b=0;b<a.length;++b)f(a[b])}function h(a,b){var c=i(a);return b&&!b(a[0])&&(c="("+c+")"),c}function i(a){switch(a[0]){case"id":return a[1];case"lit":return"string"==typeof a[1]?quote(a[1]):String(a[1]);case".":return h(a[1],isMember)+"."+a[2];case"[]":return h(a[1],isMember)+"["+i(a[2])+"]";case"!":return"!"+h(a[1],isUnary);case"u-":return"- "+h(a[1],isUnary);case"*":case"/":case"%":return h(a[1],isMul)+a[0]+h(a[2],isUnary);case"+":case"-":return h(a[1],isAdd)+a[0]+" "+h(a[2],isMul);case"<":case">":case"<=":case">=":return h(a[1],isRel)+a[0]+h(a[2],isAdd);case"eq":case"ne":return h(a[1],isEquality)+("eq"==a[0]?"===":"!==")+h(a[2],isRel);case"&&":return h(a[1],isLogicalAnd)+"&&"+h(a[2],isEquality);case"||":return h(a[1],isLogicalOr)+"||"+h(a[2],isLogicalAnd);default:throw Error("unknown expr: "+a[0])}}var j=" ",k="";return g(a[1]),k}function codegen_js_tofn(a,b){var c;b&&(c=b.htmlEncode);var d=codegen_js_tran(a,c||"$htmlEncode"),e="";c||(e+="var obj = { '<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;' };\n function $htmlEncode(s) {\n return String(s).replace(/[<>&\"]/g, function(c) {\n return obj[c];\n });\n }"),e+="var $s = '';",e+=d,e+="return $s;";var f=Function("root",e);return f}function parsetmpl(a){var b=parse(Lexer(a));return b}function compile2jsfn(a,b){var c=parsetmpl(a);return codegen_js_tofn(c,b)}function codegen_php_tran(a){function b(a){l+=a}function c(a){var c=k(a[1]);c=a[2]?"crox_encode("+c+")":"crox_ToString("+c+")",b("echo "+c+";")}function d(a){var c=a[1];b(/<\?(?:php)?|\?>/.test(c)?"echo "+phpQuote(a[1])+";":"?>"+c+"<?php ")}function e(a){b("if("+k(a[1])+"){"),i(a[2]),b("}"),a[3]&&(b("else{"),i(a[3]),b("}"))}function f(a){var c=a[3]?"$crox_"+a[3]+"=>":"";b("foreach("+k(a[1])+" as "+c+"$crox_"+a[4]+")"),b("{"),i(a[2]),b("}")}function g(a){b("$crox_"+a[1]+" = "+k(a[2])+";")}function h(a){switch(a[0]){case"if":e(a);break;case"each":f(a);break;case"set":g(a);break;case"eval":c(a);break;case"text":d(a);break;case"inc":b("include '"+changeExt(a[1],"php")+"';");break;default:throw Error("unknown stmt: "+a[0])}}function i(a){for(var b=0;b<a.length;++b)h(a[b])}function j(a,b){var c=k(a);return b&&!b(a[0])&&(c="("+c+")"),c}function k(a){switch(a[0]){case"id":return"$crox_"+a[1];case"lit":return"string"==typeof a[1]?phpQuote(a[1]):String(a[1]);case".":return j(a[1],isMember)+"->"+a[2];case"[]":return j(a[1],isMember)+"["+k(a[2])+"]";case"!":return"!crox_ToBoolean("+j(a[1],isUnary)+")";case"u-":return"- "+j(a[1],isUnary);case"*":case"/":case"%":return j(a[1],isMul)+a[0]+j(a[2],isUnary);case"+":return"crox_plus("+j(a[1],null)+", "+j(a[2],null)+")";case"-":return j(a[1],isAdd)+"- "+j(a[2],isMul);case"<":case">":case"<=":case">=":return j(a[1],isRel)+a[0]+j(a[2],isAdd);case"eq":case"ne":var b="eq"==a[0]?"===":"!==";return j(a[1],isEquality)+b+j(a[2],isRel);case"&&":return"crox_logical_and("+j(a[1],null)+", "+j(a[2],null)+")";case"||":return"crox_logical_or("+j(a[1],null)+", "+j(a[2],null)+")";default:throw Error("unknown expr: "+a[0])}}var l="";return i(a[1]),l="?>"==l.slice(0,2)?l.slice(2):"<?php "+l,"<?php "==l.slice(-6)?l=l.slice(0,-6):l+="?>",l}function codegen_vm_tran(a,b){function c(a){j+=a}function d(a){switch(a[0]){case"if":c("#if("+h(a[1])+")"),e(a[2]),a[3]&&(c("#{else}"),e(a[3])),c("#{end}");break;case"each":c("#set ($list = "+h(a[1])+")"),c("#foreach($_"+a[4]+" in $list)"),a[3]&&c("#set($_"+a[3]+" = $velocityCount - 1)"),e(a[2]),c("#{end}");break;case"set":c("#set ($"+f(a[1])+"="+h(a[2])+")");break;case"eval":var b=h(a[1]);c(/^\$([\w-]+)$/.test(b)?"${"+RegExp.$1+"}":"#set($t = "+b+")$!{t}");break;case"text":c(a[1].replace(/\$/g,"$${dollar}").replace(/#/g,"$${sharp}"));break;case"inc":c("#parse('"+changeExt(a[1],"vm")+"')");break;default:throw Error("unknown stmt: "+a[0])}}function e(a){for(var b=0;b<a.length;++b)d(a[b])}function f(a){return"root"==a?"crox_root":"_"+a}function g(a,b){var c=h(a);return b&&!b(a[0])&&(c="("+c+")"),c}function h(a){switch(a[0]){case"id":return"$"+f(a[1]);case"lit":return"string"==typeof a[1]?i(a[1]):String(a[1]);case".":return g(a[1],isMember)+"."+a[2];case"[]":return g(a[1],isMember)+"["+h(a[2])+"]";case"!":return"!"+g(a[1],isUnary);case"u-":if("u-"==a[1][0])throw Error("禁止两个负号连用");return"-"+g(a[1],isUnary);case"*":case"/":case"%":return g(a[1],isMul)+a[0]+g(a[2],isUnary);case"+":case"-":return g(a[1],isAdd)+a[0]+" "+g(a[2],isMul);case"<":case">":case"<=":case">=":return g(a[1],isRel)+a[0]+g(a[2],isAdd);case"eq":case"ne":return g(a[1],isEquality)+("eq"==a[0]?"==":"!=")+g(a[2],isRel);case"&&":return g(a[1],isLogicalAnd)+"&&"+g(a[2],isEquality);case"||":return g(a[1],isLogicalOr)+"||"+g(a[2],isLogicalAnd);default:throw Error("unknown expr: "+a[0])}}function i(a){if(-1==a.indexOf("'"))return"'"+a+"'";var b=a.split("'");return"('"+b.join("'+\"'\"+'")+"')"}b||(b="\r\n");var j="#set($dollar='$')#set($sharp='#')";return e(a[1]),j}Position.prototype.toString=function(){return"("+this.row+","+this.col+")"};var Lexer=function(){function a(a){return-1!=" abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface let long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with yield ".indexOf(" "+a+" ")}var b=/[A-Za-z_]\w*/,c=/"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'/,d=/\d+(?:\.\d+)?(?:e-?\d+)?/,e=[[/\s+/,function(){return null}],[b,function(b){switch(b){case"true":case"false":return"boolean";case"set":case"include":return b;default:if(a(b)||"null"==b)throw Error("Reserved: "+b+" "+getPos(this.source,this.index));return"realId"}}],[c,function(){return"string"}],[d,function(){return"number"}],[function(a){a.sort().reverse();for(var b=0;b<a.length;++b)a[b]=a[b].replace(/[()*+?.[\]|]/g,"\\$&");return RegExp(a.join("|"))}(["!","%","&&","(",")","*","+","-",".","/","<","<=","=",">",">=","[","]","||","===","!=="]),function(a){switch(a){case"===":return"eq";case"!==":return"ne";default:return a}}]],f=createLexer({"":[[/(?:(?!{{)[\s\S])+/,function(a){return"{{"==a.substring(0,2)?(this.pushState(a),a):"text"}],[/{{{/,function(a){return this.pushState(a),a}],[/{{(?:\/if|else|\/each|\/raw)}}/,function(a){return a}],[/{{#raw}}/,function(a){return this.pushState("raw"),a}],[/{{(?:#(?:if|each)(?=\s))?/,function(a){return this.pushState("{{"),a}]],raw:[[/(?:(?!{{\/raw}})[\s\S])+/,function(){return this.popState(),"rawtext"}]],"{{":e.concat([[/}}/,function(a){return this.popState(),a}]]),"{{{":e.concat([[/}}}/,function(a){return this.popState(),a}]])});return f}(),parse=function(){var table={nStart:40,tSymbols:["$","!","%","&&","(",")","*","+","-",".","/","<","<=","=",">",">=","[","]","boolean","eq","include","ne","number","rawtext","realId","set","string","text","{{","{{#each","{{#if","{{#raw}}","{{/each}}","{{/if}}","{{/raw}}","{{else}}","{{{","||","}}","}}}","AdditiveExpression","EqualityExpression","LogicalAndExpression","LogicalOrExpression","MemberExpression","MultiplicativeExpression","PrimaryExpression","RelationalExpression","UnaryExpression","_text","epsilon","expr","id","program","statement","statements","texts"],tAction:[{_:-2},{_:-32768},{27:3,28:4,29:5,30:6,31:7,36:8,_:-1},{_:-15},{1:12,4:13,8:14,18:15,20:16,22:17,24:18,25:19,26:20,_:0},{1:12,4:13,8:14,18:15,20:32,22:17,24:18,25:33,26:20,_:0},{23:36,_:0},{_:-13},{_:-3},{27:3,31:7,_:-11},{_:-22},{26:42,_:-19},{_:-21},{_:-17},{20:32,24:18,25:33,_:-18},{_:-20},{7:44,8:45,_:-38},{19:46,21:47,_:-46},{3:48,_:-48},{37:49,_:-50},{9:50,16:51,_:-28},{2:52,6:53,10:54,_:-35},{_:-25},{11:55,12:56,14:57,15:58,_:-43},{_:-31},{38:59,_:0},{_:-23},{_:-19},{_:-18},{26:60,_:0},{38:61,_:0},{34:62,_:0},{39:63,_:0},{_:-14},{_:-29},{5:64,_:0},{_:-30},{38:65,_:0},{13:66,_:0},{20:32,24:18,25:33,_:0},{_:-9},{26:82,_:-51},{_:-16},{_:-10},{_:-24},{_:-12},{2:52,6:53,10:54,_:-36},{2:52,6:53,10:54,_:-37},{11:55,12:56,14:57,15:58,_:-44},{11:55,12:56,14:57,15:58,_:-45},{19:46,21:47,_:-47},{3:48,_:-49},{_:-26},{17:86,_:0},{_:-34},{_:-32},{_:-33},{7:44,8:45,_:-39},{7:44,8:45,_:-41},{7:44,8:45,_:-40},{7:44,8:45,_:-42},{38:87,_:0},{38:88,_:0},{27:3,28:4,29:5,30:6,31:7,33:89,35:90,36:8,_:0},{38:91,_:0},{_:-27},{_:-4},{_:-8},{27:3,28:4,29:5,30:6,31:7,32:95,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,32:96,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,33:97,36:8,_:0},{_:-7},{_:-6},{_:-5}],actionIndex:[0,1,2,3,4,5,5,6,5,7,8,9,5,5,5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,5,5,5,5,5,5,39,5,5,5,5,5,5,5,5,40,41,0,42,43,44,45,5,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,0,0,66,0,67,68,69,70,71,72,73],tGoto:[{13:1,15:2},,{9:9,14:10,16:11},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:30,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:34,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:35,12:31},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:37,12:31},,,{9:38},{4:25,6:27,8:39,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:40,12:31},{4:25,6:27,8:41,12:31},,,,,{12:43},,,,,,,,,,,,,,,,,,,,,,,,,{4:25,5:67,6:27,8:29,12:31},{4:25,5:68,6:27,8:29,12:31},{0:21,4:25,5:26,6:27,7:69,8:29,12:31},{0:21,4:25,5:26,6:27,7:70,8:29,12:31},{0:21,1:71,4:25,5:26,6:27,7:28,8:29,12:31},{0:21,1:22,2:72,4:25,5:26,6:27,7:28,8:29,12:31},{12:73},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:74,12:31},{4:25,6:27,8:75,12:31},{4:25,6:27,8:76,12:31},{4:25,6:27,8:77,12:31},{0:78,4:25,5:26,6:27,8:29,12:31},{0:79,4:25,5:26,6:27,8:29,12:31},{0:80,4:25,5:26,6:27,8:29,12:31},{0:81,4:25,5:26,6:27,8:29,12:31},,{10:83},{15:84},,,,,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:85,12:31},,,,,,,,,,,,,,,,,,{9:9,14:10,16:11},,,{15:92},{15:93},,{15:94},,{9:9,14:10,16:11},{9:9,14:10,16:11},{9:9,14:10,16:11}],tRules:[[57,53],[53,55],[55],[55,55,54],[54,30,51,38,55,33],[54,30,51,38,55,35,55,33],[54,29,51,26,50,38,55,32],[54,29,51,26,26,38,55,32],[54,28,25,52,13,51,38],[54,28,51,38],[54,36,51,39],[54,56],[54,28,20,26,38],[56,49],[56,56,49],[49,27],[49,31,23,34],[52,24],[52,25],[52,20],[46,26],[46,22],[46,18],[46,52],[46,4,51,5],[44,46],[44,44,9,52],[44,44,16,51,17],[48,44],[48,1,48],[48,8,48],[45,48],[45,45,6,48],[45,45,10,48],[45,45,2,48],[40,45],[40,40,7,45],[40,40,8,45],[47,40],[47,47,11,40],[47,47,14,40],[47,47,12,40],[47,47,15,40],[41,47],[41,41,19,47],[41,41,21,47],[42,41],[42,42,3,41],[43,42],[43,43,37,42],[51,43],[50]],tFuncs:function(){function $f0($1,$2,$3,$4,$5,$6,$7){var $$;return $$=["each",$2,$6,$4&&eval($4.text),eval($3.text)]}function $f1($1){var $$;return $$=["lit",eval($1.text)]}function $f2(a,b,c){var d;return d=[b.text,a,c]}return[,function(a){var b;return b=["prog",a]},function(){var a;return a=[]},function(a,b){var c;return a.push(b),c=a},function(a,b,c,d){var e;return e=["if",b,d]},function(a,b,c,d,e,f){var g;return g=["if",b,d,f]},$f0,$f0,function(a,b,c,d,e){var f;return f=["set",c.text,e]},function(a,b){var c;return c=["eval",b,!0]},function(a,b){var c;return c=["eval",b,!1]},function(a){var b;return b=["text",a]},function($1,$2,$3,$4){var $$;return $$=["inc",eval($3.text)]},function(a){var b;return b=a},function(a,b){var c;return c=a+b},function(a){var b;return b=a.text},function(a,b){var c;return c=b.text},,,,$f1,$f1,function(a){var b;return b=["lit","true"==a.text]},function(a){var b;return b=["id",a.text]},function(a,b){var c;return c=b},,function(a,b,c){var d;return d=[".",a,c.text]},function(a,b,c){var d;return d=["[]",a,c]},,function(a,b){var c;return c=["!",b]},function(a,b){var c;return c=["u-",b]},,$f2,$f2,$f2,,$f2,$f2,,$f2,$f2,$f2,$f2,,function(a,b,c){var d;return d=["eq",a,c]},function(a,b,c){var d;return d=["ne",a,c]},,$f2,,$f2]}()};return function(a){function b(a,b){return g[a][b]}for(var c=a.nStart,d=a.tSymbols,e={},f=0;f<d.length;++f)e[d[f]]=f;var g=a.tAction,h=a.tGoto,i=a.tRules,j=a.tFuncs,k=a.actionIndex;return k&&(b=function(a,b){var c=g[k[a]];return c[b]||c._}),function(a,f){function g(b){throw Error("Syntax error: "+a.getPos(m.index)+(b?"\n"+b:""))}var k=0,l=[0],m=a.scan(),n=[],o={get:function(a){return n[n.length+a]},set:function(a,b){n[n.length+a]=b}};if(f)for(var p in f)o[p]=f[p];for(;;)if(p=b(k,e[m.tag]))if(p>0)l.push(k=p),n.push(m),m=a.scan();else{if(!(0>p&&p>-32768))return m.tag!=d[0]&&g(),n[0];p=-p;var k=i[p],q=k.length-1;l.length-=q,k=h[l[l.length-1]][k[0]-c],l.push(k),j[p]?(p=j[p].apply(o,n.splice(n.length-q,q)),n.push(p)):1!=q&&n.splice(n.length-q,q,null)}else{for(p=[],q=0;c>q;++q)b(k,q)&&p.push(d[q]);g("find "+m.tag+"\nexpect "+p.join(" "))}}}(table)}(),Crox={parse:parsetmpl,compile:compile2jsfn,render:function(a,b){var c=compile2jsfn(a);return c(b)}};return Crox.compileToPhp=function(a){return codegen_php_tran(parsetmpl(a))},Crox.compileToVM=function(a){return codegen_vm_tran(parsetmpl(a))},Crox.version="1.2.6",Crox}();"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=Crox:"function"==typeof define&&(define.amd||define.cmd)?define(function(){return Crox}):"undefined"!=typeof KISSY&&KISSY.add(function(){return Crox}),root&&(root.Crox=Crox)}(this);
/*
Crox v1.2.7
https://github.com/thx/crox
Released under the MIT license
md5: 4ecf66f9fee2489dfddc7bb45730f4a9
*/
(function(A){var y=function(){function y(c,a){this.row=c;this.col=a}function E(c,a){var d=c.substring(0,a),g=d.match(/\r\n?|\n/g),b=1;g&&(b+=g.length);d=1+/[^\r\n]*$/.exec(d)[0].length;return new y(b,d)}function A(c){return'"'+c.replace(/[\x00-\x1f"\\\u2028\u2029]/g,function(a){switch(a){case '"':return'\\"';case "\\":return"\\\\";case "\b":return"\\b";case "\f":return"\\f";case "\n":return"\\n";case "\r":return"\\r";case "\t":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+
'"'}function H(c){function a(b,k,a,g){this.tag=b;this.text=k;this.index=a;this.subMatches=g}function d(){}function g(b){for(var k=1,a=[],g=[1],c=[],h=0;h<b.length;++h)g.push(k+=RegExp("|"+b[h][0].source).exec("").length),c.push(b[h][1]||d),a.push("("+b[h][0].source+")");return[RegExp(a.join("|")+"|","g"),g,c]}a.prototype.toString=function(){return this.text};var b=c.$||"$",k={},h;for(h in c)"$"!=h.charAt(0)&&(k[h]=g(c[h]));return function(g){var e=g.length,c=0,d=[""],h={text:"",index:0,source:g,pushState:function(b){d.push(b)},
popState:function(){d.pop()},retract:function(b){c-=b}};return{scan:function(){do{var l;a:{var v=k[d[d.length-1]],m=v[0];m.lastIndex=c;l=m.exec(g);if(""==l[0]){if(c<e)throw Error("lexer error: "+E(g,c)+"\n"+g.slice(c,c+50));l=new a(b,"",c)}else{h.index=c;c=m.lastIndex;for(var m=v[1],q=0;q<m.length;++q)if(l[m[q]]){v=v[2][q].apply(h,l.slice(m[q],m[q+1]));l=new a(v,l[0],h.index,l.slice(m[q]+1,m[q+1]));break a}l=void 0}}}while(null==l.tag);return l},getPos:function(b){return E(g,b)},reset:function(){c=
0;d=[""]}}}}function n(c){var a;a:{switch(c){case "id":case "lit":a=!0;break a}a=!1}return a||"."==c||"[]"==c}function r(c){return n(c)||"!"==c||"u-"==c}function u(c){if(r(c))return!0;switch(c){case "*":case "/":case "%":return!0}return!1}function w(c){if(u(c))return!0;switch(c){case "+":case "-":return!0}return!1}function x(c){if(w(c))return!0;switch(c){case "<":case ">":case "<=":case ">=":return!0}return!1}function z(c){if(x(c))return!0;switch(c){case "eq":case "ne":return!0}return!1}function B(c){return z(c)||
"&&"==c}function F(c){return B(c)||"||"==c}function I(c,a){function d(b){e+=h+b+"\n"}function g(b){for(var c=0;c<b.length;++c){var e=b[c];switch(e[0]){case "if":d("if("+k(e[1])+"){");h+="\t";g(e[2]);h=h.slice(0,-1);d("}");e[3]&&(d("else{"),h+="\t",g(e[3]),h=h.slice(0,-1),d("}"));break;case "each":++f;var l=e[3]||"$i",v="$list"+(1==f?"":f);d("var "+v+" = "+k(e[1])+";");d("for(var "+l+" in "+v+") {");h+="\t";d("var "+e[4]+" = "+v+"["+l+"];");g(e[2]);h=h.slice(0,-1);d("}");--f;break;case "set":d("var "+
e[1]+"="+k(e[2])+";");break;case "eval":l=k(e[1]);e[2]&&(l=a+"("+l+")");d("$s += "+l+";");break;case "text":d("$s += "+A(e[1])+";");break;case "inc":break;default:throw Error("unknown stmt: "+e[0]);}}}function b(b,e){var c=k(b);e&&!e(b[0])&&(c="("+c+")");return c}function k(e){switch(e[0]){case "id":return e[1];case "lit":return"string"==typeof e[1]?A(e[1]):String(e[1]);case ".":return b(e[1],n)+"."+e[2];case "[]":return b(e[1],n)+"["+k(e[2])+"]";case "!":return"!"+b(e[1],r);case "u-":return"- "+
b(e[1],r);case "*":case "/":case "%":return b(e[1],u)+e[0]+b(e[2],r);case "+":case "-":return b(e[1],w)+e[0]+" "+b(e[2],u);case "<":case ">":case "<=":case ">=":return b(e[1],x)+e[0]+b(e[2],w);case "eq":case "ne":return b(e[1],z)+("eq"==e[0]?"===":"!==")+b(e[2],x);case "&&":return b(e[1],B)+"&&"+b(e[2],z);case "||":return b(e[1],F)+"||"+b(e[2],B);default:throw Error("unknown expr: "+e[0]);}}var h="\t",f=0,e="";g(c[1]);return e}function D(c){return J(K(c))}function G(c,a){var d=D(c),g;a&&(g=a.htmlEncode);
var d=I(d,g||"$htmlEncode"),b="";g||(b+="var obj = { '<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;' };\n\tfunction $htmlEncode(s) {\n\t\treturn String(s).replace(/[<>&\"]/g, function(c) {\n\t\t\treturn obj[c];\n\t\t});\n\t}");b=b+"var $s = '';"+d;b+="return $s;";return Function("root",b)}function L(c){function a(c){for(var d=0;d<c.length;++d){var f=c[d];switch(f[0]){case "if":var e="if("+g(f[1])+"){";b+=e;a(f[2]);b+="}";f[3]&&(b+="else{",a(f[3]),b+="}");break;case "each":e=f[3]?"$crox_"+f[3]+
"=>":"";e="foreach("+g(f[1])+" as "+e+"$crox_"+f[4]+")";b+=e;b+="{";a(f[2]);b+="}";break;case "set":f="$crox_"+f[1]+" = "+g(f[2])+";";b+=f;break;case "eval":e=g(f[1]);e=f[2]?"crox_encode("+e+")":"crox_ToString("+e+")";b+="echo "+e+";";break;case "text":e=f[1];/<\?(?:php)?|\?>/.test(e)?(f="echo "+("'"+String(f[1]).replace(/['\\]/g,"\\$&")+"'")+";",b+=f):b+="?>"+e+"<?php ";break;case "inc":f="include '"+f[1].replace(/\.\w+$/,".php")+"';";b+=f;break;default:throw Error("unknown stmt: "+f[0]);}}}function d(b,
c){var a=g(b);c&&!c(b[0])&&(a="("+a+")");return a}function g(b){switch(b[0]){case "id":return"$crox_"+b[1];case "lit":return"string"==typeof b[1]?"'"+String(b[1]).replace(/['\\]/g,"\\$&")+"'":String(b[1]);case ".":return d(b[1],n)+"->"+b[2];case "[]":return d(b[1],n)+"["+g(b[2])+"]";case "!":return"!crox_ToBoolean("+d(b[1],r)+")";case "u-":return"- "+d(b[1],r);case "*":case "/":case "%":return d(b[1],u)+b[0]+d(b[2],r);case "+":return"crox_plus("+d(b[1],null)+", "+d(b[2],null)+")";case "-":return d(b[1],
w)+"- "+d(b[2],u);case "<":case ">":case "<=":case ">=":return d(b[1],x)+b[0]+d(b[2],w);case "eq":case "ne":var c="eq"==b[0]?"===":"!==";return d(b[1],z)+c+d(b[2],x);case "&&":return"crox_logical_and("+d(b[1],null)+", "+d(b[2],null)+")";case "||":return"crox_logical_or("+d(b[1],null)+", "+d(b[2],null)+")";default:throw Error("unknown expr: "+b[0]);}}var b="";a(c[1]);b="?>"==b.slice(0,2)?b.slice(2):"<?php "+b;return b="<?php "==b.slice(-6)?b.slice(0,-6):b+"?>"}function M(c,a){function d(b){for(var c=
0;c<b.length;++c){var a=b[c];switch(a[0]){case "if":var C="#if("+k(a[1])+")";f+=C;d(a[2]);a[3]&&(f+="#{else}",d(a[3]));f+="#{end}";break;case "each":++h;var C="$list"+(1==h?"":h),l="#set ("+C+" = "+k(a[1])+")";f+=l;f+="#foreach($_"+a[4]+" in "+C+")";a[3]&&(f+="#set($_"+a[3]+" = $velocityCount - 1)");d(a[2]);f+="#{end}";--h;break;case "set":a="#set ($"+g(a[1])+"="+k(a[2])+")";f+=a;break;case "eval":a=k(a[1]);f=/^\$([\w-]+)$/.test(a)?f+("${"+RegExp.$1+"}"):f+("#set($t = "+a+")$!{t}");break;case "text":a=
a[1].replace(/\$/g,"$${dollar}").replace(/#/g,"$${sharp}");f+=a;break;case "inc":a="#parse('"+a[1].replace(/\.\w+$/,".vm")+"')";f+=a;break;default:throw Error("unknown stmt: "+a[0]);}}}function g(b){return"root"==b?"crox_root":"_"+b}function b(b,a){var c=k(b);a&&!a(b[0])&&(c="("+c+")");return c}function k(a){switch(a[0]){case "id":return"$"+g(a[1]);case "lit":return"string"==typeof a[1]?(a=a[1],a=-1==a.indexOf("'")?"'"+a+"'":"('"+a.split("'").join("'+\"'\"+'")+"')",a):String(a[1]);case ".":return b(a[1],
n)+"."+a[2];case "[]":return b(a[1],n)+"["+k(a[2])+"]";case "!":return"!"+b(a[1],r);case "u-":if("u-"==a[1][0])throw Error("\u7981\u6b62\u4e24\u4e2a\u8d1f\u53f7\u8fde\u7528");return"-"+b(a[1],r);case "*":case "/":case "%":return b(a[1],u)+a[0]+b(a[2],r);case "+":case "-":return b(a[1],w)+a[0]+" "+b(a[2],u);case "<":case ">":case "<=":case ">=":return b(a[1],x)+a[0]+b(a[2],w);case "eq":case "ne":return b(a[1],z)+("eq"==a[0]?"==":"!=")+b(a[2],x);case "&&":return b(a[1],B)+"&&"+b(a[2],z);case "||":return b(a[1],
F)+"||"+b(a[2],B);default:throw Error("unknown expr: "+a[0]);}}a||(a="\r\n");var h=0,f="#set($dollar='$')#set($sharp='#')";d(c[1]);return f}y.prototype.toString=function(){return"("+this.row+","+this.col+")"};var K=function(){var c=[[/\s+/,function(){return null}],[/[A-Za-z_]\w*/,function(a){switch(a){case "true":case "false":return"boolean";case "set":case "include":return a;default:if(-1!=" abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface let long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with yield ".indexOf(" "+
a+" ")||"null"==a)throw Error("Reserved: "+a+" "+E(this.source,this.index));return"realId"}}],[/"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'/,function(a){return"string"}],[/\d+(?:\.\d+)?(?:e-?\d+)?/,function(a){return"number"}],[function(a){a.sort().reverse();for(var c=0;c<a.length;++c)a[c]=a[c].replace(/[()*+?.[\]|]/g,"\\$&");return RegExp(a.join("|"))}("! % && ( ) * + - . / < <= = > >= [ ] || === !==".split(" ")),function(a){switch(a){case "===":return"eq";case "!==":return"ne";default:return a}}]];
return H({"":[[/(?:(?!{{)[\s\S])+/,function(a){return"{{"==a.substring(0,2)?(this.pushState(a),a):"text"}],[/{{{/,function(a){this.pushState(a);return a}],[/{{(?:\/if|else|\/each|\/raw)}}/,function(a){return a}],[/{{#raw}}/,function(a){this.pushState("raw");return a}],[/{{(?:#(?:if|each)(?=\s))?/,function(a){this.pushState("{{");return a}]],raw:[[/(?:(?!{{\/raw}})[\s\S])+/,function(a){this.popState();return"rawtext"}]],"{{":c.concat([[/}}/,function(a){this.popState();return a}]]),"{{{":c.concat([[/}}}/,
function(a){this.popState();return a}]])})}(),J=function(){return function(c){function a(b,a){return h[b][a]}for(var d=c.nStart,g=c.tSymbols,b={},k=0;k<g.length;++k)b[g[k]]=k;var h=c.tAction,f=c.tGoto,e=c.tRules,r=c.tFuncs,n=c.actionIndex;n&&(a=function(b,a){var c=h[n[b]];return c[a]||c._});return function(c,k){function h(b){throw Error("Syntax error: "+c.getPos(n.index)+(b?"\n"+b:""));}var m=0,q=[0],n=c.scan(),s=[],u={get:function(b){return s[s.length+b]},set:function(b,a){s[s.length+b]=a}};if(k)for(var p in k)u[p]=
k[p];for(;;)if(p=a(m,b[n.tag]))if(0<p)q.push(m=p),s.push(n),n=c.scan();else if(0>p&&-32768<p){p=-p;var m=e[p],t=m.length-1;q.length-=t;m=f[q[q.length-1]][m[0]-d];q.push(m);r[p]?(p=r[p].apply(u,s.splice(s.length-t,t)),s.push(p)):1!=t&&s.splice(s.length-t,t,null)}else return n.tag!=g[0]&&h(),s[0];else{p=[];for(t=0;t<d;++t)a(m,t)&&p.push(g[t]);h("find "+n.tag+"\nexpect "+p.join(" "))}}}({nStart:40,tSymbols:"$ ! % && ( ) * + - . / < <= = > >= [ ] boolean eq include ne number rawtext realId set string text {{ {{#each {{#if {{#raw}} {{/each}} {{/if}} {{/raw}} {{else}} {{{ || }} }}} AdditiveExpression EqualityExpression LogicalAndExpression LogicalOrExpression MemberExpression MultiplicativeExpression PrimaryExpression RelationalExpression UnaryExpression _text epsilon expr id program statement statements texts".split(" "),
tAction:[{_:-2},{_:-32768},{27:3,28:4,29:5,30:6,31:7,36:8,_:-1},{_:-15},{1:12,4:13,8:14,18:15,20:16,22:17,24:18,25:19,26:20,_:0},{1:12,4:13,8:14,18:15,20:32,22:17,24:18,25:33,26:20,_:0},{23:36,_:0},{_:-13},{_:-3},{27:3,31:7,_:-11},{_:-22},{26:42,_:-19},{_:-21},{_:-17},{20:32,24:18,25:33,_:-18},{_:-20},{7:44,8:45,_:-38},{19:46,21:47,_:-46},{3:48,_:-48},{37:49,_:-50},{9:50,16:51,_:-28},{2:52,6:53,10:54,_:-35},{_:-25},{11:55,12:56,14:57,15:58,_:-43},{_:-31},{38:59,_:0},{_:-23},{_:-19},{_:-18},{26:60,
_:0},{38:61,_:0},{34:62,_:0},{39:63,_:0},{_:-14},{_:-29},{5:64,_:0},{_:-30},{38:65,_:0},{13:66,_:0},{20:32,24:18,25:33,_:0},{_:-9},{26:82,_:-51},{_:-16},{_:-10},{_:-24},{_:-12},{2:52,6:53,10:54,_:-36},{2:52,6:53,10:54,_:-37},{11:55,12:56,14:57,15:58,_:-44},{11:55,12:56,14:57,15:58,_:-45},{19:46,21:47,_:-47},{3:48,_:-49},{_:-26},{17:86,_:0},{_:-34},{_:-32},{_:-33},{7:44,8:45,_:-39},{7:44,8:45,_:-41},{7:44,8:45,_:-40},{7:44,8:45,_:-42},{38:87,_:0},{38:88,_:0},{27:3,28:4,29:5,30:6,31:7,33:89,35:90,36:8,
_:0},{38:91,_:0},{_:-27},{_:-4},{_:-8},{27:3,28:4,29:5,30:6,31:7,32:95,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,32:96,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,33:97,36:8,_:0},{_:-7},{_:-6},{_:-5}],actionIndex:[0,1,2,3,4,5,5,6,5,7,8,9,5,5,5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,5,5,5,5,5,5,39,5,5,5,5,5,5,5,5,40,41,0,42,43,44,45,5,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,0,0,66,0,67,68,69,70,71,72,73],tGoto:[{13:1,15:2},,{9:9,14:10,16:11},,{0:21,
1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:30,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:34,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:35,12:31},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:37,12:31},,,{9:38},{4:25,6:27,8:39,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:40,12:31},{4:25,6:27,8:41,12:31},,,,,{12:43},,,,,,,,,,,,,,,,,,,,,,,,,{4:25,5:67,6:27,8:29,12:31},{4:25,5:68,6:27,8:29,12:31},{0:21,4:25,5:26,6:27,7:69,8:29,12:31},{0:21,4:25,5:26,6:27,7:70,
8:29,12:31},{0:21,1:71,4:25,5:26,6:27,7:28,8:29,12:31},{0:21,1:22,2:72,4:25,5:26,6:27,7:28,8:29,12:31},{12:73},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:74,12:31},{4:25,6:27,8:75,12:31},{4:25,6:27,8:76,12:31},{4:25,6:27,8:77,12:31},{0:78,4:25,5:26,6:27,8:29,12:31},{0:79,4:25,5:26,6:27,8:29,12:31},{0:80,4:25,5:26,6:27,8:29,12:31},{0:81,4:25,5:26,6:27,8:29,12:31},,{10:83},{15:84},,,,,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:85,12:31},,,,,,,,,,,,,,,,,,{9:9,14:10,16:11},,,{15:92},{15:93},
,{15:94},,{9:9,14:10,16:11},{9:9,14:10,16:11},{9:9,14:10,16:11}],tRules:[[57,53],[53,55],[55],[55,55,54],[54,30,51,38,55,33],[54,30,51,38,55,35,55,33],[54,29,51,26,50,38,55,32],[54,29,51,26,26,38,55,32],[54,28,25,52,13,51,38],[54,28,51,38],[54,36,51,39],[54,56],[54,28,20,26,38],[56,49],[56,56,49],[49,27],[49,31,23,34],[52,24],[52,25],[52,20],[46,26],[46,22],[46,18],[46,52],[46,4,51,5],[44,46],[44,44,9,52],[44,44,16,51,17],[48,44],[48,1,48],[48,8,48],[45,48],[45,45,6,48],[45,45,10,48],[45,45,2,48],
[40,45],[40,40,7,45],[40,40,8,45],[47,40],[47,47,11,40],[47,47,14,40],[47,47,12,40],[47,47,15,40],[41,47],[41,41,19,47],[41,41,21,47],[42,41],[42,42,3,41],[43,42],[43,43,37,42],[51,43],[50]],tFuncs:function(){function c(a,b,c,d,f,e,n){return["each",b,e,d&&eval(d.text),eval(c.text)]}function a(a){return["lit",eval(a.text)]}function d(a,b,c){return[b.text,a,c]}return[,function(a){return["prog",a]},function(){return[]},function(a,b){a.push(b);return a},function(a,b,c,d,f){return["if",b,d]},function(a,
b,c,d,f,e,n){return["if",b,d,e]},c,c,function(a,b,c,d,f,e){return["set",c.text,f]},function(a,b,c){return["eval",b,!0]},function(a,b,c){return["eval",b,!1]},function(a){return["text",a]},function(a,b,c,d){return["inc",eval(c.text)]},function(a){return a},function(a,b){return a+b},function(a){return a.text},function(a,b,c){return b.text},,,,a,a,function(a){return["lit","true"==a.text]},function(a){return["id",a.text]},function(a,b,c){return b},,function(a,b,c){return[".",a,c.text]},function(a,b,c,
d){return["[]",a,c]},,function(a,b){return["!",b]},function(a,b){return["u-",b]},,d,d,d,,d,d,,d,d,d,d,,function(a,b,c){return["eq",a,c]},function(a,b,c){return["ne",a,c]},,d,,d]}()})}();return{parse:D,compile:G,render:function(c,a){return G(c)(a)},compileToPhp:function(c){return L(D(c))},compileToVM:function(c,a){return M(D(c))},version:"1.2.7"}}();"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=y:"function"==typeof define&&(define.amd||define.cmd)?define(function(){return y}):
"undefined"!=typeof KISSY&&KISSY.add(function(){return y});A&&(A.Crox=y)})(this);

49

build/crox-all.js

@@ -1,11 +0,9 @@

/*!
* Crox v1.2.6
/**
* @preserve Crox v1.2.7
* https://github.com/thx/crox
*
* Released under the MIT license
* md5: 4ecf66f9fee2489dfddc7bb45730f4a9
*/
(function(root) {
var Crox = (function() {
(function(root) {var Crox = (function() {
function Class(base, constructor, methods) {

@@ -481,2 +479,3 @@ /// <param name="base" type="Function"></param>

}
var i_each = 0;
function stmtGen(a) {

@@ -499,10 +498,13 @@ switch (a[0]) {

case 'each':
++i_each;
var k = a[3] || '$i';
emit('var $list = ' + exprGen(a[1]) + ';');
emit('for(var ' + k + ' in $list) {');
var listName = '$list' + (i_each == 1 ? '' : i_each);
emit('var ' + listName + ' = ' + exprGen(a[1]) + ';');
emit('for(var ' + k + ' in ' + listName + ') {');
indent();
emit('var ' + a[4] + ' = $list[' + k + '];');
emit('var ' + a[4] + ' = ' + listName + '[' + k + '];');
stmtsGen(a[2]);
outdent();
emit('}');
--i_each;
break;

@@ -753,2 +755,3 @@ case 'set':

}
var i_each = 0;
function stmtGen(a) {

@@ -766,4 +769,6 @@ switch (a[0]) {

case 'each':
emit('#set ($list = ' + exprGen(a[1]) + ')');
emit('#foreach($_' + a[4] + ' in $list)');
++i_each;
var listName = '$list' + (i_each == 1 ? '' : i_each);
emit('#set (' + listName + ' = ' + exprGen(a[1]) + ')');
emit('#foreach($_' + a[4] + ' in ' + listName + ')');
if (a[3]) {

@@ -774,2 +779,3 @@ emit('#set($_' + a[3] + ' = $velocityCount - 1)');

emit('#{end}');
--i_each;
break;

@@ -872,21 +878,2 @@ case 'set':

Crox.version = '1.2.6';
return Crox;
})();
if (typeof module == "object" && module && typeof module.exports == "object") {
module.exports = Crox;
} else if (typeof define == "function" && (define.amd || define.cmd)) {
define(function() {
return Crox;
});
} else if (typeof KISSY != "undefined") {
KISSY.add(function(){
return Crox;
});
}
if (root) {
root.Crox = Crox;
}
})(this);
Crox.version = "1.2.7";return Crox;})();if ( typeof module == "object" && module && typeof module.exports == "object" ) module.exports = Crox;else if (typeof define == "function" && (define.amd || define.cmd) ) define(function () { return Crox; } );else if (typeof KISSY != "undefined") KISSY.add(function(){ return Crox; });if (root) root.Crox = Crox; })(this);

@@ -1,7 +0,30 @@

/*!
* Crox v1.2.6
* https://github.com/thx/crox
*
* Released under the MIT license
*/
!function(root){var Crox=function(){function Class(a,b,c){function d(){}d.prototype=a.prototype;var e=new d;if(c)for(var f in c)e[f]=c[f];return b||(b=d),b.prototype=e,b}function Position(a,b){this.row=a,this.col=b}function getPos(a,b){var c=a.substring(0,b),d=/\r\n?|\n/g,e=c.match(d),f=1;e&&(f+=e.length);var g=1+/[^\r\n]*$/.exec(c)[0].length;return new Position(f,g)}function Enum(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=a[c];return b}function inArr(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function inArr_strict(a,b){for(var c=0;c<a.length;++c)if(a[c]===b)return c;return-1}function nodup(a,b){b||(b=function(a,b){return a===b});for(var c=[],d=a.length,e=0;d>e;e++){for(var f=e+1;d>f;f++)b(a[e],a[f])&&(f=++e);c.push(a[e])}return c}function htmlEncode(a){return String(a).replace(/[&<>"]/g,function(a){switch(a){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";default:return"&quot;"}})}function quote(a){return'"'+a.replace(/[\x00-\x1f"\\\u2028\u2029]/g,function(a){switch(a){case'"':return'\\"';case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"'}function singleQuote(a){return"'"+a.replace(/[\x00-\x1f'\\\u2028\u2029]/g,function(a){switch(a){case"'":return"\\'";case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+"'"}function phpQuote(a){return"'"+String(a).replace(/['\\]/g,"\\$&")+"'"}function createLexer(a){function b(a,b,c,d){this.tag=a,this.text=b,this.index=c,this.subMatches=d}function c(){}function d(a){for(var b=1,d=[],e=[1],f=[],g=0;g<a.length;++g)e.push(b+=RegExp("|"+a[g][0].source).exec("").length),f.push(a[g][1]||c),d.push("("+a[g][0].source+")");var h=RegExp(d.join("|")+"|","g");return[h,e,f]}function e(a){function c(){var c=h[h.length-1],j=g[c],k=j[0];k.lastIndex=e;var l=k.exec(a);if(""==l[0]){if(d>e)throw Error("lexer error: "+getPos(a,e)+"\n"+a.slice(e,e+50));return new b(f,"",e)}i.index=e,e=k.lastIndex;for(var m=j[1],n=0;n<m.length;++n)if(l[m[n]]){var o=j[2][n].apply(i,l.slice(m[n],m[n+1]));return new b(o,l[0],i.index,l.slice(m[n]+1,m[n+1]))}}var d=a.length,e=0,h=[""],i={text:"",index:0,source:a,pushState:function(a){h.push(a)},popState:function(){h.pop()},retract:function(a){e-=a}};return{scan:function(){do var a=c();while(null==a.tag);return a},getPos:function(b){return getPos(a,b)},reset:function(){e=0,h=[""]}}}b.prototype.toString=function(){return this.text};var f=a.$||"$",g={};for(var h in a)"$"!=h.charAt(0)&&(g[h]=d(a[h]));return e}function isAtom(a){switch(a){case"id":case"lit":return!0}return!1}function isMember(a){return isAtom(a)||"."==a||"[]"==a}function isUnary(a){return isMember(a)||"!"==a||"u-"==a}function isMul(a){if(isUnary(a))return!0;switch(a){case"*":case"/":case"%":return!0}return!1}function isAdd(a){if(isMul(a))return!0;switch(a){case"+":case"-":return!0}return!1}function isRel(a){if(isAdd(a))return!0;switch(a){case"<":case">":case"<=":case">=":return!0}return!1}function isEquality(a){if(isRel(a))return!0;switch(a){case"eq":case"ne":return!0}return!1}function isLogicalAnd(a){return isEquality(a)||"&&"==a}function isLogicalOr(a){return isLogicalAnd(a)||"||"==a}function changeExt(a,b){return a.replace(/\.\w+$/,"."+b)}function codegen_js_tran(a,b){function c(){j+=" "}function d(){j=j.slice(0,-1)}function e(a){k+=j+a+"\n"}function f(a){switch(a[0]){case"if":e("if("+i(a[1])+"){"),c(),g(a[2]),d(),e("}"),a[3]&&(e("else{"),c(),g(a[3]),d(),e("}"));break;case"each":var f=a[3]||"$i";e("var $list = "+i(a[1])+";"),e("for(var "+f+" in $list) {"),c(),e("var "+a[4]+" = $list["+f+"];"),g(a[2]),d(),e("}");break;case"set":e("var "+a[1]+"="+i(a[2])+";");break;case"eval":var h=i(a[1]);a[2]&&(h=b+"("+h+")"),e("$s += "+h+";");break;case"text":e("$s += "+quote(a[1])+";");break;case"inc":break;default:throw Error("unknown stmt: "+a[0])}}function g(a){for(var b=0;b<a.length;++b)f(a[b])}function h(a,b){var c=i(a);return b&&!b(a[0])&&(c="("+c+")"),c}function i(a){switch(a[0]){case"id":return a[1];case"lit":return"string"==typeof a[1]?quote(a[1]):String(a[1]);case".":return h(a[1],isMember)+"."+a[2];case"[]":return h(a[1],isMember)+"["+i(a[2])+"]";case"!":return"!"+h(a[1],isUnary);case"u-":return"- "+h(a[1],isUnary);case"*":case"/":case"%":return h(a[1],isMul)+a[0]+h(a[2],isUnary);case"+":case"-":return h(a[1],isAdd)+a[0]+" "+h(a[2],isMul);case"<":case">":case"<=":case">=":return h(a[1],isRel)+a[0]+h(a[2],isAdd);case"eq":case"ne":return h(a[1],isEquality)+("eq"==a[0]?"===":"!==")+h(a[2],isRel);case"&&":return h(a[1],isLogicalAnd)+"&&"+h(a[2],isEquality);case"||":return h(a[1],isLogicalOr)+"||"+h(a[2],isLogicalAnd);default:throw Error("unknown expr: "+a[0])}}var j=" ",k="";return g(a[1]),k}function codegen_js_tofn(a,b){var c;b&&(c=b.htmlEncode);var d=codegen_js_tran(a,c||"$htmlEncode"),e="";c||(e+="var obj = { '<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;' };\n function $htmlEncode(s) {\n return String(s).replace(/[<>&\"]/g, function(c) {\n return obj[c];\n });\n }"),e+="var $s = '';",e+=d,e+="return $s;";var f=Function("root",e);return f}function parsetmpl(a){var b=parse(Lexer(a));return b}function compile2jsfn(a,b){var c=parsetmpl(a);return codegen_js_tofn(c,b)}Position.prototype.toString=function(){return"("+this.row+","+this.col+")"};var Lexer=function(){function a(a){return-1!=" abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface let long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with yield ".indexOf(" "+a+" ")}var b=/[A-Za-z_]\w*/,c=/"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'/,d=/\d+(?:\.\d+)?(?:e-?\d+)?/,e=[[/\s+/,function(){return null}],[b,function(b){switch(b){case"true":case"false":return"boolean";case"set":case"include":return b;default:if(a(b)||"null"==b)throw Error("Reserved: "+b+" "+getPos(this.source,this.index));return"realId"}}],[c,function(){return"string"}],[d,function(){return"number"}],[function(a){a.sort().reverse();for(var b=0;b<a.length;++b)a[b]=a[b].replace(/[()*+?.[\]|]/g,"\\$&");return RegExp(a.join("|"))}(["!","%","&&","(",")","*","+","-",".","/","<","<=","=",">",">=","[","]","||","===","!=="]),function(a){switch(a){case"===":return"eq";case"!==":return"ne";default:return a}}]],f=createLexer({"":[[/(?:(?!{{)[\s\S])+/,function(a){return"{{"==a.substring(0,2)?(this.pushState(a),a):"text"}],[/{{{/,function(a){return this.pushState(a),a}],[/{{(?:\/if|else|\/each|\/raw)}}/,function(a){return a}],[/{{#raw}}/,function(a){return this.pushState("raw"),a}],[/{{(?:#(?:if|each)(?=\s))?/,function(a){return this.pushState("{{"),a}]],raw:[[/(?:(?!{{\/raw}})[\s\S])+/,function(){return this.popState(),"rawtext"}]],"{{":e.concat([[/}}/,function(a){return this.popState(),a}]]),"{{{":e.concat([[/}}}/,function(a){return this.popState(),a}]])});return f}(),parse=function(){var table={nStart:40,tSymbols:["$","!","%","&&","(",")","*","+","-",".","/","<","<=","=",">",">=","[","]","boolean","eq","include","ne","number","rawtext","realId","set","string","text","{{","{{#each","{{#if","{{#raw}}","{{/each}}","{{/if}}","{{/raw}}","{{else}}","{{{","||","}}","}}}","AdditiveExpression","EqualityExpression","LogicalAndExpression","LogicalOrExpression","MemberExpression","MultiplicativeExpression","PrimaryExpression","RelationalExpression","UnaryExpression","_text","epsilon","expr","id","program","statement","statements","texts"],tAction:[{_:-2},{_:-32768},{27:3,28:4,29:5,30:6,31:7,36:8,_:-1},{_:-15},{1:12,4:13,8:14,18:15,20:16,22:17,24:18,25:19,26:20,_:0},{1:12,4:13,8:14,18:15,20:32,22:17,24:18,25:33,26:20,_:0},{23:36,_:0},{_:-13},{_:-3},{27:3,31:7,_:-11},{_:-22},{26:42,_:-19},{_:-21},{_:-17},{20:32,24:18,25:33,_:-18},{_:-20},{7:44,8:45,_:-38},{19:46,21:47,_:-46},{3:48,_:-48},{37:49,_:-50},{9:50,16:51,_:-28},{2:52,6:53,10:54,_:-35},{_:-25},{11:55,12:56,14:57,15:58,_:-43},{_:-31},{38:59,_:0},{_:-23},{_:-19},{_:-18},{26:60,_:0},{38:61,_:0},{34:62,_:0},{39:63,_:0},{_:-14},{_:-29},{5:64,_:0},{_:-30},{38:65,_:0},{13:66,_:0},{20:32,24:18,25:33,_:0},{_:-9},{26:82,_:-51},{_:-16},{_:-10},{_:-24},{_:-12},{2:52,6:53,10:54,_:-36},{2:52,6:53,10:54,_:-37},{11:55,12:56,14:57,15:58,_:-44},{11:55,12:56,14:57,15:58,_:-45},{19:46,21:47,_:-47},{3:48,_:-49},{_:-26},{17:86,_:0},{_:-34},{_:-32},{_:-33},{7:44,8:45,_:-39},{7:44,8:45,_:-41},{7:44,8:45,_:-40},{7:44,8:45,_:-42},{38:87,_:0},{38:88,_:0},{27:3,28:4,29:5,30:6,31:7,33:89,35:90,36:8,_:0},{38:91,_:0},{_:-27},{_:-4},{_:-8},{27:3,28:4,29:5,30:6,31:7,32:95,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,32:96,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,33:97,36:8,_:0},{_:-7},{_:-6},{_:-5}],actionIndex:[0,1,2,3,4,5,5,6,5,7,8,9,5,5,5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,5,5,5,5,5,5,39,5,5,5,5,5,5,5,5,40,41,0,42,43,44,45,5,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,0,0,66,0,67,68,69,70,71,72,73],tGoto:[{13:1,15:2},,{9:9,14:10,16:11},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:30,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:34,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:35,12:31},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:37,12:31},,,{9:38},{4:25,6:27,8:39,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:40,12:31},{4:25,6:27,8:41,12:31},,,,,{12:43},,,,,,,,,,,,,,,,,,,,,,,,,{4:25,5:67,6:27,8:29,12:31},{4:25,5:68,6:27,8:29,12:31},{0:21,4:25,5:26,6:27,7:69,8:29,12:31},{0:21,4:25,5:26,6:27,7:70,8:29,12:31},{0:21,1:71,4:25,5:26,6:27,7:28,8:29,12:31},{0:21,1:22,2:72,4:25,5:26,6:27,7:28,8:29,12:31},{12:73},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:74,12:31},{4:25,6:27,8:75,12:31},{4:25,6:27,8:76,12:31},{4:25,6:27,8:77,12:31},{0:78,4:25,5:26,6:27,8:29,12:31},{0:79,4:25,5:26,6:27,8:29,12:31},{0:80,4:25,5:26,6:27,8:29,12:31},{0:81,4:25,5:26,6:27,8:29,12:31},,{10:83},{15:84},,,,,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:85,12:31},,,,,,,,,,,,,,,,,,{9:9,14:10,16:11},,,{15:92},{15:93},,{15:94},,{9:9,14:10,16:11},{9:9,14:10,16:11},{9:9,14:10,16:11}],tRules:[[57,53],[53,55],[55],[55,55,54],[54,30,51,38,55,33],[54,30,51,38,55,35,55,33],[54,29,51,26,50,38,55,32],[54,29,51,26,26,38,55,32],[54,28,25,52,13,51,38],[54,28,51,38],[54,36,51,39],[54,56],[54,28,20,26,38],[56,49],[56,56,49],[49,27],[49,31,23,34],[52,24],[52,25],[52,20],[46,26],[46,22],[46,18],[46,52],[46,4,51,5],[44,46],[44,44,9,52],[44,44,16,51,17],[48,44],[48,1,48],[48,8,48],[45,48],[45,45,6,48],[45,45,10,48],[45,45,2,48],[40,45],[40,40,7,45],[40,40,8,45],[47,40],[47,47,11,40],[47,47,14,40],[47,47,12,40],[47,47,15,40],[41,47],[41,41,19,47],[41,41,21,47],[42,41],[42,42,3,41],[43,42],[43,43,37,42],[51,43],[50]],tFuncs:function(){function $f0($1,$2,$3,$4,$5,$6,$7){var $$;return $$=["each",$2,$6,$4&&eval($4.text),eval($3.text)]}function $f1($1){var $$;return $$=["lit",eval($1.text)]}function $f2(a,b,c){var d;return d=[b.text,a,c]}return[,function(a){var b;return b=["prog",a]},function(){var a;return a=[]},function(a,b){var c;return a.push(b),c=a},function(a,b,c,d){var e;return e=["if",b,d]},function(a,b,c,d,e,f){var g;return g=["if",b,d,f]},$f0,$f0,function(a,b,c,d,e){var f;return f=["set",c.text,e]},function(a,b){var c;return c=["eval",b,!0]},function(a,b){var c;return c=["eval",b,!1]},function(a){var b;return b=["text",a]},function($1,$2,$3,$4){var $$;return $$=["inc",eval($3.text)]},function(a){var b;return b=a},function(a,b){var c;return c=a+b},function(a){var b;return b=a.text},function(a,b){var c;return c=b.text},,,,$f1,$f1,function(a){var b;return b=["lit","true"==a.text]},function(a){var b;return b=["id",a.text]},function(a,b){var c;return c=b},,function(a,b,c){var d;return d=[".",a,c.text]},function(a,b,c){var d;return d=["[]",a,c]},,function(a,b){var c;return c=["!",b]},function(a,b){var c;return c=["u-",b]},,$f2,$f2,$f2,,$f2,$f2,,$f2,$f2,$f2,$f2,,function(a,b,c){var d;return d=["eq",a,c]},function(a,b,c){var d;return d=["ne",a,c]},,$f2,,$f2]}()};return function(a){function b(a,b){return g[a][b]}for(var c=a.nStart,d=a.tSymbols,e={},f=0;f<d.length;++f)e[d[f]]=f;var g=a.tAction,h=a.tGoto,i=a.tRules,j=a.tFuncs,k=a.actionIndex;return k&&(b=function(a,b){var c=g[k[a]];return c[b]||c._}),function(a,f){function g(b){throw Error("Syntax error: "+a.getPos(m.index)+(b?"\n"+b:""))}var k=0,l=[0],m=a.scan(),n=[],o={get:function(a){return n[n.length+a]},set:function(a,b){n[n.length+a]=b}};if(f)for(var p in f)o[p]=f[p];for(;;)if(p=b(k,e[m.tag]))if(p>0)l.push(k=p),n.push(m),m=a.scan();else{if(!(0>p&&p>-32768))return m.tag!=d[0]&&g(),n[0];p=-p;var k=i[p],q=k.length-1;l.length-=q,k=h[l[l.length-1]][k[0]-c],l.push(k),j[p]?(p=j[p].apply(o,n.splice(n.length-q,q)),n.push(p)):1!=q&&n.splice(n.length-q,q,null)}else{for(p=[],q=0;c>q;++q)b(k,q)&&p.push(d[q]);g("find "+m.tag+"\nexpect "+p.join(" "))}}}(table)}(),Crox={parse:parsetmpl,compile:compile2jsfn,render:function(a,b){var c=compile2jsfn(a);return c(b)}};return Crox.version="1.2.6",Crox}();"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=Crox:"function"==typeof define&&(define.amd||define.cmd)?define(function(){return Crox}):"undefined"!=typeof KISSY&&KISSY.add(function(){return Crox}),root&&(root.Crox=Crox)}(this);
/*
Crox v1.2.7
https://github.com/thx/crox
Released under the MIT license
md5: 7b8f2d37387983b4428d2ebf65417353
*/
(function(v){var h=function(){function h(b,a){this.row=b;this.col=a}function y(b,a){var c=b.substring(0,a),e=c.match(/\r\n?|\n/g),d=1;e&&(d+=e.length);c=1+/[^\r\n]*$/.exec(c)[0].length;return new h(d,c)}function v(b){return'"'+b.replace(/[\x00-\x1f"\\\u2028\u2029]/g,function(a){switch(a){case '"':return'\\"';case "\\":return"\\\\";case "\b":return"\\b";case "\f":return"\\f";case "\n":return"\\n";case "\r":return"\\r";case "\t":return"\\t"}return"\\u"+("000"+a.charCodeAt(0).toString(16)).slice(-4)})+
'"'}function H(b){function a(a,d,e,b){this.tag=a;this.text=d;this.index=e;this.subMatches=b}function c(){}function e(a){for(var d=1,e=[],b=[1],k=[],g=0;g<a.length;++g)b.push(d+=RegExp("|"+a[g][0].source).exec("").length),k.push(a[g][1]||c),e.push("("+a[g][0].source+")");return[RegExp(e.join("|")+"|","g"),b,k]}a.prototype.toString=function(){return this.text};var d=b.$||"$",k={},f;for(f in b)"$"!=f.charAt(0)&&(k[f]=e(b[f]));return function(e){var b=e.length,n=0,c=[""],f={text:"",index:0,source:e,pushState:function(a){c.push(a)},
popState:function(){c.pop()},retract:function(a){n-=a}};return{scan:function(){do{var g;a:{var u=k[c[c.length-1]],l=u[0];l.lastIndex=n;g=l.exec(e);if(""==g[0]){if(n<b)throw Error("lexer error: "+y(e,n)+"\n"+e.slice(n,n+50));g=new a(d,"",n)}else{f.index=n;n=l.lastIndex;for(var l=u[1],q=0;q<l.length;++q)if(g[l[q]]){u=u[2][q].apply(f,g.slice(l[q],l[q+1]));g=new a(u,g[0],f.index,g.slice(l[q]+1,l[q+1]));break a}g=void 0}}}while(null==g.tag);return g},getPos:function(a){return y(e,a)},reset:function(){n=
0;c=[""]}}}}function z(b){var a;a:{switch(b){case "id":case "lit":a=!0;break a}a=!1}return a||"."==b||"[]"==b}function x(b){return z(b)||"!"==b||"u-"==b}function A(b){if(x(b))return!0;switch(b){case "*":case "/":case "%":return!0}return!1}function B(b){if(A(b))return!0;switch(b){case "+":case "-":return!0}return!1}function C(b){if(B(b))return!0;switch(b){case "<":case ">":case "<=":case ">=":return!0}return!1}function D(b){if(C(b))return!0;switch(b){case "eq":case "ne":return!0}return!1}function E(b){return D(b)||
"&&"==b}function I(b){return E(b)||"||"==b}function J(b,a){function c(a){t+=f+a+"\n"}function e(d){for(var b=0;b<d.length;++b){var p=d[b];switch(p[0]){case "if":c("if("+k(p[1])+"){");f+="\t";e(p[2]);f=f.slice(0,-1);c("}");p[3]&&(c("else{"),f+="\t",e(p[3]),f=f.slice(0,-1),c("}"));break;case "each":++w;var g=p[3]||"$i",u="$list"+(1==w?"":w);c("var "+u+" = "+k(p[1])+";");c("for(var "+g+" in "+u+") {");f+="\t";c("var "+p[4]+" = "+u+"["+g+"];");e(p[2]);f=f.slice(0,-1);c("}");--w;break;case "set":c("var "+
p[1]+"="+k(p[2])+";");break;case "eval":g=k(p[1]);p[2]&&(g=a+"("+g+")");c("$s += "+g+";");break;case "text":c("$s += "+v(p[1])+";");break;case "inc":break;default:throw Error("unknown stmt: "+p[0]);}}}function d(a,d){var e=k(a);d&&!d(a[0])&&(e="("+e+")");return e}function k(a){switch(a[0]){case "id":return a[1];case "lit":return"string"==typeof a[1]?v(a[1]):String(a[1]);case ".":return d(a[1],z)+"."+a[2];case "[]":return d(a[1],z)+"["+k(a[2])+"]";case "!":return"!"+d(a[1],x);case "u-":return"- "+
d(a[1],x);case "*":case "/":case "%":return d(a[1],A)+a[0]+d(a[2],x);case "+":case "-":return d(a[1],B)+a[0]+" "+d(a[2],A);case "<":case ">":case "<=":case ">=":return d(a[1],C)+a[0]+d(a[2],B);case "eq":case "ne":return d(a[1],D)+("eq"==a[0]?"===":"!==")+d(a[2],C);case "&&":return d(a[1],E)+"&&"+d(a[2],D);case "||":return d(a[1],I)+"||"+d(a[2],E);default:throw Error("unknown expr: "+a[0]);}}var f="\t",w=0,t="";e(b[1]);return t}function F(b){return K(L(b))}function G(b,a){var c=F(b),e;a&&(e=a.htmlEncode);
var c=J(c,e||"$htmlEncode"),d="";e||(d+="var obj = { '<': '&lt;', '>': '&gt;', '&': '&amp;', '\"': '&quot;' };\n\tfunction $htmlEncode(s) {\n\t\treturn String(s).replace(/[<>&\"]/g, function(c) {\n\t\t\treturn obj[c];\n\t\t});\n\t}");d=d+"var $s = '';"+c;d+="return $s;";return Function("root",d)}h.prototype.toString=function(){return"("+this.row+","+this.col+")"};var L=function(){var b=[[/\s+/,function(){return null}],[/[A-Za-z_]\w*/,function(a){switch(a){case "true":case "false":return"boolean";
case "set":case "include":return a;default:if(-1!=" abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface let long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with yield ".indexOf(" "+a+" ")||"null"==a)throw Error("Reserved: "+a+" "+y(this.source,
this.index));return"realId"}}],[/"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'/,function(a){return"string"}],[/\d+(?:\.\d+)?(?:e-?\d+)?/,function(a){return"number"}],[function(a){a.sort().reverse();for(var b=0;b<a.length;++b)a[b]=a[b].replace(/[()*+?.[\]|]/g,"\\$&");return RegExp(a.join("|"))}("! % && ( ) * + - . / < <= = > >= [ ] || === !==".split(" ")),function(a){switch(a){case "===":return"eq";case "!==":return"ne";default:return a}}]];return H({"":[[/(?:(?!{{)[\s\S])+/,function(a){return"{{"==
a.substring(0,2)?(this.pushState(a),a):"text"}],[/{{{/,function(a){this.pushState(a);return a}],[/{{(?:\/if|else|\/each|\/raw)}}/,function(a){return a}],[/{{#raw}}/,function(a){this.pushState("raw");return a}],[/{{(?:#(?:if|each)(?=\s))?/,function(a){this.pushState("{{");return a}]],raw:[[/(?:(?!{{\/raw}})[\s\S])+/,function(a){this.popState();return"rawtext"}]],"{{":b.concat([[/}}/,function(a){this.popState();return a}]]),"{{{":b.concat([[/}}}/,function(a){this.popState();return a}]])})}(),K=function(){return function(b){function a(a,
e){return f[a][e]}for(var c=b.nStart,e=b.tSymbols,d={},k=0;k<e.length;++k)d[e[k]]=k;var f=b.tAction,w=b.tGoto,t=b.tRules,n=b.tFuncs,h=b.actionIndex;h&&(a=function(a,e){var d=f[h[a]];return d[e]||d._});return function(b,k){function f(a){throw Error("Syntax error: "+b.getPos(h.index)+(a?"\n"+a:""));}var l=0,q=[0],h=b.scan(),r=[],v={get:function(a){return r[r.length+a]},set:function(a,e){r[r.length+a]=e}};if(k)for(var m in k)v[m]=k[m];for(;;)if(m=a(l,d[h.tag]))if(0<m)q.push(l=m),r.push(h),h=b.scan();
else if(0>m&&-32768<m){m=-m;var l=t[m],s=l.length-1;q.length-=s;l=w[q[q.length-1]][l[0]-c];q.push(l);n[m]?(m=n[m].apply(v,r.splice(r.length-s,s)),r.push(m)):1!=s&&r.splice(r.length-s,s,null)}else return h.tag!=e[0]&&f(),r[0];else{m=[];for(s=0;s<c;++s)a(l,s)&&m.push(e[s]);f("find "+h.tag+"\nexpect "+m.join(" "))}}}({nStart:40,tSymbols:"$ ! % && ( ) * + - . / < <= = > >= [ ] boolean eq include ne number rawtext realId set string text {{ {{#each {{#if {{#raw}} {{/each}} {{/if}} {{/raw}} {{else}} {{{ || }} }}} AdditiveExpression EqualityExpression LogicalAndExpression LogicalOrExpression MemberExpression MultiplicativeExpression PrimaryExpression RelationalExpression UnaryExpression _text epsilon expr id program statement statements texts".split(" "),
tAction:[{_:-2},{_:-32768},{27:3,28:4,29:5,30:6,31:7,36:8,_:-1},{_:-15},{1:12,4:13,8:14,18:15,20:16,22:17,24:18,25:19,26:20,_:0},{1:12,4:13,8:14,18:15,20:32,22:17,24:18,25:33,26:20,_:0},{23:36,_:0},{_:-13},{_:-3},{27:3,31:7,_:-11},{_:-22},{26:42,_:-19},{_:-21},{_:-17},{20:32,24:18,25:33,_:-18},{_:-20},{7:44,8:45,_:-38},{19:46,21:47,_:-46},{3:48,_:-48},{37:49,_:-50},{9:50,16:51,_:-28},{2:52,6:53,10:54,_:-35},{_:-25},{11:55,12:56,14:57,15:58,_:-43},{_:-31},{38:59,_:0},{_:-23},{_:-19},{_:-18},{26:60,
_:0},{38:61,_:0},{34:62,_:0},{39:63,_:0},{_:-14},{_:-29},{5:64,_:0},{_:-30},{38:65,_:0},{13:66,_:0},{20:32,24:18,25:33,_:0},{_:-9},{26:82,_:-51},{_:-16},{_:-10},{_:-24},{_:-12},{2:52,6:53,10:54,_:-36},{2:52,6:53,10:54,_:-37},{11:55,12:56,14:57,15:58,_:-44},{11:55,12:56,14:57,15:58,_:-45},{19:46,21:47,_:-47},{3:48,_:-49},{_:-26},{17:86,_:0},{_:-34},{_:-32},{_:-33},{7:44,8:45,_:-39},{7:44,8:45,_:-41},{7:44,8:45,_:-40},{7:44,8:45,_:-42},{38:87,_:0},{38:88,_:0},{27:3,28:4,29:5,30:6,31:7,33:89,35:90,36:8,
_:0},{38:91,_:0},{_:-27},{_:-4},{_:-8},{27:3,28:4,29:5,30:6,31:7,32:95,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,32:96,36:8,_:0},{27:3,28:4,29:5,30:6,31:7,33:97,36:8,_:0},{_:-7},{_:-6},{_:-5}],actionIndex:[0,1,2,3,4,5,5,6,5,7,8,9,5,5,5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,5,5,5,5,5,5,39,5,5,5,5,5,5,5,5,40,41,0,42,43,44,45,5,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,0,0,66,0,67,68,69,70,71,72,73],tGoto:[{13:1,15:2},,{9:9,14:10,16:11},,{0:21,
1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:30,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:34,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:35,12:31},,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:37,12:31},,,{9:38},{4:25,6:27,8:39,12:31},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:40,12:31},{4:25,6:27,8:41,12:31},,,,,{12:43},,,,,,,,,,,,,,,,,,,,,,,,,{4:25,5:67,6:27,8:29,12:31},{4:25,5:68,6:27,8:29,12:31},{0:21,4:25,5:26,6:27,7:69,8:29,12:31},{0:21,4:25,5:26,6:27,7:70,
8:29,12:31},{0:21,1:71,4:25,5:26,6:27,7:28,8:29,12:31},{0:21,1:22,2:72,4:25,5:26,6:27,7:28,8:29,12:31},{12:73},{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:74,12:31},{4:25,6:27,8:75,12:31},{4:25,6:27,8:76,12:31},{4:25,6:27,8:77,12:31},{0:78,4:25,5:26,6:27,8:29,12:31},{0:79,4:25,5:26,6:27,8:29,12:31},{0:80,4:25,5:26,6:27,8:29,12:31},{0:81,4:25,5:26,6:27,8:29,12:31},,{10:83},{15:84},,,,,{0:21,1:22,2:23,3:24,4:25,5:26,6:27,7:28,8:29,11:85,12:31},,,,,,,,,,,,,,,,,,{9:9,14:10,16:11},,,{15:92},{15:93},
,{15:94},,{9:9,14:10,16:11},{9:9,14:10,16:11},{9:9,14:10,16:11}],tRules:[[57,53],[53,55],[55],[55,55,54],[54,30,51,38,55,33],[54,30,51,38,55,35,55,33],[54,29,51,26,50,38,55,32],[54,29,51,26,26,38,55,32],[54,28,25,52,13,51,38],[54,28,51,38],[54,36,51,39],[54,56],[54,28,20,26,38],[56,49],[56,56,49],[49,27],[49,31,23,34],[52,24],[52,25],[52,20],[46,26],[46,22],[46,18],[46,52],[46,4,51,5],[44,46],[44,44,9,52],[44,44,16,51,17],[48,44],[48,1,48],[48,8,48],[45,48],[45,45,6,48],[45,45,10,48],[45,45,2,48],
[40,45],[40,40,7,45],[40,40,8,45],[47,40],[47,47,11,40],[47,47,14,40],[47,47,12,40],[47,47,15,40],[41,47],[41,41,19,47],[41,41,21,47],[42,41],[42,42,3,41],[43,42],[43,43,37,42],[51,43],[50]],tFuncs:function(){function b(a,b,c,f,h,t,n){return["each",b,t,f&&eval(f.text),eval(c.text)]}function a(a){return["lit",eval(a.text)]}function c(a,b,c){return[b.text,a,c]}return[,function(a){return["prog",a]},function(){return[]},function(a,b){a.push(b);return a},function(a,b,c,f,h){return["if",b,f]},function(a,
b,c,f,h,t,n){return["if",b,f,t]},b,b,function(a,b,c,f,h,t){return["set",c.text,h]},function(a,b,c){return["eval",b,!0]},function(a,b,c){return["eval",b,!1]},function(a){return["text",a]},function(a,b,c,f){return["inc",eval(c.text)]},function(a){return a},function(a,b){return a+b},function(a){return a.text},function(a,b,c){return b.text},,,,a,a,function(a){return["lit","true"==a.text]},function(a){return["id",a.text]},function(a,b,c){return b},,function(a,b,c){return[".",a,c.text]},function(a,b,c,
f){return["[]",a,c]},,function(a,b){return["!",b]},function(a,b){return["u-",b]},,c,c,c,,c,c,,c,c,c,c,,function(a,b,c){return["eq",a,c]},function(a,b,c){return["ne",a,c]},,c,,c]}()})}();return{parse:F,compile:G,render:function(b,a){return G(b)(a)},version:"1.2.7"}}();"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=h:"function"==typeof define&&(define.amd||define.cmd)?define(function(){return h}):"undefined"!=typeof KISSY&&KISSY.add(function(){return h});v&&(v.Crox=
h)})(this);

@@ -1,11 +0,9 @@

/*!
* Crox v1.2.6
/**
* @preserve Crox v1.2.7
* https://github.com/thx/crox
*
* Released under the MIT license
* md5: 7b8f2d37387983b4428d2ebf65417353
*/
(function(root) {
var Crox = (function() {
(function(root) {var Crox = (function() {
function Class(base, constructor, methods) {

@@ -481,2 +479,3 @@ /// <param name="base" type="Function"></param>

}
var i_each = 0;
function stmtGen(a) {

@@ -499,10 +498,13 @@ switch (a[0]) {

case 'each':
++i_each;
var k = a[3] || '$i';
emit('var $list = ' + exprGen(a[1]) + ';');
emit('for(var ' + k + ' in $list) {');
var listName = '$list' + (i_each == 1 ? '' : i_each);
emit('var ' + listName + ' = ' + exprGen(a[1]) + ';');
emit('for(var ' + k + ' in ' + listName + ') {');
indent();
emit('var ' + a[4] + ' = $list[' + k + '];');
emit('var ' + a[4] + ' = ' + listName + '[' + k + '];');
stmtsGen(a[2]);
outdent();
emit('}');
--i_each;
break;

@@ -626,21 +628,2 @@ case 'set':

Crox.version = '1.2.6';
return Crox;
})();
if (typeof module == "object" && module && typeof module.exports == "object") {
module.exports = Crox;
} else if (typeof define == "function" && (define.amd || define.cmd)) {
define(function() {
return Crox;
});
} else if (typeof KISSY != "undefined") {
KISSY.add(function(){
return Crox;
});
}
if (root) {
root.Crox = Crox;
}
})(this);
Crox.version = "1.2.7";return Crox;})();if ( typeof module == "object" && module && typeof module.exports == "object" ) module.exports = Crox;else if (typeof define == "function" && (define.amd || define.cmd) ) define(function () { return Crox; } );else if (typeof KISSY != "undefined") KISSY.add(function(){ return Crox; });if (root) root.Crox = Crox; })(this);
{
"name": "crox",
"version": "1.2.6",
"version": "1.2.7",
"description": "Crox is a high performance cross-language template engine, written by the JavaScript.",

@@ -5,0 +5,0 @@ "homepage": "http://thx.github.io/crox/",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc