diff --git a/ajax/libs/emblem/0.0.1-dev/emblem.js b/ajax/libs/emblem/0.0.1-dev/emblem.js new file mode 100644 index 000000000..7aa128dde --- /dev/null +++ b/ajax/libs/emblem/0.0.1-dev/emblem.js @@ -0,0 +1,7479 @@ + +this.StringScanner = (function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + //module.exports = StringScanner; + return StringScanner; +}).call(this); + + + + +// lib/handlebars/base.js + +/*jshint eqnull:true*/ +this.Handlebars = {}; + +(function(Handlebars) { + +Handlebars.VERSION = "1.0.rc.2"; + +Handlebars.helpers = {}; +Handlebars.partials = {}; + +Handlebars.registerHelper = function(name, fn, inverse) { + if(inverse) { fn.not = inverse; } + this.helpers[name] = fn; +}; + +Handlebars.registerPartial = function(name, str) { + this.partials[name] = str; +}; + +Handlebars.registerHelper('helperMissing', function(arg) { + if(arguments.length === 2) { + return undefined; + } else { + throw new Error("Could not find property '" + arg + "'"); + } +}); + +var toString = Object.prototype.toString, functionType = "[object Function]"; + +Handlebars.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse || function() {}, fn = options.fn; + + + var ret = ""; + var type = toString.call(context); + + if(type === functionType) { context = context.call(this); } + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if(type === "[object Array]") { + if(context.length > 0) { + return Handlebars.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + return fn(context); + } +}); + +Handlebars.K = function() {}; + +Handlebars.createFrame = Object.create || function(object) { + Handlebars.K.prototype = object; + var obj = new Handlebars.K(); + Handlebars.K.prototype = null; + return obj; +}; + +Handlebars.logger = { + DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3, + + methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'}, + + // can be overridden in the host environment + log: function(level, obj) { + if (Handlebars.logger.level <= level) { + var method = Handlebars.logger.methodMap[level]; + if (typeof console !== 'undefined' && console[method]) { + console[method].call(console, obj); + } + } + } +}; + +Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); }; + +Handlebars.registerHelper('each', function(context, options) { + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + if (options.data) { + data = Handlebars.createFrame(options.data); + } + + if(context && typeof context === 'object') { + if(context instanceof Array){ + for(var j = context.length; i 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +} +}; +/* Jison generated lexer */ +var lexer = (function(){ +var lexer = ({EOF:1, +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, +setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; + + this._input = this._input.slice(1); + return ch; + }, +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); + + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; + + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, +more:function () { + this._more = true; + return this; + }, +less:function (n) { + this.unput(this.match.slice(n)); + }, +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; + + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; + } + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, +lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, +begin:function begin(condition) { + this.conditionStack.push(condition); + }, +popState:function popState() { + return this.conditionStack.pop(); + }, +_currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, +topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, +pushState:function begin(condition) { + this.begin(condition); + }}); +lexer.options = {}; +lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + +var YYSTATE=YY_START +switch($avoiding_name_collisions) { +case 0: + if(yy_.yytext.slice(-1) !== "\\") this.begin("mu"); + if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu"); + if(yy_.yytext) return 14; + +break; +case 1: return 14; +break; +case 2: + if(yy_.yytext.slice(-1) !== "\\") this.popState(); + if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1); + return 14; + +break; +case 3: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15; +break; +case 4: this.begin("par"); return 24; +break; +case 5: return 16; +break; +case 6: return 20; +break; +case 7: return 19; +break; +case 8: return 19; +break; +case 9: return 23; +break; +case 10: return 23; +break; +case 11: this.popState(); this.begin('com'); +break; +case 12: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; +break; +case 13: return 22; +break; +case 14: return 36; +break; +case 15: return 35; +break; +case 16: return 35; +break; +case 17: return 39; +break; +case 18: /*ignore whitespace*/ +break; +case 19: this.popState(); return 18; +break; +case 20: this.popState(); return 18; +break; +case 21: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30; +break; +case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30; +break; +case 23: yy_.yytext = yy_.yytext.substr(1); return 28; +break; +case 24: return 32; +break; +case 25: return 32; +break; +case 26: return 31; +break; +case 27: return 35; +break; +case 28: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35; +break; +case 29: return 'INVALID'; +break; +case 30: /*ignore whitespace*/ +break; +case 31: this.popState(); return 37; +break; +case 32: return 5; +break; +} +}; +lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-/]+)/,/^(?:$)/]; +lexer.conditions = {"mu":{"rules":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[3],"inclusive":false},"par":{"rules":[30,31],"inclusive":false},"INITIAL":{"rules":[0,1,32],"inclusive":true}}; +return lexer;})() +parser.lexer = lexer; +function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})();; +// lib/handlebars/compiler/base.js +Handlebars.Parser = handlebars; + +Handlebars.parse = function(string) { + Handlebars.Parser.yy = Handlebars.AST; + return Handlebars.Parser.parse(string); +}; + +Handlebars.print = function(ast) { + return new Handlebars.PrintVisitor().accept(ast); +};; +// lib/handlebars/compiler/ast.js +(function() { + + Handlebars.AST = {}; + + Handlebars.AST.ProgramNode = function(statements, inverse) { + this.type = "program"; + this.statements = statements; + if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); } + }; + + Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) { + this.type = "mustache"; + this.escaped = !unescaped; + this.hash = hash; + + var id = this.id = rawParams[0]; + var params = this.params = rawParams.slice(1); + + // a mustache is an eligible helper if: + // * its id is simple (a single part, not `this` or `..`) + var eligibleHelper = this.eligibleHelper = id.isSimple; + + // a mustache is definitely a helper if: + // * it is an eligible helper, and + // * it has at least one parameter or hash segment + this.isHelper = eligibleHelper && (params.length || hash); + + // if a mustache is an eligible helper but not a definite + // helper, it is ambiguous, and will be resolved in a later + // pass or at runtime. + }; + + Handlebars.AST.PartialNode = function(partialName, context) { + this.type = "partial"; + this.partialName = partialName; + this.context = context; + }; + + var verifyMatch = function(open, close) { + if(open.original !== close.original) { + throw new Handlebars.Exception(open.original + " doesn't match " + close.original); + } + }; + + Handlebars.AST.BlockNode = function(mustache, program, inverse, close) { + verifyMatch(mustache.id, close); + this.type = "block"; + this.mustache = mustache; + this.program = program; + this.inverse = inverse; + + if (this.inverse && !this.program) { + this.isInverse = true; + } + }; + + Handlebars.AST.ContentNode = function(string) { + this.type = "content"; + this.string = string; + }; + + Handlebars.AST.HashNode = function(pairs) { + this.type = "hash"; + this.pairs = pairs; + }; + + Handlebars.AST.IdNode = function(parts) { + this.type = "ID"; + this.original = parts.join("."); + + var dig = [], depth = 0; + + for(var i=0,l=parts.length; i": ">", + '"': """, + "'": "'", + "`": "`" + }; + + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + var escapeChar = function(chr) { + return escape[chr] || "&"; + }; + + Handlebars.Utils = { + escapeExpression: function(string) { + // don't escape SafeStrings, since they're already safe + if (string instanceof Handlebars.SafeString) { + return string.toString(); + } else if (string == null || string === false) { + return ""; + } + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); + }, + + isEmpty: function(value) { + if (!value && value !== 0) { + return true; + } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) { + return true; + } else { + return false; + } + } + }; +})();; +// lib/handlebars/compiler/compiler.js + +/*jshint eqnull:true*/ +Handlebars.Compiler = function() {}; +Handlebars.JavaScriptCompiler = function() {}; + +(function(Compiler, JavaScriptCompiler) { + // the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. + + Compiler.prototype = { + compiler: Compiler, + + disassemble: function() { + var opcodes = this.opcodes, opcode, out = [], params, param; + + for (var i=0, l=opcodes.length; i 0) { + this.source[1] = this.source[1] + ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + if (!this.isChild) { + var aliases = []; + for (var alias in this.context.aliases) { + this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias]; + } + } + + if (this.source[1]) { + this.source[1] = "var " + this.source[1].substring(2) + ";"; + } + + // Merge children + if (!this.isChild) { + this.source[1] += '\n' + this.context.programs.join('\n') + '\n'; + } + + if (!this.environment.isSimple) { + this.source.push("return buffer;"); + } + + var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"]; + + for(var i=0, l=this.environment.depths.list.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return "stack" + this.stackSlot; + }, + + popStack: function() { + var item = this.compileStack.pop(); + + if (item instanceof Literal) { + return item.value; + } else { + this.stackSlot--; + return item; + } + }, + + topStack: function() { + var item = this.compileStack[this.compileStack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + '"'; + }, + + setupHelper: function(paramSize, name) { + var params = []; + this.setupParams(paramSize, params); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + name: foundHelper, + callParams: ["depth0"].concat(params).join(", "), + helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ") + }; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(paramSize, params) { + var options = [], contexts = [], types = [], param, inverse, program; + + options.push("hash:" + this.popStack()); + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + this.context.aliases.self = "this"; + program = "self.noop"; + } + + if (!inverse) { + this.context.aliases.self = "this"; + inverse = "self.noop"; + } + + options.push("inverse:" + inverse); + options.push("fn:" + program); + } + + for(var i=0; i 1 ? arguments[1] : {}, + startRule; + + if (options.startRule !== undefined) { + startRule = options.startRule; + + if (parseFunctions[startRule] === undefined) { + throw new Error("Can't start parsing from rule " + quote(startRule) + "."); + } + } else { + startRule = "content"; + } + + var pos = 0; + var reportedPos = 0; + var cachedReportedPos = 0; + var cachedReportedPosDetails = { line: 1, column: 1, seenCR: false }; + var reportFailures = 0; + var rightmostFailuresPos = 0; + var rightmostFailuresExpected = []; + + function padLeft(input, padding, length) { + var result = input; + + var padLength = length - input.length; + for (var i = 0; i < padLength; i++) { + result = padding + result; + } + + return result; + } + + function escape(ch) { + var charCode = ch.charCodeAt(0); + var escapeChar; + var length; + + if (charCode <= 0xFF) { + escapeChar = 'x'; + length = 2; + } else { + escapeChar = 'u'; + length = 4; + } + + return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length); + } + + function computeReportedPosDetails() { + function advanceCachedReportedPos() { + var ch; + + for (; cachedReportedPos < reportedPos; cachedReportedPos++) { + ch = input.charAt(cachedReportedPos); + if (ch === "\n") { + if (!cachedReportedPosDetails.seenCR) { cachedReportedPosDetails.line++; } + cachedReportedPosDetails.column = 1; + cachedReportedPosDetails.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + cachedReportedPosDetails.line++; + cachedReportedPosDetails.column = 1; + cachedReportedPosDetails.seenCR = true; + } else { + cachedReportedPosDetails.column++; + cachedReportedPosDetails.seenCR = false; + } + } + } + + if (cachedReportedPos !== reportedPos) { + if (cachedReportedPos > reportedPos) { + cachedReportedPos = 0; + cachedReportedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advanceCachedReportedPos(); + } + + return cachedReportedPosDetails; + } + + function text() { + return input.substring(reportedPos, pos); + } + + function offset() { + return reportedPos; + } + + function line() { + return computeReportedPosDetails().line; + } + + function column() { + return computeReportedPosDetails().column; + } + + function matchFailed(failure) { + if (pos < rightmostFailuresPos) { + return; + } + + if (pos > rightmostFailuresPos) { + rightmostFailuresPos = pos; + rightmostFailuresExpected = []; + } + + rightmostFailuresExpected.push(failure); + } + + function parse_content() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + r2 = parse_statement(); + while (r2 !== null) { + r0.push(r2); + r2 = parse_statement(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_invertibleContent() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + + r1 = pos; + r2 = pos; + r3 = parse_content(); + if (r3 !== null) { + r5 = pos; + r6 = pos; + r7 = parse_DEDENT(); + if (r7 !== null) { + if (input.substr(pos, 4) === "else") { + r8 = "else"; + pos += 4; + } else { + r8 = null; + if (reportFailures === 0) { + matchFailed("\"else\""); + } + } + if (r8 !== null) { + r9 = parse__(); + if (r9 !== null) { + r10 = parse_TERM(); + if (r10 !== null) { + r11 = parse_INDENT(); + if (r11 !== null) { + r12 = parse_content(); + if (r12 !== null) { + r4 = [r7, r8, r9, r10, r11, r12]; + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + if (r4 !== null) { + reportedPos = r5; + r4 = (function(c) {return c;})(r12); + } + if (r4 === null) { + pos = r5; + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(c, i) { + return new Handlebars.AST.ProgramNode(c, i || []); + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_statement() { + var r0; + + r0 = parse_comment(); + if (r0 === null) { + r0 = parse_htmlElement(); + if (r0 === null) { + r0 = parse_textLine(); + if (r0 === null) { + r0 = parse_mustache(); + } + } + } + return r0; + } + + function parse_htmlElement() { + var r0; + + r0 = parse_htmlElementMaybeBlock(); + if (r0 === null) { + r0 = parse_htmlElementWithInlineContent(); + } + return r0; + } + + function parse_mustache() { + var r0, r1; + + r1 = pos; + r0 = parse_explicitMustache(); + if (r0 === null) { + r0 = parse_lineStartingMustache(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { + return [m]; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_comment() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 47) { + r3 = "/"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"/\""); + } + } + if (r3 !== null) { + r4 = parse_lineContent(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r11 = pos; + r12 = parse_lineContent(); + if (r12 !== null) { + r13 = parse_TERM(); + if (r13 !== null) { + r10 = [r12, r13]; + } else { + r10 = null; + pos = r11; + } + } else { + r10 = null; + pos = r11; + } + if (r10 !== null) { + r9 = []; + while (r10 !== null) { + r9.push(r10); + r11 = pos; + r12 = parse_lineContent(); + if (r12 !== null) { + r13 = parse_TERM(); + if (r13 !== null) { + r10 = [r12, r13]; + } else { + r10 = null; + pos = r11; + } + } else { + r10 = null; + pos = r11; + } + } + } else { + r9 = null; + } + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return []; })(); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_lineStartingMustache() { + var r0; + + r0 = parse_capitalizedLineStarterMustache(); + if (r0 === null) { + r0 = parse_mustacheMaybeBlock(); + } + return r0; + } + + function parse_capitalizedLineStarterMustache() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r4 = pos; + reportFailures++; + if (/^[A-Z]/.test(input.charAt(pos))) { + r3 = input.charAt(pos); + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("[A-Z]"); + } + } + reportFailures--; + if (r3 !== null) { + r3 = ""; + pos = r4; + } else { + r3 = null; + } + if (r3 !== null) { + r4 = parse_mustacheMaybeBlock(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + // ret is the MustacheNode + return unshiftParam(ret, defaultCapitalizedHelper); + } + })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_htmlElementMaybeBlock() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10; + + r1 = pos; + r2 = pos; + r3 = parse_htmlTagAndOptionalAttributes(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r9 = parse_content(); + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[1]); + } + ret.push(h[1]); + + return ret; + })(r3, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_htmlElementWithInlineContent() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_htmlTagAndOptionalAttributes(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + if (r4 !== null) { + r5 = parse_htmlInlineContent(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + ret.push(h[1]); + + return ret; + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_mustacheMaybeBlock() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10; + + r1 = pos; + r2 = pos; + r3 = parse_inMustache(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r9 = parse_invertibleContent(); + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[1]; + return new Handlebars.AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + })(r3, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_explicitMustache() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse_equalSign(); + if (r3 !== null) { + r4 = parse_mustacheMaybeBlock(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inMustache() { + var r0, r1, r2, r3, r4, r5, r6; + + r1 = pos; + r2 = pos; + r3 = parse_pathIdNode(); + if (r3 !== null) { + r4 = parse_trailingModifier(); + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r5 = []; + r6 = parse_inMustacheParam(); + while (r6 !== null) { + r5.push(r6); + r6 = parse_inMustacheParam(); + } + if (r5 !== null) { + r6 = parse_hash(); + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(path, tm, params, hash) { + params.unshift(path); + + var mustacheNode = new Handlebars.AST.MustacheNode(params, hash); + + if(tm == '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm == '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm == '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + })(r3, r4, r5, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_modifiedParam() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse_param(); + if (r3 !== null) { + r4 = parse_trailingModifier(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p, m) { + var ret = new String(p); + ret.trailingModifier = m; + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inMustacheParam() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse__(); + if (r3 !== null) { + r4 = parse_param(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_trailingModifier() { + var r0; + + if (/^[!?*\^]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[!?*\\^]"); + } + } + return r0; + } + + function parse_hash() { + var r0, r1, r2; + + r1 = pos; + r2 = parse_hashSegment(); + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + r2 = parse_hashSegment(); + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { return new Handlebars.AST.HashNode(h); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_pathIdent() { + var r0, r1, r2, r3, r4, r5; + + if (input.substr(pos, 2) === "..") { + r0 = ".."; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"..\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 46) { + r0 = "."; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\".\""); + } + } + if (r0 === null) { + r1 = pos; + r2 = pos; + if (/^[a-zA-Z0-9_$\-]/.test(input.charAt(pos))) { + r4 = input.charAt(pos); + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("[a-zA-Z0-9_$\\-]"); + } + } + if (r4 !== null) { + r3 = []; + while (r4 !== null) { + r3.push(r4); + if (/^[a-zA-Z0-9_$\-]/.test(input.charAt(pos))) { + r4 = input.charAt(pos); + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("[a-zA-Z0-9_$\\-]"); + } + } + } + } else { + r3 = null; + } + if (r3 !== null) { + r5 = pos; + reportFailures++; + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + reportFailures--; + if (r4 === null) { + r4 = ""; + } else { + r4 = null; + pos = r5; + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r3); + } + if (r0 === null) { + pos = r1; + } + } + } + return r0; + } + + function parse_hashSegment() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = parse__(); + if (r3 !== null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_pathIdNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_stringNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_integerNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_booleanNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { return [h[0], h[2]]; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_param() { + var r0; + + r0 = parse_pathIdNode(); + if (r0 === null) { + r0 = parse_stringNode(); + if (r0 === null) { + r0 = parse_integerNode(); + if (r0 === null) { + r0 = parse_booleanNode(); + } + } + } + return r0; + } + + function parse_path() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9; + + r1 = pos; + r2 = pos; + r3 = parse_pathIdent(); + if (r3 !== null) { + r4 = []; + r6 = pos; + r7 = pos; + r8 = parse_seperator(); + if (r8 !== null) { + r9 = parse_pathIdent(); + if (r9 !== null) { + r5 = [r8, r9]; + } else { + r5 = null; + pos = r7; + } + } else { + r5 = null; + pos = r7; + } + if (r5 !== null) { + reportedPos = r6; + r5 = (function(p) { return p; })(r9); + } + if (r5 === null) { + pos = r6; + } + while (r5 !== null) { + r4.push(r5); + r6 = pos; + r7 = pos; + r8 = parse_seperator(); + if (r8 !== null) { + r9 = parse_pathIdent(); + if (r9 !== null) { + r5 = [r8, r9]; + } else { + r5 = null; + pos = r7; + } + } else { + r5 = null; + pos = r7; + } + if (r5 !== null) { + reportedPos = r6; + r5 = (function(p) { return p; })(r9); + } + if (r5 === null) { + pos = r6; + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_seperator() { + var r0; + + if (/^[\/.]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[\\/.]"); + } + } + return r0; + } + + function parse_pathIdNode() { + var r0, r1; + + r1 = pos; + r0 = parse_path(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.IdNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_stringNode() { + var r0, r1; + + r1 = pos; + r0 = parse_string(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.StringNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_integerNode() { + var r0, r1; + + r1 = pos; + r0 = parse_integer(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.IntegerNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_booleanNode() { + var r0, r1; + + r1 = pos; + r0 = parse_boolean(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.BooleanNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boolean() { + var r0; + + if (input.substr(pos, 4) === "true") { + r0 = "true"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"true\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "false") { + r0 = "false"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"false\""); + } + } + } + return r0; + } + + function parse_integer() { + var r0, r1, r2; + + r1 = pos; + if (/^[0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return parseInt(s.join('')); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_string() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 34) { + r3 = "\""; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r3 !== null) { + r4 = parse_hashDoubleQuoteStringValue(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 34) { + r5 = "\""; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 === null) { + r2 = pos; + if (input.charCodeAt(pos) === 39) { + r3 = "'"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r3 !== null) { + r4 = parse_hashSingleQuoteStringValue(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 39) { + r5 = "'"; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p[1]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_hashDoubleQuoteStringValue() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^"}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\"}]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^"}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\"}]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_hashSingleQuoteStringValue() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^'}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^'}]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^'}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^'}]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_alpha() { + var r0; + + if (/^[A-Za-z]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z]"); + } + } + return r0; + } + + function parse_htmlInlineContent() { + var r0, r1; + + r1 = pos; + r0 = parse_explicitMustache(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { return [m]; })(r0); + } + if (r0 === null) { + pos = r1; + } + if (r0 === null) { + r0 = parse_textNodes(); + } + return r0; + } + + function parse_textLine() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 124) { + r3 = "|"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"|\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r5 = parse_textNodes(); + if (r5 !== null) { + r6 = []; + r8 = pos; + r9 = pos; + r10 = parse_INDENT(); + if (r10 !== null) { + r11 = parse_textNodes(); + if (r11 !== null) { + r12 = parse_DEDENT(); + if (r12 !== null) { + r7 = [r10, r11, r12]; + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + if (r7 !== null) { + reportedPos = r8; + r7 = (function(t) { return t; })(r11); + } + if (r7 === null) { + pos = r8; + } + while (r7 !== null) { + r6.push(r7); + r8 = pos; + r9 = pos; + r10 = parse_INDENT(); + if (r10 !== null) { + r11 = parse_textNodes(); + if (r11 !== null) { + r12 = parse_DEDENT(); + if (r12 !== null) { + r7 = [r10, r11, r12]; + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + if (r7 !== null) { + reportedPos = r8; + r7 = (function(t) { return t; })(r11); + } + if (r7 === null) { + pos = r8; + } + } + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(nodes, indentedNodes) { + for(var i = 0; i < indentedNodes.length; ++i) { + nodes = nodes.concat(indentedNodes[i]); + } + return nodes; + })(r5, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_textNodes() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = parse_preMustacheText(); + r3 = r3 !== null ? r3 : ""; + if (r3 !== null) { + r4 = []; + r6 = pos; + r7 = parse_rawMustache(); + if (r7 !== null) { + r8 = parse_preMustacheText(); + r8 = r8 !== null ? r8 : ""; + if (r8 !== null) { + r5 = [r7, r8]; + } else { + r5 = null; + pos = r6; + } + } else { + r5 = null; + pos = r6; + } + while (r5 !== null) { + r4.push(r5); + r6 = pos; + r7 = parse_rawMustache(); + if (r7 !== null) { + r8 = parse_preMustacheText(); + r8 = r8 !== null ? r8 : ""; + if (r8 !== null) { + r5 = [r7, r8]; + } else { + r5 = null; + pos = r6; + } + } else { + r5 = null; + pos = r6; + } + } + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustache() { + var r0; + + r0 = parse_rawMustacheUnescaped(); + if (r0 === null) { + r0 = parse_rawMustacheEscaped(); + } + return r0; + } + + function parse_rawMustacheSingle() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_singleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_singleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = true; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustacheEscaped() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_doubleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_doubleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = true; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustacheUnescaped() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_tripleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_tripleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = false; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_preMustacheText() { + var r0, r1, r2; + + r1 = pos; + if (/^[^{\uEFFF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^{\\uEFFF]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[^{\uEFFF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^{\\uEFFF]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return new Handlebars.AST.ContentNode(a.join('')); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inTagMustache() { + var r0; + + r0 = parse_rawMustacheSingle(); + if (r0 === null) { + r0 = parse_rawMustacheUnescaped(); + if (r0 === null) { + r0 = parse_rawMustacheEscaped(); + } + } + return r0; + } + + function parse_singleOpen() { + var r0; + + if (input.charCodeAt(pos) === 123) { + r0 = "{"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{\""); + } + } + return r0; + } + + function parse_doubleOpen() { + var r0; + + if (input.substr(pos, 2) === "{{") { + r0 = "{{"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{{\""); + } + } + return r0; + } + + function parse_tripleOpen() { + var r0; + + if (input.substr(pos, 3) === "{{{") { + r0 = "{{{"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{{{\""); + } + } + return r0; + } + + function parse_singleClose() { + var r0; + + if (input.charCodeAt(pos) === 125) { + r0 = "}"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}\""); + } + } + return r0; + } + + function parse_doubleClose() { + var r0; + + if (input.substr(pos, 2) === "}}") { + r0 = "}}"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}}\""); + } + } + return r0; + } + + function parse_tripleClose() { + var r0; + + if (input.substr(pos, 3) === "}}}") { + r0 = "}}}"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}}}\""); + } + } + return r0; + } + + function parse_equalSign() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.substr(pos, 2) === "==") { + r3 = "=="; + pos += 2; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"==\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return false; })(); + } + if (r0 === null) { + pos = r1; + } + if (r0 === null) { + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 61) { + r3 = "="; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return true; })(); + } + if (r0 === null) { + pos = r1; + } + } + return r0; + } + + function parse_htmlTagAndOptionalAttributes() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = pos; + r4 = parse_htmlTagName(); + if (r4 !== null) { + r5 = parse_shorthandAttributes(); + r5 = r5 !== null ? r5 : ""; + if (r5 !== null) { + r6 = []; + r7 = parse_inTagMustache(); + while (r7 !== null) { + r6.push(r7); + r7 = parse_inTagMustache(); + } + if (r6 !== null) { + r7 = []; + r8 = parse_fullAttribute(); + while (r8 !== null) { + r7.push(r8); + r8 = parse_fullAttribute(); + } + if (r7 !== null) { + r0 = [r4, r5, r6, r7]; + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + if (r0 !== null) { + reportedPos = r2; + r0 = (function(h, s, m, f) { return [h, s, m, f]; })(r4, r5, r6, r7); + } + if (r0 === null) { + pos = r2; + } + if (r0 === null) { + r2 = pos; + r3 = pos; + r4 = parse_shorthandAttributes(); + if (r4 !== null) { + r5 = []; + r6 = parse_inTagMustache(); + while (r6 !== null) { + r5.push(r6); + r6 = parse_inTagMustache(); + } + if (r5 !== null) { + r6 = []; + r7 = parse_fullAttribute(); + while (r7 !== null) { + r6.push(r7); + r7 = parse_fullAttribute(); + } + if (r6 !== null) { + r0 = [r4, r5, r6]; + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + if (r0 !== null) { + reportedPos = r2; + r0 = (function(s, m, f) { return [null, s, m, f] })(r4, r5, r6); + } + if (r0 === null) { + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new Handlebars.AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + tagOpenContent.push(new Handlebars.AST.ContentNode('>')); + + return [tagOpenContent, new Handlebars.AST.ContentNode('')]; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_shorthandAttributes() { + var r0; + + r0 = parse_attributesAtLeastID(); + if (r0 === null) { + r0 = parse_attributesAtLeastClass(); + } + return r0; + } + + function parse_attributesAtLeastID() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_idShorthand(); + if (r3 !== null) { + r4 = []; + r5 = parse_classShorthand(); + while (r5 !== null) { + r4.push(r5); + r5 = parse_classShorthand(); + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(id, classes) { return [id, classes]; })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributesAtLeastClass() { + var r0, r1, r2; + + r1 = pos; + r2 = parse_classShorthand(); + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + r2 = parse_classShorthand(); + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(classes) { return [null, classes]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_fullAttribute() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + if (r4 !== null) { + r3 = []; + while (r4 !== null) { + r3.push(r4); + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + } + } else { + r3 = null; + } + if (r3 !== null) { + r4 = parse_actionAttribute(); + if (r4 === null) { + r4 = parse_boundAttribute(); + if (r4 === null) { + r4 = parse_normalAttribute(); + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { + return [new Handlebars.AST.ContentNode(' '), a]; + })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boundAttributeValueText() { + var r0, r1, r2; + + r1 = pos; + if (/^[A-Za-z.:0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z.:0-9]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[A-Za-z.:0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z.:0-9]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_actionValue() { + var r0, r1; + + r0 = parse_quotedActionValue(); + if (r0 === null) { + r1 = pos; + r0 = parse_pathIdNode(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(id) { return new Handlebars.AST.MustacheNode([id]); })(r0); + } + if (r0 === null) { + pos = r1; + } + } + return r0; + } + + function parse_quotedActionValue() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 34) { + r3 = "\""; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r3 !== null) { + r4 = parse_inMustache(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 34) { + r5 = "\""; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 === null) { + r2 = pos; + if (input.charCodeAt(pos) === 39) { + r3 = "'"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r3 !== null) { + r4 = parse_inMustache(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 39) { + r5 = "'"; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p[1]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_actionAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_knownEvent(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_actionValue(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return unshiftParam(mustacheNode, 'action', [['on', new Handlebars.AST.StringNode(event)]]); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boundAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_ident(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_boundAttributeValueText(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(key, value) { + var hashNode = new Handlebars.AST.HashNode([[key, new Handlebars.AST.StringNode(value)]]); + var params = [new Handlebars.AST.IdNode(['bindAttr'])]; + + return new Handlebars.AST.MustacheNode(params, hashNode); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_normalAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_ident(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_string(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(key, value) { + var s = key + '=' + '"' + value + '"'; + return new Handlebars.AST.ContentNode(s); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributeName() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + r2 = parse_attributeChar(); + while (r2 !== null) { + r0.push(r2); + r2 = parse_attributeChar(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return a.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributeValue() { + var r0; + + r0 = parse_string(); + if (r0 === null) { + r0 = parse_param(); + } + return r0; + } + + function parse_attributeChar() { + var r0; + + r0 = parse_alpha(); + if (r0 === null) { + if (/^[0-9]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 95) { + r0 = "_"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"_\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 45) { + r0 = "-"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"-\""); + } + } + } + } + } + return r0; + } + + function parse_idShorthand() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 35) { + r3 = "#"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"#\""); + } + } + if (r3 !== null) { + r4 = parse_ident(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(t) { return t;})(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_classShorthand() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 46) { + r3 = "."; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\".\""); + } + } + if (r3 !== null) { + r4 = parse_ident(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(c) { return c; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_ident() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_nmstart(); + if (r3 !== null) { + r4 = []; + r5 = parse_nmchar(); + while (r5 !== null) { + r4.push(r5); + r5 = parse_nmchar(); + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(nmstart, nmchars) { return nmstart + nmchars.join(""); })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_nmchar() { + var r0; + + if (/^[_a-zA-Z0-9\-]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[_a-zA-Z0-9\\-]"); + } + } + if (r0 === null) { + r0 = parse_nonascii(); + } + return r0; + } + + function parse_nmstart() { + var r0; + + if (/^[_a-zA-Z]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[_a-zA-Z]"); + } + } + if (r0 === null) { + r0 = parse_nonascii(); + } + return r0; + } + + function parse_nonascii() { + var r0; + + if (/^[\x80-\xFF]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[\\x80-\\xFF]"); + } + } + return r0; + } + + function parse_htmlTagName() { + var r0; + + reportFailures++; + if (input.substr(pos, 10) === "figcaption") { + r0 = "figcaption"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"figcaption\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "blockquote") { + r0 = "blockquote"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"blockquote\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "plaintext") { + r0 = "plaintext"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"plaintext\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "textarea") { + r0 = "textarea"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"textarea\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "progress") { + r0 = "progress"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"progress\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "optgroup") { + r0 = "optgroup"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"optgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "noscript") { + r0 = "noscript"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"noscript\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "noframes") { + r0 = "noframes"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"noframes\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "frameset") { + r0 = "frameset"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"frameset\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "fieldset") { + r0 = "fieldset"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"fieldset\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "datalist") { + r0 = "datalist"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"datalist\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "colgroup") { + r0 = "colgroup"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"colgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "basefont") { + r0 = "basefont"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"basefont\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "summary") { + r0 = "summary"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"summary\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "section") { + r0 = "section"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"section\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "marquee") { + r0 = "marquee"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"marquee\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "listing") { + r0 = "listing"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"listing\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "isindex") { + r0 = "isindex"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"isindex\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "details") { + r0 = "details"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"details\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "command") { + r0 = "command"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"command\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "caption") { + r0 = "caption"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"caption\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "bgsound") { + r0 = "bgsound"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bgsound\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "article") { + r0 = "article"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"article\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "address") { + r0 = "address"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"address\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "acronym") { + r0 = "acronym"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"acronym\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "strong") { + r0 = "strong"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"strong\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "strike") { + r0 = "strike"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"strike\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "spacer") { + r0 = "spacer"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"spacer\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "source") { + r0 = "source"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"source\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "select") { + r0 = "select"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"select\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "script") { + r0 = "script"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"script\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "output") { + r0 = "output"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"output\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "option") { + r0 = "option"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"option\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "object") { + r0 = "object"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"object\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "legend") { + r0 = "legend"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"legend\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "keygen") { + r0 = "keygen"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keygen\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "iframe") { + r0 = "iframe"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"iframe\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "hgroup") { + r0 = "hgroup"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"hgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "header") { + r0 = "header"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"header\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "footer") { + r0 = "footer"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"footer\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "figure") { + r0 = "figure"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"figure\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "center") { + r0 = "center"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"center\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "canvas") { + r0 = "canvas"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"canvas\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "button") { + r0 = "button"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"button\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "applet") { + r0 = "applet"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"applet\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "video") { + r0 = "video"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"video\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "track") { + r0 = "track"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"track\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "title") { + r0 = "title"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"title\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "thead") { + r0 = "thead"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"thead\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "tfoot") { + r0 = "tfoot"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tfoot\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "tbody") { + r0 = "tbody"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tbody\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "table") { + r0 = "table"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"table\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "style") { + r0 = "style"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"style\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "small") { + r0 = "small"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"small\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "param") { + r0 = "param"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"param\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "meter") { + r0 = "meter"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"meter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "label") { + r0 = "label"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"label\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "input") { + r0 = "input"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"input\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "frame") { + r0 = "frame"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"frame\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "embed") { + r0 = "embed"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"embed\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "blink") { + r0 = "blink"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"blink\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "audio") { + r0 = "audio"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"audio\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "aside") { + r0 = "aside"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"aside\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "time") { + r0 = "time"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"time\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "span") { + r0 = "span"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"span\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "samp") { + r0 = "samp"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"samp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "ruby") { + r0 = "ruby"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ruby\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "nobr") { + r0 = "nobr"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"nobr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "meta") { + r0 = "meta"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"meta\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "menu") { + r0 = "menu"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"menu\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "mark") { + r0 = "mark"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mark\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "main") { + r0 = "main"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"main\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "link") { + r0 = "link"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"link\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "html") { + r0 = "html"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"html\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "head") { + r0 = "head"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"head\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "form") { + r0 = "form"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"form\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "font") { + r0 = "font"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"font\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "data") { + r0 = "data"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"data\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "code") { + r0 = "code"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"code\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "cite") { + r0 = "cite"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"cite\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "body") { + r0 = "body"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"body\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "base") { + r0 = "base"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"base\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "area") { + r0 = "area"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"area\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "abbr") { + r0 = "abbr"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"abbr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "xmp") { + r0 = "xmp"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"xmp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "wbr") { + r0 = "wbr"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"wbr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "var") { + r0 = "var"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"var\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "sup") { + r0 = "sup"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"sup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "sub") { + r0 = "sub"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"sub\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "pre") { + r0 = "pre"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"pre\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "nav") { + r0 = "nav"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"nav\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "map") { + r0 = "map"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"map\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "kbd") { + r0 = "kbd"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"kbd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "ins") { + r0 = "ins"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ins\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "img") { + r0 = "img"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"img\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "div") { + r0 = "div"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"div\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "dir") { + r0 = "dir"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dir\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "dfn") { + r0 = "dfn"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dfn\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "del") { + r0 = "del"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"del\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "col") { + r0 = "col"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"col\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "big") { + r0 = "big"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"big\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "bdo") { + r0 = "bdo"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bdo\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "bdi") { + r0 = "bdi"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bdi\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "ul") { + r0 = "ul"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ul\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "tt") { + r0 = "tt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "tr") { + r0 = "tr"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "th") { + r0 = "th"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"th\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "td") { + r0 = "td"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"td\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "rt") { + r0 = "rt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"rt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "rp") { + r0 = "rp"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"rp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "ol") { + r0 = "ol"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ol\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "li") { + r0 = "li"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"li\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "hr") { + r0 = "hr"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"hr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h6") { + r0 = "h6"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h6\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h5") { + r0 = "h5"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h5\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h4") { + r0 = "h4"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h4\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h3") { + r0 = "h3"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h3\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h2") { + r0 = "h2"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h2\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h1") { + r0 = "h1"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h1\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "em") { + r0 = "em"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"em\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dt") { + r0 = "dt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dl") { + r0 = "dl"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dl\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dd") { + r0 = "dd"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "br") { + r0 = "br"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"br\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 117) { + r0 = "u"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"u\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 115) { + r0 = "s"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"s\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 113) { + r0 = "q"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"q\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 112) { + r0 = "p"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"p\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 105) { + r0 = "i"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"i\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 98) { + r0 = "b"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"b\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 97) { + r0 = "a"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"a\""); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("a valid HTML tag name"); + } + return r0; + } + + function parse_knownEvent() { + var r0; + + reportFailures++; + if (input.substr(pos, 10) === "touchStart") { + r0 = "touchStart"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchStart\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "touchMove") { + r0 = "touchMove"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchMove\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "touchEnd") { + r0 = "touchEnd"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchEnd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "touchCancel") { + r0 = "touchCancel"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchCancel\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "keyDown") { + r0 = "keyDown"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyDown\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "keyUp") { + r0 = "keyUp"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyUp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "keyPress") { + r0 = "keyPress"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyPress\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "mouseDown") { + r0 = "mouseDown"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseDown\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "mouseUp") { + r0 = "mouseUp"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseUp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "contextMenu") { + r0 = "contextMenu"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"contextMenu\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "click") { + r0 = "click"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"click\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "doubleClick") { + r0 = "doubleClick"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"doubleClick\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "mouseMove") { + r0 = "mouseMove"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseMove\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "focusIn") { + r0 = "focusIn"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"focusIn\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "focusOut") { + r0 = "focusOut"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"focusOut\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "mouseEnter") { + r0 = "mouseEnter"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseEnter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "mouseLeave") { + r0 = "mouseLeave"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseLeave\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "submit") { + r0 = "submit"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"submit\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "input") { + r0 = "input"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"input\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "change") { + r0 = "change"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"change\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragStart") { + r0 = "dragStart"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragStart\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "drag") { + r0 = "drag"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"drag\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragEnter") { + r0 = "dragEnter"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragEnter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragLeave") { + r0 = "dragLeave"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragLeave\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "dragOver") { + r0 = "dragOver"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragOver\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "drop") { + r0 = "drop"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"drop\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "dragEnd") { + r0 = "dragEnd"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragEnd\""); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("a JS event"); + } + return r0; + } + + function parse_INDENT() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61423) { + r0 = "\uEFEF"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFEF\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("INDENT"); + } + return r0; + } + + function parse_DEDENT() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61438) { + r0 = "\uEFFE"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFFE\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("DEDENT"); + } + return r0; + } + + function parse_TERM() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61439) { + r0 = "\uEFFF"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFFF\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("TERM"); + } + return r0; + } + + function parse___() { + var r0, r1; + + reportFailures++; + r1 = parse_whitespace(); + if (r1 !== null) { + r0 = []; + while (r1 !== null) { + r0.push(r1); + r1 = parse_whitespace(); + } + } else { + r0 = null; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("required whitespace"); + } + return r0; + } + + function parse__() { + var r0, r1; + + reportFailures++; + r0 = []; + r1 = parse_whitespace(); + while (r1 !== null) { + r0.push(r1); + r1 = parse_whitespace(); + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("whitespace"); + } + return r0; + } + + function parse_whitespace() { + var r0; + + if (/^[ \t\n\r]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[ \\t\\n\\r]"); + } + } + return r0; + } + + function parse_lineContent() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^\uEFFF\uEFFE\uEFEF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\\uEFFF\\uEFFE\\uEFEF]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^\uEFFF\uEFFE\uEFEF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\\uEFFF\\uEFFE\\uEFEF]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return a.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + + function cleanupExpected(expected) { + expected.sort(); + + var lastExpected = null; + var cleanExpected = []; + for (var i = 0; i < expected.length; i++) { + if (expected[i] !== lastExpected) { + cleanExpected.push(expected[i]); + lastExpected = expected[i]; + } + } + return cleanExpected; + } + + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new Handlebars.AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new Handlebars.AST.IdNode([helperName])); + return new Handlebars.AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + + var result = parseFunctions[startRule](); + + /* + * The parser is now in one of the following three states: + * + * 1. The parser successfully parsed the whole input. + * + * - |result !== null| + * - |pos === input.length| + * - |rightmostFailuresExpected| may or may not contain something + * + * 2. The parser successfully parsed only a part of the input. + * + * - |result !== null| + * - |pos < input.length| + * - |rightmostFailuresExpected| may or may not contain something + * + * 3. The parser did not successfully parse any part of the input. + * + * - |result === null| + * - |pos === 0| + * - |rightmostFailuresExpected| contains at least one failure + * + * All code following this comment (including called functions) must + * handle these states. + */ + if (result === null || pos !== input.length) { + reportedPos = Math.max(pos, rightmostFailuresPos); + var found = reportedPos < input.length ? input.charAt(reportedPos) : null; + var reportedPosDetails = computeReportedPosDetails(); + + throw new this.SyntaxError( + cleanupExpected(rightmostFailuresExpected), + found, + reportedPos, + reportedPosDetails.line, + reportedPosDetails.column + ); + } + + return result; + } + }; + + /* Thrown when a parser encounters a syntax error. */ + + result.SyntaxError = function(expected, found, offset, line, column) { + function buildMessage(expected, found) { + var expectedHumanized, foundHumanized; + + switch (expected.length) { + case 0: + expectedHumanized = "end of input"; + break; + case 1: + expectedHumanized = expected[0]; + break; + default: + expectedHumanized = expected.slice(0, expected.length - 1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundHumanized = found ? quote(found) : "end of input"; + + return "Expected " + expectedHumanized + " but " + foundHumanized + " found."; + } + + this.name = "SyntaxError"; + this.expected = expected; + this.found = found; + this.message = buildMessage(expected, found); + this.offset = offset; + this.line = line; + this.column = column; + }; + + subclass(result.SyntaxError, Error); + + return result; +})(); + +// exports = Emblem.Parser; +; +// lib/compiler.js +var Emblem, Handlebars, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + +//  + +//  + +Emblem.parse = function(string) { + var processed; + processed = Emblem.Preprocessor.processSync(string); + return new Handlebars.AST.ProgramNode(Emblem.Parser.parse(processed), []); +}; + +Emblem.precompileRaw = function(string, options) { + var ast, environment; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.precompile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + return new Handlebars.JavaScriptCompiler().compile(environment, options); +}; + +Emblem.compileRaw = function(string, options) { + var compile, compiled; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.compile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + compiled = null; + compile = function() { + var ast, environment, templateSpec; + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Handlebars.template(templateSpec); + }; + return function(context, options) { + if (!compiled) { + compiled = compile(); + } + return compiled.call(this, context, options); + }; +}; + +Emblem.precompile = Emblem.precompileRaw; + +Emblem.compile = Emblem.compileRaw; + +Emblem.precompileEmber = function(string) { + var ast, environment, options; + ast = Emblem.parse(string); + options = { + knownHelpers: { + action: true, + unbound: true, + bindAttr: true, + template: true, + view: true, + _triageMustache: true + }, + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); +}; + +Emblem.compileEmber = function(string) { + var ast, environment, options, templateSpec; + ast = Emblem.parse(string); + options = { + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Ember.Handlebars.template(templateSpec); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + +//  + +//  + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = this.indent = null; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + this.ss = new StringScanner(''); + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, c, delta, level, lines, message, newLevel, tok; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indent != null) { + level = ((function() { + var _i, _len, _ref, _results; + _ref = this.context; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + c = _ref[_i]; + if (c === INDENT) { + _results.push(0); + } + } + return _results; + }).call(this)).length; + if (this.ss.check(RegExp("(?:" + this.indent + "){" + (level + 1) + "}[^" + ws + "#]"))) { + this.discard(RegExp("(?:" + this.indent + "){" + (level + 1) + "}")); + this.context.observe(INDENT); + this.p(INDENT); + } else if (level > 0 && this.ss.check(RegExp("(?:" + this.indent + "){0," + (level - 1) + "}[^" + ws + "]"))) { + newLevel = 0; + while (this.discard(RegExp("" + this.indent))) { + ++newLevel; + } + delta = level - newLevel; + while (delta--) { + this.context.observe(DEDENT); + this.p("" + DEDENT); + } + } else if (this.ss.check(RegExp("(?:" + this.indent + "){" + level + "}[^" + ws + "]"))) { + this.discard(RegExp("(?:" + this.indent + "){" + level + "}")); + } else { + lines = this.ss.str.substr(0, this.ss.pos).split(/\n/) || ['']; + message = "Syntax error on line " + lines.length + ": invalid indentation"; + throw new Error("" + message); + } + } else { + if (this.indent = this.discard(RegExp("[" + ws + "]+"))) { + this.context.observe(INDENT); + this.p(INDENT); + } + } + } + /* + # Search for context-introducing + tok = switch @context.peek() + when '[' + # safe things, but not closing bracket + @scan /[^\n'"\\\/#`[({\]]+/ + @scan /\]/ + when '(' + # safe things, but not closing paren + @scan /[^\n'"\\\/#`[({)]+/ + @scan /\)/ + when '#{', '{' + # safe things, but not closing brace + @scan /[^\n'"\\\/#`[({}]+/ + @scan /\}/ + else + # scan safe characters (anything that doesn't *introduce* context) + @scan /[^\n'"\\\/#`[({]+/ + null + if tok + @context.observe tok + continue + */ + + this.scan(/[^\n\\]+/); + if (tok = this.discard(/\//)) { + this.context.observe(tok); + } + if (this.discard(/\n/)) { + this.p("" + TERM); + } + this.discard(any_whitespaceFollowedByNewlines_); + break; + case '/': + if (this.discard(/.*\n/)) { + this.context.observe('\n'); + } + break; + case '\\': + if (this.scan(/[\s\S]/)) { + this.context.observe('end-\\'); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p("" + DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + +//  + +Emblem.bootstrap = function(ctx) { + if (ctx == null) { + ctx = Ember.$(document); + } + Emblem.precompile = Emblem.precompileEmber; + Emblem.compile = Emblem.compileEmber; + return Ember.$('script[type="text/x-emblem"]', ctx).each(function() { + var script, templateName; + script = Ember.$(this); + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(script.html()); + return script.remove(); + }); +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.bootstrap(); +}); +; diff --git a/ajax/libs/emblem/0.0.1-dev/emblem.min.js b/ajax/libs/emblem/0.0.1-dev/emblem.min.js new file mode 100644 index 000000000..7386c807c --- /dev/null +++ b/ajax/libs/emblem/0.0.1-dev/emblem.min.js @@ -0,0 +1,3 @@ +this.StringScanner=function(){var e;return e=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),e.prototype.beginningOfLine=e.prototype.bol,e.prototype.clear=e.prototype.terminate,e.prototype.dup=e.prototype.clone,e.prototype.endOfString=e.prototype.eos,e.prototype.exist=e.prototype.exists,e.prototype.getChar=e.prototype.getch,e.prototype.position=e.prototype.pointer,e.StringScanner=e,e}.call(this),this.Handlebars={},function(e){e.VERSION="1.0.rc.2",e.helpers={},e.partials={},e.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},e.registerPartial=function(e,t){this.partials[e]=t},e.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var t=Object.prototype.toString,n="[object Function]";e.registerHelper("blockHelperMissing",function(r,i){var s=i.inverse||function(){},o=i.fn,u="",a=t.call(r);return a===n&&(r=r.call(this)),r===!0?o(this):r===!1||r==null?s(this):a==="[object Array]"?r.length>0?e.helpers.each(r,i):s(this):o(r)}),e.K=function(){},e.createFrame=Object.create||function(t){e.K.prototype=t;var n=new e.K;return e.K.prototype=null,n},e.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,methodMap:{0:"debug",1:"info",2:"warn",3:"error"},log:function(t,n){if(e.logger.level<=t){var r=e.logger.methodMap[t];typeof console!="undefined"&&console[r]&&console[r].call(console,n)}}},e.log=function(t,n){e.logger.log(t,n)},e.registerHelper("each",function(t,n){var r=n.fn,i=n.inverse,s=0,o="",u;n.data&&(u=e.createFrame(n.data));if(t&&typeof t=="object")if(t instanceof Array)for(var a=t.length;s2&&k.push("'"+this.terminals_[T]+"'");this.lexer.showPosition?L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[g]||g)+"'":L="Parse error on line "+(a+1)+": Unexpected "+(g==1?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(L,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:p,expected:k})}}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+g);switch(w[0]){case 1:r.push(g),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(w[1]),g=null,y?(g=y,y=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:N=this.productions_[w[1]][1],x.$=i[i.length-N],x._$={first_line:s[s.length-(N||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(N||1)].first_column,last_column:s[s.length-1].last_column},d&&(x._$.range=[s[s.length-(N||1)].range[0],s[s.length-1].range[1]]),S=this.performAction.call(x,u,f,a,this.yy,w[1],i,s);if(typeof S!="undefined")return S;N&&(r=r.slice(0,-1*N*2),i=i.slice(0,-1*N),s=s.slice(0,-1*N)),r.push(this.productions_[w[1]][0]),i.push(x.$),s.push(x._$),C=o[r[r.length-2]][r[r.length-1]],r.push(C);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r,i,s;this._more||(this.yytext="",this.match="");var o=this._currentRules();for(var u=0;ut[0].length)){t=n,r=u;if(!this.options.flex)break}}if(t){s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1);if(e)return e;return}return this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.options={},e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return n.yytext.slice(-1)!=="\\"&&this.popState(),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1)),14;case 3:return n.yytext=n.yytext.substr(0,n.yyleng-4),this.popState(),15;case 4:return this.begin("par"),24;case 5:return 16;case 6:return 20;case 7:return 19;case 8:return 19;case 9:return 23;case 10:return 23;case 11:this.popState(),this.begin("com");break;case 12:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 13:return 22;case 14:return 36;case 15:return 35;case 16:return 35;case 17:return 39;case 18:break;case 19:return this.popState(),18;case 20:return this.popState(),18;case 21:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),30;case 22:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\'/g,"'"),30;case 23:return n.yytext=n.yytext.substr(1),28;case 24:return 32;case 25:return 32;case 26:return 31;case 27:return 35;case 28:return n.yytext=n.yytext.substr(1,n.yyleng-2),35;case 29:return"INVALID";case 30:break;case 31:return this.popState(),37;case 32:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-/]+)/,/^(?:$)/],e.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},par:{rules:[30,31],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},e}();return e.lexer=t,n.prototype=e,e.Parser=n,new n}();Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.escaped=!n,this.hash=t;var r=this.id=e[0],i=this.params=e.slice(1),s=this.eligibleHelper=r.isSimple;this.isHelper=s&&(i.length||t)},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.partialName=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r,i){e(t.id,i),this.type="block",this.mustache=t,this.program=n,this.inverse=r,this.inverse&&!this.program&&(this.isInverse=!0)},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r":">",'"':""","'":"'","`":"`"},t=/[&<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return!e&&e!==0?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.prototype={compiler:e,disassemble:function(){var e=this.opcodes,t,n=[],r,i;for(var s=0,o=e.length;sthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){var e=this.compileStack.pop();return e instanceof n?e.value:(this.stackSlot--,e)},topStack:function(){var e=this.compileStack[this.compileStack.length-1];return e instanceof n?e.value:e},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'},setupHelper:function(e,t){var n=[];this.setupParams(e,n);var r=this.nameLookup("helpers",t,"helper");return{params:n,name:r,callParams:["depth0"].concat(n).join(", "),helperMissingParams:["depth0",this.quotedString(t)].concat(n).join(", ")}},setupParams:function(e,t){var n=[],r=[],i=[],s,o,u;n.push("hash:"+this.popStack()),o=this.popStack(),u=this.popStack();if(u||o)u||(this.context.aliases.self="this",u="self.noop"),o||(this.context.aliases.self="this",o="self.noop"),n.push("inverse:"+o),n.push("fn:"+u);for(var a=0;ao&&(u=0,a={line:1,column:1,seenCR:!1}),t()),a}function v(){return e.substring(o,s)}function m(){return o}function g(){return d().line}function y(){return d().column}function b(e){if(sl&&(l=s,c=[]),c.push(e)}function w(){var e,t,n;t=s,e=[],n=S();while(n!==null)e.push(n),n=S();return e!==null&&(o=t,e=function(e){var t=[],n=[];for(var r=0;r")),[u,new Handlebars.AST.ContentNode("")]}(e)),e===null&&(s=t),e}function vt(){var e;return e=mt(),e===null&&(e=gt()),e}function mt(){var e,t,n,r,i,u;t=s,n=s,r=Lt();if(r!==null){i=[],u=At();while(u!==null)i.push(u),u=At();i!==null?e=[r,i]:(e=null,s=n)}else e=null,s=n;return e!==null&&(o=t,e=function(e,t){return[e,t]}(r,i)),e===null&&(s=t),e}function gt(){var e,t,n;t=s,n=At();if(n!==null){e=[];while(n!==null)e.push(n),n=At()}else e=null;return e!==null&&(o=t,e=function(e){return[null,e]}(e)),e===null&&(s=t),e}function yt(){var t,n,r,i,u;n=s,r=s,e.charCodeAt(s)===32?(u=" ",s++):(u=null,f===0&&b('" "'));if(u!==null){i=[];while(u!==null)i.push(u),e.charCodeAt(s)===32?(u=" ",s++):(u=null,f===0&&b('" "'))}else i=null;return i!==null?(u=St(),u===null&&(u=xt(),u===null&&(u=Tt())),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return[new Handlebars.AST.ContentNode(" "),e]}(u)),t===null&&(s=n),t}function bt(){var t,n,r;n=s,/^[A-Za-z.:0-9]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[A-Za-z.:0-9]"));if(r!==null){t=[];while(r!==null)t.push(r),/^[A-Za-z.:0-9]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[A-Za-z.:0-9]"))}else t=null;return t!==null&&(o=n,t=function(e){return e.join("")}(t)),t===null&&(s=n),t}function wt(){var e,t;return e=Et(),e===null&&(t=s,e=U(),e!==null&&(o=t,e=function(e){return new Handlebars.AST.MustacheNode([e])}(e)),e===null&&(s=t)),e}function Et(){var t,n,r,i,u,a;return n=s,r=s,e.charCodeAt(s)===34?(i='"',s++):(i=null,f===0&&b('"\\""')),i!==null?(u=_(),u!==null?(e.charCodeAt(s)===34?(a='"',s++):(a=null,f===0&&b('"\\""')),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t===null&&(r=s,e.charCodeAt(s)===39?(i="'",s++):(i=null,f===0&&b('"\'"')),i!==null?(u=_(),u!==null?(e.charCodeAt(s)===39?(a="'",s++):(a=null,f===0&&b('"\'"')),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r)),t!==null&&(o=n,t=function(e){return e[1]}(t)),t===null&&(s=n),t}function St(){var t,n,r,i,u,a;return n=s,r=s,i=Ht(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=wt(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){return Wt(t,"action",[["on",new Handlebars.AST.StringNode(e)]])}(i,a)),t===null&&(s=n),t}function xt(){var t,n,r,i,u,a;return n=s,r=s,i=Ot(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=bt(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){var n=new Handlebars.AST.HashNode([[e,new Handlebars.AST.StringNode(t)]]),r=[new Handlebars.AST.IdNode(["bindAttr"])];return new Handlebars.AST.MustacheNode(r,n)}(i,a)),t===null&&(s=n),t}function Tt(){var t,n,r,i,u,a;return n=s,r=s,i=Ot(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=J(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){var n=e+"="+'"'+t+'"';return new Handlebars.AST.ContentNode(n)}(i,a)),t===null&&(s=n),t}function Nt(){var e,t,n;t=s,e=[],n=kt();while(n!==null)e.push(n),n=kt();return e!==null&&(o=t,e=function(e){return e.join("")}(e)),e===null&&(s=t),e}function Ct(){var e;return e=J(),e===null&&(e=I()),e}function kt(){var t;return t=G(),t===null&&(/^[0-9]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[0-9]")),t===null&&(e.charCodeAt(s)===95?(t="_",s++):(t=null,f===0&&b('"_"')),t===null&&(e.charCodeAt(s)===45?(t="-",s++):(t=null,f===0&&b('"-"'))))),t}function Lt(){var t,n,r,i,u;return n=s,r=s,e.charCodeAt(s)===35?(i="#",s++):(i=null,f===0&&b('"#"')),i!==null?(u=Ot(),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return e}(u)),t===null&&(s=n),t}function At(){var t,n,r,i,u;return n=s,r=s,e.charCodeAt(s)===46?(i=".",s++):(i=null,f===0&&b('"."')),i!==null?(u=Ot(),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return e}(u)),t===null&&(s=n),t}function Ot(){var e,t,n,r,i,u;t=s,n=s,r=_t();if(r!==null){i=[],u=Mt();while(u!==null)i.push(u),u=Mt();i!==null?e=[r,i]:(e=null,s=n)}else e=null,s=n;return e!==null&&(o=t,e=function(e,t){return e+t.join("")}(r,i)),e===null&&(s=t),e}function Mt(){var t;return/^[_a-zA-Z0-9\-]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[_a-zA-Z0-9\\-]")),t===null&&(t=Dt()),t}function _t(){var t;return/^[_a-zA-Z]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[_a-zA-Z]")),t===null&&(t=Dt()),t}function Dt(){var t;return/^[\x80-\xFF]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[\\x80-\\xFF]")),t}function Pt(){var t;return f++,e.substr(s,10)==="figcaption"?(t="figcaption",s+=10):(t=null,f===0&&b('"figcaption"')),t===null&&(e.substr(s,10)==="blockquote"?(t="blockquote",s+=10):(t=null,f===0&&b('"blockquote"')),t===null&&(e.substr(s,9)==="plaintext"?(t="plaintext",s+=9):(t=null,f===0&&b('"plaintext"')),t===null&&(e.substr(s,8)==="textarea"?(t="textarea",s+=8):(t=null,f===0&&b('"textarea"')),t===null&&(e.substr(s,8)==="progress"?(t="progress",s+=8):(t=null,f===0&&b('"progress"')),t===null&&(e.substr(s,8)==="optgroup"?(t="optgroup",s+=8):(t=null,f===0&&b('"optgroup"')),t===null&&(e.substr(s,8)==="noscript"?(t="noscript",s+=8):(t=null,f===0&&b('"noscript"')),t===null&&(e.substr(s,8)==="noframes"?(t="noframes",s+=8):(t=null,f===0&&b('"noframes"')),t===null&&(e.substr(s,8)==="frameset"?(t="frameset",s+=8):(t=null,f===0&&b('"frameset"')),t===null&&(e.substr(s,8)==="fieldset"?(t="fieldset",s+=8):(t=null,f===0&&b('"fieldset"')),t===null&&(e.substr(s,8)==="datalist"?(t="datalist",s+=8):(t=null,f===0&&b('"datalist"')),t===null&&(e.substr(s,8)==="colgroup"?(t="colgroup",s+=8):(t=null,f===0&&b('"colgroup"')),t===null&&(e.substr(s,8)==="basefont"?(t="basefont",s+=8):(t=null,f===0&&b('"basefont"')),t===null&&(e.substr(s,7)==="summary"?(t="summary",s+=7):(t=null,f===0&&b('"summary"')),t===null&&(e.substr(s,7)==="section"?(t="section",s+=7):(t=null,f===0&&b('"section"')),t===null&&(e.substr(s,7)==="marquee"?(t="marquee",s+=7):(t=null,f===0&&b('"marquee"')),t===null&&(e.substr(s,7)==="listing"?(t="listing",s+=7):(t=null,f===0&&b('"listing"')),t===null&&(e.substr(s,7)==="isindex"?(t="isindex",s+=7):(t=null,f===0&&b('"isindex"')),t===null&&(e.substr(s,7)==="details"?(t="details",s+=7):(t=null,f===0&&b('"details"')),t===null&&(e.substr(s,7)==="command"?(t="command",s+=7):(t=null,f===0&&b('"command"')),t===null&&(e.substr(s,7)==="caption"?(t="caption",s+=7):(t=null,f===0&&b('"caption"')),t===null&&(e.substr(s,7)==="bgsound"?(t="bgsound",s+=7):(t=null,f===0&&b('"bgsound"')),t===null&&(e.substr(s,7)==="article"?(t="article",s+=7):(t=null,f===0&&b('"article"')),t===null&&(e.substr(s,7)==="address"?(t="address",s+=7):(t=null,f===0&&b('"address"')),t===null&&(e.substr(s,7)==="acronym"?(t="acronym",s+=7):(t=null,f===0&&b('"acronym"')),t===null&&(e.substr(s,6)==="strong"?(t="strong",s+=6):(t=null,f===0&&b('"strong"')),t===null&&(e.substr(s,6)==="strike"?(t="strike",s+=6):(t=null,f===0&&b('"strike"')),t===null&&(e.substr(s,6)==="spacer"?(t="spacer",s+=6):(t=null,f===0&&b('"spacer"')),t===null&&(e.substr(s,6)==="source"?(t="source",s+=6):(t=null,f===0&&b('"source"')),t===null&&(e.substr(s,6)==="select"?(t="select",s+=6):(t=null,f===0&&b('"select"')),t===null&&(e.substr(s,6)==="script"?(t="script",s+=6):(t=null,f===0&&b('"script"')),t===null&&(e.substr(s,6)==="output"?(t="output",s+=6):(t=null,f===0&&b('"output"')),t===null&&(e.substr(s,6)==="option"?(t="option",s+=6):(t=null,f===0&&b('"option"')),t===null&&(e.substr(s,6)==="object"?(t="object",s+=6):(t=null,f===0&&b('"object"')),t===null&&(e.substr(s,6)==="legend"?(t="legend",s+=6):(t=null,f===0&&b('"legend"')),t===null&&(e.substr(s,6)==="keygen"?(t="keygen",s+=6):(t=null,f===0&&b('"keygen"')),t===null&&(e.substr(s,6)==="iframe"?(t="iframe",s+=6):(t=null,f===0&&b('"iframe"')),t===null&&(e.substr(s,6)==="hgroup"?(t="hgroup",s+=6):(t=null,f===0&&b('"hgroup"')),t===null&&(e.substr(s,6)==="header"?(t="header",s+=6):(t=null,f===0&&b('"header"')),t===null&&(e.substr(s,6)==="footer"?(t="footer",s+=6):(t=null,f===0&&b('"footer"')),t===null&&(e.substr(s,6)==="figure"?(t="figure",s+=6):(t=null,f===0&&b('"figure"')),t===null&&(e.substr(s,6)==="center"?(t="center",s+=6):(t=null,f===0&&b('"center"')),t===null&&(e.substr(s,6)==="canvas"?(t="canvas",s+=6):(t=null,f===0&&b('"canvas"')),t===null&&(e.substr(s,6)==="button"?(t="button",s+=6):(t=null,f===0&&b('"button"')),t===null&&(e.substr(s,6)==="applet"?(t="applet",s+=6):(t=null,f===0&&b('"applet"')),t===null&&(e.substr(s,5)==="video"?(t="video",s+=5):(t=null,f===0&&b('"video"')),t===null&&(e.substr(s,5)==="track"?(t="track",s+=5):(t=null,f===0&&b('"track"')),t===null&&(e.substr(s,5)==="title"?(t="title",s+=5):(t=null,f===0&&b('"title"')),t===null&&(e.substr(s,5)==="thead"?(t="thead",s+=5):(t=null,f===0&&b('"thead"')),t===null&&(e.substr(s,5)==="tfoot"?(t="tfoot",s+=5):(t=null,f===0&&b('"tfoot"')),t===null&&(e.substr(s,5)==="tbody"?(t="tbody",s+=5):(t=null,f===0&&b('"tbody"')),t===null&&(e.substr(s,5)==="table"?(t="table",s+=5):(t=null,f===0&&b('"table"')),t===null&&(e.substr(s,5)==="style"?(t="style",s+=5):(t=null,f===0&&b('"style"')),t===null&&(e.substr(s,5)==="small"?(t="small",s+=5):(t=null,f===0&&b('"small"')),t===null&&(e.substr(s,5)==="param"?(t="param",s+=5):(t=null,f===0&&b('"param"')),t===null&&(e.substr(s,5)==="meter"?(t="meter",s+=5):(t=null,f===0&&b('"meter"')),t===null&&(e.substr(s,5)==="label"?(t="label",s+=5):(t=null,f===0&&b('"label"')),t===null&&(e.substr(s,5)==="input"?(t="input",s+=5):(t=null,f===0&&b('"input"')),t===null&&(e.substr(s,5)==="frame"?(t="frame",s+=5):(t=null,f===0&&b('"frame"')),t===null&&(e.substr(s,5)==="embed"?(t="embed",s+=5):(t=null,f===0&&b('"embed"')),t===null&&(e.substr(s,5)==="blink"?(t="blink",s+=5):(t=null,f===0&&b('"blink"')),t===null&&(e.substr(s,5)==="audio"?(t="audio",s+=5):(t=null,f===0&&b('"audio"')),t===null&&(e.substr(s,5)==="aside"?(t="aside",s+=5):(t=null,f===0&&b('"aside"')),t===null&&(e.substr(s,4)==="time"?(t="time",s+=4):(t=null,f===0&&b('"time"')),t===null&&(e.substr(s,4)==="span"?(t="span",s+=4):(t=null,f===0&&b('"span"')),t===null&&(e.substr(s,4)==="samp"?(t="samp",s+=4):(t=null,f===0&&b('"samp"')),t===null&&(e.substr(s,4)==="ruby"?(t="ruby",s+=4):(t=null,f===0&&b('"ruby"')),t===null&&(e.substr(s,4)==="nobr"?(t="nobr",s+=4):(t=null,f===0&&b('"nobr"')),t===null&&(e.substr(s,4)==="meta"?(t="meta",s+=4):(t=null,f===0&&b('"meta"')),t===null&&(e.substr(s,4)==="menu"?(t="menu",s+=4):(t=null,f===0&&b('"menu"')),t===null&&(e.substr(s,4)==="mark"?(t="mark",s+=4):(t=null,f===0&&b('"mark"')),t===null&&(e.substr(s,4)==="main"?(t="main",s+=4):(t=null,f===0&&b('"main"')),t===null&&(e.substr(s,4)==="link"?(t="link",s+=4):(t=null,f===0&&b('"link"')),t===null&&(e.substr(s,4)==="html"?(t="html",s+=4):(t=null,f===0&&b('"html"')),t===null&&(e.substr(s,4)==="head"?(t="head",s+=4):(t=null,f===0&&b('"head"')),t===null&&(e.substr(s,4)==="form"?(t="form",s+=4):(t=null,f===0&&b('"form"')),t===null&&(e.substr(s,4)==="font"?(t="font",s+=4):(t=null,f===0&&b('"font"')),t===null&&(e.substr(s,4)==="data"?(t="data",s+=4):(t=null,f===0&&b('"data"')),t===null&&(e.substr(s,4)==="code"?(t="code",s+=4):(t=null,f===0&&b('"code"')),t===null&&(e.substr(s,4)==="cite"?(t="cite",s+=4):(t=null,f===0&&b('"cite"')),t===null&&(e.substr(s,4)==="body"?(t="body",s+=4):(t=null,f===0&&b('"body"')),t===null&&(e.substr(s,4)==="base"?(t="base",s+=4):(t=null,f===0&&b('"base"')),t===null&&(e.substr(s,4)==="area"?(t="area",s+=4):(t=null,f===0&&b('"area"')),t===null&&(e.substr(s,4)==="abbr"?(t="abbr",s+=4):(t=null,f===0&&b('"abbr"')),t===null&&(e.substr(s,3)==="xmp"?(t="xmp",s+=3):(t=null,f===0&&b('"xmp"')),t===null&&(e.substr(s,3)==="wbr"?(t="wbr",s+=3):(t=null,f===0&&b('"wbr"')),t===null&&(e.substr(s,3)==="var"?(t="var",s+=3):(t=null,f===0&&b('"var"' +)),t===null&&(e.substr(s,3)==="sup"?(t="sup",s+=3):(t=null,f===0&&b('"sup"')),t===null&&(e.substr(s,3)==="sub"?(t="sub",s+=3):(t=null,f===0&&b('"sub"')),t===null&&(e.substr(s,3)==="pre"?(t="pre",s+=3):(t=null,f===0&&b('"pre"')),t===null&&(e.substr(s,3)==="nav"?(t="nav",s+=3):(t=null,f===0&&b('"nav"')),t===null&&(e.substr(s,3)==="map"?(t="map",s+=3):(t=null,f===0&&b('"map"')),t===null&&(e.substr(s,3)==="kbd"?(t="kbd",s+=3):(t=null,f===0&&b('"kbd"')),t===null&&(e.substr(s,3)==="ins"?(t="ins",s+=3):(t=null,f===0&&b('"ins"')),t===null&&(e.substr(s,3)==="img"?(t="img",s+=3):(t=null,f===0&&b('"img"')),t===null&&(e.substr(s,3)==="div"?(t="div",s+=3):(t=null,f===0&&b('"div"')),t===null&&(e.substr(s,3)==="dir"?(t="dir",s+=3):(t=null,f===0&&b('"dir"')),t===null&&(e.substr(s,3)==="dfn"?(t="dfn",s+=3):(t=null,f===0&&b('"dfn"')),t===null&&(e.substr(s,3)==="del"?(t="del",s+=3):(t=null,f===0&&b('"del"')),t===null&&(e.substr(s,3)==="col"?(t="col",s+=3):(t=null,f===0&&b('"col"')),t===null&&(e.substr(s,3)==="big"?(t="big",s+=3):(t=null,f===0&&b('"big"')),t===null&&(e.substr(s,3)==="bdo"?(t="bdo",s+=3):(t=null,f===0&&b('"bdo"')),t===null&&(e.substr(s,3)==="bdi"?(t="bdi",s+=3):(t=null,f===0&&b('"bdi"')),t===null&&(e.substr(s,2)==="ul"?(t="ul",s+=2):(t=null,f===0&&b('"ul"')),t===null&&(e.substr(s,2)==="tt"?(t="tt",s+=2):(t=null,f===0&&b('"tt"')),t===null&&(e.substr(s,2)==="tr"?(t="tr",s+=2):(t=null,f===0&&b('"tr"')),t===null&&(e.substr(s,2)==="th"?(t="th",s+=2):(t=null,f===0&&b('"th"')),t===null&&(e.substr(s,2)==="td"?(t="td",s+=2):(t=null,f===0&&b('"td"')),t===null&&(e.substr(s,2)==="rt"?(t="rt",s+=2):(t=null,f===0&&b('"rt"')),t===null&&(e.substr(s,2)==="rp"?(t="rp",s+=2):(t=null,f===0&&b('"rp"')),t===null&&(e.substr(s,2)==="ol"?(t="ol",s+=2):(t=null,f===0&&b('"ol"')),t===null&&(e.substr(s,2)==="li"?(t="li",s+=2):(t=null,f===0&&b('"li"')),t===null&&(e.substr(s,2)==="hr"?(t="hr",s+=2):(t=null,f===0&&b('"hr"')),t===null&&(e.substr(s,2)==="h6"?(t="h6",s+=2):(t=null,f===0&&b('"h6"')),t===null&&(e.substr(s,2)==="h5"?(t="h5",s+=2):(t=null,f===0&&b('"h5"')),t===null&&(e.substr(s,2)==="h4"?(t="h4",s+=2):(t=null,f===0&&b('"h4"')),t===null&&(e.substr(s,2)==="h3"?(t="h3",s+=2):(t=null,f===0&&b('"h3"')),t===null&&(e.substr(s,2)==="h2"?(t="h2",s+=2):(t=null,f===0&&b('"h2"')),t===null&&(e.substr(s,2)==="h1"?(t="h1",s+=2):(t=null,f===0&&b('"h1"')),t===null&&(e.substr(s,2)==="em"?(t="em",s+=2):(t=null,f===0&&b('"em"')),t===null&&(e.substr(s,2)==="dt"?(t="dt",s+=2):(t=null,f===0&&b('"dt"')),t===null&&(e.substr(s,2)==="dl"?(t="dl",s+=2):(t=null,f===0&&b('"dl"')),t===null&&(e.substr(s,2)==="dd"?(t="dd",s+=2):(t=null,f===0&&b('"dd"')),t===null&&(e.substr(s,2)==="br"?(t="br",s+=2):(t=null,f===0&&b('"br"')),t===null&&(e.charCodeAt(s)===117?(t="u",s++):(t=null,f===0&&b('"u"')),t===null&&(e.charCodeAt(s)===115?(t="s",s++):(t=null,f===0&&b('"s"')),t===null&&(e.charCodeAt(s)===113?(t="q",s++):(t=null,f===0&&b('"q"')),t===null&&(e.charCodeAt(s)===112?(t="p",s++):(t=null,f===0&&b('"p"')),t===null&&(e.charCodeAt(s)===105?(t="i",s++):(t=null,f===0&&b('"i"')),t===null&&(e.charCodeAt(s)===98?(t="b",s++):(t=null,f===0&&b('"b"')),t===null&&(e.charCodeAt(s)===97?(t="a",s++):(t=null,f===0&&b('"a"')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),f--,f===0&&t===null&&b("a valid HTML tag name"),t}function Ht(){var t;return f++,e.substr(s,10)==="touchStart"?(t="touchStart",s+=10):(t=null,f===0&&b('"touchStart"')),t===null&&(e.substr(s,9)==="touchMove"?(t="touchMove",s+=9):(t=null,f===0&&b('"touchMove"')),t===null&&(e.substr(s,8)==="touchEnd"?(t="touchEnd",s+=8):(t=null,f===0&&b('"touchEnd"')),t===null&&(e.substr(s,11)==="touchCancel"?(t="touchCancel",s+=11):(t=null,f===0&&b('"touchCancel"')),t===null&&(e.substr(s,7)==="keyDown"?(t="keyDown",s+=7):(t=null,f===0&&b('"keyDown"')),t===null&&(e.substr(s,5)==="keyUp"?(t="keyUp",s+=5):(t=null,f===0&&b('"keyUp"')),t===null&&(e.substr(s,8)==="keyPress"?(t="keyPress",s+=8):(t=null,f===0&&b('"keyPress"')),t===null&&(e.substr(s,9)==="mouseDown"?(t="mouseDown",s+=9):(t=null,f===0&&b('"mouseDown"')),t===null&&(e.substr(s,7)==="mouseUp"?(t="mouseUp",s+=7):(t=null,f===0&&b('"mouseUp"')),t===null&&(e.substr(s,11)==="contextMenu"?(t="contextMenu",s+=11):(t=null,f===0&&b('"contextMenu"')),t===null&&(e.substr(s,5)==="click"?(t="click",s+=5):(t=null,f===0&&b('"click"')),t===null&&(e.substr(s,11)==="doubleClick"?(t="doubleClick",s+=11):(t=null,f===0&&b('"doubleClick"')),t===null&&(e.substr(s,9)==="mouseMove"?(t="mouseMove",s+=9):(t=null,f===0&&b('"mouseMove"')),t===null&&(e.substr(s,7)==="focusIn"?(t="focusIn",s+=7):(t=null,f===0&&b('"focusIn"')),t===null&&(e.substr(s,8)==="focusOut"?(t="focusOut",s+=8):(t=null,f===0&&b('"focusOut"')),t===null&&(e.substr(s,10)==="mouseEnter"?(t="mouseEnter",s+=10):(t=null,f===0&&b('"mouseEnter"')),t===null&&(e.substr(s,10)==="mouseLeave"?(t="mouseLeave",s+=10):(t=null,f===0&&b('"mouseLeave"')),t===null&&(e.substr(s,6)==="submit"?(t="submit",s+=6):(t=null,f===0&&b('"submit"')),t===null&&(e.substr(s,5)==="input"?(t="input",s+=5):(t=null,f===0&&b('"input"')),t===null&&(e.substr(s,6)==="change"?(t="change",s+=6):(t=null,f===0&&b('"change"')),t===null&&(e.substr(s,9)==="dragStart"?(t="dragStart",s+=9):(t=null,f===0&&b('"dragStart"')),t===null&&(e.substr(s,4)==="drag"?(t="drag",s+=4):(t=null,f===0&&b('"drag"')),t===null&&(e.substr(s,9)==="dragEnter"?(t="dragEnter",s+=9):(t=null,f===0&&b('"dragEnter"')),t===null&&(e.substr(s,9)==="dragLeave"?(t="dragLeave",s+=9):(t=null,f===0&&b('"dragLeave"')),t===null&&(e.substr(s,8)==="dragOver"?(t="dragOver",s+=8):(t=null,f===0&&b('"dragOver"')),t===null&&(e.substr(s,4)==="drop"?(t="drop",s+=4):(t=null,f===0&&b('"drop"')),t===null&&(e.substr(s,7)==="dragEnd"?(t="dragEnd",s+=7):(t=null,f===0&&b('"dragEnd"')))))))))))))))))))))))))))),f--,f===0&&t===null&&b("a JS event"),t}function Bt(){var t,n;return f++,n=s,e.charCodeAt(s)===61423?(t="",s++):(t=null,f===0&&b('"\\uEFEF"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("INDENT"),t}function jt(){var t,n;return f++,n=s,e.charCodeAt(s)===61438?(t="",s++):(t=null,f===0&&b('"\\uEFFE"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("DEDENT"),t}function Ft(){var t,n;return f++,n=s,e.charCodeAt(s)===61439?(t="",s++):(t=null,f===0&&b('"\\uEFFF"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("TERM"),t}function It(){var e,t;f++,t=Rt();if(t!==null){e=[];while(t!==null)e.push(t),t=Rt()}else e=null;return f--,f===0&&e===null&&b("required whitespace"),e}function qt(){var e,t;f++,e=[],t=Rt();while(t!==null)e.push(t),t=Rt();return f--,f===0&&e===null&&b("whitespace"),e}function Rt(){var t;return/^[ \t\n\r]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[ \\t\\n\\r]")),t}function Ut(){var t,n,r;n=s,t=[],/^[^\uEFFF\uEFFE\uEFEF]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[^\\uEFFF\\uEFFE\\uEFEF]"));while(r!==null)t.push(r),/^[^\uEFFF\uEFFE\uEFEF]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[^\\uEFFF\\uEFFE\\uEFEF]"));return t!==null&&(o=n,t=function(e){return e.join("")}(t)),t===null&&(s=n),t}function zt(e){e.sort();var t=null,n=[];for(var r=0;r1?arguments[1]:{},i;if(r.startRule!==undefined){i=r.startRule;if(n[i]===undefined)throw new Error("Can't start parsing from rule "+t(i)+".")}else i="content";var s=0,o=0,u=0,a={line:1,column:1,seenCR:!1},f=0,l=0,c=[],Xt=n[i]();if(Xt===null||s!==e.length){o=Math.max(s,l);var Vt=o0&&this.ss.check(RegExp("(?:"+this.indent+"){0,"+(c-1)+"}[^"+o+"]"))){d=0;while(this.discard(RegExp(""+this.indent)))++d;l=c-d;while(l--)this.context.observe(e),this.p(""+e)}else{if(!this.ss.check(RegExp("(?:"+this.indent+"){"+c+"}[^"+o+"]")))throw h=this.ss.str.substr(0,this.ss.pos).split(/\n/)||[""],p="Syntax error on line "+h.length+": invalid indentation",new Error(""+p);this.discard(RegExp("(?:"+this.indent+"){"+c+"}"))}}else if(this.indent=this.discard(RegExp("["+o+"]+")))this.context.observe(t),this.p(t)}this.scan(/[^\n\\]+/),(v=this.discard(/\//))&&this.context.observe(v),this.discard(/\n/)&&this.p(""+n),this.discard(i);break;case"/":this.discard(/.*\n/)&&this.context.observe("\n");break;case"\\":this.scan(/[\s\S]/)&&this.context.observe("end-\\")}if(s){this.scan(r);while(this.context.length&&t===this.context.peek())this.context.observe(e),this.p(""+e);if(this.context.length)throw new Error("Unclosed "+this.context.peek()+" at EOF")}}},u.prototype.processData=s(!1),u.prototype.processEnd=s(!0),u.processSync=function(e){var t;return e+="\n",t=new u,t.processData(e),t.processEnd(),t.output},u}();var ENV,Emblem,_base;Emblem.bootstrap=function(e){return e==null&&(e=Ember.$(document)),Emblem.precompile=Emblem.precompileEmber,Emblem.compile=Emblem.compileEmber,Ember.$('script[type="text/x-emblem"]',e).each(function(){var e,t;return e=Ember.$(this),t=e.attr("data-template-name")||e.attr("id")||"application",Ember.TEMPLATES[t]=Emblem.compile(e.html()),e.remove()})},this.ENV||(this.ENV={}),ENV=this.ENV,ENV.EMBER_LOAD_HOOKS||(ENV.EMBER_LOAD_HOOKS={}),(_base=ENV.EMBER_LOAD_HOOKS).application||(_base.application=[]),ENV.EMBER_LOAD_HOOKS.application.push(function(){return Emblem.bootstrap()}); \ No newline at end of file diff --git a/ajax/libs/emblem/0.0.1/emblem.js b/ajax/libs/emblem/0.0.1/emblem.js new file mode 100644 index 000000000..e3e6060c5 --- /dev/null +++ b/ajax/libs/emblem/0.0.1/emblem.js @@ -0,0 +1,7481 @@ + +this.StringScanner = (function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + //module.exports = StringScanner; + return StringScanner; +}).call(this); + + + + +// lib/handlebars/base.js + +/*jshint eqnull:true*/ +this.Handlebars = {}; + +(function(Handlebars) { + +Handlebars.VERSION = "1.0.rc.2"; + +Handlebars.helpers = {}; +Handlebars.partials = {}; + +Handlebars.registerHelper = function(name, fn, inverse) { + if(inverse) { fn.not = inverse; } + this.helpers[name] = fn; +}; + +Handlebars.registerPartial = function(name, str) { + this.partials[name] = str; +}; + +Handlebars.registerHelper('helperMissing', function(arg) { + if(arguments.length === 2) { + return undefined; + } else { + throw new Error("Could not find property '" + arg + "'"); + } +}); + +var toString = Object.prototype.toString, functionType = "[object Function]"; + +Handlebars.registerHelper('blockHelperMissing', function(context, options) { + var inverse = options.inverse || function() {}, fn = options.fn; + + + var ret = ""; + var type = toString.call(context); + + if(type === functionType) { context = context.call(this); } + + if(context === true) { + return fn(this); + } else if(context === false || context == null) { + return inverse(this); + } else if(type === "[object Array]") { + if(context.length > 0) { + return Handlebars.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + return fn(context); + } +}); + +Handlebars.K = function() {}; + +Handlebars.createFrame = Object.create || function(object) { + Handlebars.K.prototype = object; + var obj = new Handlebars.K(); + Handlebars.K.prototype = null; + return obj; +}; + +Handlebars.logger = { + DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3, + + methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'}, + + // can be overridden in the host environment + log: function(level, obj) { + if (Handlebars.logger.level <= level) { + var method = Handlebars.logger.methodMap[level]; + if (typeof console !== 'undefined' && console[method]) { + console[method].call(console, obj); + } + } + } +}; + +Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); }; + +Handlebars.registerHelper('each', function(context, options) { + var fn = options.fn, inverse = options.inverse; + var i = 0, ret = "", data; + + if (options.data) { + data = Handlebars.createFrame(options.data); + } + + if(context && typeof context === 'object') { + if(context instanceof Array){ + for(var j = context.length; i 2) { + expected.push("'" + this.terminals_[p] + "'"); + } + if (this.lexer.showPosition) { + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; + } else { + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); + } + this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; + if (ranges) { + yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; + } + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + if (typeof r !== "undefined") { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +} +}; +/* Jison generated lexer */ +var lexer = (function(){ +var lexer = ({EOF:1, +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, +setInput:function (input) { + this._input = input; + this._more = this._less = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0}; + if (this.options.ranges) this.yylloc.range = [0,0]; + this.offset = 0; + return this; + }, +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) this.yylloc.range[1]++; + + this._input = this._input.slice(1); + return ch; + }, +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length-len-1); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length-1); + this.matched = this.matched.substr(0, this.matched.length-1); + + if (lines.length-1) this.yylineno -= lines.length-1; + var r = this.yylloc.range; + + this.yylloc = {first_line: this.yylloc.first_line, + last_line: this.yylineno+1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length: + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + return this; + }, +more:function () { + this._more = true; + return this; + }, +less:function (n) { + this.unput(this.match.slice(n)); + }, +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, ""); + }, +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c+"^"; + }, +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) this.done = true; + + var token, + match, + tempMatch, + index, + col, + lines; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i=0;i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (!this.options.flex) break; + } + } + if (match) { + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) this.yylineno += lines.length; + this.yylloc = {first_line: this.yylloc.last_line, + last_line: this.yylineno+1, + first_column: this.yylloc.last_column, + last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length}; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]); + if (this.done && this._input) this.done = false; + if (token) return token; + else return; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), + {text: "", token: null, line: this.yylineno}); + } + }, +lex:function lex() { + var r = this.next(); + if (typeof r !== 'undefined') { + return r; + } else { + return this.lex(); + } + }, +begin:function begin(condition) { + this.conditionStack.push(condition); + }, +popState:function popState() { + return this.conditionStack.pop(); + }, +_currentRules:function _currentRules() { + return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules; + }, +topState:function () { + return this.conditionStack[this.conditionStack.length-2]; + }, +pushState:function begin(condition) { + this.begin(condition); + }}); +lexer.options = {}; +lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + +var YYSTATE=YY_START +switch($avoiding_name_collisions) { +case 0: + if(yy_.yytext.slice(-1) !== "\\") this.begin("mu"); + if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu"); + if(yy_.yytext) return 14; + +break; +case 1: return 14; +break; +case 2: + if(yy_.yytext.slice(-1) !== "\\") this.popState(); + if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1); + return 14; + +break; +case 3: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15; +break; +case 4: this.begin("par"); return 24; +break; +case 5: return 16; +break; +case 6: return 20; +break; +case 7: return 19; +break; +case 8: return 19; +break; +case 9: return 23; +break; +case 10: return 23; +break; +case 11: this.popState(); this.begin('com'); +break; +case 12: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; +break; +case 13: return 22; +break; +case 14: return 36; +break; +case 15: return 35; +break; +case 16: return 35; +break; +case 17: return 39; +break; +case 18: /*ignore whitespace*/ +break; +case 19: this.popState(); return 18; +break; +case 20: this.popState(); return 18; +break; +case 21: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30; +break; +case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30; +break; +case 23: yy_.yytext = yy_.yytext.substr(1); return 28; +break; +case 24: return 32; +break; +case 25: return 32; +break; +case 26: return 31; +break; +case 27: return 35; +break; +case 28: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35; +break; +case 29: return 'INVALID'; +break; +case 30: /*ignore whitespace*/ +break; +case 31: this.popState(); return 37; +break; +case 32: return 5; +break; +} +}; +lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-/]+)/,/^(?:$)/]; +lexer.conditions = {"mu":{"rules":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[3],"inclusive":false},"par":{"rules":[30,31],"inclusive":false},"INITIAL":{"rules":[0,1,32],"inclusive":true}}; +return lexer;})() +parser.lexer = lexer; +function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})();; +// lib/handlebars/compiler/base.js +Handlebars.Parser = handlebars; + +Handlebars.parse = function(string) { + Handlebars.Parser.yy = Handlebars.AST; + return Handlebars.Parser.parse(string); +}; + +Handlebars.print = function(ast) { + return new Handlebars.PrintVisitor().accept(ast); +};; +// lib/handlebars/compiler/ast.js +(function() { + + Handlebars.AST = {}; + + Handlebars.AST.ProgramNode = function(statements, inverse) { + this.type = "program"; + this.statements = statements; + if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); } + }; + + Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) { + this.type = "mustache"; + this.escaped = !unescaped; + this.hash = hash; + + var id = this.id = rawParams[0]; + var params = this.params = rawParams.slice(1); + + // a mustache is an eligible helper if: + // * its id is simple (a single part, not `this` or `..`) + var eligibleHelper = this.eligibleHelper = id.isSimple; + + // a mustache is definitely a helper if: + // * it is an eligible helper, and + // * it has at least one parameter or hash segment + this.isHelper = eligibleHelper && (params.length || hash); + + // if a mustache is an eligible helper but not a definite + // helper, it is ambiguous, and will be resolved in a later + // pass or at runtime. + }; + + Handlebars.AST.PartialNode = function(partialName, context) { + this.type = "partial"; + this.partialName = partialName; + this.context = context; + }; + + var verifyMatch = function(open, close) { + if(open.original !== close.original) { + throw new Handlebars.Exception(open.original + " doesn't match " + close.original); + } + }; + + Handlebars.AST.BlockNode = function(mustache, program, inverse, close) { + verifyMatch(mustache.id, close); + this.type = "block"; + this.mustache = mustache; + this.program = program; + this.inverse = inverse; + + if (this.inverse && !this.program) { + this.isInverse = true; + } + }; + + Handlebars.AST.ContentNode = function(string) { + this.type = "content"; + this.string = string; + }; + + Handlebars.AST.HashNode = function(pairs) { + this.type = "hash"; + this.pairs = pairs; + }; + + Handlebars.AST.IdNode = function(parts) { + this.type = "ID"; + this.original = parts.join("."); + + var dig = [], depth = 0; + + for(var i=0,l=parts.length; i": ">", + '"': """, + "'": "'", + "`": "`" + }; + + var badChars = /[&<>"'`]/g; + var possible = /[&<>"'`]/; + + var escapeChar = function(chr) { + return escape[chr] || "&"; + }; + + Handlebars.Utils = { + escapeExpression: function(string) { + // don't escape SafeStrings, since they're already safe + if (string instanceof Handlebars.SafeString) { + return string.toString(); + } else if (string == null || string === false) { + return ""; + } + + if(!possible.test(string)) { return string; } + return string.replace(badChars, escapeChar); + }, + + isEmpty: function(value) { + if (!value && value !== 0) { + return true; + } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) { + return true; + } else { + return false; + } + } + }; +})();; +// lib/handlebars/compiler/compiler.js + +/*jshint eqnull:true*/ +Handlebars.Compiler = function() {}; +Handlebars.JavaScriptCompiler = function() {}; + +(function(Compiler, JavaScriptCompiler) { + // the foundHelper register will disambiguate helper lookup from finding a + // function in a context. This is necessary for mustache compatibility, which + // requires that context functions in blocks are evaluated by blockHelperMissing, + // and then proceed as if the resulting value was provided to blockHelperMissing. + + Compiler.prototype = { + compiler: Compiler, + + disassemble: function() { + var opcodes = this.opcodes, opcode, out = [], params, param; + + for (var i=0, l=opcodes.length; i 0) { + this.source[1] = this.source[1] + ", " + locals.join(", "); + } + + // Generate minimizer alias mappings + if (!this.isChild) { + var aliases = []; + for (var alias in this.context.aliases) { + this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias]; + } + } + + if (this.source[1]) { + this.source[1] = "var " + this.source[1].substring(2) + ";"; + } + + // Merge children + if (!this.isChild) { + this.source[1] += '\n' + this.context.programs.join('\n') + '\n'; + } + + if (!this.environment.isSimple) { + this.source.push("return buffer;"); + } + + var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"]; + + for(var i=0, l=this.environment.depths.list.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); } + return "stack" + this.stackSlot; + }, + + popStack: function() { + var item = this.compileStack.pop(); + + if (item instanceof Literal) { + return item.value; + } else { + this.stackSlot--; + return item; + } + }, + + topStack: function() { + var item = this.compileStack[this.compileStack.length - 1]; + + if (item instanceof Literal) { + return item.value; + } else { + return item; + } + }, + + quotedString: function(str) { + return '"' + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + '"'; + }, + + setupHelper: function(paramSize, name) { + var params = []; + this.setupParams(paramSize, params); + var foundHelper = this.nameLookup('helpers', name, 'helper'); + + return { + params: params, + name: foundHelper, + callParams: ["depth0"].concat(params).join(", "), + helperMissingParams: ["depth0", this.quotedString(name)].concat(params).join(", ") + }; + }, + + // the params and contexts arguments are passed in arrays + // to fill in + setupParams: function(paramSize, params) { + var options = [], contexts = [], types = [], param, inverse, program; + + options.push("hash:" + this.popStack()); + + inverse = this.popStack(); + program = this.popStack(); + + // Avoid setting fn and inverse if neither are set. This allows + // helpers to do a check for `if (options.fn)` + if (program || inverse) { + if (!program) { + this.context.aliases.self = "this"; + program = "self.noop"; + } + + if (!inverse) { + this.context.aliases.self = "this"; + inverse = "self.noop"; + } + + options.push("inverse:" + inverse); + options.push("fn:" + program); + } + + for(var i=0; i 1 ? arguments[1] : {}, + startRule; + + if (options.startRule !== undefined) { + startRule = options.startRule; + + if (parseFunctions[startRule] === undefined) { + throw new Error("Can't start parsing from rule " + quote(startRule) + "."); + } + } else { + startRule = "content"; + } + + var pos = 0; + var reportedPos = 0; + var cachedReportedPos = 0; + var cachedReportedPosDetails = { line: 1, column: 1, seenCR: false }; + var reportFailures = 0; + var rightmostFailuresPos = 0; + var rightmostFailuresExpected = []; + + function padLeft(input, padding, length) { + var result = input; + + var padLength = length - input.length; + for (var i = 0; i < padLength; i++) { + result = padding + result; + } + + return result; + } + + function escape(ch) { + var charCode = ch.charCodeAt(0); + var escapeChar; + var length; + + if (charCode <= 0xFF) { + escapeChar = 'x'; + length = 2; + } else { + escapeChar = 'u'; + length = 4; + } + + return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length); + } + + function computeReportedPosDetails() { + function advanceCachedReportedPos() { + var ch; + + for (; cachedReportedPos < reportedPos; cachedReportedPos++) { + ch = input.charAt(cachedReportedPos); + if (ch === "\n") { + if (!cachedReportedPosDetails.seenCR) { cachedReportedPosDetails.line++; } + cachedReportedPosDetails.column = 1; + cachedReportedPosDetails.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + cachedReportedPosDetails.line++; + cachedReportedPosDetails.column = 1; + cachedReportedPosDetails.seenCR = true; + } else { + cachedReportedPosDetails.column++; + cachedReportedPosDetails.seenCR = false; + } + } + } + + if (cachedReportedPos !== reportedPos) { + if (cachedReportedPos > reportedPos) { + cachedReportedPos = 0; + cachedReportedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advanceCachedReportedPos(); + } + + return cachedReportedPosDetails; + } + + function text() { + return input.substring(reportedPos, pos); + } + + function offset() { + return reportedPos; + } + + function line() { + return computeReportedPosDetails().line; + } + + function column() { + return computeReportedPosDetails().column; + } + + function matchFailed(failure) { + if (pos < rightmostFailuresPos) { + return; + } + + if (pos > rightmostFailuresPos) { + rightmostFailuresPos = pos; + rightmostFailuresExpected = []; + } + + rightmostFailuresExpected.push(failure); + } + + function parse_content() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + r2 = parse_statement(); + while (r2 !== null) { + r0.push(r2); + r2 = parse_statement(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_invertibleContent() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + + r1 = pos; + r2 = pos; + r3 = parse_content(); + if (r3 !== null) { + r5 = pos; + r6 = pos; + r7 = parse_DEDENT(); + if (r7 !== null) { + if (input.substr(pos, 4) === "else") { + r8 = "else"; + pos += 4; + } else { + r8 = null; + if (reportFailures === 0) { + matchFailed("\"else\""); + } + } + if (r8 !== null) { + r9 = parse__(); + if (r9 !== null) { + r10 = parse_TERM(); + if (r10 !== null) { + r11 = parse_INDENT(); + if (r11 !== null) { + r12 = parse_content(); + if (r12 !== null) { + r4 = [r7, r8, r9, r10, r11, r12]; + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + } else { + r4 = null; + pos = r6; + } + if (r4 !== null) { + reportedPos = r5; + r4 = (function(c) {return c;})(r12); + } + if (r4 === null) { + pos = r5; + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(c, i) { + return new Handlebars.AST.ProgramNode(c, i || []); + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_statement() { + var r0; + + r0 = parse_comment(); + if (r0 === null) { + r0 = parse_htmlElement(); + if (r0 === null) { + r0 = parse_textLine(); + if (r0 === null) { + r0 = parse_mustache(); + } + } + } + return r0; + } + + function parse_htmlElement() { + var r0; + + r0 = parse_htmlElementMaybeBlock(); + if (r0 === null) { + r0 = parse_htmlElementWithInlineContent(); + } + return r0; + } + + function parse_mustache() { + var r0, r1; + + r1 = pos; + r0 = parse_explicitMustache(); + if (r0 === null) { + r0 = parse_lineStartingMustache(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { + return [m]; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_comment() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 47) { + r3 = "/"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"/\""); + } + } + if (r3 !== null) { + r4 = parse_lineContent(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r11 = pos; + r12 = parse_lineContent(); + if (r12 !== null) { + r13 = parse_TERM(); + if (r13 !== null) { + r10 = [r12, r13]; + } else { + r10 = null; + pos = r11; + } + } else { + r10 = null; + pos = r11; + } + if (r10 !== null) { + r9 = []; + while (r10 !== null) { + r9.push(r10); + r11 = pos; + r12 = parse_lineContent(); + if (r12 !== null) { + r13 = parse_TERM(); + if (r13 !== null) { + r10 = [r12, r13]; + } else { + r10 = null; + pos = r11; + } + } else { + r10 = null; + pos = r11; + } + } + } else { + r9 = null; + } + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return []; })(); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_lineStartingMustache() { + var r0; + + r0 = parse_capitalizedLineStarterMustache(); + if (r0 === null) { + r0 = parse_mustacheMaybeBlock(); + } + return r0; + } + + function parse_capitalizedLineStarterMustache() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r4 = pos; + reportFailures++; + if (/^[A-Z]/.test(input.charAt(pos))) { + r3 = input.charAt(pos); + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("[A-Z]"); + } + } + reportFailures--; + if (r3 !== null) { + r3 = ""; + pos = r4; + } else { + r3 = null; + } + if (r3 !== null) { + r4 = parse_mustacheMaybeBlock(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + // ret is the MustacheNode + return unshiftParam(ret, defaultCapitalizedHelper); + } + })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_htmlElementMaybeBlock() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10; + + r1 = pos; + r2 = pos; + r3 = parse_htmlTagAndOptionalAttributes(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r9 = parse_content(); + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[1]); + } + ret.push(h[1]); + + return ret; + })(r3, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_htmlElementWithInlineContent() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_htmlTagAndOptionalAttributes(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + if (r4 !== null) { + r5 = parse_htmlInlineContent(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + ret.push(h[1]); + + return ret; + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_mustacheMaybeBlock() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10; + + r1 = pos; + r2 = pos; + r3 = parse_inMustache(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r7 = pos; + r8 = parse_INDENT(); + if (r8 !== null) { + r9 = parse_invertibleContent(); + if (r9 !== null) { + r10 = parse_DEDENT(); + if (r10 !== null) { + r6 = [r8, r9, r10]; + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + } else { + r6 = null; + pos = r7; + } + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[1]; + return new Handlebars.AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + })(r3, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_explicitMustache() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse_equalSign(); + if (r3 !== null) { + r4 = parse_mustacheMaybeBlock(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inMustache() { + var r0, r1, r2, r3, r4, r5, r6; + + r1 = pos; + r2 = pos; + r3 = parse_pathIdNode(); + if (r3 !== null) { + r4 = parse_trailingModifier(); + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r5 = []; + r6 = parse_inMustacheParam(); + while (r6 !== null) { + r5.push(r6); + r6 = parse_inMustacheParam(); + } + if (r5 !== null) { + r6 = parse_hash(); + r6 = r6 !== null ? r6 : ""; + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(path, tm, params, hash) { + params.unshift(path); + + var mustacheNode = new Handlebars.AST.MustacheNode(params, hash); + + if(tm == '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm == '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm == '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + })(r3, r4, r5, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_modifiedParam() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse_param(); + if (r3 !== null) { + r4 = parse_trailingModifier(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p, m) { + var ret = new String(p); + ret.trailingModifier = m; + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inMustacheParam() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + r3 = parse__(); + if (r3 !== null) { + r4 = parse_param(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_trailingModifier() { + var r0; + + if (/^[!?*\^]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[!?*\\^]"); + } + } + return r0; + } + + function parse_hash() { + var r0, r1, r2; + + r1 = pos; + r2 = parse_hashSegment(); + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + r2 = parse_hashSegment(); + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { return new Handlebars.AST.HashNode(h); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_pathIdent() { + var r0, r1, r2, r3, r4, r5; + + if (input.substr(pos, 2) === "..") { + r0 = ".."; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"..\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 46) { + r0 = "."; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\".\""); + } + } + if (r0 === null) { + r1 = pos; + r2 = pos; + if (/^[a-zA-Z0-9_$\-]/.test(input.charAt(pos))) { + r4 = input.charAt(pos); + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("[a-zA-Z0-9_$\\-]"); + } + } + if (r4 !== null) { + r3 = []; + while (r4 !== null) { + r3.push(r4); + if (/^[a-zA-Z0-9_$\-]/.test(input.charAt(pos))) { + r4 = input.charAt(pos); + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("[a-zA-Z0-9_$\\-]"); + } + } + } + } else { + r3 = null; + } + if (r3 !== null) { + r5 = pos; + reportFailures++; + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + reportFailures--; + if (r4 === null) { + r4 = ""; + } else { + r4 = null; + pos = r5; + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r3); + } + if (r0 === null) { + pos = r1; + } + } + } + return r0; + } + + function parse_hashSegment() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = parse__(); + if (r3 !== null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_pathIdNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_stringNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_integerNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + if (r4 === null) { + r5 = pos; + r6 = parse_ident(); + if (r6 !== null) { + if (input.charCodeAt(pos) === 61) { + r7 = "="; + pos++; + } else { + r7 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r7 !== null) { + r8 = parse_booleanNode(); + if (r8 !== null) { + r4 = [r6, r7, r8]; + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } else { + r4 = null; + pos = r5; + } + } + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { return [h[0], h[2]]; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_param() { + var r0; + + r0 = parse_pathIdNode(); + if (r0 === null) { + r0 = parse_stringNode(); + if (r0 === null) { + r0 = parse_integerNode(); + if (r0 === null) { + r0 = parse_booleanNode(); + } + } + } + return r0; + } + + function parse_path() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9; + + r1 = pos; + r2 = pos; + r3 = parse_pathIdent(); + if (r3 !== null) { + r4 = []; + r6 = pos; + r7 = pos; + r8 = parse_seperator(); + if (r8 !== null) { + r9 = parse_pathIdent(); + if (r9 !== null) { + r5 = [r8, r9]; + } else { + r5 = null; + pos = r7; + } + } else { + r5 = null; + pos = r7; + } + if (r5 !== null) { + reportedPos = r6; + r5 = (function(p) { return p; })(r9); + } + if (r5 === null) { + pos = r6; + } + while (r5 !== null) { + r4.push(r5); + r6 = pos; + r7 = pos; + r8 = parse_seperator(); + if (r8 !== null) { + r9 = parse_pathIdent(); + if (r9 !== null) { + r5 = [r8, r9]; + } else { + r5 = null; + pos = r7; + } + } else { + r5 = null; + pos = r7; + } + if (r5 !== null) { + reportedPos = r6; + r5 = (function(p) { return p; })(r9); + } + if (r5 === null) { + pos = r6; + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_seperator() { + var r0; + + if (/^[\/.]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[\\/.]"); + } + } + return r0; + } + + function parse_pathIdNode() { + var r0, r1; + + r1 = pos; + r0 = parse_path(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.IdNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_stringNode() { + var r0, r1; + + r1 = pos; + r0 = parse_string(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.StringNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_integerNode() { + var r0, r1; + + r1 = pos; + r0 = parse_integer(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.IntegerNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_booleanNode() { + var r0, r1; + + r1 = pos; + r0 = parse_boolean(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(v) { return new Handlebars.AST.BooleanNode(v); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boolean() { + var r0; + + if (input.substr(pos, 4) === "true") { + r0 = "true"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"true\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "false") { + r0 = "false"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"false\""); + } + } + } + return r0; + } + + function parse_integer() { + var r0, r1, r2; + + r1 = pos; + if (/^[0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return parseInt(s.join('')); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_string() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 34) { + r3 = "\""; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r3 !== null) { + r4 = parse_hashDoubleQuoteStringValue(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 34) { + r5 = "\""; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 === null) { + r2 = pos; + if (input.charCodeAt(pos) === 39) { + r3 = "'"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r3 !== null) { + r4 = parse_hashSingleQuoteStringValue(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 39) { + r5 = "'"; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p[1]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_hashDoubleQuoteStringValue() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^"}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\"}]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^"}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\"}]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_hashSingleQuoteStringValue() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^'}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^'}]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^'}]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^'}]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_alpha() { + var r0; + + if (/^[A-Za-z]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z]"); + } + } + return r0; + } + + function parse_htmlInlineContent() { + var r0, r1; + + r1 = pos; + r0 = parse_explicitMustache(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { return [m]; })(r0); + } + if (r0 === null) { + pos = r1; + } + if (r0 === null) { + r0 = parse_textNodes(); + } + return r0; + } + + function parse_textLine() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 124) { + r3 = "|"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"|\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r5 = parse_textNodes(); + if (r5 !== null) { + r6 = []; + r8 = pos; + r9 = pos; + r10 = parse_INDENT(); + if (r10 !== null) { + r11 = parse_textNodes(); + if (r11 !== null) { + r12 = parse_DEDENT(); + if (r12 !== null) { + r7 = [r10, r11, r12]; + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + if (r7 !== null) { + reportedPos = r8; + r7 = (function(t) { return t; })(r11); + } + if (r7 === null) { + pos = r8; + } + while (r7 !== null) { + r6.push(r7); + r8 = pos; + r9 = pos; + r10 = parse_INDENT(); + if (r10 !== null) { + r11 = parse_textNodes(); + if (r11 !== null) { + r12 = parse_DEDENT(); + if (r12 !== null) { + r7 = [r10, r11, r12]; + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + } else { + r7 = null; + pos = r9; + } + if (r7 !== null) { + reportedPos = r8; + r7 = (function(t) { return t; })(r11); + } + if (r7 === null) { + pos = r8; + } + } + if (r6 !== null) { + r0 = [r3, r4, r5, r6]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(nodes, indentedNodes) { + for(var i = 0; i < indentedNodes.length; ++i) { + nodes = nodes.concat(indentedNodes[i]); + } + return nodes; + })(r5, r6); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_textNodes() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = parse_preMustacheText(); + r3 = r3 !== null ? r3 : ""; + if (r3 !== null) { + r4 = []; + r6 = pos; + r7 = parse_rawMustache(); + if (r7 !== null) { + r8 = parse_preMustacheText(); + r8 = r8 !== null ? r8 : ""; + if (r8 !== null) { + r5 = [r7, r8]; + } else { + r5 = null; + pos = r6; + } + } else { + r5 = null; + pos = r6; + } + while (r5 !== null) { + r4.push(r5); + r6 = pos; + r7 = parse_rawMustache(); + if (r7 !== null) { + r8 = parse_preMustacheText(); + r8 = r8 !== null ? r8 : ""; + if (r8 !== null) { + r5 = [r7, r8]; + } else { + r5 = null; + pos = r6; + } + } else { + r5 = null; + pos = r6; + } + } + if (r4 !== null) { + r5 = parse_TERM(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustache() { + var r0; + + r0 = parse_rawMustacheUnescaped(); + if (r0 === null) { + r0 = parse_rawMustacheEscaped(); + } + return r0; + } + + function parse_rawMustacheSingle() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_singleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_singleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = true; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustacheEscaped() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_doubleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_doubleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = true; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_rawMustacheUnescaped() { + var r0, r1, r2, r3, r4, r5, r6, r7; + + r1 = pos; + r2 = pos; + r3 = parse_tripleOpen(); + if (r3 !== null) { + r4 = parse__(); + if (r4 !== null) { + r5 = parse_inMustache(); + if (r5 !== null) { + r6 = parse__(); + if (r6 !== null) { + r7 = parse_tripleClose(); + if (r7 !== null) { + r0 = [r3, r4, r5, r6, r7]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(m) { m.escaped = false; return m; })(r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_preMustacheText() { + var r0, r1, r2; + + r1 = pos; + if (/^[^{\uEFFF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^{\\uEFFF]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[^{\uEFFF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^{\\uEFFF]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return new Handlebars.AST.ContentNode(a.join('')); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_inTagMustache() { + var r0; + + r0 = parse_rawMustacheSingle(); + if (r0 === null) { + r0 = parse_rawMustacheUnescaped(); + if (r0 === null) { + r0 = parse_rawMustacheEscaped(); + } + } + return r0; + } + + function parse_singleOpen() { + var r0; + + if (input.charCodeAt(pos) === 123) { + r0 = "{"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{\""); + } + } + return r0; + } + + function parse_doubleOpen() { + var r0; + + if (input.substr(pos, 2) === "{{") { + r0 = "{{"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{{\""); + } + } + return r0; + } + + function parse_tripleOpen() { + var r0; + + if (input.substr(pos, 3) === "{{{") { + r0 = "{{{"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"{{{\""); + } + } + return r0; + } + + function parse_singleClose() { + var r0; + + if (input.charCodeAt(pos) === 125) { + r0 = "}"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}\""); + } + } + return r0; + } + + function parse_doubleClose() { + var r0; + + if (input.substr(pos, 2) === "}}") { + r0 = "}}"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}}\""); + } + } + return r0; + } + + function parse_tripleClose() { + var r0; + + if (input.substr(pos, 3) === "}}}") { + r0 = "}}}"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"}}}\""); + } + } + return r0; + } + + function parse_equalSign() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.substr(pos, 2) === "==") { + r3 = "=="; + pos += 2; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"==\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return false; })(); + } + if (r0 === null) { + pos = r1; + } + if (r0 === null) { + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 61) { + r3 = "="; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r3 !== null) { + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + r4 = r4 !== null ? r4 : ""; + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return true; })(); + } + if (r0 === null) { + pos = r1; + } + } + return r0; + } + + function parse_htmlTagAndOptionalAttributes() { + var r0, r1, r2, r3, r4, r5, r6, r7, r8; + + r1 = pos; + r2 = pos; + r3 = pos; + r4 = parse_htmlTagName(); + if (r4 !== null) { + r5 = parse_shorthandAttributes(); + r5 = r5 !== null ? r5 : ""; + if (r5 !== null) { + r6 = []; + r7 = parse_inTagMustache(); + while (r7 !== null) { + r6.push(r7); + r7 = parse_inTagMustache(); + } + if (r6 !== null) { + r7 = []; + r8 = parse_fullAttribute(); + while (r8 !== null) { + r7.push(r8); + r8 = parse_fullAttribute(); + } + if (r7 !== null) { + r0 = [r4, r5, r6, r7]; + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + if (r0 !== null) { + reportedPos = r2; + r0 = (function(h, s, m, f) { return [h, s, m, f]; })(r4, r5, r6, r7); + } + if (r0 === null) { + pos = r2; + } + if (r0 === null) { + r2 = pos; + r3 = pos; + r4 = parse_shorthandAttributes(); + if (r4 !== null) { + r5 = []; + r6 = parse_inTagMustache(); + while (r6 !== null) { + r5.push(r6); + r6 = parse_inTagMustache(); + } + if (r5 !== null) { + r6 = []; + r7 = parse_fullAttribute(); + while (r7 !== null) { + r6.push(r7); + r7 = parse_fullAttribute(); + } + if (r6 !== null) { + r0 = [r4, r5, r6]; + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + } else { + r0 = null; + pos = r3; + } + if (r0 !== null) { + reportedPos = r2; + r0 = (function(s, m, f) { return [null, s, m, f] })(r4, r5, r6); + } + if (r0 === null) { + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new Handlebars.AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + tagOpenContent.push(new Handlebars.AST.ContentNode('>')); + + return [tagOpenContent, new Handlebars.AST.ContentNode('')]; + })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_shorthandAttributes() { + var r0; + + r0 = parse_attributesAtLeastID(); + if (r0 === null) { + r0 = parse_attributesAtLeastClass(); + } + return r0; + } + + function parse_attributesAtLeastID() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_idShorthand(); + if (r3 !== null) { + r4 = []; + r5 = parse_classShorthand(); + while (r5 !== null) { + r4.push(r5); + r5 = parse_classShorthand(); + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(id, classes) { return [id, classes]; })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributesAtLeastClass() { + var r0, r1, r2; + + r1 = pos; + r2 = parse_classShorthand(); + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + r2 = parse_classShorthand(); + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(classes) { return [null, classes]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_fullAttribute() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + if (r4 !== null) { + r3 = []; + while (r4 !== null) { + r3.push(r4); + if (input.charCodeAt(pos) === 32) { + r4 = " "; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\" \""); + } + } + } + } else { + r3 = null; + } + if (r3 !== null) { + r4 = parse_actionAttribute(); + if (r4 === null) { + r4 = parse_boundAttribute(); + if (r4 === null) { + r4 = parse_normalAttribute(); + } + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { + return [new Handlebars.AST.ContentNode(' '), a]; + })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boundAttributeValueText() { + var r0, r1, r2; + + r1 = pos; + if (/^[A-Za-z.:0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z.:0-9]"); + } + } + if (r2 !== null) { + r0 = []; + while (r2 !== null) { + r0.push(r2); + if (/^[A-Za-z.:0-9]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[A-Za-z.:0-9]"); + } + } + } + } else { + r0 = null; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(s) { return s.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_actionValue() { + var r0, r1; + + r0 = parse_quotedActionValue(); + if (r0 === null) { + r1 = pos; + r0 = parse_pathIdNode(); + if (r0 !== null) { + reportedPos = r1; + r0 = (function(id) { return new Handlebars.AST.MustacheNode([id]); })(r0); + } + if (r0 === null) { + pos = r1; + } + } + return r0; + } + + function parse_quotedActionValue() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 34) { + r3 = "\""; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r3 !== null) { + r4 = parse_inMustache(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 34) { + r5 = "\""; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"\\\"\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 === null) { + r2 = pos; + if (input.charCodeAt(pos) === 39) { + r3 = "'"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r3 !== null) { + r4 = parse_inMustache(); + if (r4 !== null) { + if (input.charCodeAt(pos) === 39) { + r5 = "'"; + pos++; + } else { + r5 = null; + if (reportFailures === 0) { + matchFailed("\"'\""); + } + } + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(p) { return p[1]; })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_actionAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_knownEvent(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_actionValue(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return unshiftParam(mustacheNode, 'action', [['on', new Handlebars.AST.StringNode(event)]]); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_boundAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_ident(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_boundAttributeValueText(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(key, value) { + var hashNode = new Handlebars.AST.HashNode([[key, new Handlebars.AST.StringNode(value)]]); + var params = [new Handlebars.AST.IdNode(['bindAttr'])]; + + return new Handlebars.AST.MustacheNode(params, hashNode); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_normalAttribute() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_ident(); + if (r3 !== null) { + if (input.charCodeAt(pos) === 61) { + r4 = "="; + pos++; + } else { + r4 = null; + if (reportFailures === 0) { + matchFailed("\"=\""); + } + } + if (r4 !== null) { + r5 = parse_string(); + if (r5 !== null) { + r0 = [r3, r4, r5]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(key, value) { + var s = key + '=' + '"' + value + '"'; + return new Handlebars.AST.ContentNode(s); + })(r3, r5); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributeName() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + r2 = parse_attributeChar(); + while (r2 !== null) { + r0.push(r2); + r2 = parse_attributeChar(); + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return a.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_attributeValue() { + var r0; + + r0 = parse_string(); + if (r0 === null) { + r0 = parse_param(); + } + return r0; + } + + function parse_attributeChar() { + var r0; + + r0 = parse_alpha(); + if (r0 === null) { + if (/^[0-9]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[0-9]"); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 95) { + r0 = "_"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"_\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 45) { + r0 = "-"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"-\""); + } + } + } + } + } + return r0; + } + + function parse_idShorthand() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 35) { + r3 = "#"; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\"#\""); + } + } + if (r3 !== null) { + r4 = parse_ident(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(t) { return t;})(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_classShorthand() { + var r0, r1, r2, r3, r4; + + r1 = pos; + r2 = pos; + if (input.charCodeAt(pos) === 46) { + r3 = "."; + pos++; + } else { + r3 = null; + if (reportFailures === 0) { + matchFailed("\".\""); + } + } + if (r3 !== null) { + r4 = parse_ident(); + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(c) { return c; })(r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_ident() { + var r0, r1, r2, r3, r4, r5; + + r1 = pos; + r2 = pos; + r3 = parse_nmstart(); + if (r3 !== null) { + r4 = []; + r5 = parse_nmchar(); + while (r5 !== null) { + r4.push(r5); + r5 = parse_nmchar(); + } + if (r4 !== null) { + r0 = [r3, r4]; + } else { + r0 = null; + pos = r2; + } + } else { + r0 = null; + pos = r2; + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(nmstart, nmchars) { return nmstart + nmchars.join(""); })(r3, r4); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + function parse_nmchar() { + var r0; + + if (/^[_a-zA-Z0-9\-]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[_a-zA-Z0-9\\-]"); + } + } + if (r0 === null) { + r0 = parse_nonascii(); + } + return r0; + } + + function parse_nmstart() { + var r0; + + if (/^[_a-zA-Z]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[_a-zA-Z]"); + } + } + if (r0 === null) { + r0 = parse_nonascii(); + } + return r0; + } + + function parse_nonascii() { + var r0; + + if (/^[\x80-\xFF]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[\\x80-\\xFF]"); + } + } + return r0; + } + + function parse_htmlTagName() { + var r0; + + reportFailures++; + if (input.substr(pos, 10) === "figcaption") { + r0 = "figcaption"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"figcaption\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "blockquote") { + r0 = "blockquote"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"blockquote\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "plaintext") { + r0 = "plaintext"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"plaintext\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "textarea") { + r0 = "textarea"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"textarea\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "progress") { + r0 = "progress"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"progress\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "optgroup") { + r0 = "optgroup"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"optgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "noscript") { + r0 = "noscript"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"noscript\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "noframes") { + r0 = "noframes"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"noframes\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "frameset") { + r0 = "frameset"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"frameset\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "fieldset") { + r0 = "fieldset"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"fieldset\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "datalist") { + r0 = "datalist"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"datalist\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "colgroup") { + r0 = "colgroup"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"colgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "basefont") { + r0 = "basefont"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"basefont\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "summary") { + r0 = "summary"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"summary\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "section") { + r0 = "section"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"section\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "marquee") { + r0 = "marquee"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"marquee\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "listing") { + r0 = "listing"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"listing\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "isindex") { + r0 = "isindex"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"isindex\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "details") { + r0 = "details"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"details\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "command") { + r0 = "command"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"command\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "caption") { + r0 = "caption"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"caption\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "bgsound") { + r0 = "bgsound"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bgsound\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "article") { + r0 = "article"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"article\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "address") { + r0 = "address"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"address\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "acronym") { + r0 = "acronym"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"acronym\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "strong") { + r0 = "strong"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"strong\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "strike") { + r0 = "strike"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"strike\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "spacer") { + r0 = "spacer"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"spacer\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "source") { + r0 = "source"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"source\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "select") { + r0 = "select"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"select\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "script") { + r0 = "script"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"script\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "output") { + r0 = "output"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"output\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "option") { + r0 = "option"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"option\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "object") { + r0 = "object"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"object\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "legend") { + r0 = "legend"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"legend\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "keygen") { + r0 = "keygen"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keygen\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "iframe") { + r0 = "iframe"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"iframe\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "hgroup") { + r0 = "hgroup"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"hgroup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "header") { + r0 = "header"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"header\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "footer") { + r0 = "footer"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"footer\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "figure") { + r0 = "figure"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"figure\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "center") { + r0 = "center"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"center\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "canvas") { + r0 = "canvas"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"canvas\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "button") { + r0 = "button"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"button\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "applet") { + r0 = "applet"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"applet\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "video") { + r0 = "video"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"video\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "track") { + r0 = "track"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"track\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "title") { + r0 = "title"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"title\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "thead") { + r0 = "thead"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"thead\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "tfoot") { + r0 = "tfoot"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tfoot\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "tbody") { + r0 = "tbody"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tbody\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "table") { + r0 = "table"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"table\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "style") { + r0 = "style"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"style\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "small") { + r0 = "small"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"small\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "param") { + r0 = "param"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"param\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "meter") { + r0 = "meter"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"meter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "label") { + r0 = "label"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"label\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "input") { + r0 = "input"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"input\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "frame") { + r0 = "frame"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"frame\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "embed") { + r0 = "embed"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"embed\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "blink") { + r0 = "blink"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"blink\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "audio") { + r0 = "audio"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"audio\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "aside") { + r0 = "aside"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"aside\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "time") { + r0 = "time"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"time\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "span") { + r0 = "span"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"span\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "samp") { + r0 = "samp"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"samp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "ruby") { + r0 = "ruby"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ruby\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "nobr") { + r0 = "nobr"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"nobr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "meta") { + r0 = "meta"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"meta\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "menu") { + r0 = "menu"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"menu\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "mark") { + r0 = "mark"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mark\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "main") { + r0 = "main"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"main\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "link") { + r0 = "link"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"link\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "html") { + r0 = "html"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"html\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "head") { + r0 = "head"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"head\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "form") { + r0 = "form"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"form\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "font") { + r0 = "font"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"font\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "data") { + r0 = "data"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"data\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "code") { + r0 = "code"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"code\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "cite") { + r0 = "cite"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"cite\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "body") { + r0 = "body"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"body\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "base") { + r0 = "base"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"base\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "area") { + r0 = "area"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"area\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "abbr") { + r0 = "abbr"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"abbr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "xmp") { + r0 = "xmp"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"xmp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "wbr") { + r0 = "wbr"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"wbr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "var") { + r0 = "var"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"var\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "sup") { + r0 = "sup"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"sup\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "sub") { + r0 = "sub"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"sub\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "pre") { + r0 = "pre"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"pre\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "nav") { + r0 = "nav"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"nav\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "map") { + r0 = "map"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"map\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "kbd") { + r0 = "kbd"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"kbd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "ins") { + r0 = "ins"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ins\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "img") { + r0 = "img"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"img\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "div") { + r0 = "div"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"div\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "dir") { + r0 = "dir"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dir\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "dfn") { + r0 = "dfn"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dfn\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "del") { + r0 = "del"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"del\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "col") { + r0 = "col"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"col\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "big") { + r0 = "big"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"big\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "bdo") { + r0 = "bdo"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bdo\""); + } + } + if (r0 === null) { + if (input.substr(pos, 3) === "bdi") { + r0 = "bdi"; + pos += 3; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"bdi\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "ul") { + r0 = "ul"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ul\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "tt") { + r0 = "tt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "tr") { + r0 = "tr"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"tr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "th") { + r0 = "th"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"th\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "td") { + r0 = "td"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"td\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "rt") { + r0 = "rt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"rt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "rp") { + r0 = "rp"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"rp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "ol") { + r0 = "ol"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"ol\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "li") { + r0 = "li"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"li\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "hr") { + r0 = "hr"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"hr\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h6") { + r0 = "h6"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h6\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h5") { + r0 = "h5"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h5\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h4") { + r0 = "h4"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h4\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h3") { + r0 = "h3"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h3\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h2") { + r0 = "h2"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h2\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "h1") { + r0 = "h1"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"h1\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "em") { + r0 = "em"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"em\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dt") { + r0 = "dt"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dt\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dl") { + r0 = "dl"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dl\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "dd") { + r0 = "dd"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 2) === "br") { + r0 = "br"; + pos += 2; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"br\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 117) { + r0 = "u"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"u\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 115) { + r0 = "s"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"s\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 113) { + r0 = "q"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"q\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 112) { + r0 = "p"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"p\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 105) { + r0 = "i"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"i\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 98) { + r0 = "b"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"b\""); + } + } + if (r0 === null) { + if (input.charCodeAt(pos) === 97) { + r0 = "a"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"a\""); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("a valid HTML tag name"); + } + return r0; + } + + function parse_knownEvent() { + var r0; + + reportFailures++; + if (input.substr(pos, 10) === "touchStart") { + r0 = "touchStart"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchStart\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "touchMove") { + r0 = "touchMove"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchMove\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "touchEnd") { + r0 = "touchEnd"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchEnd\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "touchCancel") { + r0 = "touchCancel"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"touchCancel\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "keyDown") { + r0 = "keyDown"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyDown\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "keyUp") { + r0 = "keyUp"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyUp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "keyPress") { + r0 = "keyPress"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"keyPress\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "mouseDown") { + r0 = "mouseDown"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseDown\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "mouseUp") { + r0 = "mouseUp"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseUp\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "contextMenu") { + r0 = "contextMenu"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"contextMenu\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "click") { + r0 = "click"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"click\""); + } + } + if (r0 === null) { + if (input.substr(pos, 11) === "doubleClick") { + r0 = "doubleClick"; + pos += 11; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"doubleClick\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "mouseMove") { + r0 = "mouseMove"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseMove\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "focusIn") { + r0 = "focusIn"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"focusIn\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "focusOut") { + r0 = "focusOut"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"focusOut\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "mouseEnter") { + r0 = "mouseEnter"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseEnter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 10) === "mouseLeave") { + r0 = "mouseLeave"; + pos += 10; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"mouseLeave\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "submit") { + r0 = "submit"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"submit\""); + } + } + if (r0 === null) { + if (input.substr(pos, 5) === "input") { + r0 = "input"; + pos += 5; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"input\""); + } + } + if (r0 === null) { + if (input.substr(pos, 6) === "change") { + r0 = "change"; + pos += 6; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"change\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragStart") { + r0 = "dragStart"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragStart\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "drag") { + r0 = "drag"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"drag\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragEnter") { + r0 = "dragEnter"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragEnter\""); + } + } + if (r0 === null) { + if (input.substr(pos, 9) === "dragLeave") { + r0 = "dragLeave"; + pos += 9; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragLeave\""); + } + } + if (r0 === null) { + if (input.substr(pos, 8) === "dragOver") { + r0 = "dragOver"; + pos += 8; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragOver\""); + } + } + if (r0 === null) { + if (input.substr(pos, 4) === "drop") { + r0 = "drop"; + pos += 4; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"drop\""); + } + } + if (r0 === null) { + if (input.substr(pos, 7) === "dragEnd") { + r0 = "dragEnd"; + pos += 7; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"dragEnd\""); + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("a JS event"); + } + return r0; + } + + function parse_INDENT() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61423) { + r0 = "\uEFEF"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFEF\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("INDENT"); + } + return r0; + } + + function parse_DEDENT() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61438) { + r0 = "\uEFFE"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFFE\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("DEDENT"); + } + return r0; + } + + function parse_TERM() { + var r0, r1; + + reportFailures++; + r1 = pos; + if (input.charCodeAt(pos) === 61439) { + r0 = "\uEFFF"; + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("\"\\uEFFF\""); + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function() { return ''; })(); + } + if (r0 === null) { + pos = r1; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("TERM"); + } + return r0; + } + + function parse___() { + var r0, r1; + + reportFailures++; + r1 = parse_whitespace(); + if (r1 !== null) { + r0 = []; + while (r1 !== null) { + r0.push(r1); + r1 = parse_whitespace(); + } + } else { + r0 = null; + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("required whitespace"); + } + return r0; + } + + function parse__() { + var r0, r1; + + reportFailures++; + r0 = []; + r1 = parse_whitespace(); + while (r1 !== null) { + r0.push(r1); + r1 = parse_whitespace(); + } + reportFailures--; + if (reportFailures === 0 && r0 === null) { + matchFailed("whitespace"); + } + return r0; + } + + function parse_whitespace() { + var r0; + + if (/^[ \t\n\r]/.test(input.charAt(pos))) { + r0 = input.charAt(pos); + pos++; + } else { + r0 = null; + if (reportFailures === 0) { + matchFailed("[ \\t\\n\\r]"); + } + } + return r0; + } + + function parse_lineContent() { + var r0, r1, r2; + + r1 = pos; + r0 = []; + if (/^[^\uEFFF\uEFFE\uEFEF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\\uEFFF\\uEFFE\\uEFEF]"); + } + } + while (r2 !== null) { + r0.push(r2); + if (/^[^\uEFFF\uEFFE\uEFEF]/.test(input.charAt(pos))) { + r2 = input.charAt(pos); + pos++; + } else { + r2 = null; + if (reportFailures === 0) { + matchFailed("[^\\uEFFF\\uEFFE\\uEFEF]"); + } + } + } + if (r0 !== null) { + reportedPos = r1; + r0 = (function(a) { return a.join(''); })(r0); + } + if (r0 === null) { + pos = r1; + } + return r0; + } + + + function cleanupExpected(expected) { + expected.sort(); + + var lastExpected = null; + var cleanExpected = []; + for (var i = 0; i < expected.length; i++) { + if (expected[i] !== lastExpected) { + cleanExpected.push(expected[i]); + lastExpected = expected[i]; + } + } + return cleanExpected; + } + + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new Handlebars.AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new Handlebars.AST.IdNode([helperName])); + return new Handlebars.AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + + var result = parseFunctions[startRule](); + + /* + * The parser is now in one of the following three states: + * + * 1. The parser successfully parsed the whole input. + * + * - |result !== null| + * - |pos === input.length| + * - |rightmostFailuresExpected| may or may not contain something + * + * 2. The parser successfully parsed only a part of the input. + * + * - |result !== null| + * - |pos < input.length| + * - |rightmostFailuresExpected| may or may not contain something + * + * 3. The parser did not successfully parse any part of the input. + * + * - |result === null| + * - |pos === 0| + * - |rightmostFailuresExpected| contains at least one failure + * + * All code following this comment (including called functions) must + * handle these states. + */ + if (result === null || pos !== input.length) { + reportedPos = Math.max(pos, rightmostFailuresPos); + var found = reportedPos < input.length ? input.charAt(reportedPos) : null; + var reportedPosDetails = computeReportedPosDetails(); + + throw new this.SyntaxError( + cleanupExpected(rightmostFailuresExpected), + found, + reportedPos, + reportedPosDetails.line, + reportedPosDetails.column + ); + } + + return result; + } + }; + + /* Thrown when a parser encounters a syntax error. */ + + result.SyntaxError = function(expected, found, offset, line, column) { + function buildMessage(expected, found) { + var expectedHumanized, foundHumanized; + + switch (expected.length) { + case 0: + expectedHumanized = "end of input"; + break; + case 1: + expectedHumanized = expected[0]; + break; + default: + expectedHumanized = expected.slice(0, expected.length - 1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundHumanized = found ? quote(found) : "end of input"; + + return "Expected " + expectedHumanized + " but " + foundHumanized + " found."; + } + + this.name = "SyntaxError"; + this.expected = expected; + this.found = found; + this.message = buildMessage(expected, found); + this.offset = offset; + this.line = line; + this.column = column; + }; + + subclass(result.SyntaxError, Error); + + return result; +})(); + +// exports = Emblem.Parser; +; +// lib/compiler.js +var Emblem, Handlebars, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + +//  + +//  + +Emblem.parse = function(string) { + var processed; + processed = Emblem.Preprocessor.processSync(string); + return new Handlebars.AST.ProgramNode(Emblem.Parser.parse(processed), []); +}; + +Emblem.precompileRaw = function(string, options) { + var ast, environment; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.precompile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + return new Handlebars.JavaScriptCompiler().compile(environment, options); +}; + +Emblem.compileRaw = function(string, options) { + var compile, compiled; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.compile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + compiled = null; + compile = function() { + var ast, environment, templateSpec; + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Handlebars.template(templateSpec); + }; + return function(context, options) { + if (!compiled) { + compiled = compile(); + } + return compiled.call(this, context, options); + }; +}; + +Emblem.precompile = Emblem.precompileRaw; + +Emblem.compile = Emblem.compileRaw; + +Emblem.precompileEmber = function(string) { + var ast, environment, options; + ast = Emblem.parse(string); + options = { + knownHelpers: { + action: true, + unbound: true, + bindAttr: true, + template: true, + view: true, + _triageMustache: true + }, + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); +}; + +Emblem.compileEmber = function(string) { + var ast, environment, options, templateSpec; + ast = Emblem.parse(string); + options = { + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Ember.Handlebars.template(templateSpec); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + +//  + +//  + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = this.indent = null; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + this.ss = new StringScanner(''); + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, c, delta, level, lines, message, newLevel, tok; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indent != null) { + level = ((function() { + var _i, _len, _ref, _results; + _ref = this.context; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + c = _ref[_i]; + if (c === INDENT) { + _results.push(0); + } + } + return _results; + }).call(this)).length; + if (this.ss.check(RegExp("(?:" + this.indent + "){" + (level + 1) + "}[^" + ws + "#]"))) { + this.discard(RegExp("(?:" + this.indent + "){" + (level + 1) + "}")); + this.context.observe(INDENT); + this.p(INDENT); + } else if (level > 0 && this.ss.check(RegExp("(?:" + this.indent + "){0," + (level - 1) + "}[^" + ws + "]"))) { + newLevel = 0; + while (this.discard(RegExp("" + this.indent))) { + ++newLevel; + } + delta = level - newLevel; + while (delta--) { + this.context.observe(DEDENT); + this.p("" + DEDENT); + } + } else if (this.ss.check(RegExp("(?:" + this.indent + "){" + level + "}[^" + ws + "]"))) { + this.discard(RegExp("(?:" + this.indent + "){" + level + "}")); + } else { + lines = this.ss.str.substr(0, this.ss.pos).split(/\n/) || ['']; + message = "Syntax error on line " + lines.length + ": invalid indentation"; + throw new Error("" + message); + } + } else { + if (this.indent = this.discard(RegExp("[" + ws + "]+"))) { + this.context.observe(INDENT); + this.p(INDENT); + } + } + } + /* + # Search for context-introducing + tok = switch @context.peek() + when '[' + # safe things, but not closing bracket + @scan /[^\n'"\\\/#`[({\]]+/ + @scan /\]/ + when '(' + # safe things, but not closing paren + @scan /[^\n'"\\\/#`[({)]+/ + @scan /\)/ + when '#{', '{' + # safe things, but not closing brace + @scan /[^\n'"\\\/#`[({}]+/ + @scan /\}/ + else + # scan safe characters (anything that doesn't *introduce* context) + @scan /[^\n'"\\\/#`[({]+/ + null + if tok + @context.observe tok + continue + */ + + this.scan(/[^\n\\]+/); + if (tok = this.discard(/\//)) { + this.context.observe(tok); + } + if (this.discard(/\n/)) { + this.p("" + TERM); + } + this.discard(any_whitespaceFollowedByNewlines_); + break; + case '/': + if (this.discard(/.*\n/)) { + this.context.observe('\n'); + } + break; + case '\\': + if (this.scan(/[\s\S]/)) { + this.context.observe('end-\\'); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p("" + DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + +//  + +Emblem.bootstrap = function(ctx) { + if (ctx == null) { + ctx = Ember.$(document); + } + Emblem.precompile = Emblem.precompileEmber; + Emblem.compile = Emblem.compileEmber; + return Ember.$('script[type="text/x-emblem"]', ctx).each(function() { + var script, templateName; + script = Ember.$(this); + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(script.html()); + return script.remove(); + }); +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.bootstrap(); +}); +; diff --git a/ajax/libs/emblem/0.0.1/emblem.min.js b/ajax/libs/emblem/0.0.1/emblem.min.js new file mode 100644 index 000000000..18eb6da9d --- /dev/null +++ b/ajax/libs/emblem/0.0.1/emblem.min.js @@ -0,0 +1,3 @@ +this.StringScanner=function(){var e;return e=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),e.prototype.beginningOfLine=e.prototype.bol,e.prototype.clear=e.prototype.terminate,e.prototype.dup=e.prototype.clone,e.prototype.endOfString=e.prototype.eos,e.prototype.exist=e.prototype.exists,e.prototype.getChar=e.prototype.getch,e.prototype.position=e.prototype.pointer,e.StringScanner=e,e}.call(this),this.Handlebars={},function(e){e.VERSION="1.0.rc.2",e.helpers={},e.partials={},e.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},e.registerPartial=function(e,t){this.partials[e]=t},e.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var t=Object.prototype.toString,n="[object Function]";e.registerHelper("blockHelperMissing",function(r,i){var s=i.inverse||function(){},o=i.fn,u="",a=t.call(r);return a===n&&(r=r.call(this)),r===!0?o(this):r===!1||r==null?s(this):a==="[object Array]"?r.length>0?e.helpers.each(r,i):s(this):o(r)}),e.K=function(){},e.createFrame=Object.create||function(t){e.K.prototype=t;var n=new e.K;return e.K.prototype=null,n},e.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,methodMap:{0:"debug",1:"info",2:"warn",3:"error"},log:function(t,n){if(e.logger.level<=t){var r=e.logger.methodMap[t];typeof console!="undefined"&&console[r]&&console[r].call(console,n)}}},e.log=function(t,n){e.logger.log(t,n)},e.registerHelper("each",function(t,n){var r=n.fn,i=n.inverse,s=0,o="",u;n.data&&(u=e.createFrame(n.data));if(t&&typeof t=="object")if(t instanceof Array)for(var a=t.length;s2&&k.push("'"+this.terminals_[T]+"'");this.lexer.showPosition?L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[g]||g)+"'":L="Parse error on line "+(a+1)+": Unexpected "+(g==1?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(L,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:p,expected:k})}}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+g);switch(w[0]){case 1:r.push(g),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(w[1]),g=null,y?(g=y,y=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:N=this.productions_[w[1]][1],x.$=i[i.length-N],x._$={first_line:s[s.length-(N||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(N||1)].first_column,last_column:s[s.length-1].last_column},d&&(x._$.range=[s[s.length-(N||1)].range[0],s[s.length-1].range[1]]),S=this.performAction.call(x,u,f,a,this.yy,w[1],i,s);if(typeof S!="undefined")return S;N&&(r=r.slice(0,-1*N*2),i=i.slice(0,-1*N),s=s.slice(0,-1*N)),r.push(this.productions_[w[1]][0]),i.push(x.$),s.push(x._$),C=o[r[r.length-2]][r[r.length-1]],r.push(C);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r,i,s;this._more||(this.yytext="",this.match="");var o=this._currentRules();for(var u=0;ut[0].length)){t=n,r=u;if(!this.options.flex)break}}if(t){s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1);if(e)return e;return}return this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.options={},e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return n.yytext.slice(-1)!=="\\"&&this.popState(),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1)),14;case 3:return n.yytext=n.yytext.substr(0,n.yyleng-4),this.popState(),15;case 4:return this.begin("par"),24;case 5:return 16;case 6:return 20;case 7:return 19;case 8:return 19;case 9:return 23;case 10:return 23;case 11:this.popState(),this.begin("com");break;case 12:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 13:return 22;case 14:return 36;case 15:return 35;case 16:return 35;case 17:return 39;case 18:break;case 19:return this.popState(),18;case 20:return this.popState(),18;case 21:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),30;case 22:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\'/g,"'"),30;case 23:return n.yytext=n.yytext.substr(1),28;case 24:return 32;case 25:return 32;case 26:return 31;case 27:return 35;case 28:return n.yytext=n.yytext.substr(1,n.yyleng-2),35;case 29:return"INVALID";case 30:break;case 31:return this.popState(),37;case 32:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-/]+)/,/^(?:$)/],e.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},par:{rules:[30,31],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},e}();return e.lexer=t,n.prototype=e,e.Parser=n,new n}();Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.escaped=!n,this.hash=t;var r=this.id=e[0],i=this.params=e.slice(1),s=this.eligibleHelper=r.isSimple;this.isHelper=s&&(i.length||t)},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.partialName=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r,i){e(t.id,i),this.type="block",this.mustache=t,this.program=n,this.inverse=r,this.inverse&&!this.program&&(this.isInverse=!0)},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r":">",'"':""","'":"'","`":"`"},t=/[&<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return!e&&e!==0?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.prototype={compiler:e,disassemble:function(){var e=this.opcodes,t,n=[],r,i;for(var s=0,o=e.length;sthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){var e=this.compileStack.pop();return e instanceof n?e.value:(this.stackSlot--,e)},topStack:function(){var e=this.compileStack[this.compileStack.length-1];return e instanceof n?e.value:e},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'},setupHelper:function(e,t){var n=[];this.setupParams(e,n);var r=this.nameLookup("helpers",t,"helper");return{params:n,name:r,callParams:["depth0"].concat(n).join(", "),helperMissingParams:["depth0",this.quotedString(t)].concat(n).join(", ")}},setupParams:function(e,t){var n=[],r=[],i=[],s,o,u;n.push("hash:"+this.popStack()),o=this.popStack(),u=this.popStack();if(u||o)u||(this.context.aliases.self="this",u="self.noop"),o||(this.context.aliases.self="this",o="self.noop"),n.push("inverse:"+o),n.push("fn:"+u);for(var a=0;ao&&(u=0,a={line:1,column:1,seenCR:!1}),t()),a}function v(){return e.substring(o,s)}function m(){return o}function g(){return d().line}function y(){return d().column}function b(e){if(sl&&(l=s,c=[]),c.push(e)}function w(){var e,t,n;t=s,e=[],n=S();while(n!==null)e.push(n),n=S();return e!==null&&(o=t,e=function(e){var t=[],n=[];for(var r=0;r")),[u,new Handlebars.AST.ContentNode("")]}(e)),e===null&&(s=t),e}function vt(){var e;return e=mt(),e===null&&(e=gt()),e}function mt(){var e,t,n,r,i,u;t=s,n=s,r=Lt();if(r!==null){i=[],u=At();while(u!==null)i.push(u),u=At();i!==null?e=[r,i]:(e=null,s=n)}else e=null,s=n;return e!==null&&(o=t,e=function(e,t){return[e,t]}(r,i)),e===null&&(s=t),e}function gt(){var e,t,n;t=s,n=At();if(n!==null){e=[];while(n!==null)e.push(n),n=At()}else e=null;return e!==null&&(o=t,e=function(e){return[null,e]}(e)),e===null&&(s=t),e}function yt(){var t,n,r,i,u;n=s,r=s,e.charCodeAt(s)===32?(u=" ",s++):(u=null,f===0&&b('" "'));if(u!==null){i=[];while(u!==null)i.push(u),e.charCodeAt(s)===32?(u=" ",s++):(u=null,f===0&&b('" "'))}else i=null;return i!==null?(u=St(),u===null&&(u=xt(),u===null&&(u=Tt())),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return[new Handlebars.AST.ContentNode(" "),e]}(u)),t===null&&(s=n),t}function bt(){var t,n,r;n=s,/^[A-Za-z.:0-9]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[A-Za-z.:0-9]"));if(r!==null){t=[];while(r!==null)t.push(r),/^[A-Za-z.:0-9]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[A-Za-z.:0-9]"))}else t=null;return t!==null&&(o=n,t=function(e){return e.join("")}(t)),t===null&&(s=n),t}function wt(){var e,t;return e=Et(),e===null&&(t=s,e=U(),e!==null&&(o=t,e=function(e){return new Handlebars.AST.MustacheNode([e])}(e)),e===null&&(s=t)),e}function Et(){var t,n,r,i,u,a;return n=s,r=s,e.charCodeAt(s)===34?(i='"',s++):(i=null,f===0&&b('"\\""')),i!==null?(u=_(),u!==null?(e.charCodeAt(s)===34?(a='"',s++):(a=null,f===0&&b('"\\""')),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t===null&&(r=s,e.charCodeAt(s)===39?(i="'",s++):(i=null,f===0&&b('"\'"')),i!==null?(u=_(),u!==null?(e.charCodeAt(s)===39?(a="'",s++):(a=null,f===0&&b('"\'"')),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r)),t!==null&&(o=n,t=function(e){return e[1]}(t)),t===null&&(s=n),t}function St(){var t,n,r,i,u,a;return n=s,r=s,i=Ht(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=wt(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){return Wt(t,"action",[["on",new Handlebars.AST.StringNode(e)]])}(i,a)),t===null&&(s=n),t}function xt(){var t,n,r,i,u,a;return n=s,r=s,i=Ot(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=bt(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){var n=new Handlebars.AST.HashNode([[e,new Handlebars.AST.StringNode(t)]]),r=[new Handlebars.AST.IdNode(["bindAttr"])];return new Handlebars.AST.MustacheNode(r,n)}(i,a)),t===null&&(s=n),t}function Tt(){var t,n,r,i,u,a;return n=s,r=s,i=Ot(),i!==null?(e.charCodeAt(s)===61?(u="=",s++):(u=null,f===0&&b('"="')),u!==null?(a=J(),a!==null?t=[i,u,a]:(t=null,s=r)):(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e,t){var n=e+"="+'"'+t+'"';return new Handlebars.AST.ContentNode(n)}(i,a)),t===null&&(s=n),t}function Nt(){var e,t,n;t=s,e=[],n=kt();while(n!==null)e.push(n),n=kt();return e!==null&&(o=t,e=function(e){return e.join("")}(e)),e===null&&(s=t),e}function Ct(){var e;return e=J(),e===null&&(e=I()),e}function kt(){var t;return t=G(),t===null&&(/^[0-9]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[0-9]")),t===null&&(e.charCodeAt(s)===95?(t="_",s++):(t=null,f===0&&b('"_"')),t===null&&(e.charCodeAt(s)===45?(t="-",s++):(t=null,f===0&&b('"-"'))))),t}function Lt(){var t,n,r,i,u;return n=s,r=s,e.charCodeAt(s)===35?(i="#",s++):(i=null,f===0&&b('"#"')),i!==null?(u=Ot(),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return e}(u)),t===null&&(s=n),t}function At(){var t,n,r,i,u;return n=s,r=s,e.charCodeAt(s)===46?(i=".",s++):(i=null,f===0&&b('"."')),i!==null?(u=Ot(),u!==null?t=[i,u]:(t=null,s=r)):(t=null,s=r),t!==null&&(o=n,t=function(e){return e}(u)),t===null&&(s=n),t}function Ot(){var e,t,n,r,i,u;t=s,n=s,r=_t();if(r!==null){i=[],u=Mt();while(u!==null)i.push(u),u=Mt();i!==null?e=[r,i]:(e=null,s=n)}else e=null,s=n;return e!==null&&(o=t,e=function(e,t){return e+t.join("")}(r,i)),e===null&&(s=t),e}function Mt(){var t;return/^[_a-zA-Z0-9\-]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[_a-zA-Z0-9\\-]")),t===null&&(t=Dt()),t}function _t(){var t;return/^[_a-zA-Z]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[_a-zA-Z]")),t===null&&(t=Dt()),t}function Dt(){var t;return/^[\x80-\xFF]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[\\x80-\\xFF]")),t}function Pt(){var t;return f++,e.substr(s,10)==="figcaption"?(t="figcaption",s+=10):(t=null,f===0&&b('"figcaption"')),t===null&&(e.substr(s,10)==="blockquote"?(t="blockquote",s+=10):(t=null,f===0&&b('"blockquote"')),t===null&&(e.substr(s,9)==="plaintext"?(t="plaintext",s+=9):(t=null,f===0&&b('"plaintext"')),t===null&&(e.substr(s,8)==="textarea"?(t="textarea",s+=8):(t=null,f===0&&b('"textarea"')),t===null&&(e.substr(s,8)==="progress"?(t="progress",s+=8):(t=null,f===0&&b('"progress"')),t===null&&(e.substr(s,8)==="optgroup"?(t="optgroup",s+=8):(t=null,f===0&&b('"optgroup"')),t===null&&(e.substr(s,8)==="noscript"?(t="noscript",s+=8):(t=null,f===0&&b('"noscript"')),t===null&&(e.substr(s,8)==="noframes"?(t="noframes",s+=8):(t=null,f===0&&b('"noframes"')),t===null&&(e.substr(s,8)==="frameset"?(t="frameset",s+=8):(t=null,f===0&&b('"frameset"')),t===null&&(e.substr(s,8)==="fieldset"?(t="fieldset",s+=8):(t=null,f===0&&b('"fieldset"')),t===null&&(e.substr(s,8)==="datalist"?(t="datalist",s+=8):(t=null,f===0&&b('"datalist"')),t===null&&(e.substr(s,8)==="colgroup"?(t="colgroup",s+=8):(t=null,f===0&&b('"colgroup"')),t===null&&(e.substr(s,8)==="basefont"?(t="basefont",s+=8):(t=null,f===0&&b('"basefont"')),t===null&&(e.substr(s,7)==="summary"?(t="summary",s+=7):(t=null,f===0&&b('"summary"')),t===null&&(e.substr(s,7)==="section"?(t="section",s+=7):(t=null,f===0&&b('"section"')),t===null&&(e.substr(s,7)==="marquee"?(t="marquee",s+=7):(t=null,f===0&&b('"marquee"')),t===null&&(e.substr(s,7)==="listing"?(t="listing",s+=7):(t=null,f===0&&b('"listing"')),t===null&&(e.substr(s,7)==="isindex"?(t="isindex",s+=7):(t=null,f===0&&b('"isindex"')),t===null&&(e.substr(s,7)==="details"?(t="details",s+=7):(t=null,f===0&&b('"details"')),t===null&&(e.substr(s,7)==="command"?(t="command",s+=7):(t=null,f===0&&b('"command"')),t===null&&(e.substr(s,7)==="caption"?(t="caption",s+=7):(t=null,f===0&&b('"caption"')),t===null&&(e.substr(s,7)==="bgsound"?(t="bgsound",s+=7):(t=null,f===0&&b('"bgsound"')),t===null&&(e.substr(s,7)==="article"?(t="article",s+=7):(t=null,f===0&&b('"article"')),t===null&&(e.substr(s,7)==="address"?(t="address",s+=7):(t=null,f===0&&b('"address"')),t===null&&(e.substr(s,7)==="acronym"?(t="acronym",s+=7):(t=null,f===0&&b('"acronym"')),t===null&&(e.substr(s,6)==="strong"?(t="strong",s+=6):(t=null,f===0&&b('"strong"')),t===null&&(e.substr(s,6)==="strike"?(t="strike",s+=6):(t=null,f===0&&b('"strike"')),t===null&&(e.substr(s,6)==="spacer"?(t="spacer",s+=6):(t=null,f===0&&b('"spacer"')),t===null&&(e.substr(s,6)==="source"?(t="source",s+=6):(t=null,f===0&&b('"source"')),t===null&&(e.substr(s,6)==="select"?(t="select",s+=6):(t=null,f===0&&b('"select"')),t===null&&(e.substr(s,6)==="script"?(t="script",s+=6):(t=null,f===0&&b('"script"')),t===null&&(e.substr(s,6)==="output"?(t="output",s+=6):(t=null,f===0&&b('"output"')),t===null&&(e.substr(s,6)==="option"?(t="option",s+=6):(t=null,f===0&&b('"option"')),t===null&&(e.substr(s,6)==="object"?(t="object",s+=6):(t=null,f===0&&b('"object"')),t===null&&(e.substr(s,6)==="legend"?(t="legend",s+=6):(t=null,f===0&&b('"legend"')),t===null&&(e.substr(s,6)==="keygen"?(t="keygen",s+=6):(t=null,f===0&&b('"keygen"')),t===null&&(e.substr(s,6)==="iframe"?(t="iframe",s+=6):(t=null,f===0&&b('"iframe"')),t===null&&(e.substr(s,6)==="hgroup"?(t="hgroup",s+=6):(t=null,f===0&&b('"hgroup"')),t===null&&(e.substr(s,6)==="header"?(t="header",s+=6):(t=null,f===0&&b('"header"')),t===null&&(e.substr(s,6)==="footer"?(t="footer",s+=6):(t=null,f===0&&b('"footer"')),t===null&&(e.substr(s,6)==="figure"?(t="figure",s+=6):(t=null,f===0&&b('"figure"')),t===null&&(e.substr(s,6)==="center"?(t="center",s+=6):(t=null,f===0&&b('"center"')),t===null&&(e.substr(s,6)==="canvas"?(t="canvas",s+=6):(t=null,f===0&&b('"canvas"')),t===null&&(e.substr(s,6)==="button"?(t="button",s+=6):(t=null,f===0&&b('"button"')),t===null&&(e.substr(s,6)==="applet"?(t="applet",s+=6):(t=null,f===0&&b('"applet"')),t===null&&(e.substr(s,5)==="video"?(t="video",s+=5):(t=null,f===0&&b('"video"')),t===null&&(e.substr(s,5)==="track"?(t="track",s+=5):(t=null,f===0&&b('"track"')),t===null&&(e.substr(s,5)==="title"?(t="title",s+=5):(t=null,f===0&&b('"title"')),t===null&&(e.substr(s,5)==="thead"?(t="thead",s+=5):(t=null,f===0&&b('"thead"')),t===null&&(e.substr(s,5)==="tfoot"?(t="tfoot",s+=5):(t=null,f===0&&b('"tfoot"')),t===null&&(e.substr(s,5)==="tbody"?(t="tbody",s+=5):(t=null,f===0&&b('"tbody"')),t===null&&(e.substr(s,5)==="table"?(t="table",s+=5):(t=null,f===0&&b('"table"')),t===null&&(e.substr(s,5)==="style"?(t="style",s+=5):(t=null,f===0&&b('"style"')),t===null&&(e.substr(s,5)==="small"?(t="small",s+=5):(t=null,f===0&&b('"small"')),t===null&&(e.substr(s,5)==="param"?(t="param",s+=5):(t=null,f===0&&b('"param"')),t===null&&(e.substr(s,5)==="meter"?(t="meter",s+=5):(t=null,f===0&&b('"meter"')),t===null&&(e.substr(s,5)==="label"?(t="label",s+=5):(t=null,f===0&&b('"label"')),t===null&&(e.substr(s,5)==="input"?(t="input",s+=5):(t=null,f===0&&b('"input"')),t===null&&(e.substr(s,5)==="frame"?(t="frame",s+=5):(t=null,f===0&&b('"frame"')),t===null&&(e.substr(s,5)==="embed"?(t="embed",s+=5):(t=null,f===0&&b('"embed"')),t===null&&(e.substr(s,5)==="blink"?(t="blink",s+=5):(t=null,f===0&&b('"blink"')),t===null&&(e.substr(s,5)==="audio"?(t="audio",s+=5):(t=null,f===0&&b('"audio"')),t===null&&(e.substr(s,5)==="aside"?(t="aside",s+=5):(t=null,f===0&&b('"aside"')),t===null&&(e.substr(s,4)==="time"?(t="time",s+=4):(t=null,f===0&&b('"time"')),t===null&&(e.substr(s,4)==="span"?(t="span",s+=4):(t=null,f===0&&b('"span"')),t===null&&(e.substr(s,4)==="samp"?(t="samp",s+=4):(t=null,f===0&&b('"samp"')),t===null&&(e.substr(s,4)==="ruby"?(t="ruby",s+=4):(t=null,f===0&&b('"ruby"')),t===null&&(e.substr(s,4)==="nobr"?(t="nobr",s+=4):(t=null,f===0&&b('"nobr"')),t===null&&(e.substr(s,4)==="meta"?(t="meta",s+=4):(t=null,f===0&&b('"meta"')),t===null&&(e.substr(s,4)==="menu"?(t="menu",s+=4):(t=null,f===0&&b('"menu"')),t===null&&(e.substr(s,4)==="mark"?(t="mark",s+=4):(t=null,f===0&&b('"mark"')),t===null&&(e.substr(s,4)==="main"?(t="main",s+=4):(t=null,f===0&&b('"main"')),t===null&&(e.substr(s,4)==="link"?(t="link",s+=4):(t=null,f===0&&b('"link"')),t===null&&(e.substr(s,4)==="html"?(t="html",s+=4):(t=null,f===0&&b('"html"')),t===null&&(e.substr(s,4)==="head"?(t="head",s+=4):(t=null,f===0&&b('"head"')),t===null&&(e.substr(s,4)==="form"?(t="form",s+=4):(t=null,f===0&&b('"form"')),t===null&&(e.substr(s,4)==="font"?(t="font",s+=4):(t=null,f===0&&b('"font"')),t===null&&(e.substr(s,4)==="data"?(t="data",s+=4):(t=null,f===0&&b('"data"')),t===null&&(e.substr(s,4)==="code"?(t="code",s+=4):(t=null,f===0&&b('"code"')),t===null&&(e.substr(s,4)==="cite"?(t="cite",s+=4):(t=null,f===0&&b('"cite"')),t===null&&(e.substr(s,4)==="body"?(t="body",s+=4):(t=null,f===0&&b('"body"')),t===null&&(e.substr(s,4)==="base"?(t="base",s+=4):(t=null,f===0&&b('"base"')),t===null&&(e.substr(s,4)==="area"?(t="area",s+=4):(t=null,f===0&&b('"area"')),t===null&&(e.substr(s,4)==="abbr"?(t="abbr",s+=4):(t=null,f===0&&b('"abbr"')),t===null&&(e.substr(s,3)==="xmp"?(t="xmp",s+=3):(t=null,f===0&&b('"xmp"')),t===null&&(e.substr(s,3)==="wbr"?(t="wbr",s+=3):(t=null,f===0&&b('"wbr"')),t===null&&(e.substr(s,3)==="var"?(t="var",s+=3 +):(t=null,f===0&&b('"var"')),t===null&&(e.substr(s,3)==="sup"?(t="sup",s+=3):(t=null,f===0&&b('"sup"')),t===null&&(e.substr(s,3)==="sub"?(t="sub",s+=3):(t=null,f===0&&b('"sub"')),t===null&&(e.substr(s,3)==="pre"?(t="pre",s+=3):(t=null,f===0&&b('"pre"')),t===null&&(e.substr(s,3)==="nav"?(t="nav",s+=3):(t=null,f===0&&b('"nav"')),t===null&&(e.substr(s,3)==="map"?(t="map",s+=3):(t=null,f===0&&b('"map"')),t===null&&(e.substr(s,3)==="kbd"?(t="kbd",s+=3):(t=null,f===0&&b('"kbd"')),t===null&&(e.substr(s,3)==="ins"?(t="ins",s+=3):(t=null,f===0&&b('"ins"')),t===null&&(e.substr(s,3)==="img"?(t="img",s+=3):(t=null,f===0&&b('"img"')),t===null&&(e.substr(s,3)==="div"?(t="div",s+=3):(t=null,f===0&&b('"div"')),t===null&&(e.substr(s,3)==="dir"?(t="dir",s+=3):(t=null,f===0&&b('"dir"')),t===null&&(e.substr(s,3)==="dfn"?(t="dfn",s+=3):(t=null,f===0&&b('"dfn"')),t===null&&(e.substr(s,3)==="del"?(t="del",s+=3):(t=null,f===0&&b('"del"')),t===null&&(e.substr(s,3)==="col"?(t="col",s+=3):(t=null,f===0&&b('"col"')),t===null&&(e.substr(s,3)==="big"?(t="big",s+=3):(t=null,f===0&&b('"big"')),t===null&&(e.substr(s,3)==="bdo"?(t="bdo",s+=3):(t=null,f===0&&b('"bdo"')),t===null&&(e.substr(s,3)==="bdi"?(t="bdi",s+=3):(t=null,f===0&&b('"bdi"')),t===null&&(e.substr(s,2)==="ul"?(t="ul",s+=2):(t=null,f===0&&b('"ul"')),t===null&&(e.substr(s,2)==="tt"?(t="tt",s+=2):(t=null,f===0&&b('"tt"')),t===null&&(e.substr(s,2)==="tr"?(t="tr",s+=2):(t=null,f===0&&b('"tr"')),t===null&&(e.substr(s,2)==="th"?(t="th",s+=2):(t=null,f===0&&b('"th"')),t===null&&(e.substr(s,2)==="td"?(t="td",s+=2):(t=null,f===0&&b('"td"')),t===null&&(e.substr(s,2)==="rt"?(t="rt",s+=2):(t=null,f===0&&b('"rt"')),t===null&&(e.substr(s,2)==="rp"?(t="rp",s+=2):(t=null,f===0&&b('"rp"')),t===null&&(e.substr(s,2)==="ol"?(t="ol",s+=2):(t=null,f===0&&b('"ol"')),t===null&&(e.substr(s,2)==="li"?(t="li",s+=2):(t=null,f===0&&b('"li"')),t===null&&(e.substr(s,2)==="hr"?(t="hr",s+=2):(t=null,f===0&&b('"hr"')),t===null&&(e.substr(s,2)==="h6"?(t="h6",s+=2):(t=null,f===0&&b('"h6"')),t===null&&(e.substr(s,2)==="h5"?(t="h5",s+=2):(t=null,f===0&&b('"h5"')),t===null&&(e.substr(s,2)==="h4"?(t="h4",s+=2):(t=null,f===0&&b('"h4"')),t===null&&(e.substr(s,2)==="h3"?(t="h3",s+=2):(t=null,f===0&&b('"h3"')),t===null&&(e.substr(s,2)==="h2"?(t="h2",s+=2):(t=null,f===0&&b('"h2"')),t===null&&(e.substr(s,2)==="h1"?(t="h1",s+=2):(t=null,f===0&&b('"h1"')),t===null&&(e.substr(s,2)==="em"?(t="em",s+=2):(t=null,f===0&&b('"em"')),t===null&&(e.substr(s,2)==="dt"?(t="dt",s+=2):(t=null,f===0&&b('"dt"')),t===null&&(e.substr(s,2)==="dl"?(t="dl",s+=2):(t=null,f===0&&b('"dl"')),t===null&&(e.substr(s,2)==="dd"?(t="dd",s+=2):(t=null,f===0&&b('"dd"')),t===null&&(e.substr(s,2)==="br"?(t="br",s+=2):(t=null,f===0&&b('"br"')),t===null&&(e.charCodeAt(s)===117?(t="u",s++):(t=null,f===0&&b('"u"')),t===null&&(e.charCodeAt(s)===115?(t="s",s++):(t=null,f===0&&b('"s"')),t===null&&(e.charCodeAt(s)===113?(t="q",s++):(t=null,f===0&&b('"q"')),t===null&&(e.charCodeAt(s)===112?(t="p",s++):(t=null,f===0&&b('"p"')),t===null&&(e.charCodeAt(s)===105?(t="i",s++):(t=null,f===0&&b('"i"')),t===null&&(e.charCodeAt(s)===98?(t="b",s++):(t=null,f===0&&b('"b"')),t===null&&(e.charCodeAt(s)===97?(t="a",s++):(t=null,f===0&&b('"a"')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),f--,f===0&&t===null&&b("a valid HTML tag name"),t}function Ht(){var t;return f++,e.substr(s,10)==="touchStart"?(t="touchStart",s+=10):(t=null,f===0&&b('"touchStart"')),t===null&&(e.substr(s,9)==="touchMove"?(t="touchMove",s+=9):(t=null,f===0&&b('"touchMove"')),t===null&&(e.substr(s,8)==="touchEnd"?(t="touchEnd",s+=8):(t=null,f===0&&b('"touchEnd"')),t===null&&(e.substr(s,11)==="touchCancel"?(t="touchCancel",s+=11):(t=null,f===0&&b('"touchCancel"')),t===null&&(e.substr(s,7)==="keyDown"?(t="keyDown",s+=7):(t=null,f===0&&b('"keyDown"')),t===null&&(e.substr(s,5)==="keyUp"?(t="keyUp",s+=5):(t=null,f===0&&b('"keyUp"')),t===null&&(e.substr(s,8)==="keyPress"?(t="keyPress",s+=8):(t=null,f===0&&b('"keyPress"')),t===null&&(e.substr(s,9)==="mouseDown"?(t="mouseDown",s+=9):(t=null,f===0&&b('"mouseDown"')),t===null&&(e.substr(s,7)==="mouseUp"?(t="mouseUp",s+=7):(t=null,f===0&&b('"mouseUp"')),t===null&&(e.substr(s,11)==="contextMenu"?(t="contextMenu",s+=11):(t=null,f===0&&b('"contextMenu"')),t===null&&(e.substr(s,5)==="click"?(t="click",s+=5):(t=null,f===0&&b('"click"')),t===null&&(e.substr(s,11)==="doubleClick"?(t="doubleClick",s+=11):(t=null,f===0&&b('"doubleClick"')),t===null&&(e.substr(s,9)==="mouseMove"?(t="mouseMove",s+=9):(t=null,f===0&&b('"mouseMove"')),t===null&&(e.substr(s,7)==="focusIn"?(t="focusIn",s+=7):(t=null,f===0&&b('"focusIn"')),t===null&&(e.substr(s,8)==="focusOut"?(t="focusOut",s+=8):(t=null,f===0&&b('"focusOut"')),t===null&&(e.substr(s,10)==="mouseEnter"?(t="mouseEnter",s+=10):(t=null,f===0&&b('"mouseEnter"')),t===null&&(e.substr(s,10)==="mouseLeave"?(t="mouseLeave",s+=10):(t=null,f===0&&b('"mouseLeave"')),t===null&&(e.substr(s,6)==="submit"?(t="submit",s+=6):(t=null,f===0&&b('"submit"')),t===null&&(e.substr(s,5)==="input"?(t="input",s+=5):(t=null,f===0&&b('"input"')),t===null&&(e.substr(s,6)==="change"?(t="change",s+=6):(t=null,f===0&&b('"change"')),t===null&&(e.substr(s,9)==="dragStart"?(t="dragStart",s+=9):(t=null,f===0&&b('"dragStart"')),t===null&&(e.substr(s,4)==="drag"?(t="drag",s+=4):(t=null,f===0&&b('"drag"')),t===null&&(e.substr(s,9)==="dragEnter"?(t="dragEnter",s+=9):(t=null,f===0&&b('"dragEnter"')),t===null&&(e.substr(s,9)==="dragLeave"?(t="dragLeave",s+=9):(t=null,f===0&&b('"dragLeave"')),t===null&&(e.substr(s,8)==="dragOver"?(t="dragOver",s+=8):(t=null,f===0&&b('"dragOver"')),t===null&&(e.substr(s,4)==="drop"?(t="drop",s+=4):(t=null,f===0&&b('"drop"')),t===null&&(e.substr(s,7)==="dragEnd"?(t="dragEnd",s+=7):(t=null,f===0&&b('"dragEnd"')))))))))))))))))))))))))))),f--,f===0&&t===null&&b("a JS event"),t}function Bt(){var t,n;return f++,n=s,e.charCodeAt(s)===61423?(t="",s++):(t=null,f===0&&b('"\\uEFEF"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("INDENT"),t}function jt(){var t,n;return f++,n=s,e.charCodeAt(s)===61438?(t="",s++):(t=null,f===0&&b('"\\uEFFE"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("DEDENT"),t}function Ft(){var t,n;return f++,n=s,e.charCodeAt(s)===61439?(t="",s++):(t=null,f===0&&b('"\\uEFFF"')),t!==null&&(o=n,t=function(){return""}()),t===null&&(s=n),f--,f===0&&t===null&&b("TERM"),t}function It(){var e,t;f++,t=Rt();if(t!==null){e=[];while(t!==null)e.push(t),t=Rt()}else e=null;return f--,f===0&&e===null&&b("required whitespace"),e}function qt(){var e,t;f++,e=[],t=Rt();while(t!==null)e.push(t),t=Rt();return f--,f===0&&e===null&&b("whitespace"),e}function Rt(){var t;return/^[ \t\n\r]/.test(e.charAt(s))?(t=e.charAt(s),s++):(t=null,f===0&&b("[ \\t\\n\\r]")),t}function Ut(){var t,n,r;n=s,t=[],/^[^\uEFFF\uEFFE\uEFEF]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[^\\uEFFF\\uEFFE\\uEFEF]"));while(r!==null)t.push(r),/^[^\uEFFF\uEFFE\uEFEF]/.test(e.charAt(s))?(r=e.charAt(s),s++):(r=null,f===0&&b("[^\\uEFFF\\uEFFE\\uEFEF]"));return t!==null&&(o=n,t=function(e){return e.join("")}(t)),t===null&&(s=n),t}function zt(e){e.sort();var t=null,n=[];for(var r=0;r1?arguments[1]:{},i;if(r.startRule!==undefined){i=r.startRule;if(n[i]===undefined)throw new Error("Can't start parsing from rule "+t(i)+".")}else i="content";var s=0,o=0,u=0,a={line:1,column:1,seenCR:!1},f=0,l=0,c=[],Xt=n[i]();if(Xt===null||s!==e.length){o=Math.max(s,l);var Vt=o0&&this.ss.check(RegExp("(?:"+this.indent+"){0,"+(c-1)+"}[^"+o+"]"))){d=0;while(this.discard(RegExp(""+this.indent)))++d;l=c-d;while(l--)this.context.observe(e),this.p(""+e)}else{if(!this.ss.check(RegExp("(?:"+this.indent+"){"+c+"}[^"+o+"]")))throw h=this.ss.str.substr(0,this.ss.pos).split(/\n/)||[""],p="Syntax error on line "+h.length+": invalid indentation",new Error(""+p);this.discard(RegExp("(?:"+this.indent+"){"+c+"}"))}}else if(this.indent=this.discard(RegExp("["+o+"]+")))this.context.observe(t),this.p(t)}this.scan(/[^\n\\]+/),(v=this.discard(/\//))&&this.context.observe(v),this.discard(/\n/)&&this.p(""+n),this.discard(i);break;case"/":this.discard(/.*\n/)&&this.context.observe("\n");break;case"\\":this.scan(/[\s\S]/)&&this.context.observe("end-\\")}if(s){this.scan(r);while(this.context.length&&t===this.context.peek())this.context.observe(e),this.p(""+e);if(this.context.length)throw new Error("Unclosed "+this.context.peek()+" at EOF")}}},u.prototype.processData=s(!1),u.prototype.processEnd=s(!0),u.processSync=function(e){var t;return e+="\n",t=new u,t.processData(e),t.processEnd(),t.output},u}();var ENV,Emblem,_base;Emblem.bootstrap=function(e){return e==null&&(e=Ember.$(document)),Emblem.precompile=Emblem.precompileEmber,Emblem.compile=Emblem.compileEmber,Ember.$('script[type="text/x-emblem"]',e).each(function(){var e,t;return e=Ember.$(this),t=e.attr("data-template-name")||e.attr("id")||"application",Ember.TEMPLATES[t]=Emblem.compile(e.html()),e.remove()})},this.ENV||(this.ENV={}),ENV=this.ENV,ENV.EMBER_LOAD_HOOKS||(ENV.EMBER_LOAD_HOOKS={}),(_base=ENV.EMBER_LOAD_HOOKS).application||(_base.application=[]),ENV.EMBER_LOAD_HOOKS.application.push(function(){return Emblem.bootstrap()}); \ No newline at end of file diff --git a/ajax/libs/emblem/0.1.11/emblem.js b/ajax/libs/emblem/0.1.11/emblem.js new file mode 100644 index 000000000..69133cde2 --- /dev/null +++ b/ajax/libs/emblem/0.1.11/emblem.js @@ -0,0 +1,5460 @@ + (function(root) { + + +(function(root) { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.9"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = "else", + peg$c3 = "\"else\"", + peg$c4 = function(c) {return c;}, + peg$c5 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c6 = [], + peg$c7 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c8 = "BeginStatement", + peg$c9 = function() { return []; }, + peg$c10 = ">", + peg$c11 = "\">\"", + peg$c12 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c13 = /^[a-zA-Z0-9_$-\/]/, + peg$c14 = "[a-zA-Z0-9_$-\\/]", + peg$c15 = function(s) { return new AST.PartialNameNode(s); }, + peg$c16 = function(m) { + return [m]; + }, + peg$c17 = "/", + peg$c18 = "\"/\"", + peg$c19 = /^[A-Z]/, + peg$c20 = "[A-Z]", + peg$c21 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c22 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c23 = " ", + peg$c24 = "\" \"", + peg$c25 = "=", + peg$c26 = "\"=\"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`]/, + peg$c81 = "[|`]", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c123 = /^[A-Za-z.:0-9_\-]/, + peg$c124 = "[A-Za-z.:0-9_\\-]", + peg$c125 = function(id) { return new AST.MustacheNode([id]); }, + peg$c126 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c127 = function(value) { return value.replace(/ *$/, ''); }, + peg$c128 = "!", + peg$c129 = "\"!\"", + peg$c130 = function(key, value) { return IS_EMBER; }, + peg$c131 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c132 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c133 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c134 = "_", + peg$c135 = "\"_\"", + peg$c136 = "-", + peg$c137 = "\"-\"", + peg$c138 = "%", + peg$c139 = "\"%\"", + peg$c140 = "#", + peg$c141 = "\"#\"", + peg$c142 = function(c) { return c;}, + peg$c143 = "CSSIdentifier", + peg$c144 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c145 = /^[_a-zA-Z0-9\-]/, + peg$c146 = "[_a-zA-Z0-9\\-]", + peg$c147 = /^[_a-zA-Z]/, + peg$c148 = "[_a-zA-Z]", + peg$c149 = /^[\x80-\xFF]/, + peg$c150 = "[\\x80-\\xFF]", + peg$c151 = "KnownHTMLTagName", + peg$c152 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c153 = function(t) { return t; }, + peg$c154 = /^[:_a-zA-Z0-9\-]/, + peg$c155 = "[:_a-zA-Z0-9\\-]", + peg$c156 = "a JS event", + peg$c157 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c158 = "INDENT", + peg$c159 = "\uEFEF", + peg$c160 = "\"\\uEFEF\"", + peg$c161 = function() { return ''; }, + peg$c162 = "DEDENT", + peg$c163 = "\uEFFE", + peg$c164 = "\"\\uEFFE\"", + peg$c165 = "Unmatched DEDENT", + peg$c166 = "\uEFEE", + peg$c167 = "\"\\uEFEE\"", + peg$c168 = "LineEnd", + peg$c169 = "\uEFFF", + peg$c170 = "\"\\uEFFF\"", + peg$c171 = "\n", + peg$c172 = "\"\\n\"", + peg$c173 = "ANYDEDENT", + peg$c174 = "RequiredWhitespace", + peg$c175 = "OptionalWhitespace", + peg$c176 = "InlineWhitespace", + peg$c177 = /^[ \t]/, + peg$c178 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c2) { + s4 = peg$c2; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c4(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c5(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c19.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c22(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c123.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c128; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c130(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c134; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c136; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c138; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c140; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c145.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c147.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c149.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c138; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c152(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c154.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c157(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c159; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c163; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c171; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c177.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.11/emblem.min.js b/ajax/libs/emblem/0.1.11/emblem.min.js new file mode 100644 index 000000000..46a39f810 --- /dev/null +++ b/ajax/libs/emblem/0.1.11/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.9",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function _r(){return e.substring(Nr,Tr)}function Dr(){return Nr}function Pr(){return Br(Nr).line}function Hr(){return Br(Nr).column}function Br(t){function n(t,n){var r,i;for(r=0;rt&&(Cr=0,kr={line:1,column:1,seenCR:!1}),Cr=t,n(kr,Cr)),kr}function jr(e){if(TrLr&&(Lr=Tr,Ar=[]),Ar.push(e)}function Fr(e){var t=0;e.sort();while(tTr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function Fi(){var t,n,r,i;t=Tr,n=Tr,r=[],i=Ii();if(i!==null)while(i!==null)r.push(i),i=Ii();else r=o;return r!==null&&(r=e.substring(n,Tr)),n=r,n!==null&&(Nr=t,n=Ut(n)),n===null?(Tr=t,t=n):t=n,t}function Ii(){var t,n,r;return t=Tr,n=Tr,Or++,r=qi(),Or--,r===null?n=u:(Tr=n,n=o),n!==null?(e.length>Tr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function qi(){var e;return e=Xi(),e===null&&(e=Wi(),e===null&&(e=Ki(),e===null&&(e=As(),e===null&&(e=Ls())))),e}function Ri(){var e,t,n,r,i,s;return e=Tr,t=zi(),t!==null?(n=Ms(),n!==null?(r=ri(),r!==null?(i=Ms(),i!==null?(s=Vi(),s!==null?(Nr=e,t=qt(r),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o),e}function Ui(){var e;return e=Ri(),e===null&&(e=Hi(),e===null&&(e=Pi())),e}function zi(){var t,n;return Or++,e.charCodeAt(Tr)===123?(t=Vt,Tr++):(t=null,Or===0&&jr($t)),Or--,t===null&&(n=null,Or===0&&jr(Xt)),t}function Wi(){var t,n;return Or++,e.substr(Tr,2)===Kt?(t=Kt,Tr+=2):(t=null,Or===0&&jr(Qt)),Or--,t===null&&(n=null,Or===0&&jr(Jt)),t}function Xi(){var t,n;return Or++,e.substr(Tr,3)===Yt?(t=Yt,Tr+=3):(t=null,Or===0&&jr(Zt)),Or--,t===null&&(n=null,Or===0&&jr(Gt)),t}function Vi(){var t,n;return Or++,e.charCodeAt(Tr)===125?(t=tn,Tr++):(t=null,Or===0&&jr(nn)),Or--,t===null&&(n=null,Or===0&&jr(en)),t}function $i(){var t,n;return Or++,e.substr(Tr,2)===sn?(t=sn,Tr+=2):(t=null,Or===0&&jr(on)),Or--,t===null&&(n=null,Or===0&&jr(rn)),t}function Ji(){var t,n;return Or++,e.substr(Tr,3)===an?(t=an,Tr+=3):(t=null,Or===0&&jr(fn)),Or--,t===null&&(n=null,Or===0&&jr(un)),t}function Ki(){var t,n;return Or++,e.substr(Tr,2)===cn?(t=cn,Tr+=2):(t=null,Or===0&&jr(hn)),Or--,t===null&&(n=null,Or===0&&jr(ln)),t}function Qi(){var t,n;return Or++,e.charCodeAt(Tr)===125?(t=tn,Tr++):(t=null,Or===0&&jr(nn)),Or--,t===null&&(n=null,Or===0&&jr(pn)),t}function Gi(){var t,n,r;return t=Tr,e.substr(Tr,2)===dn?(n=dn,Tr+=2):(n=null,Or===0&&jr(vn)),n!==null?(e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O)),r===null&&(r=u),r!==null?(Nr=t,n=mn(),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t===null&&(t=Tr,e.charCodeAt(Tr)===61?(n=M,Tr++):(n=null,Or===0&&jr(_)),n!==null?(e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O)),r===null&&(r=u),r!==null?(Nr=t,n=gn(),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)),t}function Yi(){var e,t,n,r,i,s,a;e=Tr,t=Tr,n=ws();if(n!==null){r=si(),r===null&&(r=u);if(r!==null){i=[],s=Ui();while(s!==null)i.push(s),s=Ui();if(i!==null){s=[],a=Zi();while(a!==null)s.push(a),a=Zi();s!==null?(Nr=t,n=yn(n,r,i,s),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o}else Tr=t,t=o;if(t===null){t=Tr,n=si();if(n!==null){r=[],i=Ui();while(i!==null)r.push(i),i=Ui();if(r!==null){i=[],s=Zi();while(s!==null)i.push(s),s=Zi();i!==null?(Nr=t,n=bn(n,r,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o}return t!==null&&(Nr=e,t=wn(t)),t===null?(Tr=e,e=t):e=t,e}function si(){var e;return e=oi(),e===null&&(e=ui()),e}function oi(){var e,t,n,r;e=Tr,t=hs();if(t!==null){n=[],r=ps();while(r!==null)n.push(r),r=ps();n!==null?(Nr=e,t=R(t,n),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)}else Tr=e,e=o;return e}function ui(){var e,t,n;e=Tr,t=[],n=ps();if(n!==null)while(n!==null)t.push(n),n=ps();else t=o;return t!==null&&(Nr=e,t=U(t)),t===null?(Tr=e,e=t):e=t,e}function Zi(){var t,n,r;t=Tr,n=[],e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O));else n=o;return n!==null?(r=rs(),r===null&&(r=ss(),r===null&&(r=os(),r===null&&(r=us()))),r!==null?(Nr=t,n=En(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function es(){var t;return Sn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(xn)),t}function ts(){var e,t;return e=ns(),e===null&&(e=Tr,t=mi(),t!==null&&(Nr=e,t=Tn(t)),t===null?(Tr=e,e=t):e=t),e}function ns(){var t,n,r,i,s;return t=Tr,n=Tr,e.charCodeAt(Tr)===34?(r=bt,Tr++):(r=null,Or===0&&jr(wt)),r!==null?(i=ri(),i!==null?(e.charCodeAt(Tr)===34?(s=bt,Tr++):(s=null,Or===0&&jr(wt)),s!==null?(r=[r,i,s],n=r):(Tr=n,n=o)):(Tr=n,n=o)):(Tr=n,n=o),n===null&&(n=Tr,e.charCodeAt(Tr)===39?(r=Et,Tr++):(r=null,Or===0&&jr(St)),r!==null?(i=ri(),i!==null?(e.charCodeAt(Tr)===39?(s=Et,Tr++):(s=null,Or===0&&jr(St)),s!==null?(r=[r,i,s],n=r):(Tr=n,n=o)):(Tr=n,n=o)):(Tr=n,n=o)),n!==null&&(Nr=t,n=xt(n)),n===null?(Tr=t,t=n):t=n,t}function rs(){var t,n,r,i;return t=Tr,n=xs(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=ts(),i!==null?(Nr=t,n=Nn(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function is(){var t,n,r,i,s,u;t=Tr,e.charCodeAt(Tr)===123?(n=Vt,Tr++):(n=null,Or===0&&jr($t));if(n!==null){r=Ms();if(r!==null){i=Tr,s=[],u=es(),u===null&&(e.charCodeAt(Tr)===32?(u=A,Tr++):(u=null,Or===0&&jr(O)));if(u!==null)while(u!==null)s.push(u),u=es(),u===null&&(e.charCodeAt(Tr)===32?(u=A,Tr++):(u=null,Or===0&&jr(O)));else s=o;s!==null&&(s=e.substring(i,Tr)),i=s,i!==null?(s=Ms(),s!==null?(e.charCodeAt(Tr)===125?(u=tn,Tr++):(u=null,Or===0&&jr(nn)),u!==null?(Nr=t,n=Cn(i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o;if(t===null){t=Tr,n=[],r=es();if(r!==null)while(r!==null)n.push(r),r=es();else n=o;n!==null&&(n=e.substring(t,Tr)),t=n}return t}function ss(){var t,n,r,i,s,a;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=is(),i!==null?(s=Tr,Or++,e.charCodeAt(Tr)===33?(a=kn,Tr++):(a=null,Or===0&&jr(Ln)),Or--,a===null?s=u:(Tr=s,s=o),s!==null?(Nr=Tr,a=An(n,i),a?a=u:a=o,a!==null?(Nr=t,n=On(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function os(){var t,n,r,i;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=mi(),i!==null?(Nr=t,n=Mn(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function us(){var t,n,r,i;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=Mi(),i!==null?(Nr=t,n=_n(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function as(){var t,n,r;t=Tr,n=[],r=ls();while(r!==null)n.push(r),r=ls();return n!==null&&(n=e.substring(t,Tr)),t=n,t}function fs(){var e;return e=Si(),e===null&&(e=pi()),e}function ls(){var t;return t=Ni(),t===null&&(mt.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(gt)),t===null&&(e.charCodeAt(Tr)===95?(t=Dn,Tr++):(t=null,Or===0&&jr(Pn)),t===null&&(e.charCodeAt(Tr)===45?(t=Hn,Tr++):(t=null,Or===0&&jr(Bn))))),t}function cs(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===37?(n=jn,Tr++):(n=null,Or===0&&jr(Fn)),n!==null?(r=ds(),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function hs(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===35?(n=In,Tr++):(n=null,Or===0&&jr(qn)),n!==null?(r=ds(),r!==null?(Nr=t,n=Rn(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function ps(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===46?(n=J,Tr++):(n=null,Or===0&&jr(K)),n!==null?(r=ds(),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function ds(){var e,t;return Or++,e=vs(),Or--,e===null&&(t=null,Or===0&&jr(Un)),e}function vs(){var t,n,r,i,s;t=Tr,n=gs();if(n!==null){r=Tr,i=[],s=ms();while(s!==null)i.push(s),s=ms();i!==null&&(i=e.substring(r,Tr)),r=i,r!==null?(Nr=t,n=zn(n,r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o;return t}function ms(){var t;return Wn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(Xn)),t===null&&(t=ys()),t}function gs(){var t;return Vn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr($n)),t===null&&(t=ys()),t}function ys(){var t;return Jn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(Kn)),t}function bs(){var t,n,r;t=Tr,n=[],r=Ss();if(r!==null)while(r!==null)n.push(r),r=Ss();else n=o;return n!==null&&(n=e.substring(t,Tr)),t=n,t}function ws(){var t,n,r;return Or++,t=Tr,e.charCodeAt(Tr)===37?(n=jn,Tr++):(n=null,Or===0&&jr(Fn)),n!==null?(r=bs(),r!==null?(Nr=t,n=Y(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t===null&&(t=Es()),Or--,t===null&&(n=null,Or===0&&jr(Qn)),t}function Es(){var e,t,n;return e=Tr,t=bs(),t!==null?(Nr=Tr,n=Gn(t),n?n=u:n=o,n!==null?(Nr=e,t=Yn(t),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),e}function Ss(){var t;return Zn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(er)),t}function xs(){var e,t,n;return Or++,e=Tr,t=bs(),t!==null?(Nr=Tr,n=nr(t),n?n=u:n=o,n!==null?(Nr=e,t=Yn(t),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),Or--,e===null&&(t=null,Or===0&&jr(tr)),e}function Ts(){var e,t,n;return e=Tr,t=Ns(),t!==null?(n=Os(),n!==null?(Nr=e,t=Y(n),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),e}function Ns(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61423?(n=ir,Tr++):(n=null,Or===0&&jr(sr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(rr)),t}function Cs(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61438?(n=ar,Tr++):(n=null,Or===0&&jr(fr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(ur)),t}function ks(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61422?(n=cr,Tr++):(n=null,Or===0&&jr(hr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(lr)),t}function Ls(){var t,n,r;return Or++,t=Tr,e.charCodeAt(Tr)===61439?(n=dr,Tr++):(n=null,Or===0&&jr(vr)),n!==null?(e.charCodeAt(Tr)===10?(r=mr,Tr++):(r=null,Or===0&&jr(gr)),r!==null?(n=[n,r],t=n):(Tr=t,t=o)):(Tr=t,t=o),Or--,t===null&&(n=null,Or===0&&jr(pr)),t}function As(){var e,t;return Or++,e=Cs(),e===null&&(e=ks()),Or--,e===null&&(t=null,Or===0&&jr(yr)),e}function Os(){var t,n,r;Or++,t=Tr,n=[],r=_s();if(r!==null)while(r!==null)n.push(r),r=_s();else n=o;return n!==null&&(n=e.substring(t,Tr)),t=n,Or--,t===null&&(n=null,Or===0&&jr(br)),t}function Ms(){var e,t;Or++,e=[],t=_s();while(t!==null)e.push(t),t=_s();return Or--,e===null&&(t=null,Or===0&&jr(wr)),e}function _s(){var t,n;return Or++,Sr.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(xr)),Or--,t===null&&(n=null,Or===0&&jr(Er)),t}function Ds(){var t,n,r;return t=Tr,n=Tr,Or++,r=Ns(),r===null&&(r=Cs(),r===null&&(r=Ls())),Or--,r===null?n=u:(Tr=n,n=o),n!==null?(e.length>Tr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function Ps(){var t,n,r;t=Tr,n=[],r=Ds();while(r!==null)n.push(r),r=Ds();return n!==null&&(n=e.substring(t,Tr)),t=n,t}function Rs(e,t,n){var r=e.hash;if(n){r=r||new js.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ir},s=Ir,o=null,u="",a="else",f='"else"',l=function(e){return e},c=function(e,t){return new js.ProgramNode(e,t||[])},h=[],p=function(e){var t=[],n=[];for(var r=0;r",g='">"',y=function(e,t){return[new js.PartialNode(e,t[0])]},b=/^[a-zA-Z0-9_$-\/]/,w="[a-zA-Z0-9_$-\\/]",E=function(e){return new js.PartialNameNode(e)},S=function(e){return[e]},x="/",T='"/"',N=/^[A-Z]/,C="[A-Z]",k=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Bs||!n.match(/[A-Z]/)?e:(e.mustache=Rs(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Bs||!n.match(/[A-Z]/)?e:Rs(e,t)},L=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},A=" ",O='" "',M="=",_='"="',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new js.ContentNode(">")),[u,new js.ContentNode("")])},En=function(e){return[new js.ContentNode(" ")].concat(e)},Sn=/^[A-Za-z.:0-9_\-]/,xn="[A-Za-z.:0-9_\\-]",Tn=function(e){return new js.MustacheNode([e])},Nn=function(e,t){return[Rs(t,"action",[["on",new js.StringNode(e)]])]},Cn=function(e){return e.replace(/ *$/,"")},kn="!",Ln='"!"',An=function(e,t){return Bs},On=function(e,t){var n=new js.HashNode([[e,new js.StringNode(t)]]),r=[new js.IdNode(["bindAttr"])],i=new js.MustacheNode(r,n);return[i]},Mn=function(e,t){var n=new js.MustacheNode([t]);return Bs&&t._emblemSuffixModifier==="!"&&(n=Rs(n,"unbound")),[new js.ContentNode(e+"="+'"'),n,new js.ContentNode('"')]},_n=function(e,t){var n=[new js.ContentNode(e+"="+'"')].concat(t);return n.concat([new js.ContentNode('"')])},Dn="_",Pn='"_"',Hn="-",Bn='"-"',jn="%",Fn='"%"',In="#",qn='"#"',Rn=function(e){return e},Un="CSSIdentifier",zn=function(e,t){return e+t},Wn=/^[_a-zA-Z0-9\-]/,Xn="[_a-zA-Z0-9\\-]",Vn=/^[_a-zA-Z]/,$n="[_a-zA-Z]",Jn=/^[\x80-\xFF]/,Kn="[\\x80-\\xFF]",Qn="KnownHTMLTagName",Gn=function(e){return!!Is[e]},Yn=function(e){return e},Zn=/^[:_a-zA-Z0-9\-]/,er="[:_a-zA-Z0-9\\-]",tr="a JS event",nr=function(e){return!!qs[e]},rr="INDENT",ir="",sr='"\\uEFEF"',or=function(){return""},ur="DEDENT",ar="",fr='"\\uEFFE"',lr="Unmatched DEDENT",cr="",hr='"\\uEFEE"',pr="LineEnd",dr="",vr='"\\uEFFF"',mr="\n",gr='"\\n"',yr="ANYDEDENT",br="RequiredWhitespace",wr="OptionalWhitespace",Er="InlineWhitespace",Sr=/^[ \t]/,xr="[ \\t]",Tr=0,Nr=0,Cr=0,kr={line:1,column:1,seenCR:!1},Lr=0,Ar=[],Or=0,Mr;if("startRule"in r){if(!(r.startRule in i))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=i[r.startRule]}var Hs=n.handlebarsVariant,Bs=Hs.JavaScriptCompiler.prototype.namespace==="Ember.Handlebars",js=Hs.AST,Fs={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Is={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},qs={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0};Mr=s();if(Mr!==null&&Tr===e.length)return Mr;throw Fr(Ar),Nr=Math.max(Tr,Lr),new t(Ar,Nr this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.11"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = "else", + peg$c3 = "\"else\"", + peg$c4 = function(c) {return c;}, + peg$c5 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c6 = [], + peg$c7 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c8 = "BeginStatement", + peg$c9 = function() { return []; }, + peg$c10 = ">", + peg$c11 = "\">\"", + peg$c12 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c13 = /^[a-zA-Z0-9_$-\/]/, + peg$c14 = "[a-zA-Z0-9_$-\\/]", + peg$c15 = function(s) { return new AST.PartialNameNode(s); }, + peg$c16 = function(m) { + return [m]; + }, + peg$c17 = "/", + peg$c18 = "\"/\"", + peg$c19 = /^[A-Z]/, + peg$c20 = "[A-Z]", + peg$c21 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c22 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c23 = " ", + peg$c24 = "\" \"", + peg$c25 = "=", + peg$c26 = "\"=\"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`]/, + peg$c81 = "[|`]", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c123 = /^[A-Za-z.:0-9_\-]/, + peg$c124 = "[A-Za-z.:0-9_\\-]", + peg$c125 = function(id) { return new AST.MustacheNode([id]); }, + peg$c126 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c127 = function(value) { return value.replace(/ *$/, ''); }, + peg$c128 = "!", + peg$c129 = "\"!\"", + peg$c130 = function(key, value) { return IS_EMBER; }, + peg$c131 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c132 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c133 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c134 = "_", + peg$c135 = "\"_\"", + peg$c136 = "-", + peg$c137 = "\"-\"", + peg$c138 = "%", + peg$c139 = "\"%\"", + peg$c140 = "#", + peg$c141 = "\"#\"", + peg$c142 = function(c) { return c;}, + peg$c143 = "CSSIdentifier", + peg$c144 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c145 = /^[_a-zA-Z0-9\-]/, + peg$c146 = "[_a-zA-Z0-9\\-]", + peg$c147 = /^[_a-zA-Z]/, + peg$c148 = "[_a-zA-Z]", + peg$c149 = /^[\x80-\xFF]/, + peg$c150 = "[\\x80-\\xFF]", + peg$c151 = "KnownHTMLTagName", + peg$c152 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c153 = function(t) { return t; }, + peg$c154 = /^[:_a-zA-Z0-9\-]/, + peg$c155 = "[:_a-zA-Z0-9\\-]", + peg$c156 = "a JS event", + peg$c157 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c158 = "INDENT", + peg$c159 = "\uEFEF", + peg$c160 = "\"\\uEFEF\"", + peg$c161 = function() { return ''; }, + peg$c162 = "DEDENT", + peg$c163 = "\uEFFE", + peg$c164 = "\"\\uEFFE\"", + peg$c165 = "Unmatched DEDENT", + peg$c166 = "\uEFEE", + peg$c167 = "\"\\uEFEE\"", + peg$c168 = "LineEnd", + peg$c169 = "\uEFFF", + peg$c170 = "\"\\uEFFF\"", + peg$c171 = "\n", + peg$c172 = "\"\\n\"", + peg$c173 = "ANYDEDENT", + peg$c174 = "RequiredWhitespace", + peg$c175 = "OptionalWhitespace", + peg$c176 = "InlineWhitespace", + peg$c177 = /^[ \t]/, + peg$c178 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c2) { + s4 = peg$c2; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c4(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c5(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c19.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c22(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c123.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c128; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c130(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c134; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c136; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c138; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c140; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c145.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c147.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c149.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c138; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c152(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c154.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c157(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c159; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c163; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c171; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c177.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.12/emblem.min.js b/ajax/libs/emblem/0.1.12/emblem.min.js new file mode 100644 index 000000000..4563cf1b7 --- /dev/null +++ b/ajax/libs/emblem/0.1.12/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.11",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function _r(){return e.substring(Nr,Tr)}function Dr(){return Nr}function Pr(){return Br(Nr).line}function Hr(){return Br(Nr).column}function Br(t){function n(t,n){var r,i;for(r=0;rt&&(Cr=0,kr={line:1,column:1,seenCR:!1}),Cr=t,n(kr,Cr)),kr}function jr(e){if(TrLr&&(Lr=Tr,Ar=[]),Ar.push(e)}function Fr(e){var t=0;e.sort();while(tTr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function Fi(){var t,n,r,i;t=Tr,n=Tr,r=[],i=Ii();if(i!==null)while(i!==null)r.push(i),i=Ii();else r=o;return r!==null&&(r=e.substring(n,Tr)),n=r,n!==null&&(Nr=t,n=Ut(n)),n===null?(Tr=t,t=n):t=n,t}function Ii(){var t,n,r;return t=Tr,n=Tr,Or++,r=qi(),Or--,r===null?n=u:(Tr=n,n=o),n!==null?(e.length>Tr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function qi(){var e;return e=Xi(),e===null&&(e=Wi(),e===null&&(e=Ki(),e===null&&(e=As(),e===null&&(e=Ls())))),e}function Ri(){var e,t,n,r,i,s;return e=Tr,t=zi(),t!==null?(n=Ms(),n!==null?(r=ri(),r!==null?(i=Ms(),i!==null?(s=Vi(),s!==null?(Nr=e,t=qt(r),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o)):(Tr=e,e=o),e}function Ui(){var e;return e=Ri(),e===null&&(e=Hi(),e===null&&(e=Pi())),e}function zi(){var t,n;return Or++,e.charCodeAt(Tr)===123?(t=Vt,Tr++):(t=null,Or===0&&jr($t)),Or--,t===null&&(n=null,Or===0&&jr(Xt)),t}function Wi(){var t,n;return Or++,e.substr(Tr,2)===Kt?(t=Kt,Tr+=2):(t=null,Or===0&&jr(Qt)),Or--,t===null&&(n=null,Or===0&&jr(Jt)),t}function Xi(){var t,n;return Or++,e.substr(Tr,3)===Yt?(t=Yt,Tr+=3):(t=null,Or===0&&jr(Zt)),Or--,t===null&&(n=null,Or===0&&jr(Gt)),t}function Vi(){var t,n;return Or++,e.charCodeAt(Tr)===125?(t=tn,Tr++):(t=null,Or===0&&jr(nn)),Or--,t===null&&(n=null,Or===0&&jr(en)),t}function $i(){var t,n;return Or++,e.substr(Tr,2)===sn?(t=sn,Tr+=2):(t=null,Or===0&&jr(on)),Or--,t===null&&(n=null,Or===0&&jr(rn)),t}function Ji(){var t,n;return Or++,e.substr(Tr,3)===an?(t=an,Tr+=3):(t=null,Or===0&&jr(fn)),Or--,t===null&&(n=null,Or===0&&jr(un)),t}function Ki(){var t,n;return Or++,e.substr(Tr,2)===cn?(t=cn,Tr+=2):(t=null,Or===0&&jr(hn)),Or--,t===null&&(n=null,Or===0&&jr(ln)),t}function Qi(){var t,n;return Or++,e.charCodeAt(Tr)===125?(t=tn,Tr++):(t=null,Or===0&&jr(nn)),Or--,t===null&&(n=null,Or===0&&jr(pn)),t}function Gi(){var t,n,r;return t=Tr,e.substr(Tr,2)===dn?(n=dn,Tr+=2):(n=null,Or===0&&jr(vn)),n!==null?(e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O)),r===null&&(r=u),r!==null?(Nr=t,n=mn(),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t===null&&(t=Tr,e.charCodeAt(Tr)===61?(n=M,Tr++):(n=null,Or===0&&jr(_)),n!==null?(e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O)),r===null&&(r=u),r!==null?(Nr=t,n=gn(),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)),t}function Yi(){var e,t,n,r,i,s,a;e=Tr,t=Tr,n=ws();if(n!==null){r=si(),r===null&&(r=u);if(r!==null){i=[],s=Ui();while(s!==null)i.push(s),s=Ui();if(i!==null){s=[],a=Zi();while(a!==null)s.push(a),a=Zi();s!==null?(Nr=t,n=yn(n,r,i,s),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o}else Tr=t,t=o;if(t===null){t=Tr,n=si();if(n!==null){r=[],i=Ui();while(i!==null)r.push(i),i=Ui();if(r!==null){i=[],s=Zi();while(s!==null)i.push(s),s=Zi();i!==null?(Nr=t,n=bn(n,r,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o}return t!==null&&(Nr=e,t=wn(t)),t===null?(Tr=e,e=t):e=t,e}function si(){var e;return e=oi(),e===null&&(e=ui()),e}function oi(){var e,t,n,r;e=Tr,t=hs();if(t!==null){n=[],r=ps();while(r!==null)n.push(r),r=ps();n!==null?(Nr=e,t=R(t,n),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)}else Tr=e,e=o;return e}function ui(){var e,t,n;e=Tr,t=[],n=ps();if(n!==null)while(n!==null)t.push(n),n=ps();else t=o;return t!==null&&(Nr=e,t=U(t)),t===null?(Tr=e,e=t):e=t,e}function Zi(){var t,n,r;t=Tr,n=[],e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Tr)===32?(r=A,Tr++):(r=null,Or===0&&jr(O));else n=o;return n!==null?(r=rs(),r===null&&(r=ss(),r===null&&(r=os(),r===null&&(r=us()))),r!==null?(Nr=t,n=En(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function es(){var t;return Sn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(xn)),t}function ts(){var e,t;return e=ns(),e===null&&(e=Tr,t=mi(),t!==null&&(Nr=e,t=Tn(t)),t===null?(Tr=e,e=t):e=t),e}function ns(){var t,n,r,i,s;return t=Tr,n=Tr,e.charCodeAt(Tr)===34?(r=bt,Tr++):(r=null,Or===0&&jr(wt)),r!==null?(i=ri(),i!==null?(e.charCodeAt(Tr)===34?(s=bt,Tr++):(s=null,Or===0&&jr(wt)),s!==null?(r=[r,i,s],n=r):(Tr=n,n=o)):(Tr=n,n=o)):(Tr=n,n=o),n===null&&(n=Tr,e.charCodeAt(Tr)===39?(r=Et,Tr++):(r=null,Or===0&&jr(St)),r!==null?(i=ri(),i!==null?(e.charCodeAt(Tr)===39?(s=Et,Tr++):(s=null,Or===0&&jr(St)),s!==null?(r=[r,i,s],n=r):(Tr=n,n=o)):(Tr=n,n=o)):(Tr=n,n=o)),n!==null&&(Nr=t,n=xt(n)),n===null?(Tr=t,t=n):t=n,t}function rs(){var t,n,r,i;return t=Tr,n=xs(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=ts(),i!==null?(Nr=t,n=Nn(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function is(){var t,n,r,i,s,u;t=Tr,e.charCodeAt(Tr)===123?(n=Vt,Tr++):(n=null,Or===0&&jr($t));if(n!==null){r=Ms();if(r!==null){i=Tr,s=[],u=es(),u===null&&(e.charCodeAt(Tr)===32?(u=A,Tr++):(u=null,Or===0&&jr(O)));if(u!==null)while(u!==null)s.push(u),u=es(),u===null&&(e.charCodeAt(Tr)===32?(u=A,Tr++):(u=null,Or===0&&jr(O)));else s=o;s!==null&&(s=e.substring(i,Tr)),i=s,i!==null?(s=Ms(),s!==null?(e.charCodeAt(Tr)===125?(u=tn,Tr++):(u=null,Or===0&&jr(nn)),u!==null?(Nr=t,n=Cn(i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)}else Tr=t,t=o}else Tr=t,t=o;if(t===null){t=Tr,n=[],r=es();if(r!==null)while(r!==null)n.push(r),r=es();else n=o;n!==null&&(n=e.substring(t,Tr)),t=n}return t}function ss(){var t,n,r,i,s,a;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=is(),i!==null?(s=Tr,Or++,e.charCodeAt(Tr)===33?(a=kn,Tr++):(a=null,Or===0&&jr(Ln)),Or--,a===null?s=u:(Tr=s,s=o),s!==null?(Nr=Tr,a=An(n,i),a?a=u:a=o,a!==null?(Nr=t,n=On(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function os(){var t,n,r,i;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=mi(),i!==null?(Nr=t,n=Mn(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function us(){var t,n,r,i;return t=Tr,n=ci(),n!==null?(e.charCodeAt(Tr)===61?(r=M,Tr++):(r=null,Or===0&&jr(_)),r!==null?(i=Mi(),i!==null?(Nr=t,n=_n(n,i),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o)):(Tr=t,t=o),t}function as(){var t,n,r;t=Tr,n=[],r=ls();while(r!==null)n.push(r),r=ls();return n!==null&&(n=e.substring(t,Tr)),t=n,t}function fs(){var e;return e=Si(),e===null&&(e=pi()),e}function ls(){var t;return t=Ni(),t===null&&(mt.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(gt)),t===null&&(e.charCodeAt(Tr)===95?(t=Dn,Tr++):(t=null,Or===0&&jr(Pn)),t===null&&(e.charCodeAt(Tr)===45?(t=Hn,Tr++):(t=null,Or===0&&jr(Bn))))),t}function cs(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===37?(n=jn,Tr++):(n=null,Or===0&&jr(Fn)),n!==null?(r=ds(),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function hs(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===35?(n=In,Tr++):(n=null,Or===0&&jr(qn)),n!==null?(r=ds(),r!==null?(Nr=t,n=Rn(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function ps(){var t,n,r;return t=Tr,e.charCodeAt(Tr)===46?(n=J,Tr++):(n=null,Or===0&&jr(K)),n!==null?(r=ds(),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function ds(){var e,t;return Or++,e=vs(),Or--,e===null&&(t=null,Or===0&&jr(Un)),e}function vs(){var t,n,r,i,s;t=Tr,n=gs();if(n!==null){r=Tr,i=[],s=ms();while(s!==null)i.push(s),s=ms();i!==null&&(i=e.substring(r,Tr)),r=i,r!==null?(Nr=t,n=zn(n,r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)}else Tr=t,t=o;return t}function ms(){var t;return Wn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(Xn)),t===null&&(t=ys()),t}function gs(){var t;return Vn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr($n)),t===null&&(t=ys()),t}function ys(){var t;return Jn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(Kn)),t}function bs(){var t,n,r;t=Tr,n=[],r=Ss();if(r!==null)while(r!==null)n.push(r),r=Ss();else n=o;return n!==null&&(n=e.substring(t,Tr)),t=n,t}function ws(){var t,n,r;return Or++,t=Tr,e.charCodeAt(Tr)===37?(n=jn,Tr++):(n=null,Or===0&&jr(Fn)),n!==null?(r=bs(),r!==null?(Nr=t,n=Y(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t===null&&(t=Es()),Or--,t===null&&(n=null,Or===0&&jr(Qn)),t}function Es(){var e,t,n;return e=Tr,t=bs(),t!==null?(Nr=Tr,n=Gn(t),n?n=u:n=o,n!==null?(Nr=e,t=Yn(t),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),e}function Ss(){var t;return Zn.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(er)),t}function xs(){var e,t,n;return Or++,e=Tr,t=bs(),t!==null?(Nr=Tr,n=nr(t),n?n=u:n=o,n!==null?(Nr=e,t=Yn(t),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),Or--,e===null&&(t=null,Or===0&&jr(tr)),e}function Ts(){var e,t,n;return e=Tr,t=Ns(),t!==null?(n=Os(),n!==null?(Nr=e,t=Y(n),t===null?(Tr=e,e=t):e=t):(Tr=e,e=o)):(Tr=e,e=o),e}function Ns(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61423?(n=ir,Tr++):(n=null,Or===0&&jr(sr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(rr)),t}function Cs(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61438?(n=ar,Tr++):(n=null,Or===0&&jr(fr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(ur)),t}function ks(){var t,n;return Or++,t=Tr,e.charCodeAt(Tr)===61422?(n=cr,Tr++):(n=null,Or===0&&jr(hr)),n!==null&&(Nr=t,n=or()),n===null?(Tr=t,t=n):t=n,Or--,t===null&&(n=null,Or===0&&jr(lr)),t}function Ls(){var t,n,r;return Or++,t=Tr,e.charCodeAt(Tr)===61439?(n=dr,Tr++):(n=null,Or===0&&jr(vr)),n!==null?(e.charCodeAt(Tr)===10?(r=mr,Tr++):(r=null,Or===0&&jr(gr)),r!==null?(n=[n,r],t=n):(Tr=t,t=o)):(Tr=t,t=o),Or--,t===null&&(n=null,Or===0&&jr(pr)),t}function As(){var e,t;return Or++,e=Cs(),e===null&&(e=ks()),Or--,e===null&&(t=null,Or===0&&jr(yr)),e}function Os(){var t,n,r;Or++,t=Tr,n=[],r=_s();if(r!==null)while(r!==null)n.push(r),r=_s();else n=o;return n!==null&&(n=e.substring(t,Tr)),t=n,Or--,t===null&&(n=null,Or===0&&jr(br)),t}function Ms(){var e,t;Or++,e=[],t=_s();while(t!==null)e.push(t),t=_s();return Or--,e===null&&(t=null,Or===0&&jr(wr)),e}function _s(){var t,n;return Or++,Sr.test(e.charAt(Tr))?(t=e.charAt(Tr),Tr++):(t=null,Or===0&&jr(xr)),Or--,t===null&&(n=null,Or===0&&jr(Er)),t}function Ds(){var t,n,r;return t=Tr,n=Tr,Or++,r=Ns(),r===null&&(r=Cs(),r===null&&(r=Ls())),Or--,r===null?n=u:(Tr=n,n=o),n!==null?(e.length>Tr?(r=e.charAt(Tr),Tr++):(r=null,Or===0&&jr(zt)),r!==null?(Nr=t,n=Wt(r),n===null?(Tr=t,t=n):t=n):(Tr=t,t=o)):(Tr=t,t=o),t}function Ps(){var t,n,r;t=Tr,n=[],r=Ds();while(r!==null)n.push(r),r=Ds();return n!==null&&(n=e.substring(t,Tr)),t=n,t}function Rs(e,t,n){var r=e.hash;if(n){r=r||new js.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ir},s=Ir,o=null,u="",a="else",f='"else"',l=function(e){return e},c=function(e,t){return new js.ProgramNode(e,t||[])},h=[],p=function(e){var t=[],n=[];for(var r=0;r",g='">"',y=function(e,t){return[new js.PartialNode(e,t[0])]},b=/^[a-zA-Z0-9_$-\/]/,w="[a-zA-Z0-9_$-\\/]",E=function(e){return new js.PartialNameNode(e)},S=function(e){return[e]},x="/",T='"/"',N=/^[A-Z]/,C="[A-Z]",k=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Bs||!n.match(/[A-Z]/)?e:(e.mustache=Rs(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Bs||!n.match(/[A-Z]/)?e:Rs(e,t)},L=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},A=" ",O='" "',M="=",_='"="',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new js.ContentNode(">")),[u,new js.ContentNode("")])},En=function(e){return[new js.ContentNode(" ")].concat(e)},Sn=/^[A-Za-z.:0-9_\-]/,xn="[A-Za-z.:0-9_\\-]",Tn=function(e){return new js.MustacheNode([e])},Nn=function(e,t){return[Rs(t,"action",[["on",new js.StringNode(e)]])]},Cn=function(e){return e.replace(/ *$/,"")},kn="!",Ln='"!"',An=function(e,t){return Bs},On=function(e,t){var n=new js.HashNode([[e,new js.StringNode(t)]]),r=[new js.IdNode(["bindAttr"])],i=new js.MustacheNode(r,n);return[i]},Mn=function(e,t){var n=new js.MustacheNode([t]);return Bs&&t._emblemSuffixModifier==="!"&&(n=Rs(n,"unbound")),[new js.ContentNode(e+"="+'"'),n,new js.ContentNode('"')]},_n=function(e,t){var n=[new js.ContentNode(e+"="+'"')].concat(t);return n.concat([new js.ContentNode('"')])},Dn="_",Pn='"_"',Hn="-",Bn='"-"',jn="%",Fn='"%"',In="#",qn='"#"',Rn=function(e){return e},Un="CSSIdentifier",zn=function(e,t){return e+t},Wn=/^[_a-zA-Z0-9\-]/,Xn="[_a-zA-Z0-9\\-]",Vn=/^[_a-zA-Z]/,$n="[_a-zA-Z]",Jn=/^[\x80-\xFF]/,Kn="[\\x80-\\xFF]",Qn="KnownHTMLTagName",Gn=function(e){return!!Is[e]},Yn=function(e){return e},Zn=/^[:_a-zA-Z0-9\-]/,er="[:_a-zA-Z0-9\\-]",tr="a JS event",nr=function(e){return!!qs[e]},rr="INDENT",ir="",sr='"\\uEFEF"',or=function(){return""},ur="DEDENT",ar="",fr='"\\uEFFE"',lr="Unmatched DEDENT",cr="",hr='"\\uEFEE"',pr="LineEnd",dr="",vr='"\\uEFFF"',mr="\n",gr='"\\n"',yr="ANYDEDENT",br="RequiredWhitespace",wr="OptionalWhitespace",Er="InlineWhitespace",Sr=/^[ \t]/,xr="[ \\t]",Tr=0,Nr=0,Cr=0,kr={line:1,column:1,seenCR:!1},Lr=0,Ar=[],Or=0,Mr;if("startRule"in r){if(!(r.startRule in i))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=i[r.startRule]}var Hs=n.handlebarsVariant,Bs=Hs.JavaScriptCompiler.prototype.namespace==="Ember.Handlebars",js=Hs.AST,Fs={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Is={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},qs={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0};Mr=s();if(Mr!==null&&Tr===e.length)return Mr;throw Fr(Ar),Nr=Math.max(Tr,Lr),new t(Ar,Nr this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.11"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = "else", + peg$c3 = "\"else\"", + peg$c4 = function(c) {return c;}, + peg$c5 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c6 = [], + peg$c7 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c8 = "BeginStatement", + peg$c9 = function() { return []; }, + peg$c10 = ">", + peg$c11 = "\">\"", + peg$c12 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c13 = /^[a-zA-Z0-9_$-\/]/, + peg$c14 = "[a-zA-Z0-9_$-\\/]", + peg$c15 = function(s) { return new AST.PartialNameNode(s); }, + peg$c16 = function(m) { + return [m]; + }, + peg$c17 = "/", + peg$c18 = "\"/\"", + peg$c19 = /^[A-Z]/, + peg$c20 = "[A-Z]", + peg$c21 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c22 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c23 = " ", + peg$c24 = "\" \"", + peg$c25 = "=", + peg$c26 = "\"=\"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`]/, + peg$c81 = "[|`]", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(s) { return { shorthand: s, id: true}; }, + peg$c123 = function(s) { return { shorthand: s }; }, + peg$c124 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c125 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c126 = /^[A-Za-z.:0-9_\-]/, + peg$c127 = "[A-Za-z.:0-9_\\-]", + peg$c128 = function(id) { return new AST.MustacheNode([id]); }, + peg$c129 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c130 = function(value) { return value.replace(/ *$/, ''); }, + peg$c131 = "!", + peg$c132 = "\"!\"", + peg$c133 = function(key, value) { return IS_EMBER; }, + peg$c134 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c135 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c136 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c137 = "_", + peg$c138 = "\"_\"", + peg$c139 = "-", + peg$c140 = "\"-\"", + peg$c141 = "%", + peg$c142 = "\"%\"", + peg$c143 = "#", + peg$c144 = "\"#\"", + peg$c145 = function(c) { return c;}, + peg$c146 = "CSSIdentifier", + peg$c147 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c148 = /^[_a-zA-Z0-9\-]/, + peg$c149 = "[_a-zA-Z0-9\\-]", + peg$c150 = /^[_a-zA-Z]/, + peg$c151 = "[_a-zA-Z]", + peg$c152 = /^[\x80-\xFF]/, + peg$c153 = "[\\x80-\\xFF]", + peg$c154 = "KnownHTMLTagName", + peg$c155 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c156 = function(t) { return t; }, + peg$c157 = /^[:_a-zA-Z0-9\-]/, + peg$c158 = "[:_a-zA-Z0-9\\-]", + peg$c159 = "a JS event", + peg$c160 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c161 = "INDENT", + peg$c162 = "\uEFEF", + peg$c163 = "\"\\uEFEF\"", + peg$c164 = function() { return ''; }, + peg$c165 = "DEDENT", + peg$c166 = "\uEFFE", + peg$c167 = "\"\\uEFFE\"", + peg$c168 = "Unmatched DEDENT", + peg$c169 = "\uEFEE", + peg$c170 = "\"\\uEFEE\"", + peg$c171 = "LineEnd", + peg$c172 = "\uEFFF", + peg$c173 = "\"\\uEFFF\"", + peg$c174 = "\n", + peg$c175 = "\"\\n\"", + peg$c176 = "ANYDEDENT", + peg$c177 = "RequiredWhitespace", + peg$c178 = "OptionalWhitespace", + peg$c179 = "InlineWhitespace", + peg$c180 = /^[ \t]/, + peg$c181 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c2) { + s4 = peg$c2; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c4(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c5(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c19.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c22(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c126.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c131; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c133(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c143; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c148.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c155(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c174; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.13/emblem.min.js b/ajax/libs/emblem/0.1.13/emblem.min.js new file mode 100644 index 000000000..f51f782aa --- /dev/null +++ b/ajax/libs/emblem/0.1.13/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.11",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Hr(){return e.substring(Lr,kr)}function Br(){return Lr}function jr(){return Ir(Lr).line}function Fr(){return Ir(Lr).column}function Ir(t){function n(t,n){var r,i;for(r=0;rt&&(Ar=0,Or={line:1,column:1,seenCR:!1}),Ar=t,n(Or,Ar)),Or}function qr(e){if(krMr&&(Mr=kr,_r=[]),_r.push(e)}function Rr(e){var t=0;e.sort();while(tkr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Ri(){var t,n,r,i;t=kr,n=kr,r=[],i=Ui();if(i!==null)while(i!==null)r.push(i),i=Ui();else r=o;return r!==null&&(r=e.substring(n,kr)),n=r,n!==null&&(Lr=t,n=Ut(n)),n===null?(kr=t,t=n):t=n,t}function Ui(){var t,n,r;return t=kr,n=kr,Dr++,r=zi(),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function zi(){var e;return e=Ji(),e===null&&(e=$i(),e===null&&(e=Yi(),e===null&&(e=_s(),e===null&&(e=Ms())))),e}function Wi(){var e,t,n,r,i,s;return e=kr,t=Vi(),t!==null?(n=Ps(),n!==null?(r=oi(),r!==null?(i=Ps(),i!==null?(s=Ki(),s!==null?(Lr=e,t=qt(r),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o),e}function Xi(){var e;return e=Wi(),e===null&&(e=Fi(),e===null&&(e=ji())),e}function Vi(){var t,n;return Dr++,e.charCodeAt(kr)===123?(t=Vt,kr++):(t=null,Dr===0&&qr($t)),Dr--,t===null&&(n=null,Dr===0&&qr(Xt)),t}function $i(){var t,n;return Dr++,e.substr(kr,2)===Kt?(t=Kt,kr+=2):(t=null,Dr===0&&qr(Qt)),Dr--,t===null&&(n=null,Dr===0&&qr(Jt)),t}function Ji(){var t,n;return Dr++,e.substr(kr,3)===Yt?(t=Yt,kr+=3):(t=null,Dr===0&&qr(Zt)),Dr--,t===null&&(n=null,Dr===0&&qr(Gt)),t}function Ki(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(en)),t}function Qi(){var t,n;return Dr++,e.substr(kr,2)===sn?(t=sn,kr+=2):(t=null,Dr===0&&qr(on)),Dr--,t===null&&(n=null,Dr===0&&qr(rn)),t}function Gi(){var t,n;return Dr++,e.substr(kr,3)===an?(t=an,kr+=3):(t=null,Dr===0&&qr(fn)),Dr--,t===null&&(n=null,Dr===0&&qr(un)),t}function Yi(){var t,n;return Dr++,e.substr(kr,2)===cn?(t=cn,kr+=2):(t=null,Dr===0&&qr(hn)),Dr--,t===null&&(n=null,Dr===0&&qr(ln)),t}function Zi(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(pn)),t}function es(){var t,n,r;return t=kr,e.substr(kr,2)===dn?(n=dn,kr+=2):(n=null,Dr===0&&qr(vn)),n!==null?(e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O)),r===null&&(r=u),r!==null?(Lr=t,n=mn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=kr,e.charCodeAt(kr)===61?(n=M,kr++):(n=null,Dr===0&&qr(_)),n!==null?(e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O)),r===null&&(r=u),r!==null?(Lr=t,n=gn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)),t}function ts(){var e,t,n,r,i,s,a;e=kr,t=kr,n=xs();if(n!==null){r=ai(),r===null&&(r=u);if(r!==null){i=[],s=Xi();while(s!==null)i.push(s),s=Xi();if(i!==null){s=[],a=ns();while(a!==null)s.push(a),a=ns();s!==null?(Lr=t,n=yn(n,r,i,s),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=ai();if(n!==null){r=[],i=Xi();while(i!==null)r.push(i),i=Xi();if(r!==null){i=[],s=ns();while(s!==null)i.push(s),s=ns();i!==null?(Lr=t,n=bn(n,r,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}return t!==null&&(Lr=e,t=wn(t)),t===null?(kr=e,e=t):e=t,e}function ai(){var e,t,n,r;e=kr,t=[],n=kr,r=vs(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=ms(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=kr,r=vs(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=ms(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);else t=o;return t!==null&&(Lr=e,t=xn(t)),t===null?(kr=e,e=t):e=t,e}function ns(){var t,n,r;t=kr,n=[],e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O));else n=o;return n!==null?(r=os(),r===null&&(r=as(),r===null&&(r=fs(),r===null&&(r=ls()))),r!==null?(Lr=t,n=Tn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function rs(){var t;return Nn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cn)),t}function is(){var e,t;return e=ss(),e===null&&(e=kr,t=bi(),t!==null&&(Lr=e,t=kn(t)),t===null?(kr=e,e=t):e=t),e}function ss(){var t,n,r,i,s;return t=kr,n=kr,e.charCodeAt(kr)===34?(r=bt,kr++):(r=null,Dr===0&&qr(wt)),r!==null?(i=oi(),i!==null?(e.charCodeAt(kr)===34?(s=bt,kr++):(s=null,Dr===0&&qr(wt)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o),n===null&&(n=kr,e.charCodeAt(kr)===39?(r=Et,kr++):(r=null,Dr===0&&qr(St)),r!==null?(i=oi(),i!==null?(e.charCodeAt(kr)===39?(s=Et,kr++):(s=null,Dr===0&&qr(St)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o)),n!==null&&(Lr=t,n=xt(n)),n===null?(kr=t,t=n):t=n,t}function os(){var t,n,r,i;return t=kr,n=Cs(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=is(),i!==null?(Lr=t,n=Ln(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function us(){var t,n,r,i,s,u;t=kr,e.charCodeAt(kr)===123?(n=Vt,kr++):(n=null,Dr===0&&qr($t));if(n!==null){r=Ps();if(r!==null){i=kr,s=[],u=rs(),u===null&&(e.charCodeAt(kr)===32?(u=A,kr++):(u=null,Dr===0&&qr(O)));if(u!==null)while(u!==null)s.push(u),u=rs(),u===null&&(e.charCodeAt(kr)===32?(u=A,kr++):(u=null,Dr===0&&qr(O)));else s=o;s!==null&&(s=e.substring(i,kr)),i=s,i!==null?(s=Ps(),s!==null?(e.charCodeAt(kr)===125?(u=tn,kr++):(u=null,Dr===0&&qr(nn)),u!==null?(Lr=t,n=An(i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=[],r=rs();if(r!==null)while(r!==null)n.push(r),r=rs();else n=o;n!==null&&(n=e.substring(t,kr)),t=n}return t}function as(){var t,n,r,i,s,a;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=us(),i!==null?(s=kr,Dr++,e.charCodeAt(kr)===33?(a=On,kr++):(a=null,Dr===0&&qr(Mn)),Dr--,a===null?s=u:(kr=s,s=o),s!==null?(Lr=kr,a=_n(n,i),a?a=u:a=o,a!==null?(Lr=t,n=Dn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function fs(){var t,n,r,i;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=bi(),i!==null?(Lr=t,n=Pn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function ls(){var t,n,r,i;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=Pi(),i!==null?(Lr=t,n=Hn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function cs(){var t,n,r;t=kr,n=[],r=ps();while(r!==null)n.push(r),r=ps();return n!==null&&(n=e.substring(t,kr)),t=n,t}function hs(){var e;return e=Ni(),e===null&&(e=mi()),e}function ps(){var t;return t=Li(),t===null&&(mt.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(gt)),t===null&&(e.charCodeAt(kr)===95?(t=Bn,kr++):(t=null,Dr===0&&qr(jn)),t===null&&(e.charCodeAt(kr)===45?(t=Fn,kr++):(t=null,Dr===0&&qr(In))))),t}function ds(){var t,n,r;return t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function vs(){var t,n,r;return t=kr,e.charCodeAt(kr)===35?(n=Un,kr++):(n=null,Dr===0&&qr(zn)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ms(){var t,n,r;return t=kr,e.charCodeAt(kr)===46?(n=J,kr++):(n=null,Dr===0&&qr(K)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function gs(){var e,t;return Dr++,e=ys(),Dr--,e===null&&(t=null,Dr===0&&qr(Xn)),e}function ys(){var t,n,r,i,s;t=kr,n=ws();if(n!==null){r=kr,i=[],s=bs();while(s!==null)i.push(s),s=bs();i!==null&&(i=e.substring(r,kr)),r=i,r!==null?(Lr=t,n=Vn(n,r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o;return t}function bs(){var t;return $n.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Jn)),t===null&&(t=Es()),t}function ws(){var t;return Kn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Qn)),t===null&&(t=Es()),t}function Es(){var t;return Gn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Yn)),t}function Ss(){var t,n,r;t=kr,n=[],r=Ns();if(r!==null)while(r!==null)n.push(r),r=Ns();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,t}function xs(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=Ss(),r!==null?(Lr=t,n=Y(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=Ts()),Dr--,t===null&&(n=null,Dr===0&&qr(Zn)),t}function Ts(){var e,t,n;return e=kr,t=Ss(),t!==null?(Lr=kr,n=er(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Ns(){var t;return nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(rr)),t}function Cs(){var e,t,n;return Dr++,e=kr,t=Ss(),t!==null?(Lr=kr,n=sr(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),Dr--,e===null&&(t=null,Dr===0&&qr(ir)),e}function ks(){var e,t,n;return e=kr,t=Ls(),t!==null?(n=Ds(),n!==null?(Lr=e,t=Y(n),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Ls(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61423?(n=ur,kr++):(n=null,Dr===0&&qr(ar)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(or)),t}function As(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61438?(n=cr,kr++):(n=null,Dr===0&&qr(hr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(lr)),t}function Os(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61422?(n=dr,kr++):(n=null,Dr===0&&qr(vr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(pr)),t}function Ms(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===61439?(n=gr,kr++):(n=null,Dr===0&&qr(yr)),n!==null?(e.charCodeAt(kr)===10?(r=br,kr++):(r=null,Dr===0&&qr(wr)),r!==null?(n=[n,r],t=n):(kr=t,t=o)):(kr=t,t=o),Dr--,t===null&&(n=null,Dr===0&&qr(mr)),t}function _s(){var e,t;return Dr++,e=As(),e===null&&(e=Os()),Dr--,e===null&&(t=null,Dr===0&&qr(Er)),e}function Ds(){var t,n,r;Dr++,t=kr,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,Dr--,t===null&&(n=null,Dr===0&&qr(Sr)),t}function Ps(){var e,t;Dr++,e=[],t=Hs();while(t!==null)e.push(t),t=Hs();return Dr--,e===null&&(t=null,Dr===0&&qr(xr)),e}function Hs(){var t,n;return Dr++,Nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cr)),Dr--,t===null&&(n=null,Dr===0&&qr(Tr)),t}function Bs(){var t,n,r;return t=kr,n=kr,Dr++,r=Ls(),r===null&&(r=As(),r===null&&(r=Ms())),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function js(){var t,n,r;t=kr,n=[],r=Bs();while(r!==null)n.push(r),r=Bs();return n!==null&&(n=e.substring(t,kr)),t=n,t}function Ws(e,t,n){var r=e.hash;if(n){r=r||new qs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ur},s=Ur,o=null,u="",a="else",f='"else"',l=function(e){return e},c=function(e,t){return new qs.ProgramNode(e,t||[])},h=[],p=function(e){var t=[],n=[];for(var r=0;r",g='">"',y=function(e,t){return[new qs.PartialNode(e,t[0])]},b=/^[a-zA-Z0-9_$-\/]/,w="[a-zA-Z0-9_$-\\/]",E=function(e){return new qs.PartialNameNode(e)},S=function(e){return[e]},x="/",T='"/"',N=/^[A-Z]/,C="[A-Z]",k=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Is||!n.match(/[A-Z]/)?e:(e.mustache=Ws(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Is||!n.match(/[A-Z]/)?e:Ws(e,t)},L=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},A=" ",O='" "',M="=",_='"="',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new qs.ContentNode(">")),[u,new qs.ContentNode("")])},En=function(e){return{shorthand:e,id:!0}},Sn=function(e){return{shorthand:e}},xn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.13"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = "else", + peg$c3 = "\"else\"", + peg$c4 = function(c) {return c;}, + peg$c5 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c6 = [], + peg$c7 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c8 = "BeginStatement", + peg$c9 = function() { return []; }, + peg$c10 = ">", + peg$c11 = "\">\"", + peg$c12 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c13 = /^[a-zA-Z0-9_$-\/]/, + peg$c14 = "[a-zA-Z0-9_$-\\/]", + peg$c15 = function(s) { return new AST.PartialNameNode(s); }, + peg$c16 = function(m) { + return [m]; + }, + peg$c17 = "/", + peg$c18 = "\"/\"", + peg$c19 = /^[A-Z]/, + peg$c20 = "[A-Z]", + peg$c21 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c22 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c23 = " ", + peg$c24 = "\" \"", + peg$c25 = "=", + peg$c26 = "\"=\"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`']/, + peg$c81 = "[|`']", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(s) { return { shorthand: s, id: true}; }, + peg$c123 = function(s) { return { shorthand: s }; }, + peg$c124 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c125 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c126 = /^[A-Za-z.:0-9_\-]/, + peg$c127 = "[A-Za-z.:0-9_\\-]", + peg$c128 = function(id) { return new AST.MustacheNode([id]); }, + peg$c129 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c130 = function(value) { return value.replace(/ *$/, ''); }, + peg$c131 = "!", + peg$c132 = "\"!\"", + peg$c133 = function(key, value) { return IS_EMBER; }, + peg$c134 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c135 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c136 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c137 = "_", + peg$c138 = "\"_\"", + peg$c139 = "-", + peg$c140 = "\"-\"", + peg$c141 = "%", + peg$c142 = "\"%\"", + peg$c143 = "#", + peg$c144 = "\"#\"", + peg$c145 = function(c) { return c;}, + peg$c146 = "CSSIdentifier", + peg$c147 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c148 = /^[_a-zA-Z0-9\-]/, + peg$c149 = "[_a-zA-Z0-9\\-]", + peg$c150 = /^[_a-zA-Z]/, + peg$c151 = "[_a-zA-Z]", + peg$c152 = /^[\x80-\xFF]/, + peg$c153 = "[\\x80-\\xFF]", + peg$c154 = "KnownHTMLTagName", + peg$c155 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c156 = function(t) { return t; }, + peg$c157 = /^[:_a-zA-Z0-9\-]/, + peg$c158 = "[:_a-zA-Z0-9\\-]", + peg$c159 = "a JS event", + peg$c160 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c161 = "INDENT", + peg$c162 = "\uEFEF", + peg$c163 = "\"\\uEFEF\"", + peg$c164 = function() { return ''; }, + peg$c165 = "DEDENT", + peg$c166 = "\uEFFE", + peg$c167 = "\"\\uEFFE\"", + peg$c168 = "Unmatched DEDENT", + peg$c169 = "\uEFEE", + peg$c170 = "\"\\uEFEE\"", + peg$c171 = "LineEnd", + peg$c172 = "\uEFFF", + peg$c173 = "\"\\uEFFF\"", + peg$c174 = "\n", + peg$c175 = "\"\\n\"", + peg$c176 = "ANYDEDENT", + peg$c177 = "RequiredWhitespace", + peg$c178 = "OptionalWhitespace", + peg$c179 = "InlineWhitespace", + peg$c180 = /^[ \t]/, + peg$c181 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c2) { + s4 = peg$c2; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c4(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c5(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c13.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c17; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c18); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c19.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c22(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c10; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c25; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c23; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c126.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c23; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c24); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c131; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c133(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c143; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c148.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c155(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c174; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.14/emblem.min.js b/ajax/libs/emblem/0.1.14/emblem.min.js new file mode 100644 index 000000000..f0ee6f05c --- /dev/null +++ b/ajax/libs/emblem/0.1.14/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.13",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Hr(){return e.substring(Lr,kr)}function Br(){return Lr}function jr(){return Ir(Lr).line}function Fr(){return Ir(Lr).column}function Ir(t){function n(t,n){var r,i;for(r=0;rt&&(Ar=0,Or={line:1,column:1,seenCR:!1}),Ar=t,n(Or,Ar)),Or}function qr(e){if(krMr&&(Mr=kr,_r=[]),_r.push(e)}function Rr(e){var t=0;e.sort();while(tkr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Ri(){var t,n,r,i;t=kr,n=kr,r=[],i=Ui();if(i!==null)while(i!==null)r.push(i),i=Ui();else r=o;return r!==null&&(r=e.substring(n,kr)),n=r,n!==null&&(Lr=t,n=Ut(n)),n===null?(kr=t,t=n):t=n,t}function Ui(){var t,n,r;return t=kr,n=kr,Dr++,r=zi(),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function zi(){var e;return e=Ji(),e===null&&(e=$i(),e===null&&(e=Yi(),e===null&&(e=_s(),e===null&&(e=Ms())))),e}function Wi(){var e,t,n,r,i,s;return e=kr,t=Vi(),t!==null?(n=Ps(),n!==null?(r=oi(),r!==null?(i=Ps(),i!==null?(s=Ki(),s!==null?(Lr=e,t=qt(r),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o),e}function Xi(){var e;return e=Wi(),e===null&&(e=Fi(),e===null&&(e=ji())),e}function Vi(){var t,n;return Dr++,e.charCodeAt(kr)===123?(t=Vt,kr++):(t=null,Dr===0&&qr($t)),Dr--,t===null&&(n=null,Dr===0&&qr(Xt)),t}function $i(){var t,n;return Dr++,e.substr(kr,2)===Kt?(t=Kt,kr+=2):(t=null,Dr===0&&qr(Qt)),Dr--,t===null&&(n=null,Dr===0&&qr(Jt)),t}function Ji(){var t,n;return Dr++,e.substr(kr,3)===Yt?(t=Yt,kr+=3):(t=null,Dr===0&&qr(Zt)),Dr--,t===null&&(n=null,Dr===0&&qr(Gt)),t}function Ki(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(en)),t}function Qi(){var t,n;return Dr++,e.substr(kr,2)===sn?(t=sn,kr+=2):(t=null,Dr===0&&qr(on)),Dr--,t===null&&(n=null,Dr===0&&qr(rn)),t}function Gi(){var t,n;return Dr++,e.substr(kr,3)===an?(t=an,kr+=3):(t=null,Dr===0&&qr(fn)),Dr--,t===null&&(n=null,Dr===0&&qr(un)),t}function Yi(){var t,n;return Dr++,e.substr(kr,2)===cn?(t=cn,kr+=2):(t=null,Dr===0&&qr(hn)),Dr--,t===null&&(n=null,Dr===0&&qr(ln)),t}function Zi(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(pn)),t}function es(){var t,n,r;return t=kr,e.substr(kr,2)===dn?(n=dn,kr+=2):(n=null,Dr===0&&qr(vn)),n!==null?(e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O)),r===null&&(r=u),r!==null?(Lr=t,n=mn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=kr,e.charCodeAt(kr)===61?(n=M,kr++):(n=null,Dr===0&&qr(_)),n!==null?(e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O)),r===null&&(r=u),r!==null?(Lr=t,n=gn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)),t}function ts(){var e,t,n,r,i,s,a;e=kr,t=kr,n=xs();if(n!==null){r=ai(),r===null&&(r=u);if(r!==null){i=[],s=Xi();while(s!==null)i.push(s),s=Xi();if(i!==null){s=[],a=ns();while(a!==null)s.push(a),a=ns();s!==null?(Lr=t,n=yn(n,r,i,s),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=ai();if(n!==null){r=[],i=Xi();while(i!==null)r.push(i),i=Xi();if(r!==null){i=[],s=ns();while(s!==null)i.push(s),s=ns();i!==null?(Lr=t,n=bn(n,r,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}return t!==null&&(Lr=e,t=wn(t)),t===null?(kr=e,e=t):e=t,e}function ai(){var e,t,n,r;e=kr,t=[],n=kr,r=vs(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=ms(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=kr,r=vs(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=ms(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);else t=o;return t!==null&&(Lr=e,t=xn(t)),t===null?(kr=e,e=t):e=t,e}function ns(){var t,n,r;t=kr,n=[],e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(kr)===32?(r=A,kr++):(r=null,Dr===0&&qr(O));else n=o;return n!==null?(r=os(),r===null&&(r=as(),r===null&&(r=fs(),r===null&&(r=ls()))),r!==null?(Lr=t,n=Tn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function rs(){var t;return Nn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cn)),t}function is(){var e,t;return e=ss(),e===null&&(e=kr,t=bi(),t!==null&&(Lr=e,t=kn(t)),t===null?(kr=e,e=t):e=t),e}function ss(){var t,n,r,i,s;return t=kr,n=kr,e.charCodeAt(kr)===34?(r=bt,kr++):(r=null,Dr===0&&qr(wt)),r!==null?(i=oi(),i!==null?(e.charCodeAt(kr)===34?(s=bt,kr++):(s=null,Dr===0&&qr(wt)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o),n===null&&(n=kr,e.charCodeAt(kr)===39?(r=Et,kr++):(r=null,Dr===0&&qr(St)),r!==null?(i=oi(),i!==null?(e.charCodeAt(kr)===39?(s=Et,kr++):(s=null,Dr===0&&qr(St)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o)),n!==null&&(Lr=t,n=xt(n)),n===null?(kr=t,t=n):t=n,t}function os(){var t,n,r,i;return t=kr,n=Cs(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=is(),i!==null?(Lr=t,n=Ln(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function us(){var t,n,r,i,s,u;t=kr,e.charCodeAt(kr)===123?(n=Vt,kr++):(n=null,Dr===0&&qr($t));if(n!==null){r=Ps();if(r!==null){i=kr,s=[],u=rs(),u===null&&(e.charCodeAt(kr)===32?(u=A,kr++):(u=null,Dr===0&&qr(O)));if(u!==null)while(u!==null)s.push(u),u=rs(),u===null&&(e.charCodeAt(kr)===32?(u=A,kr++):(u=null,Dr===0&&qr(O)));else s=o;s!==null&&(s=e.substring(i,kr)),i=s,i!==null?(s=Ps(),s!==null?(e.charCodeAt(kr)===125?(u=tn,kr++):(u=null,Dr===0&&qr(nn)),u!==null?(Lr=t,n=An(i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=[],r=rs();if(r!==null)while(r!==null)n.push(r),r=rs();else n=o;n!==null&&(n=e.substring(t,kr)),t=n}return t}function as(){var t,n,r,i,s,a;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=us(),i!==null?(s=kr,Dr++,e.charCodeAt(kr)===33?(a=On,kr++):(a=null,Dr===0&&qr(Mn)),Dr--,a===null?s=u:(kr=s,s=o),s!==null?(Lr=kr,a=_n(n,i),a?a=u:a=o,a!==null?(Lr=t,n=Dn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function fs(){var t,n,r,i;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=bi(),i!==null?(Lr=t,n=Pn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function ls(){var t,n,r,i;return t=kr,n=di(),n!==null?(e.charCodeAt(kr)===61?(r=M,kr++):(r=null,Dr===0&&qr(_)),r!==null?(i=Pi(),i!==null?(Lr=t,n=Hn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function cs(){var t,n,r;t=kr,n=[],r=ps();while(r!==null)n.push(r),r=ps();return n!==null&&(n=e.substring(t,kr)),t=n,t}function hs(){var e;return e=Ni(),e===null&&(e=mi()),e}function ps(){var t;return t=Li(),t===null&&(mt.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(gt)),t===null&&(e.charCodeAt(kr)===95?(t=Bn,kr++):(t=null,Dr===0&&qr(jn)),t===null&&(e.charCodeAt(kr)===45?(t=Fn,kr++):(t=null,Dr===0&&qr(In))))),t}function ds(){var t,n,r;return t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function vs(){var t,n,r;return t=kr,e.charCodeAt(kr)===35?(n=Un,kr++):(n=null,Dr===0&&qr(zn)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ms(){var t,n,r;return t=kr,e.charCodeAt(kr)===46?(n=J,kr++):(n=null,Dr===0&&qr(K)),n!==null?(r=gs(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function gs(){var e,t;return Dr++,e=ys(),Dr--,e===null&&(t=null,Dr===0&&qr(Xn)),e}function ys(){var t,n,r,i,s;t=kr,n=ws();if(n!==null){r=kr,i=[],s=bs();while(s!==null)i.push(s),s=bs();i!==null&&(i=e.substring(r,kr)),r=i,r!==null?(Lr=t,n=Vn(n,r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o;return t}function bs(){var t;return $n.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Jn)),t===null&&(t=Es()),t}function ws(){var t;return Kn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Qn)),t===null&&(t=Es()),t}function Es(){var t;return Gn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Yn)),t}function Ss(){var t,n,r;t=kr,n=[],r=Ns();if(r!==null)while(r!==null)n.push(r),r=Ns();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,t}function xs(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=Ss(),r!==null?(Lr=t,n=Y(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=Ts()),Dr--,t===null&&(n=null,Dr===0&&qr(Zn)),t}function Ts(){var e,t,n;return e=kr,t=Ss(),t!==null?(Lr=kr,n=er(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Ns(){var t;return nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(rr)),t}function Cs(){var e,t,n;return Dr++,e=kr,t=Ss(),t!==null?(Lr=kr,n=sr(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),Dr--,e===null&&(t=null,Dr===0&&qr(ir)),e}function ks(){var e,t,n;return e=kr,t=Ls(),t!==null?(n=Ds(),n!==null?(Lr=e,t=Y(n),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Ls(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61423?(n=ur,kr++):(n=null,Dr===0&&qr(ar)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(or)),t}function As(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61438?(n=cr,kr++):(n=null,Dr===0&&qr(hr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(lr)),t}function Os(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61422?(n=dr,kr++):(n=null,Dr===0&&qr(vr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(pr)),t}function Ms(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===61439?(n=gr,kr++):(n=null,Dr===0&&qr(yr)),n!==null?(e.charCodeAt(kr)===10?(r=br,kr++):(r=null,Dr===0&&qr(wr)),r!==null?(n=[n,r],t=n):(kr=t,t=o)):(kr=t,t=o),Dr--,t===null&&(n=null,Dr===0&&qr(mr)),t}function _s(){var e,t;return Dr++,e=As(),e===null&&(e=Os()),Dr--,e===null&&(t=null,Dr===0&&qr(Er)),e}function Ds(){var t,n,r;Dr++,t=kr,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,Dr--,t===null&&(n=null,Dr===0&&qr(Sr)),t}function Ps(){var e,t;Dr++,e=[],t=Hs();while(t!==null)e.push(t),t=Hs();return Dr--,e===null&&(t=null,Dr===0&&qr(xr)),e}function Hs(){var t,n;return Dr++,Nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cr)),Dr--,t===null&&(n=null,Dr===0&&qr(Tr)),t}function Bs(){var t,n,r;return t=kr,n=kr,Dr++,r=Ls(),r===null&&(r=As(),r===null&&(r=Ms())),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function js(){var t,n,r;t=kr,n=[],r=Bs();while(r!==null)n.push(r),r=Bs();return n!==null&&(n=e.substring(t,kr)),t=n,t}function Ws(e,t,n){var r=e.hash;if(n){r=r||new qs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ur},s=Ur,o=null,u="",a="else",f='"else"',l=function(e){return e},c=function(e,t){return new qs.ProgramNode(e,t||[])},h=[],p=function(e){var t=[],n=[];for(var r=0;r",g='">"',y=function(e,t){return[new qs.PartialNode(e,t[0])]},b=/^[a-zA-Z0-9_$-\/]/,w="[a-zA-Z0-9_$-\\/]",E=function(e){return new qs.PartialNameNode(e)},S=function(e){return[e]},x="/",T='"/"',N=/^[A-Z]/,C="[A-Z]",k=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Is||!n.match(/[A-Z]/)?e:(e.mustache=Ws(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Is||!n.match(/[A-Z]/)?e:Ws(e,t)},L=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},A=" ",O='" "',M="=",_='"="',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new qs.ContentNode(">")),[u,new qs.ContentNode("")])},En=function(e){return{shorthand:e,id:!0}},Sn=function(e){return{shorthand:e}},xn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.13"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = function() { return []; }, + peg$c12 = ">", + peg$c13 = "\">\"", + peg$c14 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c15 = /^[a-zA-Z0-9_$-\/]/, + peg$c16 = "[a-zA-Z0-9_$-\\/]", + peg$c17 = function(s) { return new AST.PartialNameNode(s); }, + peg$c18 = function(m) { + return [m]; + }, + peg$c19 = "/", + peg$c20 = "\"/\"", + peg$c21 = /^[A-Z]/, + peg$c22 = "[A-Z]", + peg$c23 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c24 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`']/, + peg$c81 = "[|`']", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(s) { return { shorthand: s, id: true}; }, + peg$c123 = function(s) { return { shorthand: s }; }, + peg$c124 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c125 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c126 = /^[A-Za-z.:0-9_\-]/, + peg$c127 = "[A-Za-z.:0-9_\\-]", + peg$c128 = function(id) { return new AST.MustacheNode([id]); }, + peg$c129 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c130 = function(value) { return value.replace(/ *$/, ''); }, + peg$c131 = "!", + peg$c132 = "\"!\"", + peg$c133 = function(key, value) { return IS_EMBER; }, + peg$c134 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c135 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c136 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c137 = "_", + peg$c138 = "\"_\"", + peg$c139 = "-", + peg$c140 = "\"-\"", + peg$c141 = "%", + peg$c142 = "\"%\"", + peg$c143 = "#", + peg$c144 = "\"#\"", + peg$c145 = function(c) { return c;}, + peg$c146 = "CSSIdentifier", + peg$c147 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c148 = /^[_a-zA-Z0-9\-]/, + peg$c149 = "[_a-zA-Z0-9\\-]", + peg$c150 = /^[_a-zA-Z]/, + peg$c151 = "[_a-zA-Z]", + peg$c152 = /^[\x80-\xFF]/, + peg$c153 = "[\\x80-\\xFF]", + peg$c154 = "KnownHTMLTagName", + peg$c155 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c156 = function(t) { return t; }, + peg$c157 = /^[:_a-zA-Z0-9\-]/, + peg$c158 = "[:_a-zA-Z0-9\\-]", + peg$c159 = "a JS event", + peg$c160 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c161 = "INDENT", + peg$c162 = "\uEFEF", + peg$c163 = "\"\\uEFEF\"", + peg$c164 = function() { return ''; }, + peg$c165 = "DEDENT", + peg$c166 = "\uEFFE", + peg$c167 = "\"\\uEFFE\"", + peg$c168 = "Unmatched DEDENT", + peg$c169 = "\uEFEE", + peg$c170 = "\"\\uEFEE\"", + peg$c171 = "LineEnd", + peg$c172 = "\uEFFF", + peg$c173 = "\"\\uEFFF\"", + peg$c174 = "\n", + peg$c175 = "\"\\n\"", + peg$c176 = "ANYDEDENT", + peg$c177 = "RequiredWhitespace", + peg$c178 = "OptionalWhitespace", + peg$c179 = "InlineWhitespace", + peg$c180 = /^[ \t]/, + peg$c181 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c19; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c21.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c22); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c23(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c126.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c131; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c133(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c143; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c148.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c155(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c174; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.15/emblem.min.js b/ajax/libs/emblem/0.1.15/emblem.min.js new file mode 100644 index 000000000..d96096fca --- /dev/null +++ b/ajax/libs/emblem/0.1.15/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.13",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Hr(){return e.substring(Lr,kr)}function Br(){return Lr}function jr(){return Ir(Lr).line}function Fr(){return Ir(Lr).column}function Ir(t){function n(t,n){var r,i;for(r=0;rt&&(Ar=0,Or={line:1,column:1,seenCR:!1}),Ar=t,n(Or,Ar)),Or}function qr(e){if(krMr&&(Mr=kr,_r=[]),_r.push(e)}function Rr(e){var t=0;e.sort();while(tkr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Ui(){var t,n,r,i;t=kr,n=kr,r=[],i=zi();if(i!==null)while(i!==null)r.push(i),i=zi();else r=o;return r!==null&&(r=e.substring(n,kr)),n=r,n!==null&&(Lr=t,n=Ut(n)),n===null?(kr=t,t=n):t=n,t}function zi(){var t,n,r;return t=kr,n=kr,Dr++,r=Wi(),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Wi(){var e;return e=Ki(),e===null&&(e=Ji(),e===null&&(e=Zi(),e===null&&(e=Ds(),e===null&&(e=_s())))),e}function Xi(){var e,t,n,r,i,s;return e=kr,t=$i(),t!==null?(n=Hs(),n!==null?(r=ui(),r!==null?(i=Hs(),i!==null?(s=Qi(),s!==null?(Lr=e,t=qt(r),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o),e}function Vi(){var e;return e=Xi(),e===null&&(e=Ii(),e===null&&(e=Fi())),e}function $i(){var t,n;return Dr++,e.charCodeAt(kr)===123?(t=Vt,kr++):(t=null,Dr===0&&qr($t)),Dr--,t===null&&(n=null,Dr===0&&qr(Xt)),t}function Ji(){var t,n;return Dr++,e.substr(kr,2)===Kt?(t=Kt,kr+=2):(t=null,Dr===0&&qr(Qt)),Dr--,t===null&&(n=null,Dr===0&&qr(Jt)),t}function Ki(){var t,n;return Dr++,e.substr(kr,3)===Yt?(t=Yt,kr+=3):(t=null,Dr===0&&qr(Zt)),Dr--,t===null&&(n=null,Dr===0&&qr(Gt)),t}function Qi(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(en)),t}function Gi(){var t,n;return Dr++,e.substr(kr,2)===sn?(t=sn,kr+=2):(t=null,Dr===0&&qr(on)),Dr--,t===null&&(n=null,Dr===0&&qr(rn)),t}function Yi(){var t,n;return Dr++,e.substr(kr,3)===an?(t=an,kr+=3):(t=null,Dr===0&&qr(fn)),Dr--,t===null&&(n=null,Dr===0&&qr(un)),t}function Zi(){var t,n;return Dr++,e.substr(kr,2)===cn?(t=cn,kr+=2):(t=null,Dr===0&&qr(hn)),Dr--,t===null&&(n=null,Dr===0&&qr(ln)),t}function es(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(pn)),t}function ts(){var t,n,r;return t=kr,e.substr(kr,2)===dn?(n=dn,kr+=2):(n=null,Dr===0&&qr(vn)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=mn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=kr,e.charCodeAt(kr)===61?(n=l,kr++):(n=null,Dr===0&&qr(c)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=gn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)),t}function ns(){var e,t,n,r,i,s,a;e=kr,t=kr,n=Ts();if(n!==null){r=fi(),r===null&&(r=u);if(r!==null){i=[],s=Vi();while(s!==null)i.push(s),s=Vi();if(i!==null){s=[],a=rs();while(a!==null)s.push(a),a=rs();s!==null?(Lr=t,n=yn(n,r,i,s),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=fi();if(n!==null){r=[],i=Vi();while(i!==null)r.push(i),i=Vi();if(r!==null){i=[],s=rs();while(s!==null)i.push(s),s=rs();i!==null?(Lr=t,n=bn(n,r,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}return t!==null&&(Lr=e,t=wn(t)),t===null?(kr=e,e=t):e=t,e}function fi(){var e,t,n,r;e=kr,t=[],n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);else t=o;return t!==null&&(Lr=e,t=xn(t)),t===null?(kr=e,e=t):e=t,e}function rs(){var t,n,r;t=kr,n=[],e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));else n=o;return n!==null?(r=us(),r===null&&(r=fs(),r===null&&(r=ls(),r===null&&(r=cs()))),r!==null?(Lr=t,n=Tn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function is(){var t;return Nn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cn)),t}function ss(){var e,t;return e=os(),e===null&&(e=kr,t=wi(),t!==null&&(Lr=e,t=kn(t)),t===null?(kr=e,e=t):e=t),e}function os(){var t,n,r,i,s;return t=kr,n=kr,e.charCodeAt(kr)===34?(r=bt,kr++):(r=null,Dr===0&&qr(wt)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===34?(s=bt,kr++):(s=null,Dr===0&&qr(wt)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o),n===null&&(n=kr,e.charCodeAt(kr)===39?(r=Et,kr++):(r=null,Dr===0&&qr(St)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===39?(s=Et,kr++):(s=null,Dr===0&&qr(St)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o)),n!==null&&(Lr=t,n=xt(n)),n===null?(kr=t,t=n):t=n,t}function us(){var t,n,r,i;return t=kr,n=ks(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=ss(),i!==null?(Lr=t,n=Ln(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function as(){var t,n,r,i,s,u;t=kr,e.charCodeAt(kr)===123?(n=Vt,kr++):(n=null,Dr===0&&qr($t));if(n!==null){r=Hs();if(r!==null){i=kr,s=[],u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));if(u!==null)while(u!==null)s.push(u),u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));else s=o;s!==null&&(s=e.substring(i,kr)),i=s,i!==null?(s=Hs(),s!==null?(e.charCodeAt(kr)===125?(u=tn,kr++):(u=null,Dr===0&&qr(nn)),u!==null?(Lr=t,n=An(i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=[],r=is();if(r!==null)while(r!==null)n.push(r),r=is();else n=o;n!==null&&(n=e.substring(t,kr)),t=n}return t}function fs(){var t,n,r,i,s,a;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=as(),i!==null?(s=kr,Dr++,e.charCodeAt(kr)===33?(a=On,kr++):(a=null,Dr===0&&qr(Mn)),Dr--,a===null?s=u:(kr=s,s=o),s!==null?(Lr=kr,a=_n(n,i),a?a=u:a=o,a!==null?(Lr=t,n=Dn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function ls(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=wi(),i!==null?(Lr=t,n=Pn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function cs(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=Hi(),i!==null?(Lr=t,n=Hn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function hs(){var t,n,r;t=kr,n=[],r=ds();while(r!==null)n.push(r),r=ds();return n!==null&&(n=e.substring(t,kr)),t=n,t}function ps(){var e;return e=Ci(),e===null&&(e=gi()),e}function ds(){var t;return t=Ai(),t===null&&(mt.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(gt)),t===null&&(e.charCodeAt(kr)===95?(t=Bn,kr++):(t=null,Dr===0&&qr(jn)),t===null&&(e.charCodeAt(kr)===45?(t=Fn,kr++):(t=null,Dr===0&&qr(In))))),t}function vs(){var t,n,r;return t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ms(){var t,n,r;return t=kr,e.charCodeAt(kr)===35?(n=Un,kr++):(n=null,Dr===0&&qr(zn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function gs(){var t,n,r;return t=kr,e.charCodeAt(kr)===46?(n=J,kr++):(n=null,Dr===0&&qr(K)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ys(){var e,t;return Dr++,e=bs(),Dr--,e===null&&(t=null,Dr===0&&qr(Xn)),e}function bs(){var t,n,r,i,s;t=kr,n=Es();if(n!==null){r=kr,i=[],s=ws();while(s!==null)i.push(s),s=ws();i!==null&&(i=e.substring(r,kr)),r=i,r!==null?(Lr=t,n=Vn(n,r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o;return t}function ws(){var t;return $n.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Jn)),t===null&&(t=Ss()),t}function Es(){var t;return Kn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Qn)),t===null&&(t=Ss()),t}function Ss(){var t;return Gn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Yn)),t}function xs(){var t,n,r;t=kr,n=[],r=Cs();if(r!==null)while(r!==null)n.push(r),r=Cs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,t}function Ts(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=xs(),r!==null?(Lr=t,n=Y(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=Ns()),Dr--,t===null&&(n=null,Dr===0&&qr(Zn)),t}function Ns(){var e,t,n;return e=kr,t=xs(),t!==null?(Lr=kr,n=er(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Cs(){var t;return nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(rr)),t}function ks(){var e,t,n;return Dr++,e=kr,t=xs(),t!==null?(Lr=kr,n=sr(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),Dr--,e===null&&(t=null,Dr===0&&qr(ir)),e}function Ls(){var e,t,n;return e=kr,t=As(),t!==null?(n=Ps(),n!==null?(Lr=e,t=Y(n),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function As(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61423?(n=ur,kr++):(n=null,Dr===0&&qr(ar)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(or)),t}function Os(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61438?(n=cr,kr++):(n=null,Dr===0&&qr(hr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(lr)),t}function Ms(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61422?(n=dr,kr++):(n=null,Dr===0&&qr(vr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(pr)),t}function _s(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===61439?(n=gr,kr++):(n=null,Dr===0&&qr(yr)),n!==null?(e.charCodeAt(kr)===10?(r=br,kr++):(r=null,Dr===0&&qr(wr)),r!==null?(n=[n,r],t=n):(kr=t,t=o)):(kr=t,t=o),Dr--,t===null&&(n=null,Dr===0&&qr(mr)),t}function Ds(){var e,t;return Dr++,e=Os(),e===null&&(e=Ms()),Dr--,e===null&&(t=null,Dr===0&&qr(Er)),e}function Ps(){var t,n,r;Dr++,t=kr,n=[],r=Bs();if(r!==null)while(r!==null)n.push(r),r=Bs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,Dr--,t===null&&(n=null,Dr===0&&qr(Sr)),t}function Hs(){var e,t;Dr++,e=[],t=Bs();while(t!==null)e.push(t),t=Bs();return Dr--,e===null&&(t=null,Dr===0&&qr(xr)),e}function Bs(){var t,n;return Dr++,Nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cr)),Dr--,t===null&&(n=null,Dr===0&&qr(Tr)),t}function js(){var t,n,r;return t=kr,n=kr,Dr++,r=As(),r===null&&(r=Os(),r===null&&(r=_s())),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Fs(){var t,n,r;t=kr,n=[],r=js();while(r!==null)n.push(r),r=js();return n!==null&&(n=e.substring(t,kr)),t=n,t}function Xs(e,t,n){var r=e.hash;if(n){r=r||new Rs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ur},s=Ur,o=null,u="",a=function(e){return e},f=function(e,t){return new Rs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",b='">"',w=function(e,t){return[new Rs.PartialNode(e,t[0])]},E=/^[a-zA-Z0-9_$-\/]/,S="[a-zA-Z0-9_$-\\/]",x=function(e){return new Rs.PartialNameNode(e)},T=function(e){return[e]},N="/",C='"/"',k=/^[A-Z]/,L="[A-Z]",A=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:(e.mustache=Xs(e.mustache,t),e)}var n=e.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:Xs(e,t)},O=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},M=" ",_='" "',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new Rs.ContentNode(">")),[u,new Rs.ContentNode("")])},En=function(e){return{shorthand:e,id:!0}},Sn=function(e){return{shorthand:e}},xn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.16"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = function() { return []; }, + peg$c12 = ">", + peg$c13 = "\">\"", + peg$c14 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c15 = /^[a-zA-Z0-9_$-\/]/, + peg$c16 = "[a-zA-Z0-9_$-\\/]", + peg$c17 = function(s) { return new AST.PartialNameNode(s); }, + peg$c18 = function(m) { + return [m]; + }, + peg$c19 = "/", + peg$c20 = "\"/\"", + peg$c21 = /^[A-Z]/, + peg$c22 = "[A-Z]", + peg$c23 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c24 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`']/, + peg$c81 = "[|`']", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(s) { return { shorthand: s, id: true}; }, + peg$c123 = function(s) { return { shorthand: s }; }, + peg$c124 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c125 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c126 = /^[A-Za-z.:0-9_\-]/, + peg$c127 = "[A-Za-z.:0-9_\\-]", + peg$c128 = function(id) { return new AST.MustacheNode([id]); }, + peg$c129 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c130 = function(value) { return value.replace(/ *$/, ''); }, + peg$c131 = "!", + peg$c132 = "\"!\"", + peg$c133 = function(key, value) { return IS_EMBER; }, + peg$c134 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c135 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c136 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c137 = "_", + peg$c138 = "\"_\"", + peg$c139 = "-", + peg$c140 = "\"-\"", + peg$c141 = "%", + peg$c142 = "\"%\"", + peg$c143 = "#", + peg$c144 = "\"#\"", + peg$c145 = function(c) { return c;}, + peg$c146 = "CSSIdentifier", + peg$c147 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c148 = /^[_a-zA-Z0-9\-]/, + peg$c149 = "[_a-zA-Z0-9\\-]", + peg$c150 = /^[_a-zA-Z]/, + peg$c151 = "[_a-zA-Z]", + peg$c152 = /^[\x80-\xFF]/, + peg$c153 = "[\\x80-\\xFF]", + peg$c154 = "KnownHTMLTagName", + peg$c155 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c156 = function(t) { return t; }, + peg$c157 = /^[:_a-zA-Z0-9\-]/, + peg$c158 = "[:_a-zA-Z0-9\\-]", + peg$c159 = "a JS event", + peg$c160 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c161 = "INDENT", + peg$c162 = "\uEFEF", + peg$c163 = "\"\\uEFEF\"", + peg$c164 = function() { return ''; }, + peg$c165 = "DEDENT", + peg$c166 = "\uEFFE", + peg$c167 = "\"\\uEFFE\"", + peg$c168 = "Unmatched DEDENT", + peg$c169 = "\uEFEE", + peg$c170 = "\"\\uEFEE\"", + peg$c171 = "LineEnd", + peg$c172 = "\uEFFF", + peg$c173 = "\"\\uEFFF\"", + peg$c174 = "\n", + peg$c175 = "\"\\n\"", + peg$c176 = "ANYDEDENT", + peg$c177 = "RequiredWhitespace", + peg$c178 = "OptionalWhitespace", + peg$c179 = "InlineWhitespace", + peg$c180 = /^[ \t]/, + peg$c181 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c19; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c21.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c22); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c23(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c126.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c131; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c133(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c143; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c148.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c155(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c174; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.16/emblem.min.js b/ajax/libs/emblem/0.1.16/emblem.min.js new file mode 100644 index 000000000..de0721692 --- /dev/null +++ b/ajax/libs/emblem/0.1.16/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.16",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Hr(){return e.substring(Lr,kr)}function Br(){return Lr}function jr(){return Ir(Lr).line}function Fr(){return Ir(Lr).column}function Ir(t){function n(t,n){var r,i;for(r=0;rt&&(Ar=0,Or={line:1,column:1,seenCR:!1}),Ar=t,n(Or,Ar)),Or}function qr(e){if(krMr&&(Mr=kr,_r=[]),_r.push(e)}function Rr(e){var t=0;e.sort();while(tkr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Ui(){var t,n,r,i;t=kr,n=kr,r=[],i=zi();if(i!==null)while(i!==null)r.push(i),i=zi();else r=o;return r!==null&&(r=e.substring(n,kr)),n=r,n!==null&&(Lr=t,n=Ut(n)),n===null?(kr=t,t=n):t=n,t}function zi(){var t,n,r;return t=kr,n=kr,Dr++,r=Wi(),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Wi(){var e;return e=Ki(),e===null&&(e=Ji(),e===null&&(e=Zi(),e===null&&(e=Ds(),e===null&&(e=_s())))),e}function Xi(){var e,t,n,r,i,s;return e=kr,t=$i(),t!==null?(n=Hs(),n!==null?(r=ui(),r!==null?(i=Hs(),i!==null?(s=Qi(),s!==null?(Lr=e,t=qt(r),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o),e}function Vi(){var e;return e=Xi(),e===null&&(e=Ii(),e===null&&(e=Fi())),e}function $i(){var t,n;return Dr++,e.charCodeAt(kr)===123?(t=Vt,kr++):(t=null,Dr===0&&qr($t)),Dr--,t===null&&(n=null,Dr===0&&qr(Xt)),t}function Ji(){var t,n;return Dr++,e.substr(kr,2)===Kt?(t=Kt,kr+=2):(t=null,Dr===0&&qr(Qt)),Dr--,t===null&&(n=null,Dr===0&&qr(Jt)),t}function Ki(){var t,n;return Dr++,e.substr(kr,3)===Yt?(t=Yt,kr+=3):(t=null,Dr===0&&qr(Zt)),Dr--,t===null&&(n=null,Dr===0&&qr(Gt)),t}function Qi(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(en)),t}function Gi(){var t,n;return Dr++,e.substr(kr,2)===sn?(t=sn,kr+=2):(t=null,Dr===0&&qr(on)),Dr--,t===null&&(n=null,Dr===0&&qr(rn)),t}function Yi(){var t,n;return Dr++,e.substr(kr,3)===an?(t=an,kr+=3):(t=null,Dr===0&&qr(fn)),Dr--,t===null&&(n=null,Dr===0&&qr(un)),t}function Zi(){var t,n;return Dr++,e.substr(kr,2)===cn?(t=cn,kr+=2):(t=null,Dr===0&&qr(hn)),Dr--,t===null&&(n=null,Dr===0&&qr(ln)),t}function es(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(pn)),t}function ts(){var t,n,r;return t=kr,e.substr(kr,2)===dn?(n=dn,kr+=2):(n=null,Dr===0&&qr(vn)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=mn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=kr,e.charCodeAt(kr)===61?(n=l,kr++):(n=null,Dr===0&&qr(c)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=gn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)),t}function ns(){var e,t,n,r,i,s,a;e=kr,t=kr,n=Ts();if(n!==null){r=fi(),r===null&&(r=u);if(r!==null){i=[],s=Vi();while(s!==null)i.push(s),s=Vi();if(i!==null){s=[],a=rs();while(a!==null)s.push(a),a=rs();s!==null?(Lr=t,n=yn(n,r,i,s),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=fi();if(n!==null){r=[],i=Vi();while(i!==null)r.push(i),i=Vi();if(r!==null){i=[],s=rs();while(s!==null)i.push(s),s=rs();i!==null?(Lr=t,n=bn(n,r,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}return t!==null&&(Lr=e,t=wn(t)),t===null?(kr=e,e=t):e=t,e}function fi(){var e,t,n,r;e=kr,t=[],n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);else t=o;return t!==null&&(Lr=e,t=xn(t)),t===null?(kr=e,e=t):e=t,e}function rs(){var t,n,r;t=kr,n=[],e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));else n=o;return n!==null?(r=us(),r===null&&(r=fs(),r===null&&(r=ls(),r===null&&(r=cs()))),r!==null?(Lr=t,n=Tn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function is(){var t;return Nn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cn)),t}function ss(){var e,t;return e=os(),e===null&&(e=kr,t=wi(),t!==null&&(Lr=e,t=kn(t)),t===null?(kr=e,e=t):e=t),e}function os(){var t,n,r,i,s;return t=kr,n=kr,e.charCodeAt(kr)===34?(r=bt,kr++):(r=null,Dr===0&&qr(wt)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===34?(s=bt,kr++):(s=null,Dr===0&&qr(wt)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o),n===null&&(n=kr,e.charCodeAt(kr)===39?(r=Et,kr++):(r=null,Dr===0&&qr(St)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===39?(s=Et,kr++):(s=null,Dr===0&&qr(St)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o)),n!==null&&(Lr=t,n=xt(n)),n===null?(kr=t,t=n):t=n,t}function us(){var t,n,r,i;return t=kr,n=ks(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=ss(),i!==null?(Lr=t,n=Ln(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function as(){var t,n,r,i,s,u;t=kr,e.charCodeAt(kr)===123?(n=Vt,kr++):(n=null,Dr===0&&qr($t));if(n!==null){r=Hs();if(r!==null){i=kr,s=[],u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));if(u!==null)while(u!==null)s.push(u),u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));else s=o;s!==null&&(s=e.substring(i,kr)),i=s,i!==null?(s=Hs(),s!==null?(e.charCodeAt(kr)===125?(u=tn,kr++):(u=null,Dr===0&&qr(nn)),u!==null?(Lr=t,n=An(i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=[],r=is();if(r!==null)while(r!==null)n.push(r),r=is();else n=o;n!==null&&(n=e.substring(t,kr)),t=n}return t}function fs(){var t,n,r,i,s,a;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=as(),i!==null?(s=kr,Dr++,e.charCodeAt(kr)===33?(a=On,kr++):(a=null,Dr===0&&qr(Mn)),Dr--,a===null?s=u:(kr=s,s=o),s!==null?(Lr=kr,a=_n(n,i),a?a=u:a=o,a!==null?(Lr=t,n=Dn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function ls(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=wi(),i!==null?(Lr=t,n=Pn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function cs(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=Hi(),i!==null?(Lr=t,n=Hn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function hs(){var t,n,r;t=kr,n=[],r=ds();while(r!==null)n.push(r),r=ds();return n!==null&&(n=e.substring(t,kr)),t=n,t}function ps(){var e;return e=Ci(),e===null&&(e=gi()),e}function ds(){var t;return t=Ai(),t===null&&(mt.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(gt)),t===null&&(e.charCodeAt(kr)===95?(t=Bn,kr++):(t=null,Dr===0&&qr(jn)),t===null&&(e.charCodeAt(kr)===45?(t=Fn,kr++):(t=null,Dr===0&&qr(In))))),t}function vs(){var t,n,r;return t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ms(){var t,n,r;return t=kr,e.charCodeAt(kr)===35?(n=Un,kr++):(n=null,Dr===0&&qr(zn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function gs(){var t,n,r;return t=kr,e.charCodeAt(kr)===46?(n=J,kr++):(n=null,Dr===0&&qr(K)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ys(){var e,t;return Dr++,e=bs(),Dr--,e===null&&(t=null,Dr===0&&qr(Xn)),e}function bs(){var t,n,r,i,s;t=kr,n=Es();if(n!==null){r=kr,i=[],s=ws();while(s!==null)i.push(s),s=ws();i!==null&&(i=e.substring(r,kr)),r=i,r!==null?(Lr=t,n=Vn(n,r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o;return t}function ws(){var t;return $n.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Jn)),t===null&&(t=Ss()),t}function Es(){var t;return Kn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Qn)),t===null&&(t=Ss()),t}function Ss(){var t;return Gn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Yn)),t}function xs(){var t,n,r;t=kr,n=[],r=Cs();if(r!==null)while(r!==null)n.push(r),r=Cs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,t}function Ts(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=xs(),r!==null?(Lr=t,n=Y(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=Ns()),Dr--,t===null&&(n=null,Dr===0&&qr(Zn)),t}function Ns(){var e,t,n;return e=kr,t=xs(),t!==null?(Lr=kr,n=er(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Cs(){var t;return nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(rr)),t}function ks(){var e,t,n;return Dr++,e=kr,t=xs(),t!==null?(Lr=kr,n=sr(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),Dr--,e===null&&(t=null,Dr===0&&qr(ir)),e}function Ls(){var e,t,n;return e=kr,t=As(),t!==null?(n=Ps(),n!==null?(Lr=e,t=Y(n),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function As(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61423?(n=ur,kr++):(n=null,Dr===0&&qr(ar)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(or)),t}function Os(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61438?(n=cr,kr++):(n=null,Dr===0&&qr(hr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(lr)),t}function Ms(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61422?(n=dr,kr++):(n=null,Dr===0&&qr(vr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(pr)),t}function _s(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===61439?(n=gr,kr++):(n=null,Dr===0&&qr(yr)),n!==null?(e.charCodeAt(kr)===10?(r=br,kr++):(r=null,Dr===0&&qr(wr)),r!==null?(n=[n,r],t=n):(kr=t,t=o)):(kr=t,t=o),Dr--,t===null&&(n=null,Dr===0&&qr(mr)),t}function Ds(){var e,t;return Dr++,e=Os(),e===null&&(e=Ms()),Dr--,e===null&&(t=null,Dr===0&&qr(Er)),e}function Ps(){var t,n,r;Dr++,t=kr,n=[],r=Bs();if(r!==null)while(r!==null)n.push(r),r=Bs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,Dr--,t===null&&(n=null,Dr===0&&qr(Sr)),t}function Hs(){var e,t;Dr++,e=[],t=Bs();while(t!==null)e.push(t),t=Bs();return Dr--,e===null&&(t=null,Dr===0&&qr(xr)),e}function Bs(){var t,n;return Dr++,Nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cr)),Dr--,t===null&&(n=null,Dr===0&&qr(Tr)),t}function js(){var t,n,r;return t=kr,n=kr,Dr++,r=As(),r===null&&(r=Os(),r===null&&(r=_s())),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Fs(){var t,n,r;t=kr,n=[],r=js();while(r!==null)n.push(r),r=js();return n!==null&&(n=e.substring(t,kr)),t=n,t}function Xs(e,t,n){var r=e.hash;if(n){r=r||new Rs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ur},s=Ur,o=null,u="",a=function(e){return e},f=function(e,t){return new Rs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",b='">"',w=function(e,t){return[new Rs.PartialNode(e,t[0])]},E=/^[a-zA-Z0-9_$-\/]/,S="[a-zA-Z0-9_$-\\/]",x=function(e){return new Rs.PartialNameNode(e)},T=function(e){return[e]},N="/",C='"/"',k=/^[A-Z]/,L="[A-Z]",A=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:(e.mustache=Xs(e.mustache,t),e)}var n=e.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:Xs(e,t)},O=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},M=" ",_='" "',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new Rs.ContentNode(">")),[u,new Rs.ContentNode("")])},En=function(e){return{shorthand:e,id:!0}},Sn=function(e){return{shorthand:e}},xn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.16"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = function() { return []; }, + peg$c12 = ">", + peg$c13 = "\">\"", + peg$c14 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c15 = /^[a-zA-Z0-9_$-\/]/, + peg$c16 = "[a-zA-Z0-9_$-\\/]", + peg$c17 = function(s) { return new AST.PartialNameNode(s); }, + peg$c18 = function(m) { + return [m]; + }, + peg$c19 = "/", + peg$c20 = "\"/\"", + peg$c21 = /^[A-Z]/, + peg$c22 = "[A-Z]", + peg$c23 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c24 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`']/, + peg$c81 = "[|`']", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(m) { m.escaped = true; return m; }, + peg$c89 = function(m) { m.escaped = false; return m; }, + peg$c90 = function(a) { return new AST.ContentNode(a); }, + peg$c91 = "any character", + peg$c92 = function(c) { return c; }, + peg$c93 = "SingleMustacheOpen", + peg$c94 = "{", + peg$c95 = "\"{\"", + peg$c96 = "DoubleMustacheOpen", + peg$c97 = "{{", + peg$c98 = "\"{{\"", + peg$c99 = "TripleMustacheOpen", + peg$c100 = "{{{", + peg$c101 = "\"{{{\"", + peg$c102 = "SingleMustacheClose", + peg$c103 = "}", + peg$c104 = "\"}\"", + peg$c105 = "DoubleMustacheClose", + peg$c106 = "}}", + peg$c107 = "\"}}\"", + peg$c108 = "TripleMustacheClose", + peg$c109 = "}}}", + peg$c110 = "\"}}}\"", + peg$c111 = "InterpolationOpen", + peg$c112 = "#{", + peg$c113 = "\"#{\"", + peg$c114 = "InterpolationClose", + peg$c115 = "==", + peg$c116 = "\"==\"", + peg$c117 = function() { return false; }, + peg$c118 = function() { return true; }, + peg$c119 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c120 = function(s, m, f) { return [null, s, m, f] }, + peg$c121 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c122 = function(s) { return { shorthand: s, id: true}; }, + peg$c123 = function(s) { return { shorthand: s }; }, + peg$c124 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c125 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c126 = /^[A-Za-z.:0-9_\-]/, + peg$c127 = "[A-Za-z.:0-9_\\-]", + peg$c128 = function(id) { return new AST.MustacheNode([id]); }, + peg$c129 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c130 = function(value) { return value.replace(/ *$/, ''); }, + peg$c131 = "!", + peg$c132 = "\"!\"", + peg$c133 = function(key, value) { return IS_EMBER; }, + peg$c134 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c135 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c136 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c137 = "_", + peg$c138 = "\"_\"", + peg$c139 = "-", + peg$c140 = "\"-\"", + peg$c141 = "%", + peg$c142 = "\"%\"", + peg$c143 = "#", + peg$c144 = "\"#\"", + peg$c145 = function(c) { return c;}, + peg$c146 = "CSSIdentifier", + peg$c147 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c148 = /^[_a-zA-Z0-9\-]/, + peg$c149 = "[_a-zA-Z0-9\\-]", + peg$c150 = /^[_a-zA-Z]/, + peg$c151 = "[_a-zA-Z]", + peg$c152 = /^[\x80-\xFF]/, + peg$c153 = "[\\x80-\\xFF]", + peg$c154 = "KnownHTMLTagName", + peg$c155 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c156 = function(t) { return t; }, + peg$c157 = /^[:_a-zA-Z0-9\-]/, + peg$c158 = "[:_a-zA-Z0-9\\-]", + peg$c159 = "a JS event", + peg$c160 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c161 = "INDENT", + peg$c162 = "\uEFEF", + peg$c163 = "\"\\uEFEF\"", + peg$c164 = function() { return ''; }, + peg$c165 = "DEDENT", + peg$c166 = "\uEFFE", + peg$c167 = "\"\\uEFFE\"", + peg$c168 = "Unmatched DEDENT", + peg$c169 = "\uEFEE", + peg$c170 = "\"\\uEFEE\"", + peg$c171 = "LineEnd", + peg$c172 = "\uEFFF", + peg$c173 = "\"\\uEFFF\"", + peg$c174 = "\n", + peg$c175 = "\"\\n\"", + peg$c176 = "ANYDEDENT", + peg$c177 = "RequiredWhitespace", + peg$c178 = "OptionalWhitespace", + peg$c179 = "InlineWhitespace", + peg$c180 = /^[ \t]/, + peg$c181 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c19; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c21.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c22); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c23(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c94; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c93); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c97) { + s0 = peg$c97; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c100) { + s0 = peg$c100; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c103; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c122(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c126.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c103; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c131; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c133(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c143; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c148.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c141; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c155(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c166; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c174; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.17/emblem.min.js b/ajax/libs/emblem/0.1.17/emblem.min.js new file mode 100644 index 000000000..a99357a9f --- /dev/null +++ b/ajax/libs/emblem/0.1.17/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.16",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Hr(){return e.substring(Lr,kr)}function Br(){return Lr}function jr(){return Ir(Lr).line}function Fr(){return Ir(Lr).column}function Ir(t){function n(t,n){var r,i;for(r=0;rt&&(Ar=0,Or={line:1,column:1,seenCR:!1}),Ar=t,n(Or,Ar)),Or}function qr(e){if(krMr&&(Mr=kr,_r=[]),_r.push(e)}function Rr(e){var t=0;e.sort();while(tkr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Ui(){var t,n,r,i;t=kr,n=kr,r=[],i=zi();if(i!==null)while(i!==null)r.push(i),i=zi();else r=o;return r!==null&&(r=e.substring(n,kr)),n=r,n!==null&&(Lr=t,n=Ut(n)),n===null?(kr=t,t=n):t=n,t}function zi(){var t,n,r;return t=kr,n=kr,Dr++,r=Wi(),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Wi(){var e;return e=Ki(),e===null&&(e=Ji(),e===null&&(e=Zi(),e===null&&(e=Ds(),e===null&&(e=_s())))),e}function Xi(){var e,t,n,r,i,s;return e=kr,t=$i(),t!==null?(n=Hs(),n!==null?(r=ui(),r!==null?(i=Hs(),i!==null?(s=Qi(),s!==null?(Lr=e,t=qt(r),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o)):(kr=e,e=o),e}function Vi(){var e;return e=Xi(),e===null&&(e=Ii(),e===null&&(e=Fi())),e}function $i(){var t,n;return Dr++,e.charCodeAt(kr)===123?(t=Vt,kr++):(t=null,Dr===0&&qr($t)),Dr--,t===null&&(n=null,Dr===0&&qr(Xt)),t}function Ji(){var t,n;return Dr++,e.substr(kr,2)===Kt?(t=Kt,kr+=2):(t=null,Dr===0&&qr(Qt)),Dr--,t===null&&(n=null,Dr===0&&qr(Jt)),t}function Ki(){var t,n;return Dr++,e.substr(kr,3)===Yt?(t=Yt,kr+=3):(t=null,Dr===0&&qr(Zt)),Dr--,t===null&&(n=null,Dr===0&&qr(Gt)),t}function Qi(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(en)),t}function Gi(){var t,n;return Dr++,e.substr(kr,2)===sn?(t=sn,kr+=2):(t=null,Dr===0&&qr(on)),Dr--,t===null&&(n=null,Dr===0&&qr(rn)),t}function Yi(){var t,n;return Dr++,e.substr(kr,3)===an?(t=an,kr+=3):(t=null,Dr===0&&qr(fn)),Dr--,t===null&&(n=null,Dr===0&&qr(un)),t}function Zi(){var t,n;return Dr++,e.substr(kr,2)===cn?(t=cn,kr+=2):(t=null,Dr===0&&qr(hn)),Dr--,t===null&&(n=null,Dr===0&&qr(ln)),t}function es(){var t,n;return Dr++,e.charCodeAt(kr)===125?(t=tn,kr++):(t=null,Dr===0&&qr(nn)),Dr--,t===null&&(n=null,Dr===0&&qr(pn)),t}function ts(){var t,n,r;return t=kr,e.substr(kr,2)===dn?(n=dn,kr+=2):(n=null,Dr===0&&qr(vn)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=mn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=kr,e.charCodeAt(kr)===61?(n=l,kr++):(n=null,Dr===0&&qr(c)),n!==null?(e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_)),r===null&&(r=u),r!==null?(Lr=t,n=gn(),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)),t}function ns(){var e,t,n,r,i,s,a;e=kr,t=kr,n=Ts();if(n!==null){r=fi(),r===null&&(r=u);if(r!==null){i=[],s=Vi();while(s!==null)i.push(s),s=Vi();if(i!==null){s=[],a=rs();while(a!==null)s.push(a),a=rs();s!==null?(Lr=t,n=yn(n,r,i,s),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=fi();if(n!==null){r=[],i=Vi();while(i!==null)r.push(i),i=Vi();if(r!==null){i=[],s=rs();while(s!==null)i.push(s),s=rs();i!==null?(Lr=t,n=bn(n,r,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o}return t!==null&&(Lr=e,t=wn(t)),t===null?(kr=e,e=t):e=t,e}function fi(){var e,t,n,r;e=kr,t=[],n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=kr,r=ms(),r!==null&&(Lr=n,r=En(r)),r===null?(kr=n,n=r):n=r,n===null&&(n=kr,r=gs(),r!==null&&(Lr=n,r=Sn(r)),r===null?(kr=n,n=r):n=r);else t=o;return t!==null&&(Lr=e,t=xn(t)),t===null?(kr=e,e=t):e=t,e}function rs(){var t,n,r;t=kr,n=[],e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(kr)===32?(r=M,kr++):(r=null,Dr===0&&qr(_));else n=o;return n!==null?(r=us(),r===null&&(r=fs(),r===null&&(r=ls(),r===null&&(r=cs()))),r!==null?(Lr=t,n=Tn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function is(){var t;return Nn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cn)),t}function ss(){var e,t;return e=os(),e===null&&(e=kr,t=wi(),t!==null&&(Lr=e,t=kn(t)),t===null?(kr=e,e=t):e=t),e}function os(){var t,n,r,i,s;return t=kr,n=kr,e.charCodeAt(kr)===34?(r=bt,kr++):(r=null,Dr===0&&qr(wt)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===34?(s=bt,kr++):(s=null,Dr===0&&qr(wt)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o),n===null&&(n=kr,e.charCodeAt(kr)===39?(r=Et,kr++):(r=null,Dr===0&&qr(St)),r!==null?(i=ui(),i!==null?(e.charCodeAt(kr)===39?(s=Et,kr++):(s=null,Dr===0&&qr(St)),s!==null?(r=[r,i,s],n=r):(kr=n,n=o)):(kr=n,n=o)):(kr=n,n=o)),n!==null&&(Lr=t,n=xt(n)),n===null?(kr=t,t=n):t=n,t}function us(){var t,n,r,i;return t=kr,n=ks(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=ss(),i!==null?(Lr=t,n=Ln(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function as(){var t,n,r,i,s,u;t=kr,e.charCodeAt(kr)===123?(n=Vt,kr++):(n=null,Dr===0&&qr($t));if(n!==null){r=Hs();if(r!==null){i=kr,s=[],u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));if(u!==null)while(u!==null)s.push(u),u=is(),u===null&&(e.charCodeAt(kr)===32?(u=M,kr++):(u=null,Dr===0&&qr(_)));else s=o;s!==null&&(s=e.substring(i,kr)),i=s,i!==null?(s=Hs(),s!==null?(e.charCodeAt(kr)===125?(u=tn,kr++):(u=null,Dr===0&&qr(nn)),u!==null?(Lr=t,n=An(i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)}else kr=t,t=o}else kr=t,t=o;if(t===null){t=kr,n=[],r=is();if(r!==null)while(r!==null)n.push(r),r=is();else n=o;n!==null&&(n=e.substring(t,kr)),t=n}return t}function fs(){var t,n,r,i,s,a;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=as(),i!==null?(s=kr,Dr++,e.charCodeAt(kr)===33?(a=On,kr++):(a=null,Dr===0&&qr(Mn)),Dr--,a===null?s=u:(kr=s,s=o),s!==null?(Lr=kr,a=_n(n,i),a?a=u:a=o,a!==null?(Lr=t,n=Dn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function ls(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=wi(),i!==null?(Lr=t,n=Pn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function cs(){var t,n,r,i;return t=kr,n=vi(),n!==null?(e.charCodeAt(kr)===61?(r=l,kr++):(r=null,Dr===0&&qr(c)),r!==null?(i=Hi(),i!==null?(Lr=t,n=Hn(n,i),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o)):(kr=t,t=o),t}function hs(){var t,n,r;t=kr,n=[],r=ds();while(r!==null)n.push(r),r=ds();return n!==null&&(n=e.substring(t,kr)),t=n,t}function ps(){var e;return e=Ci(),e===null&&(e=gi()),e}function ds(){var t;return t=Ai(),t===null&&(mt.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(gt)),t===null&&(e.charCodeAt(kr)===95?(t=Bn,kr++):(t=null,Dr===0&&qr(jn)),t===null&&(e.charCodeAt(kr)===45?(t=Fn,kr++):(t=null,Dr===0&&qr(In))))),t}function vs(){var t,n,r;return t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ms(){var t,n,r;return t=kr,e.charCodeAt(kr)===35?(n=Un,kr++):(n=null,Dr===0&&qr(zn)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wn(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function gs(){var t,n,r;return t=kr,e.charCodeAt(kr)===46?(n=J,kr++):(n=null,Dr===0&&qr(K)),n!==null?(r=ys(),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function ys(){var e,t;return Dr++,e=bs(),Dr--,e===null&&(t=null,Dr===0&&qr(Xn)),e}function bs(){var t,n,r,i,s;t=kr,n=Es();if(n!==null){r=kr,i=[],s=ws();while(s!==null)i.push(s),s=ws();i!==null&&(i=e.substring(r,kr)),r=i,r!==null?(Lr=t,n=Vn(n,r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)}else kr=t,t=o;return t}function ws(){var t;return $n.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Jn)),t===null&&(t=Ss()),t}function Es(){var t;return Kn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Qn)),t===null&&(t=Ss()),t}function Ss(){var t;return Gn.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Yn)),t}function xs(){var t,n,r;t=kr,n=[],r=Cs();if(r!==null)while(r!==null)n.push(r),r=Cs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,t}function Ts(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===37?(n=qn,kr++):(n=null,Dr===0&&qr(Rn)),n!==null?(r=xs(),r!==null?(Lr=t,n=Y(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t===null&&(t=Ns()),Dr--,t===null&&(n=null,Dr===0&&qr(Zn)),t}function Ns(){var e,t,n;return e=kr,t=xs(),t!==null?(Lr=kr,n=er(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function Cs(){var t;return nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(rr)),t}function ks(){var e,t,n;return Dr++,e=kr,t=xs(),t!==null?(Lr=kr,n=sr(t),n?n=u:n=o,n!==null?(Lr=e,t=tr(t),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),Dr--,e===null&&(t=null,Dr===0&&qr(ir)),e}function Ls(){var e,t,n;return e=kr,t=As(),t!==null?(n=Ps(),n!==null?(Lr=e,t=Y(n),t===null?(kr=e,e=t):e=t):(kr=e,e=o)):(kr=e,e=o),e}function As(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61423?(n=ur,kr++):(n=null,Dr===0&&qr(ar)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(or)),t}function Os(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61438?(n=cr,kr++):(n=null,Dr===0&&qr(hr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(lr)),t}function Ms(){var t,n;return Dr++,t=kr,e.charCodeAt(kr)===61422?(n=dr,kr++):(n=null,Dr===0&&qr(vr)),n!==null&&(Lr=t,n=fr()),n===null?(kr=t,t=n):t=n,Dr--,t===null&&(n=null,Dr===0&&qr(pr)),t}function _s(){var t,n,r;return Dr++,t=kr,e.charCodeAt(kr)===61439?(n=gr,kr++):(n=null,Dr===0&&qr(yr)),n!==null?(e.charCodeAt(kr)===10?(r=br,kr++):(r=null,Dr===0&&qr(wr)),r!==null?(n=[n,r],t=n):(kr=t,t=o)):(kr=t,t=o),Dr--,t===null&&(n=null,Dr===0&&qr(mr)),t}function Ds(){var e,t;return Dr++,e=Os(),e===null&&(e=Ms()),Dr--,e===null&&(t=null,Dr===0&&qr(Er)),e}function Ps(){var t,n,r;Dr++,t=kr,n=[],r=Bs();if(r!==null)while(r!==null)n.push(r),r=Bs();else n=o;return n!==null&&(n=e.substring(t,kr)),t=n,Dr--,t===null&&(n=null,Dr===0&&qr(Sr)),t}function Hs(){var e,t;Dr++,e=[],t=Bs();while(t!==null)e.push(t),t=Bs();return Dr--,e===null&&(t=null,Dr===0&&qr(xr)),e}function Bs(){var t,n;return Dr++,Nr.test(e.charAt(kr))?(t=e.charAt(kr),kr++):(t=null,Dr===0&&qr(Cr)),Dr--,t===null&&(n=null,Dr===0&&qr(Tr)),t}function js(){var t,n,r;return t=kr,n=kr,Dr++,r=As(),r===null&&(r=Os(),r===null&&(r=_s())),Dr--,r===null?n=u:(kr=n,n=o),n!==null?(e.length>kr?(r=e.charAt(kr),kr++):(r=null,Dr===0&&qr(zt)),r!==null?(Lr=t,n=Wt(r),n===null?(kr=t,t=n):t=n):(kr=t,t=o)):(kr=t,t=o),t}function Fs(){var t,n,r;t=kr,n=[],r=js();while(r!==null)n.push(r),r=js();return n!==null&&(n=e.substring(t,kr)),t=n,t}function Xs(e,t,n){var r=e.hash;if(n){r=r||new Rs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Ur},s=Ur,o=null,u="",a=function(e){return e},f=function(e,t){return new Rs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",b='">"',w=function(e,t){return[new Rs.PartialNode(e,t[0])]},E=/^[a-zA-Z0-9_$-\/]/,S="[a-zA-Z0-9_$-\\/]",x=function(e){return new Rs.PartialNameNode(e)},T=function(e){return[e]},N="/",C='"/"',k=/^[A-Z]/,L="[A-Z]",A=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:(e.mustache=Xs(e.mustache,t),e)}var n=e.id.string.charAt(0);return!qs||!n.match(/[A-Z]/)?e:Xs(e,t)},O=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},M=" ",_='" "',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new Rs.ContentNode(">")),[u,new Rs.ContentNode("")])},En=function(e){return{shorthand:e,id:!0}},Sn=function(e){return{shorthand:e}},xn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.1.17"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = function() { return []; }, + peg$c12 = ">", + peg$c13 = "\">\"", + peg$c14 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c15 = /^[a-zA-Z0-9_$-\/]/, + peg$c16 = "[a-zA-Z0-9_$-\\/]", + peg$c17 = function(s) { return new AST.PartialNameNode(s); }, + peg$c18 = function(m) { + return [m]; + }, + peg$c19 = "/", + peg$c20 = "\"/\"", + peg$c21 = /^[A-Z]/, + peg$c22 = "[A-Z]", + peg$c23 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c24 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[2]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c28 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[2]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c29 = function(mustacheNode, t) { + var programNode = new AST.ProgramNode(t, []); + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c30 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c31 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c32 = function(t) { return ['tagName', t]; }, + peg$c33 = function(i) { return ['elementId', i]; }, + peg$c34 = function(c) { return ['class', c]; }, + peg$c35 = function(id, classes) { return [id, classes]; }, + peg$c36 = function(classes) { return [null, classes]; }, + peg$c37 = function(h) { return h; }, + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c45 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c46 = function(s) { return s; }, + peg$c47 = "Key", + peg$c48 = function(h) { return [h[0], h[2]]; }, + peg$c49 = function(p) { return p; }, + peg$c50 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c51 = "PathSeparator", + peg$c52 = /^[\/.]/, + peg$c53 = "[\\/.]", + peg$c54 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c55 = function(v) { return new AST.StringNode(v); }, + peg$c56 = function(v) { return new AST.IntegerNode(v); }, + peg$c57 = function(v) { return new AST.BooleanNode(v); }, + peg$c58 = "Boolean", + peg$c59 = "true", + peg$c60 = "\"true\"", + peg$c61 = "false", + peg$c62 = "\"false\"", + peg$c63 = "Integer", + peg$c64 = /^[0-9]/, + peg$c65 = "[0-9]", + peg$c66 = function(s) { return parseInt(s); }, + peg$c67 = "\"", + peg$c68 = "\"\\\"\"", + peg$c69 = "'", + peg$c70 = "\"'\"", + peg$c71 = function(p) { return p[1]; }, + peg$c72 = /^[^"}]/, + peg$c73 = "[^\"}]", + peg$c74 = /^[^'}]/, + peg$c75 = "[^'}]", + peg$c76 = /^[A-Za-z]/, + peg$c77 = "[A-Za-z]", + peg$c78 = function(m) { return [m]; }, + peg$c79 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c80 = /^[|`']/, + peg$c81 = "[|`']", + peg$c82 = "<", + peg$c83 = "\"<\"", + peg$c84 = function() { return '<'; }, + peg$c85 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c86 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c87 = function(a) { return a; }, + peg$c88 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c89 = function(m) { m.escaped = true; return m; }, + peg$c90 = function(m) { m.escaped = false; return m; }, + peg$c91 = function(a) { return new AST.ContentNode(a); }, + peg$c92 = "any character", + peg$c93 = function(c) { return c; }, + peg$c94 = "SingleMustacheOpen", + peg$c95 = "{", + peg$c96 = "\"{\"", + peg$c97 = "DoubleMustacheOpen", + peg$c98 = "{{", + peg$c99 = "\"{{\"", + peg$c100 = "TripleMustacheOpen", + peg$c101 = "{{{", + peg$c102 = "\"{{{\"", + peg$c103 = "SingleMustacheClose", + peg$c104 = "}", + peg$c105 = "\"}\"", + peg$c106 = "DoubleMustacheClose", + peg$c107 = "}}", + peg$c108 = "\"}}\"", + peg$c109 = "TripleMustacheClose", + peg$c110 = "}}}", + peg$c111 = "\"}}}\"", + peg$c112 = "InterpolationOpen", + peg$c113 = "#{", + peg$c114 = "\"#{\"", + peg$c115 = "InterpolationClose", + peg$c116 = "==", + peg$c117 = "\"==\"", + peg$c118 = function() { return false; }, + peg$c119 = function() { return true; }, + peg$c120 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c121 = function(s, m, f) { return [null, s, m, f] }, + peg$c122 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c123 = function(s) { return { shorthand: s, id: true}; }, + peg$c124 = function(s) { return { shorthand: s }; }, + peg$c125 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c126 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c127 = /^[A-Za-z.:0-9_\-]/, + peg$c128 = "[A-Za-z.:0-9_\\-]", + peg$c129 = function(id) { return new AST.MustacheNode([id]); }, + peg$c130 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c131 = function(value) { return value.replace(/ *$/, ''); }, + peg$c132 = "!", + peg$c133 = "\"!\"", + peg$c134 = function(key, value) { return IS_EMBER; }, + peg$c135 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c136 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c137 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c138 = "_", + peg$c139 = "\"_\"", + peg$c140 = "-", + peg$c141 = "\"-\"", + peg$c142 = "%", + peg$c143 = "\"%\"", + peg$c144 = "#", + peg$c145 = "\"#\"", + peg$c146 = function(c) { return c;}, + peg$c147 = "CSSIdentifier", + peg$c148 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c149 = /^[_a-zA-Z0-9\-]/, + peg$c150 = "[_a-zA-Z0-9\\-]", + peg$c151 = /^[_a-zA-Z]/, + peg$c152 = "[_a-zA-Z]", + peg$c153 = /^[\x80-\xFF]/, + peg$c154 = "[\\x80-\\xFF]", + peg$c155 = "KnownHTMLTagName", + peg$c156 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c157 = function(t) { return t; }, + peg$c158 = /^[:_a-zA-Z0-9\-]/, + peg$c159 = "[:_a-zA-Z0-9\\-]", + peg$c160 = "a JS event", + peg$c161 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c162 = "INDENT", + peg$c163 = "\uEFEF", + peg$c164 = "\"\\uEFEF\"", + peg$c165 = function() { return ''; }, + peg$c166 = "DEDENT", + peg$c167 = "\uEFFE", + peg$c168 = "\"\\uEFFE\"", + peg$c169 = "Unmatched DEDENT", + peg$c170 = "\uEFEE", + peg$c171 = "\"\\uEFEE\"", + peg$c172 = "LineEnd", + peg$c173 = "\uEFFF", + peg$c174 = "\"\\uEFFF\"", + peg$c175 = "\n", + peg$c176 = "\"\\n\"", + peg$c177 = "ANYDEDENT", + peg$c178 = "RequiredWhitespace", + peg$c179 = "OptionalWhitespace", + peg$c180 = "InlineWhitespace", + peg$c181 = /^[ \t]/, + peg$c182 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c15.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c19; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c21.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c22); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c23(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parsecontent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 !== null) { + peg$currPos = s2; + s2 = peg$c1; + } else { + s2 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsewhitespaceableTextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsewhitespaceableTextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$parsemustacheInlineBlock(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = []; + s6 = peg$parseblankLine(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseblankLine(); + } + if (s5 !== null) { + s6 = peg$parseindentation(); + if (s6 !== null) { + s7 = peg$parseinvertibleContent(); + if (s7 !== null) { + s8 = peg$parseDEDENT(); + if (s8 !== null) { + s5 = [s5, s6, s7, s8]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsemustacheInlineBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetextLine(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c49(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c52.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c59) { + s0 = peg$c59; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c61) { + s0 = peg$c61; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c64.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c80.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c82; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c67; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c67; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c69; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c69; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c95; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c98) { + s0 = peg$c98; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c101) { + s0 = peg$c101; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c104; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c107) { + s0 = peg$c107; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c110) { + s0 = peg$c110; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c113) { + s0 = peg$c113; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c104; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c116) { + s1 = peg$c116; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c119(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c120(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c121(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c124(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c123(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c124(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c127.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c67; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c67; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c104; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c132; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c134(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c138; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c142; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c146(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c149.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c151.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c142; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + if (s1 !== null) { + s2 = peg$parsetagString(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c156(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c161(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c163; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c165(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c165(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c165(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c173; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c175; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c181.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.18/emblem.min.js b/ajax/libs/emblem/0.1.18/emblem.min.js new file mode 100644 index 000000000..d373f781c --- /dev/null +++ b/ajax/libs/emblem/0.1.18/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.1.17",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Br(){return e.substring(Ar,Lr)}function jr(){return Ar}function Fr(){return qr(Ar).line}function Ir(){return qr(Ar).column}function qr(t){function n(t,n){var r,i;for(r=0;rt&&(Or=0,Mr={line:1,column:1,seenCR:!1}),Or=t,n(Mr,Or)),Mr}function Rr(e){if(Lr<_r)return;Lr>_r&&(_r=Lr,Dr=[]),Dr.push(e)}function Ur(e){var t=0;e.sort();while(tLr?(r=e.charAt(Lr),Lr++):(r=null,Pr===0&&Rr(Wt)),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Xi(){var t,n,r;return t=Lr,n=Lr,Pr++,r=Ji(),r===null&&(e.charCodeAt(Lr)===39?(r=Et,Lr++):(r=null,Pr===0&&Rr(St))),Pr--,r===null?n=u:(Lr=n,n=o),n!==null?(e.length>Lr?(r=e.charAt(Lr),Lr++):(r=null,Pr===0&&Rr(Wt)),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Vi(){var t,n,r,i;t=Lr,n=Lr,r=[],i=$i();if(i!==null)while(i!==null)r.push(i),i=$i();else r=o;return r!==null&&(r=e.substring(n,Lr)),n=r,n!==null&&(Ar=t,n=zt(n)),n===null?(Lr=t,t=n):t=n,t}function $i(){var t,n,r;return t=Lr,n=Lr,Pr++,r=Ji(),Pr--,r===null?n=u:(Lr=n,n=o),n!==null?(e.length>Lr?(r=e.charAt(Lr),Lr++):(r=null,Pr===0&&Rr(Wt)),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Ji(){var e;return e=Zi(),e===null&&(e=Yi(),e===null&&(e=rs(),e===null&&(e=js(),e===null&&(e=Bs())))),e}function Ki(){var e,t,n,r,i,s;return e=Lr,t=Gi(),t!==null?(n=Is(),n!==null?(r=ai(),r!==null?(i=Is(),i!==null?(s=es(),s!==null?(Ar=e,t=Rt(r),t===null?(Lr=e,e=t):e=t):(Lr=e,e=o)):(Lr=e,e=o)):(Lr=e,e=o)):(Lr=e,e=o)):(Lr=e,e=o),e}function Qi(){var e;return e=Ki(),e===null&&(e=Ri(),e===null&&(e=qi())),e}function Gi(){var t,n;return Pr++,e.charCodeAt(Lr)===123?(t=$t,Lr++):(t=null,Pr===0&&Rr(Jt)),Pr--,t===null&&(n=null,Pr===0&&Rr(Vt)),t}function Yi(){var t,n;return Pr++,e.substr(Lr,2)===Qt?(t=Qt,Lr+=2):(t=null,Pr===0&&Rr(Gt)),Pr--,t===null&&(n=null,Pr===0&&Rr(Kt)),t}function Zi(){var t,n;return Pr++,e.substr(Lr,3)===Zt?(t=Zt,Lr+=3):(t=null,Pr===0&&Rr(en)),Pr--,t===null&&(n=null,Pr===0&&Rr(Yt)),t}function es(){var t,n;return Pr++,e.charCodeAt(Lr)===125?(t=nn,Lr++):(t=null,Pr===0&&Rr(rn)),Pr--,t===null&&(n=null,Pr===0&&Rr(tn)),t}function ts(){var t,n;return Pr++,e.substr(Lr,2)===on?(t=on,Lr+=2):(t=null,Pr===0&&Rr(un)),Pr--,t===null&&(n=null,Pr===0&&Rr(sn)),t}function ns(){var t,n;return Pr++,e.substr(Lr,3)===fn?(t=fn,Lr+=3):(t=null,Pr===0&&Rr(ln)),Pr--,t===null&&(n=null,Pr===0&&Rr(an)),t}function rs(){var t,n;return Pr++,e.substr(Lr,2)===hn?(t=hn,Lr+=2):(t=null,Pr===0&&Rr(pn)),Pr--,t===null&&(n=null,Pr===0&&Rr(cn)),t}function is(){var t,n;return Pr++,e.charCodeAt(Lr)===125?(t=nn,Lr++):(t=null,Pr===0&&Rr(rn)),Pr--,t===null&&(n=null,Pr===0&&Rr(dn)),t}function ss(){var t,n,r;return t=Lr,e.substr(Lr,2)===vn?(n=vn,Lr+=2):(n=null,Pr===0&&Rr(mn)),n!==null?(e.charCodeAt(Lr)===32?(r=M,Lr++):(r=null,Pr===0&&Rr(_)),r===null&&(r=u),r!==null?(Ar=t,n=gn(),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t===null&&(t=Lr,e.charCodeAt(Lr)===61?(n=l,Lr++):(n=null,Pr===0&&Rr(c)),n!==null?(e.charCodeAt(Lr)===32?(r=M,Lr++):(r=null,Pr===0&&Rr(_)),r===null&&(r=u),r!==null?(Ar=t,n=yn(),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)),t}function os(){var e,t,n,r,i,s,a;e=Lr,t=Lr,n=Ls();if(n!==null){r=li(),r===null&&(r=u);if(r!==null){i=[],s=Qi();while(s!==null)i.push(s),s=Qi();if(i!==null){s=[],a=us();while(a!==null)s.push(a),a=us();s!==null?(Ar=t,n=bn(n,r,i,s),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)}else Lr=t,t=o}else Lr=t,t=o}else Lr=t,t=o;if(t===null){t=Lr,n=li();if(n!==null){r=[],i=Qi();while(i!==null)r.push(i),i=Qi();if(r!==null){i=[],s=us();while(s!==null)i.push(s),s=us();i!==null?(Ar=t,n=wn(n,r,i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)}else Lr=t,t=o}else Lr=t,t=o}return t!==null&&(Ar=e,t=En(t)),t===null?(Lr=e,e=t):e=t,e}function li(){var e,t,n,r;e=Lr,t=[],n=Lr,r=ws(),r!==null&&(Ar=n,r=Sn(r)),r===null?(Lr=n,n=r):n=r,n===null&&(n=Lr,r=Es(),r!==null&&(Ar=n,r=xn(r)),r===null?(Lr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Lr,r=ws(),r!==null&&(Ar=n,r=Sn(r)),r===null?(Lr=n,n=r):n=r,n===null&&(n=Lr,r=Es(),r!==null&&(Ar=n,r=xn(r)),r===null?(Lr=n,n=r):n=r);else t=o;return t!==null&&(Ar=e,t=Tn(t)),t===null?(Lr=e,e=t):e=t,e}function us(){var t,n,r;t=Lr,n=[],e.charCodeAt(Lr)===32?(r=M,Lr++):(r=null,Pr===0&&Rr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Lr)===32?(r=M,Lr++):(r=null,Pr===0&&Rr(_));else n=o;return n!==null?(r=cs(),r===null&&(r=ps(),r===null&&(r=ds(),r===null&&(r=vs()))),r!==null?(Ar=t,n=Nn(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function as(){var t;return Cn.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(kn)),t}function fs(){var e,t;return e=ls(),e===null&&(e=Lr,t=Ei(),t!==null&&(Ar=e,t=Ln(t)),t===null?(Lr=e,e=t):e=t),e}function ls(){var t,n,r,i,s;return t=Lr,n=Lr,e.charCodeAt(Lr)===34?(r=bt,Lr++):(r=null,Pr===0&&Rr(wt)),r!==null?(i=ai(),i!==null?(e.charCodeAt(Lr)===34?(s=bt,Lr++):(s=null,Pr===0&&Rr(wt)),s!==null?(r=[r,i,s],n=r):(Lr=n,n=o)):(Lr=n,n=o)):(Lr=n,n=o),n===null&&(n=Lr,e.charCodeAt(Lr)===39?(r=Et,Lr++):(r=null,Pr===0&&Rr(St)),r!==null?(i=ai(),i!==null?(e.charCodeAt(Lr)===39?(s=Et,Lr++):(s=null,Pr===0&&Rr(St)),s!==null?(r=[r,i,s],n=r):(Lr=n,n=o)):(Lr=n,n=o)):(Lr=n,n=o)),n!==null&&(Ar=t,n=xt(n)),n===null?(Lr=t,t=n):t=n,t}function cs(){var t,n,r,i;return t=Lr,n=Ms(),n!==null?(e.charCodeAt(Lr)===61?(r=l,Lr++):(r=null,Pr===0&&Rr(c)),r!==null?(i=fs(),i!==null?(Ar=t,n=An(n,i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o),t}function hs(){var t,n,r,i,s,u;t=Lr,e.charCodeAt(Lr)===123?(n=$t,Lr++):(n=null,Pr===0&&Rr(Jt));if(n!==null){r=Is();if(r!==null){i=Lr,s=[],u=as(),u===null&&(e.charCodeAt(Lr)===32?(u=M,Lr++):(u=null,Pr===0&&Rr(_)));if(u!==null)while(u!==null)s.push(u),u=as(),u===null&&(e.charCodeAt(Lr)===32?(u=M,Lr++):(u=null,Pr===0&&Rr(_)));else s=o;s!==null&&(s=e.substring(i,Lr)),i=s,i!==null?(s=Is(),s!==null?(e.charCodeAt(Lr)===125?(u=nn,Lr++):(u=null,Pr===0&&Rr(rn)),u!==null?(Ar=t,n=On(i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o)}else Lr=t,t=o}else Lr=t,t=o;if(t===null){t=Lr,n=[],r=as();if(r!==null)while(r!==null)n.push(r),r=as();else n=o;n!==null&&(n=e.substring(t,Lr)),t=n}return t}function ps(){var t,n,r,i,s,a;return t=Lr,n=mi(),n!==null?(e.charCodeAt(Lr)===61?(r=l,Lr++):(r=null,Pr===0&&Rr(c)),r!==null?(i=hs(),i!==null?(s=Lr,Pr++,e.charCodeAt(Lr)===33?(a=Mn,Lr++):(a=null,Pr===0&&Rr(_n)),Pr--,a===null?s=u:(Lr=s,s=o),s!==null?(Ar=Lr,a=Dn(n,i),a?a=u:a=o,a!==null?(Ar=t,n=Pn(n,i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o),t}function ds(){var t,n,r,i;return t=Lr,n=mi(),n!==null?(e.charCodeAt(Lr)===61?(r=l,Lr++):(r=null,Pr===0&&Rr(c)),r!==null?(i=Ei(),i!==null?(Ar=t,n=Hn(n,i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o),t}function vs(){var t,n,r,i;return t=Lr,n=mi(),n!==null?(e.charCodeAt(Lr)===61?(r=l,Lr++):(r=null,Pr===0&&Rr(c)),r!==null?(i=Bi(),i!==null?(Ar=t,n=Bn(n,i),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o)):(Lr=t,t=o),t}function ms(){var t,n,r;t=Lr,n=[],r=ys();while(r!==null)n.push(r),r=ys();return n!==null&&(n=e.substring(t,Lr)),t=n,t}function gs(){var e;return e=ki(),e===null&&(e=yi()),e}function ys(){var t;return t=Oi(),t===null&&(mt.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(gt)),t===null&&(e.charCodeAt(Lr)===95?(t=jn,Lr++):(t=null,Pr===0&&Rr(Fn)),t===null&&(e.charCodeAt(Lr)===45?(t=In,Lr++):(t=null,Pr===0&&Rr(qn))))),t}function bs(){var t,n,r;return t=Lr,e.charCodeAt(Lr)===37?(n=Rn,Lr++):(n=null,Pr===0&&Rr(Un)),n!==null?(r=Ss(),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function ws(){var t,n,r;return t=Lr,e.charCodeAt(Lr)===35?(n=zn,Lr++):(n=null,Pr===0&&Rr(Wn)),n!==null?(r=Ss(),r!==null?(Ar=t,n=Xn(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Es(){var t,n,r;return t=Lr,e.charCodeAt(Lr)===46?(n=J,Lr++):(n=null,Pr===0&&Rr(K)),n!==null?(r=Ss(),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Ss(){var e,t;return Pr++,e=xs(),Pr--,e===null&&(t=null,Pr===0&&Rr(Vn)),e}function xs(){var t,n,r,i,s;t=Lr,n=Ns();if(n!==null){r=Lr,i=[],s=Ts();while(s!==null)i.push(s),s=Ts();i!==null&&(i=e.substring(r,Lr)),r=i,r!==null?(Ar=t,n=$n(n,r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)}else Lr=t,t=o;return t}function Ts(){var t;return Jn.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(Kn)),t===null&&(t=Cs()),t}function Ns(){var t;return Qn.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(Gn)),t===null&&(t=Cs()),t}function Cs(){var t;return Yn.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(Zn)),t}function ks(){var t,n,r;t=Lr,n=[],r=Os();if(r!==null)while(r!==null)n.push(r),r=Os();else n=o;return n!==null&&(n=e.substring(t,Lr)),t=n,t}function Ls(){var t,n,r;return Pr++,t=Lr,e.charCodeAt(Lr)===37?(n=Rn,Lr++):(n=null,Pr===0&&Rr(Un)),n!==null?(r=ks(),r!==null?(Ar=t,n=Y(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t===null&&(t=As()),Pr--,t===null&&(n=null,Pr===0&&Rr(er)),t}function As(){var e,t,n;return e=Lr,t=ks(),t!==null?(Ar=Lr,n=tr(t),n?n=u:n=o,n!==null?(Ar=e,t=nr(t),t===null?(Lr=e,e=t):e=t):(Lr=e,e=o)):(Lr=e,e=o),e}function Os(){var t;return rr.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(ir)),t}function Ms(){var e,t,n;return Pr++,e=Lr,t=ks(),t!==null?(Ar=Lr,n=or(t),n?n=u:n=o,n!==null?(Ar=e,t=nr(t),t===null?(Lr=e,e=t):e=t):(Lr=e,e=o)):(Lr=e,e=o),Pr--,e===null&&(t=null,Pr===0&&Rr(sr)),e}function _s(){var e,t,n;return e=Lr,t=Ds(),t!==null?(n=Fs(),n!==null?(Ar=e,t=Y(n),t===null?(Lr=e,e=t):e=t):(Lr=e,e=o)):(Lr=e,e=o),e}function Ds(){var t,n;return Pr++,t=Lr,e.charCodeAt(Lr)===61423?(n=ar,Lr++):(n=null,Pr===0&&Rr(fr)),n!==null&&(Ar=t,n=lr()),n===null?(Lr=t,t=n):t=n,Pr--,t===null&&(n=null,Pr===0&&Rr(ur)),t}function Ps(){var t,n;return Pr++,t=Lr,e.charCodeAt(Lr)===61438?(n=hr,Lr++):(n=null,Pr===0&&Rr(pr)),n!==null&&(Ar=t,n=lr()),n===null?(Lr=t,t=n):t=n,Pr--,t===null&&(n=null,Pr===0&&Rr(cr)),t}function Hs(){var t,n;return Pr++,t=Lr,e.charCodeAt(Lr)===61422?(n=vr,Lr++):(n=null,Pr===0&&Rr(mr)),n!==null&&(Ar=t,n=lr()),n===null?(Lr=t,t=n):t=n,Pr--,t===null&&(n=null,Pr===0&&Rr(dr)),t}function Bs(){var t,n,r;return Pr++,t=Lr,e.charCodeAt(Lr)===61439?(n=yr,Lr++):(n=null,Pr===0&&Rr(br)),n!==null?(e.charCodeAt(Lr)===10?(r=wr,Lr++):(r=null,Pr===0&&Rr(Er)),r!==null?(n=[n,r],t=n):(Lr=t,t=o)):(Lr=t,t=o),Pr--,t===null&&(n=null,Pr===0&&Rr(gr)),t}function js(){var e,t;return Pr++,e=Ps(),e===null&&(e=Hs()),Pr--,e===null&&(t=null,Pr===0&&Rr(Sr)),e}function Fs(){var t,n,r;Pr++,t=Lr,n=[],r=qs();if(r!==null)while(r!==null)n.push(r),r=qs();else n=o;return n!==null&&(n=e.substring(t,Lr)),t=n,Pr--,t===null&&(n=null,Pr===0&&Rr(xr)),t}function Is(){var e,t;Pr++,e=[],t=qs();while(t!==null)e.push(t),t=qs();return Pr--,e===null&&(t=null,Pr===0&&Rr(Tr)),e}function qs(){var t,n;return Pr++,Cr.test(e.charAt(Lr))?(t=e.charAt(Lr),Lr++):(t=null,Pr===0&&Rr(kr)),Pr--,t===null&&(n=null,Pr===0&&Rr(Nr)),t}function Rs(){var t,n,r;return t=Lr,n=Lr,Pr++,r=Ds(),r===null&&(r=Ps(),r===null&&(r=Bs())),Pr--,r===null?n=u:(Lr=n,n=o),n!==null?(e.length>Lr?(r=e.charAt(Lr),Lr++):(r=null,Pr===0&&Rr(Wt)),r!==null?(Ar=t,n=Xt(r),n===null?(Lr=t,t=n):t=n):(Lr=t,t=o)):(Lr=t,t=o),t}function Us(){var t,n,r;t=Lr,n=[],r=Rs();while(r!==null)n.push(r),r=Rs();return n!==null&&(n=e.substring(t,Lr)),t=n,t}function Ks(e,t,n){var r=e.hash;if(n){r=r||new Xs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:zr},s=zr,o=null,u="",a=function(e){return e},f=function(e,t){return new Xs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",b='">"',w=function(e,t){return[new Xs.PartialNode(e,t[0])]},E=/^[a-zA-Z0-9_$-\/]/,S="[a-zA-Z0-9_$-\\/]",x=function(e){return new Xs.PartialNameNode(e)},T=function(e){return[e]},N="/",C='"/"',k=/^[A-Z]/,L="[A-Z]",A=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Ws||!n.match(/[A-Z]/)?e:(e.mustache=Ks(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Ws||!n.match(/[A-Z]/)?e:Ks(e,t)},O=function(e,t){var n=e[0];return t&&(n=n.concat(t[2])),e[1]&&n.push(e[1]),n},M=" ",_='" "',D=function(e,t,n){var r=e[0];t&&(r=r.concat(t));if(n){n=n[1];for(var i=0;i")),[u]):(u.push(new Xs.ContentNode(">")),[u,new Xs.ContentNode("")])},Sn=function(e){return{shorthand:e,id:!0}},xn=function(e){return{shorthand:e}},Tn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem, Handlebars; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Handlebars = this.Handlebars; + +Emblem.VERSION = "0.0.3"; + +exports = Emblem; + + + + + + + + +; +// lib/parser.js + + + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = [], + peg$c1 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new Handlebars.AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c2 = null, + peg$c3 = "", + peg$c4 = "else", + peg$c5 = "\"else\"", + peg$c6 = function(c) {return c;}, + peg$c7 = function(c, i) { + return new Handlebars.AST.ProgramNode(c, i || []); + }, + peg$c8 = function(m) { + return [m]; + }, + peg$c9 = "/", + peg$c10 = "\"/\"", + peg$c11 = function() { return []; }, + peg$c12 = /^[A-Z]/, + peg$c13 = "[A-Z]", + peg$c14 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c15 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[1]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c16 = " ", + peg$c17 = "\" \"", + peg$c18 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c19 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[1]; + return new Handlebars.AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c20 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c21 = function(path, tm, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new Handlebars.AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new Handlebars.AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new Handlebars.AST.MustacheNode(actualParams, hash); + + if(tm == '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm == '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm == '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c22 = function(p, m) { + var ret = new String(p); + ret.trailingModifier = m; + return ret; + }, + peg$c23 = function(t) { return ['tagName', t]; }, + peg$c24 = function(i) { return ['elementId', i]; }, + peg$c25 = function(c) { return ['class', c]; }, + peg$c26 = function(id, classes) { return [id, classes]; }, + peg$c27 = function(classes) { return [null, classes]; }, + peg$c28 = function(h) { return h; }, + peg$c29 = "TrailingModifier", + peg$c30 = /^[!?*\^]/, + peg$c31 = "[!?*\\^]", + peg$c32 = function(h) { return new Handlebars.AST.HashNode(h); }, + peg$c33 = "PathIdent", + peg$c34 = "..", + peg$c35 = "\"..\"", + peg$c36 = ".", + peg$c37 = "\".\"", + peg$c38 = /^[a-zA-Z0-9_$\-]/, + peg$c39 = "[a-zA-Z0-9_$\\-]", + peg$c40 = "=", + peg$c41 = "\"=\"", + peg$c42 = function(s) { return s; }, + peg$c43 = "Key", + peg$c44 = function(h) { return [h[0], h[2]]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c47 = "PathSeparator", + peg$c48 = /^[\/.]/, + peg$c49 = "[\\/.]", + peg$c50 = function(v) { return new Handlebars.AST.IdNode(v); }, + peg$c51 = function(v) { return new Handlebars.AST.StringNode(v); }, + peg$c52 = function(v) { return new Handlebars.AST.IntegerNode(v); }, + peg$c53 = function(v) { return new Handlebars.AST.BooleanNode(v); }, + peg$c54 = "Boolean", + peg$c55 = "true", + peg$c56 = "\"true\"", + peg$c57 = "false", + peg$c58 = "\"false\"", + peg$c59 = "Integer", + peg$c60 = /^[0-9]/, + peg$c61 = "[0-9]", + peg$c62 = function(s) { return parseInt(s); }, + peg$c63 = "\"", + peg$c64 = "\"\\\"\"", + peg$c65 = "'", + peg$c66 = "\"'\"", + peg$c67 = function(p) { return p[1]; }, + peg$c68 = /^[^"}]/, + peg$c69 = "[^\"}]", + peg$c70 = /^[^'}]/, + peg$c71 = "[^'}]", + peg$c72 = /^[A-Za-z]/, + peg$c73 = "[A-Za-z]", + peg$c74 = function(m) { return [m]; }, + peg$c75 = "|", + peg$c76 = "\"|\"", + peg$c77 = "<", + peg$c78 = "\"<\"", + peg$c79 = function(nodes, indentedNodes) { + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + nodes = nodes.concat(indentedNodes[i]); + } + } + return nodes; + }, + peg$c80 = function(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + }, + peg$c81 = function(m) { m.escaped = true; return m; }, + peg$c82 = function(m) { m.escaped = false; return m; }, + peg$c83 = function(a) { return new Handlebars.AST.ContentNode(a.join('')); }, + peg$c84 = "any character", + peg$c85 = function(c) { return c; }, + peg$c86 = "SingleMustacheOpen", + peg$c87 = "{", + peg$c88 = "\"{\"", + peg$c89 = "DoubleMustacheOpen", + peg$c90 = "{{", + peg$c91 = "\"{{\"", + peg$c92 = "TripleMustacheOpen", + peg$c93 = "{{{", + peg$c94 = "\"{{{\"", + peg$c95 = "SingleMustacheClose", + peg$c96 = "}", + peg$c97 = "\"}\"", + peg$c98 = "DoubleMustacheClose", + peg$c99 = "}}", + peg$c100 = "\"}}\"", + peg$c101 = "TripleMustacheClose", + peg$c102 = "}}}", + peg$c103 = "\"}}}\"", + peg$c104 = "InterpolationOpen", + peg$c105 = "#{", + peg$c106 = "\"#{\"", + peg$c107 = "InterpolationClose", + peg$c108 = "==", + peg$c109 = "\"==\"", + peg$c110 = function() { return false; }, + peg$c111 = function() { return true; }, + peg$c112 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c113 = function(s, m, f) { return [null, s, m, f] }, + peg$c114 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new Handlebars.AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new Handlebars.AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new Handlebars.AST.ContentNode('>')); + return [tagOpenContent, new Handlebars.AST.ContentNode('')]; + } + }, + peg$c115 = function(a) { + return [new Handlebars.AST.ContentNode(' '), a]; + }, + peg$c116 = /^[A-Za-z.:0-9]/, + peg$c117 = "[A-Za-z.:0-9]", + peg$c118 = function(id) { return new Handlebars.AST.MustacheNode([id]); }, + peg$c119 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return unshiftParam(mustacheNode, 'action', [['on', new Handlebars.AST.StringNode(event)]]); + }, + peg$c120 = function(key, value) { + var hashNode = new Handlebars.AST.HashNode([[key, new Handlebars.AST.StringNode(value)]]); + var params = [new Handlebars.AST.IdNode(['bindAttr'])]; + + return new Handlebars.AST.MustacheNode(params, hashNode); + }, + peg$c121 = function(key, value) { + var s = key + '=' + '"' + value + '"'; + return new Handlebars.AST.ContentNode(s); + }, + peg$c122 = "_", + peg$c123 = "\"_\"", + peg$c124 = "-", + peg$c125 = "\"-\"", + peg$c126 = "%", + peg$c127 = "\"%\"", + peg$c128 = "#", + peg$c129 = "\"#\"", + peg$c130 = function(c) { return c;}, + peg$c131 = "CSSIdentifier", + peg$c132 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c133 = /^[_a-zA-Z0-9\-]/, + peg$c134 = "[_a-zA-Z0-9\\-]", + peg$c135 = /^[_a-zA-Z]/, + peg$c136 = "[_a-zA-Z]", + peg$c137 = /^[\x80-\xFF]/, + peg$c138 = "[\\x80-\\xFF]", + peg$c139 = "KnownHTMLTagName", + peg$c140 = /^[:_a-zA-Z0-9\-]/, + peg$c141 = "[:_a-zA-Z0-9\\-]", + peg$c142 = "figcaption", + peg$c143 = "\"figcaption\"", + peg$c144 = "blockquote", + peg$c145 = "\"blockquote\"", + peg$c146 = "plaintext", + peg$c147 = "\"plaintext\"", + peg$c148 = "textarea", + peg$c149 = "\"textarea\"", + peg$c150 = "progress", + peg$c151 = "\"progress\"", + peg$c152 = "optgroup", + peg$c153 = "\"optgroup\"", + peg$c154 = "noscript", + peg$c155 = "\"noscript\"", + peg$c156 = "noframes", + peg$c157 = "\"noframes\"", + peg$c158 = "frameset", + peg$c159 = "\"frameset\"", + peg$c160 = "fieldset", + peg$c161 = "\"fieldset\"", + peg$c162 = "datalist", + peg$c163 = "\"datalist\"", + peg$c164 = "colgroup", + peg$c165 = "\"colgroup\"", + peg$c166 = "basefont", + peg$c167 = "\"basefont\"", + peg$c168 = "summary", + peg$c169 = "\"summary\"", + peg$c170 = "section", + peg$c171 = "\"section\"", + peg$c172 = "marquee", + peg$c173 = "\"marquee\"", + peg$c174 = "listing", + peg$c175 = "\"listing\"", + peg$c176 = "isindex", + peg$c177 = "\"isindex\"", + peg$c178 = "details", + peg$c179 = "\"details\"", + peg$c180 = "command", + peg$c181 = "\"command\"", + peg$c182 = "caption", + peg$c183 = "\"caption\"", + peg$c184 = "bgsound", + peg$c185 = "\"bgsound\"", + peg$c186 = "article", + peg$c187 = "\"article\"", + peg$c188 = "address", + peg$c189 = "\"address\"", + peg$c190 = "acronym", + peg$c191 = "\"acronym\"", + peg$c192 = "strong", + peg$c193 = "\"strong\"", + peg$c194 = "strike", + peg$c195 = "\"strike\"", + peg$c196 = "spacer", + peg$c197 = "\"spacer\"", + peg$c198 = "source", + peg$c199 = "\"source\"", + peg$c200 = "select", + peg$c201 = "\"select\"", + peg$c202 = "script", + peg$c203 = "\"script\"", + peg$c204 = "output", + peg$c205 = "\"output\"", + peg$c206 = "option", + peg$c207 = "\"option\"", + peg$c208 = "object", + peg$c209 = "\"object\"", + peg$c210 = "legend", + peg$c211 = "\"legend\"", + peg$c212 = "keygen", + peg$c213 = "\"keygen\"", + peg$c214 = "iframe", + peg$c215 = "\"iframe\"", + peg$c216 = "hgroup", + peg$c217 = "\"hgroup\"", + peg$c218 = "header", + peg$c219 = "\"header\"", + peg$c220 = "footer", + peg$c221 = "\"footer\"", + peg$c222 = "figure", + peg$c223 = "\"figure\"", + peg$c224 = "center", + peg$c225 = "\"center\"", + peg$c226 = "canvas", + peg$c227 = "\"canvas\"", + peg$c228 = "button", + peg$c229 = "\"button\"", + peg$c230 = "applet", + peg$c231 = "\"applet\"", + peg$c232 = "video", + peg$c233 = "\"video\"", + peg$c234 = "track", + peg$c235 = "\"track\"", + peg$c236 = "title", + peg$c237 = "\"title\"", + peg$c238 = "thead", + peg$c239 = "\"thead\"", + peg$c240 = "tfoot", + peg$c241 = "\"tfoot\"", + peg$c242 = "tbody", + peg$c243 = "\"tbody\"", + peg$c244 = "table", + peg$c245 = "\"table\"", + peg$c246 = "style", + peg$c247 = "\"style\"", + peg$c248 = "small", + peg$c249 = "\"small\"", + peg$c250 = "param", + peg$c251 = "\"param\"", + peg$c252 = "meter", + peg$c253 = "\"meter\"", + peg$c254 = "label", + peg$c255 = "\"label\"", + peg$c256 = "input", + peg$c257 = "\"input\"", + peg$c258 = "frame", + peg$c259 = "\"frame\"", + peg$c260 = "embed", + peg$c261 = "\"embed\"", + peg$c262 = "blink", + peg$c263 = "\"blink\"", + peg$c264 = "audio", + peg$c265 = "\"audio\"", + peg$c266 = "aside", + peg$c267 = "\"aside\"", + peg$c268 = "time", + peg$c269 = "\"time\"", + peg$c270 = "span", + peg$c271 = "\"span\"", + peg$c272 = "samp", + peg$c273 = "\"samp\"", + peg$c274 = "ruby", + peg$c275 = "\"ruby\"", + peg$c276 = "nobr", + peg$c277 = "\"nobr\"", + peg$c278 = "meta", + peg$c279 = "\"meta\"", + peg$c280 = "menu", + peg$c281 = "\"menu\"", + peg$c282 = "mark", + peg$c283 = "\"mark\"", + peg$c284 = "main", + peg$c285 = "\"main\"", + peg$c286 = "link", + peg$c287 = "\"link\"", + peg$c288 = "html", + peg$c289 = "\"html\"", + peg$c290 = "head", + peg$c291 = "\"head\"", + peg$c292 = "form", + peg$c293 = "\"form\"", + peg$c294 = "font", + peg$c295 = "\"font\"", + peg$c296 = "data", + peg$c297 = "\"data\"", + peg$c298 = "code", + peg$c299 = "\"code\"", + peg$c300 = "cite", + peg$c301 = "\"cite\"", + peg$c302 = "body", + peg$c303 = "\"body\"", + peg$c304 = "base", + peg$c305 = "\"base\"", + peg$c306 = "area", + peg$c307 = "\"area\"", + peg$c308 = "abbr", + peg$c309 = "\"abbr\"", + peg$c310 = "xmp", + peg$c311 = "\"xmp\"", + peg$c312 = "wbr", + peg$c313 = "\"wbr\"", + peg$c314 = "var", + peg$c315 = "\"var\"", + peg$c316 = "sup", + peg$c317 = "\"sup\"", + peg$c318 = "sub", + peg$c319 = "\"sub\"", + peg$c320 = "pre", + peg$c321 = "\"pre\"", + peg$c322 = "nav", + peg$c323 = "\"nav\"", + peg$c324 = "map", + peg$c325 = "\"map\"", + peg$c326 = "kbd", + peg$c327 = "\"kbd\"", + peg$c328 = "ins", + peg$c329 = "\"ins\"", + peg$c330 = "img", + peg$c331 = "\"img\"", + peg$c332 = "div", + peg$c333 = "\"div\"", + peg$c334 = "dir", + peg$c335 = "\"dir\"", + peg$c336 = "dfn", + peg$c337 = "\"dfn\"", + peg$c338 = "del", + peg$c339 = "\"del\"", + peg$c340 = "col", + peg$c341 = "\"col\"", + peg$c342 = "big", + peg$c343 = "\"big\"", + peg$c344 = "bdo", + peg$c345 = "\"bdo\"", + peg$c346 = "bdi", + peg$c347 = "\"bdi\"", + peg$c348 = "ul", + peg$c349 = "\"ul\"", + peg$c350 = "tt", + peg$c351 = "\"tt\"", + peg$c352 = "tr", + peg$c353 = "\"tr\"", + peg$c354 = "th", + peg$c355 = "\"th\"", + peg$c356 = "td", + peg$c357 = "\"td\"", + peg$c358 = "rt", + peg$c359 = "\"rt\"", + peg$c360 = "rp", + peg$c361 = "\"rp\"", + peg$c362 = "ol", + peg$c363 = "\"ol\"", + peg$c364 = "li", + peg$c365 = "\"li\"", + peg$c366 = "hr", + peg$c367 = "\"hr\"", + peg$c368 = "h6", + peg$c369 = "\"h6\"", + peg$c370 = "h5", + peg$c371 = "\"h5\"", + peg$c372 = "h4", + peg$c373 = "\"h4\"", + peg$c374 = "h3", + peg$c375 = "\"h3\"", + peg$c376 = "h2", + peg$c377 = "\"h2\"", + peg$c378 = "h1", + peg$c379 = "\"h1\"", + peg$c380 = "em", + peg$c381 = "\"em\"", + peg$c382 = "dt", + peg$c383 = "\"dt\"", + peg$c384 = "dl", + peg$c385 = "\"dl\"", + peg$c386 = "dd", + peg$c387 = "\"dd\"", + peg$c388 = "br", + peg$c389 = "\"br\"", + peg$c390 = "u", + peg$c391 = "\"u\"", + peg$c392 = "s", + peg$c393 = "\"s\"", + peg$c394 = "q", + peg$c395 = "\"q\"", + peg$c396 = "p", + peg$c397 = "\"p\"", + peg$c398 = "i", + peg$c399 = "\"i\"", + peg$c400 = "b", + peg$c401 = "\"b\"", + peg$c402 = "a", + peg$c403 = "\"a\"", + peg$c404 = "a JS event", + peg$c405 = "touchStart", + peg$c406 = "\"touchStart\"", + peg$c407 = "touchMove", + peg$c408 = "\"touchMove\"", + peg$c409 = "touchEnd", + peg$c410 = "\"touchEnd\"", + peg$c411 = "touchCancel", + peg$c412 = "\"touchCancel\"", + peg$c413 = "keyDown", + peg$c414 = "\"keyDown\"", + peg$c415 = "keyUp", + peg$c416 = "\"keyUp\"", + peg$c417 = "keyPress", + peg$c418 = "\"keyPress\"", + peg$c419 = "mouseDown", + peg$c420 = "\"mouseDown\"", + peg$c421 = "mouseUp", + peg$c422 = "\"mouseUp\"", + peg$c423 = "contextMenu", + peg$c424 = "\"contextMenu\"", + peg$c425 = "click", + peg$c426 = "\"click\"", + peg$c427 = "doubleClick", + peg$c428 = "\"doubleClick\"", + peg$c429 = "mouseMove", + peg$c430 = "\"mouseMove\"", + peg$c431 = "focusIn", + peg$c432 = "\"focusIn\"", + peg$c433 = "focusOut", + peg$c434 = "\"focusOut\"", + peg$c435 = "mouseEnter", + peg$c436 = "\"mouseEnter\"", + peg$c437 = "mouseLeave", + peg$c438 = "\"mouseLeave\"", + peg$c439 = "submit", + peg$c440 = "\"submit\"", + peg$c441 = "change", + peg$c442 = "\"change\"", + peg$c443 = "dragStart", + peg$c444 = "\"dragStart\"", + peg$c445 = "drag", + peg$c446 = "\"drag\"", + peg$c447 = "dragEnter", + peg$c448 = "\"dragEnter\"", + peg$c449 = "dragLeave", + peg$c450 = "\"dragLeave\"", + peg$c451 = "dragOver", + peg$c452 = "\"dragOver\"", + peg$c453 = "drop", + peg$c454 = "\"drop\"", + peg$c455 = "dragEnd", + peg$c456 = "\"dragEnd\"", + peg$c457 = "INDENT", + peg$c458 = "\uEFEF", + peg$c459 = "\"\\uEFEF\"", + peg$c460 = function() { return ''; }, + peg$c461 = "DEDENT", + peg$c462 = "\uEFFE", + peg$c463 = "\"\\uEFFE\"", + peg$c464 = "LineEnd", + peg$c465 = "\n", + peg$c466 = "\"\\n\"", + peg$c467 = "\uEFFF", + peg$c468 = "\"\\uEFFF\"", + peg$c469 = "RequiredWhitespace", + peg$c470 = "OptionalWhitespace", + peg$c471 = "InlineWhitespace", + peg$c472 = /^[ \t]/, + peg$c473 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsecontent(); + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c1(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c4) { + s4 = peg$c4; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseINDENT(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c6(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 === null) { + s2 = peg$c3; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsestatement() { + var s0; + + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c8(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c9; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = []; + s7 = peg$currPos; + s8 = peg$parselineContent(); + if (s8 !== null) { + s9 = peg$parseTERM(); + if (s9 !== null) { + s8 = [s8, s9]; + s7 = s8; + } else { + peg$currPos = s7; + s7 = peg$c2; + } + } else { + peg$currPos = s7; + s7 = peg$c2; + } + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$currPos; + s8 = peg$parselineContent(); + if (s8 !== null) { + s9 = peg$parseTERM(); + if (s9 !== null) { + s8 = [s8, s9]; + s7 = s8; + } else { + peg$currPos = s7; + s7 = peg$c2; + } + } else { + peg$currPos = s7; + s7 = peg$c2; + } + } + } else { + s6 = peg$c2; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === null) { + s4 = peg$c3; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c12.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c3; + } else { + s1 = peg$c2; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = peg$parsecontent(); + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === null) { + s4 = peg$c3; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c16; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsetextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsetextNodes(); + } + } else { + s6 = peg$c2; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === null) { + s4 = peg$c3; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = peg$parseinvertibleContent(); + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === null) { + s4 = peg$c3; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c20(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = peg$parsetrailingModifier(); + if (s2 === null) { + s2 = peg$c3; + } + if (s2 !== null) { + s3 = []; + s4 = peg$parseinMustacheParam(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinMustacheParam(); + } + if (s3 !== null) { + s4 = peg$parsehash(); + if (s4 === null) { + s4 = peg$c3; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s1,s2,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsemodifiedParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseparam(); + if (s1 !== null) { + s2 = peg$parsetrailingModifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c22(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c23(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c25(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c26(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsetrailingModifier() { + var s0, s1; + + peg$silentFails++; + if (peg$c30.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c34) { + s0 = peg$c34; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c36; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c38.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c38.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + } + } else { + s2 = peg$c2; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c40; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c45(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c45(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c48.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c51(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c55) { + s0 = peg$c55; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c57) { + s0 = peg$c57; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c60.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + } + } else { + s2 = peg$c2; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c63; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c63; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c65; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c65; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c3; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== null) { + if (peg$c68.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c3; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== null) { + if (peg$c68.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c3; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c3; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c16; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 === null) { + s3 = peg$c3; + } + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 === null) { + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c3; + } else { + s1 = peg$c2; + } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseINDENT(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsetextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsetextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 === null) { + s3 = peg$c3; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c3; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c3; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c3; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c81(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c81(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c81(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c82(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsepreMustacheUnit(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsepreMustacheUnit(); + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsetripleOpen(); + if (s2 === null) { + s2 = peg$parsedoubleOpen(); + if (s2 === null) { + s2 = peg$parsehashStacheOpen(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c3; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c87; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c90) { + s0 = peg$c90; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c93) { + s0 = peg$c93; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c96; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c99) { + s0 = peg$c99; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c102) { + s0 = peg$c102; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c105) { + s0 = peg$c105; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c96; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c108) { + s1 = peg$c108; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c16; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 === null) { + s2 = peg$c3; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c110(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c40; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c16; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 === null) { + s2 = peg$c3; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c111(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c3; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c112(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c113(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c114(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c26(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c16; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c16; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseboundAttributeValueText() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (peg$c116.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (peg$c116.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c63; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c63; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c65; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c65; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c40; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c119(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c40; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValueText(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c120(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c40; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s2 !== null) { + s3 = peg$parsestring(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c60.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c122; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c124; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c126; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c128; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c36; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c133.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c135.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c136); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c137.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3, s4; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c126; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsetagChar(); + if (s4 !== null) { + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsetagChar(); + } + } else { + s3 = peg$c2; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c140.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 10) === peg$c142) { + s0 = peg$c142; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c144) { + s0 = peg$c144; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c146) { + s0 = peg$c146; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c148) { + s0 = peg$c148; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c150) { + s0 = peg$c150; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c152) { + s0 = peg$c152; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c154) { + s0 = peg$c154; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c156) { + s0 = peg$c156; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c158) { + s0 = peg$c158; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c160) { + s0 = peg$c160; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c162) { + s0 = peg$c162; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c164) { + s0 = peg$c164; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c166) { + s0 = peg$c166; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c168) { + s0 = peg$c168; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c170) { + s0 = peg$c170; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c172) { + s0 = peg$c172; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c174) { + s0 = peg$c174; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c176) { + s0 = peg$c176; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c178) { + s0 = peg$c178; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c180) { + s0 = peg$c180; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c182) { + s0 = peg$c182; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c184) { + s0 = peg$c184; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c186) { + s0 = peg$c186; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c188) { + s0 = peg$c188; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c190) { + s0 = peg$c190; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c192) { + s0 = peg$c192; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c194) { + s0 = peg$c194; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c196) { + s0 = peg$c196; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c198) { + s0 = peg$c198; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c200) { + s0 = peg$c200; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c201); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c202) { + s0 = peg$c202; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c204) { + s0 = peg$c204; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c205); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c206) { + s0 = peg$c206; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c207); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c208) { + s0 = peg$c208; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c209); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c210) { + s0 = peg$c210; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c211); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c212) { + s0 = peg$c212; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c213); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c214) { + s0 = peg$c214; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c215); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c216) { + s0 = peg$c216; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c217); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c218) { + s0 = peg$c218; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c219); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c220) { + s0 = peg$c220; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c221); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c222) { + s0 = peg$c222; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c223); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c224) { + s0 = peg$c224; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c226) { + s0 = peg$c226; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c228) { + s0 = peg$c228; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c229); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c230) { + s0 = peg$c230; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c231); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c232) { + s0 = peg$c232; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c233); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c234) { + s0 = peg$c234; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c235); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c236) { + s0 = peg$c236; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c237); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c238) { + s0 = peg$c238; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c239); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c240) { + s0 = peg$c240; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c241); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c242) { + s0 = peg$c242; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c243); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c244) { + s0 = peg$c244; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c245); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c246) { + s0 = peg$c246; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c247); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c248) { + s0 = peg$c248; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c249); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c250) { + s0 = peg$c250; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c251); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c252) { + s0 = peg$c252; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c253); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c254) { + s0 = peg$c254; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c255); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c256) { + s0 = peg$c256; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c257); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c258) { + s0 = peg$c258; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c259); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c260) { + s0 = peg$c260; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c261); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c262) { + s0 = peg$c262; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c263); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c264) { + s0 = peg$c264; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c265); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c266) { + s0 = peg$c266; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c267); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c268) { + s0 = peg$c268; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c269); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c270) { + s0 = peg$c270; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c271); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c272) { + s0 = peg$c272; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c273); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c274) { + s0 = peg$c274; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c275); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c276) { + s0 = peg$c276; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c277); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c278) { + s0 = peg$c278; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c279); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c280) { + s0 = peg$c280; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c282) { + s0 = peg$c282; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c283); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c284) { + s0 = peg$c284; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c285); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c286) { + s0 = peg$c286; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c287); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c288) { + s0 = peg$c288; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c289); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c290) { + s0 = peg$c290; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c291); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c292) { + s0 = peg$c292; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c293); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c294) { + s0 = peg$c294; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c295); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c296) { + s0 = peg$c296; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c297); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c298) { + s0 = peg$c298; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c299); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c300) { + s0 = peg$c300; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c301); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c302) { + s0 = peg$c302; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c303); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c304) { + s0 = peg$c304; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c305); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c306) { + s0 = peg$c306; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c307); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c308) { + s0 = peg$c308; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c309); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c310) { + s0 = peg$c310; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c311); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c312) { + s0 = peg$c312; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c313); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c314) { + s0 = peg$c314; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c315); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c316) { + s0 = peg$c316; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c317); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c318) { + s0 = peg$c318; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c319); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c320) { + s0 = peg$c320; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c321); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c322) { + s0 = peg$c322; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c323); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c324) { + s0 = peg$c324; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c325); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c326) { + s0 = peg$c326; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c327); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c328) { + s0 = peg$c328; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c329); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c330) { + s0 = peg$c330; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c331); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c332) { + s0 = peg$c332; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c333); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c334) { + s0 = peg$c334; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c335); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c336) { + s0 = peg$c336; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c337); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c338) { + s0 = peg$c338; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c339); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c340) { + s0 = peg$c340; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c341); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c342) { + s0 = peg$c342; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c343); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c344) { + s0 = peg$c344; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c345); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c346) { + s0 = peg$c346; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c347); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c348) { + s0 = peg$c348; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c349); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c350) { + s0 = peg$c350; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c351); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c352) { + s0 = peg$c352; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c353); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c354) { + s0 = peg$c354; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c355); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c356) { + s0 = peg$c356; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c357); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c358) { + s0 = peg$c358; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c359); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c360) { + s0 = peg$c360; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c361); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c362) { + s0 = peg$c362; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c363); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c364) { + s0 = peg$c364; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c365); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c366) { + s0 = peg$c366; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c367); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c368) { + s0 = peg$c368; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c369); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c370) { + s0 = peg$c370; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c371); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c372) { + s0 = peg$c372; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c373); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c374) { + s0 = peg$c374; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c375); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c376) { + s0 = peg$c376; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c377); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c378) { + s0 = peg$c378; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c379); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c380) { + s0 = peg$c380; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c381); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c382) { + s0 = peg$c382; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c383); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c384) { + s0 = peg$c384; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c385); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c386) { + s0 = peg$c386; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c387); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c388) { + s0 = peg$c388; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c389); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 117) { + s0 = peg$c390; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c391); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 115) { + s0 = peg$c392; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c393); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 113) { + s0 = peg$c394; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c395); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 112) { + s0 = peg$c396; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c397); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 105) { + s0 = peg$c398; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c399); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 98) { + s0 = peg$c400; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c401); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 97) { + s0 = peg$c402; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c403); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 10) === peg$c405) { + s0 = peg$c405; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c406); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c407) { + s0 = peg$c407; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c408); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c409) { + s0 = peg$c409; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c410); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c411) { + s0 = peg$c411; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c412); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c413) { + s0 = peg$c413; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c414); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c415) { + s0 = peg$c415; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c416); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c417) { + s0 = peg$c417; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c418); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c419) { + s0 = peg$c419; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c420); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c421) { + s0 = peg$c421; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c422); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c423) { + s0 = peg$c423; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c424); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c425) { + s0 = peg$c425; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c426); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c427) { + s0 = peg$c427; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c428); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c429) { + s0 = peg$c429; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c430); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c431) { + s0 = peg$c431; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c432); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c433) { + s0 = peg$c433; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c434); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c435) { + s0 = peg$c435; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c436); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c437) { + s0 = peg$c437; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c438); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c439) { + s0 = peg$c439; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c440); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c256) { + s0 = peg$c256; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c257); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c441) { + s0 = peg$c441; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c442); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c443) { + s0 = peg$c443; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c444); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c445) { + s0 = peg$c445; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c446); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c447) { + s0 = peg$c447; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c448); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c449) { + s0 = peg$c449; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c450); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c451) { + s0 = peg$c451; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c452); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c453) { + s0 = peg$c453; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c454); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c455) { + s0 = peg$c455; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c456); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c404); } + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c458; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c459); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c460(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c457); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c462; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c463); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c460(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c461); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 10) { + s1 = peg$c465; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c466); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c467; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c468); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c464); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + if (s1 !== null) { + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + } else { + s0 = peg$c2; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c469); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c470); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c472.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c473); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c471); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c3; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new Handlebars.AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new Handlebars.AST.IdNode([helperName])); + return new Handlebars.AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +exports = Emblem.Parser; +; +// lib/compiler.js +var Emblem, Handlebars, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return new Handlebars.AST.ProgramNode(Emblem.Parser.parse(processed), []); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompileRaw = function(string, options) { + var ast, environment; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.precompile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + return new Handlebars.JavaScriptCompiler().compile(environment, options); +}; + +Emblem.compileRaw = function(string, options) { + var compile, compiled; + if (options == null) { + options = {}; + } + if (typeof string !== 'string') { + throw new Handlebars.Exception("You must pass a string to Emblem.compile. You passed " + string); + } + if (__indexOf.call(options, 'data') < 0) { + options.data = true; + } + compiled = null; + compile = function() { + var ast, environment, templateSpec; + ast = Emblem.parse(string); + environment = new Handlebars.Compiler().compile(ast, options); + templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Handlebars.template(templateSpec); + }; + return function(context, options) { + if (!compiled) { + compiled = compile(); + } + return compiled.call(this, context, options); + }; +}; + +Emblem.precompile = Emblem.precompileRaw; + +Emblem.compile = Emblem.compileRaw; + +Emblem.precompileEmber = function(string) { + var ast, environment, options; + ast = Emblem.parse(string); + options = { + knownHelpers: { + action: true, + unbound: true, + bindAttr: true, + template: true, + view: true, + _triageMustache: true + }, + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); +}; + +Emblem.compileEmber = function(string) { + var ast, environment, options, templateSpec; + ast = Emblem.parse(string); + options = { + data: true, + stringParams: true + }; + environment = new Ember.Handlebars.Compiler().compile(ast, options); + templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, void 0, true); + return Ember.Handlebars.template(templateSpec); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, indent, lines, message, newIndent, tok; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (newIndent = this.discard(RegExp("[" + ws + "]+"))) { + this.indents.push(newIndent); + this.context.observe(INDENT); + this.p(INDENT); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (newIndent = this.discard(RegExp("(" + indent + "[" + ws + "]+)"))) { + this.indents.push(newIndent); + this.context.observe(INDENT); + this.p(INDENT); + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (this.ss.check(RegExp("[" + ws + "]+"))) { + lines = this.ss.str.substr(0, this.ss.pos).split(/\n/) || ['']; + message = "Invalid indentation"; + Emblem.throwCompileError(lines.length, message); + } + } + } + } + this.scan(/[^\n\\]+/); + if (tok = this.discard(/\//)) { + this.context.observe(tok); + } else if (this.scan(/\n/)) { + this.p("" + TERM); + } + this.discard(any_whitespaceFollowedByNewlines_); + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.enableEmber = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + Emblem.precompile = Emblem.precompileEmber; + Emblem.compile = Emblem.compileEmber; + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"]', Ember.$(document)).each(function() { + var script, templateName; + script = Ember.$(this); + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.enableEmber(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.5/emblem.min.js b/ajax/libs/emblem/0.1.5/emblem.min.js new file mode 100644 index 000000000..b41236970 --- /dev/null +++ b/ajax/libs/emblem/0.1.5/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n,r;this.Emblem={},n=this.Emblem,r=this.Handlebars,n.VERSION="0.0.3",exports=n,n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function n(e){function sf(){return e.substring(Ga,Qa)}function of(){return Ga}function uf(){return ff(Ga).line}function af(){return ff(Ga).column}function ff(t){function n(t,n){var r,i;for(r=0;rt&&(Ya=0,Za={line:1,column:1,seenCR:!1}),Ya=t,n(Za,Ya)),Za}function lf(e){if(Qaef&&(ef=Qa,tf=[]),tf.push(e)}function cf(e){var t=0;e.sort();while(tQa?(r=e.charAt(Qa),Qa++):(r=null,nf===0&&lf(Bt)),r!==null?(Ga=t,n=jt(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function sl(){var e;return e=el(),e===null&&(e=nl(),e===null&&(e=tl())),e}function ol(){var t,n;return nf++,e.charCodeAt(Qa)===123?(t=It,Qa++):(t=null,nf===0&&lf(qt)),nf--,t===null&&(n=null,nf===0&&lf(Ft)),t}function ul(){var t,n;return nf++,e.substr(Qa,2)===Ut?(t=Ut,Qa+=2):(t=null,nf===0&&lf(zt)),nf--,t===null&&(n=null,nf===0&&lf(Rt)),t}function al(){var t,n;return nf++,e.substr(Qa,3)===Xt?(t=Xt,Qa+=3):(t=null,nf===0&&lf(Vt)),nf--,t===null&&(n=null,nf===0&&lf(Wt)),t}function fl(){var t,n;return nf++,e.charCodeAt(Qa)===125?(t=Jt,Qa++):(t=null,nf===0&&lf(Kt)),nf--,t===null&&(n=null,nf===0&&lf($t)),t}function ll(){var t,n;return nf++,e.substr(Qa,2)===Gt?(t=Gt,Qa+=2):(t=null,nf===0&&lf(Yt)),nf--,t===null&&(n=null,nf===0&&lf(Qt)),t}function cl(){var t,n;return nf++,e.substr(Qa,3)===en?(t=en,Qa+=3):(t=null,nf===0&&lf(tn)),nf--,t===null&&(n=null,nf===0&&lf(Zt)),t}function hl(){var t,n;return nf++,e.substr(Qa,2)===rn?(t=rn,Qa+=2):(t=null,nf===0&&lf(sn)),nf--,t===null&&(n=null,nf===0&&lf(nn)),t}function pl(){var t,n;return nf++,e.charCodeAt(Qa)===125?(t=Jt,Qa++):(t=null,nf===0&&lf(Kt)),nf--,t===null&&(n=null,nf===0&&lf(on)),t}function dl(){var t,n,r;return t=Qa,e.substr(Qa,2)===un?(n=un,Qa+=2):(n=null,nf===0&&lf(an)),n!==null?(e.charCodeAt(Qa)===32?(r=S,Qa++):(r=null,nf===0&&lf(x)),r===null&&(r=f),r!==null?(Ga=t,n=fn(),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t===null&&(t=Qa,e.charCodeAt(Qa)===61?(n=V,Qa++):(n=null,nf===0&&lf($)),n!==null?(e.charCodeAt(Qa)===32?(r=S,Qa++):(r=null,nf===0&&lf(x)),r===null&&(r=f),r!==null?(Ga=t,n=ln(),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a)),t}function vl(){var e,t,n,r,i,s,o;e=Qa,t=Qa,n=Pl();if(n!==null){r=Lf(),r===null&&(r=f);if(r!==null){i=[],s=sl();while(s!==null)i.push(s),s=sl();if(i!==null){s=[],o=ml();while(o!==null)s.push(o),o=ml();s!==null?(Ga=t,n=cn(n,r,i,s),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)}else Qa=t,t=a}else Qa=t,t=a}else Qa=t,t=a;if(t===null){t=Qa,n=Lf();if(n!==null){r=[],i=sl();while(i!==null)r.push(i),i=sl();if(r!==null){i=[],s=ml();while(s!==null)i.push(s),s=ml();i!==null?(Ga=t,n=hn(n,r,i),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)}else Qa=t,t=a}else Qa=t,t=a}return t!==null&&(Ga=e,t=pn(t)),t===null?(Qa=e,e=t):e=t,e}function Lf(){var e;return e=Af(),e===null&&(e=Of()),e}function Af(){var e,t,n,r;e=Qa,t=kl();if(t!==null){n=[],r=Ll();while(r!==null)n.push(r),r=Ll();n!==null?(Ga=e,t=_(t,n),t===null?(Qa=e,e=t):e=t):(Qa=e,e=a)}else Qa=e,e=a;return e}function Of(){var e,t,n;e=Qa,t=[],n=Ll();if(n!==null)while(n!==null)t.push(n),n=Ll();else t=a;return t!==null&&(Ga=e,t=D(t)),t===null?(Qa=e,e=t):e=t,e}function ml(){var t,n,r;t=Qa,n=[],e.charCodeAt(Qa)===32?(r=S,Qa++):(r=null,nf===0&&lf(x));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Qa)===32?(r=S,Qa++):(r=null,nf===0&&lf(x));else n=a;return n!==null?(r=wl(),r===null&&(r=El(),r===null&&(r=Sl())),r!==null?(Ga=t,n=dn(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function gl(){var t,n,r;t=Qa,n=[],vn.test(e.charAt(Qa))?(r=e.charAt(Qa),Qa++):(r=null,nf===0&&lf(mn));if(r!==null)while(r!==null)n.push(r),vn.test(e.charAt(Qa))?(r=e.charAt(Qa),Qa++):(r=null,nf===0&&lf(mn));else n=a;return n!==null&&(n=e.substring(t,Qa)),t=n,t}function yl(){var e,t;return e=bl(),e===null&&(e=Qa,t=qf(),t!==null&&(Ga=e,t=gn(t)),t===null?(Qa=e,e=t):e=t),e}function bl(){var t,n,r,i,s;return t=Qa,n=Qa,e.charCodeAt(Qa)===34?(r=vt,Qa++):(r=null,nf===0&&lf(mt)),r!==null?(i=Nf(),i!==null?(e.charCodeAt(Qa)===34?(s=vt,Qa++):(s=null,nf===0&&lf(mt)),s!==null?(r=[r,i,s],n=r):(Qa=n,n=a)):(Qa=n,n=a)):(Qa=n,n=a),n===null&&(n=Qa,e.charCodeAt(Qa)===39?(r=gt,Qa++):(r=null,nf===0&&lf(yt)),r!==null?(i=Nf(),i!==null?(e.charCodeAt(Qa)===39?(s=gt,Qa++):(s=null,nf===0&&lf(yt)),s!==null?(r=[r,i,s],n=r):(Qa=n,n=a)):(Qa=n,n=a)):(Qa=n,n=a)),n!==null&&(Ga=t,n=bt(n)),n===null?(Qa=t,t=n):t=n,t}function wl(){var t,n,r,i;return t=Qa,n=jl(),n!==null?(e.charCodeAt(Qa)===61?(r=V,Qa++):(r=null,nf===0&&lf($)),r!==null?(i=yl(),i!==null?(Ga=t,n=yn(n,i),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a)):(Qa=t,t=a),t}function El(){var t,n,r,i;return t=Qa,n=Hf(),n!==null?(e.charCodeAt(Qa)===61?(r=V,Qa++):(r=null,nf===0&&lf($)),r!==null?(i=gl(),i!==null?(Ga=t,n=bn(n,i),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a)):(Qa=t,t=a),t}function Sl(){var t,n,r,i;return t=Qa,n=Hf(),n!==null?(e.charCodeAt(Qa)===61?(r=V,Qa++):(r=null,nf===0&&lf($)),r!==null?(i=Vf(),i!==null?(Ga=t,n=wn(n,i),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a)):(Qa=t,t=a),t}function xl(){var t,n,r;t=Qa,n=[],r=Nl();while(r!==null)n.push(r),r=Nl();return n!==null&&(n=e.substring(t,Qa)),t=n,t}function Tl(){var e;return e=Vf(),e===null&&(e=jf()),e}function Nl(){var t;return t=Kf(),t===null&&(ht.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(pt)),t===null&&(e.charCodeAt(Qa)===95?(t=En,Qa++):(t=null,nf===0&&lf(Sn)),t===null&&(e.charCodeAt(Qa)===45?(t=xn,Qa++):(t=null,nf===0&&lf(Tn))))),t}function Cl(){var t,n,r;return t=Qa,e.charCodeAt(Qa)===37?(n=Nn,Qa++):(n=null,nf===0&&lf(Cn)),n!==null?(r=Al(),r!==null?(Ga=t,n=jt(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function kl(){var t,n,r;return t=Qa,e.charCodeAt(Qa)===35?(n=kn,Qa++):(n=null,nf===0&&lf(Ln)),n!==null?(r=Al(),r!==null?(Ga=t,n=An(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function Ll(){var t,n,r;return t=Qa,e.charCodeAt(Qa)===46?(n=U,Qa++):(n=null,nf===0&&lf(z)),n!==null?(r=Al(),r!==null?(Ga=t,n=jt(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function Al(){var e,t;return nf++,e=Ol(),nf--,e===null&&(t=null,nf===0&&lf(On)),e}function Ol(){var t,n,r,i,s;t=Qa,n=_l();if(n!==null){r=Qa,i=[],s=Ml();while(s!==null)i.push(s),s=Ml();i!==null&&(i=e.substring(r,Qa)),r=i,r!==null?(Ga=t,n=Mn(n,r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)}else Qa=t,t=a;return t}function Ml(){var t;return _n.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(Dn)),t===null&&(t=Dl()),t}function _l(){var t;return Pn.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(Hn)),t===null&&(t=Dl()),t}function Dl(){var t;return Bn.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(jn)),t}function Pl(){var t,n,r,i,s;nf++,t=Qa,e.charCodeAt(Qa)===37?(n=Nn,Qa++):(n=null,nf===0&&lf(Cn));if(n!==null){r=Qa,i=[],s=Hl();if(s!==null)while(s!==null)i.push(s),s=Hl();else i=a;i!==null&&(i=e.substring(r,Qa)),r=i,r!==null?(Ga=t,n=jt(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)}else Qa=t,t=a;return t===null&&(t=Bl()),nf--,t===null&&(n=null,nf===0&&lf(Fn)),t}function Hl(){var t;return In.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(qn)),t}function Bl(){var t,n;return nf++,e.substr(Qa,10)===Rn?(t=Rn,Qa+=10):(t=null,nf===0&&lf(Un)),t===null&&(e.substr(Qa,10)===zn?(t=zn,Qa+=10):(t=null,nf===0&&lf(Wn)),t===null&&(e.substr(Qa,9)===Xn?(t=Xn,Qa+=9):(t=null,nf===0&&lf(Vn)),t===null&&(e.substr(Qa,8)===$n?(t=$n,Qa+=8):(t=null,nf===0&&lf(Jn)),t===null&&(e.substr(Qa,8)===Kn?(t=Kn,Qa+=8):(t=null,nf===0&&lf(Qn)),t===null&&(e.substr(Qa,8)===Gn?(t=Gn,Qa+=8):(t=null,nf===0&&lf(Yn)),t===null&&(e.substr(Qa,8)===Zn?(t=Zn,Qa+=8):(t=null,nf===0&&lf(er)),t===null&&(e.substr(Qa,8)===tr?(t=tr,Qa+=8):(t=null,nf===0&&lf(nr)),t===null&&(e.substr(Qa,8)===rr?(t=rr,Qa+=8):(t=null,nf===0&&lf(ir)),t===null&&(e.substr(Qa,8)===sr?(t=sr,Qa+=8):(t=null,nf===0&&lf(or)),t===null&&(e.substr(Qa,8)===ur?(t=ur,Qa+=8):(t=null,nf===0&&lf(ar)),t===null&&(e.substr(Qa,8)===fr?(t=fr,Qa+=8):(t=null,nf===0&&lf(lr)),t===null&&(e.substr(Qa,8)===cr?(t=cr,Qa+=8):(t=null,nf===0&&lf(hr)),t===null&&(e.substr(Qa,7)===pr?(t=pr,Qa+=7):(t=null,nf===0&&lf(dr)),t===null&&(e.substr(Qa,7)===vr?(t=vr,Qa+=7):(t=null,nf===0&&lf(mr)),t===null&&(e.substr(Qa,7)===gr?(t=gr,Qa+=7):(t=null,nf===0&&lf(yr)),t===null&&(e.substr(Qa,7)===br?(t=br,Qa+=7):(t=null,nf===0&&lf(wr)),t===null&&(e.substr(Qa,7)===Er?(t=Er,Qa+=7):(t=null,nf===0&&lf(Sr)),t===null&&(e.substr(Qa,7)===xr?(t=xr,Qa+=7):(t=null,nf===0&&lf(Tr)),t===null&&(e.substr(Qa,7)===Nr?(t=Nr,Qa+=7):(t=null,nf===0&&lf(Cr)),t===null&&(e.substr(Qa,7)===kr?(t=kr,Qa+=7):(t=null,nf===0&&lf(Lr)),t===null&&(e.substr(Qa,7)===Ar?(t=Ar,Qa+=7):(t=null,nf===0&&lf(Or)),t===null&&(e.substr(Qa,7)===Mr?(t=Mr,Qa+=7):(t=null,nf===0&&lf(_r)),t===null&&(e.substr(Qa,7)===Dr?(t=Dr,Qa+=7):(t=null,nf===0&&lf(Pr)),t===null&&(e.substr(Qa,7)===Hr?(t=Hr,Qa+=7):(t=null,nf===0&&lf(Br)),t===null&&(e.substr(Qa,6)===jr?(t=jr,Qa+=6):(t=null,nf===0&&lf(Fr)),t===null&&(e.substr(Qa,6)===Ir?(t=Ir,Qa+=6):(t=null,nf===0&&lf(qr)),t===null&&(e.substr(Qa,6)===Rr?(t=Rr,Qa+=6):(t=null,nf===0&&lf(Ur)),t===null&&(e.substr(Qa,6)===zr?(t=zr,Qa+=6):(t=null,nf===0&&lf(Wr)),t===null&&(e.substr(Qa,6)===Xr?(t=Xr,Qa+=6):(t=null,nf===0&&lf(Vr)),t===null&&(e.substr(Qa,6)===$r?(t=$r,Qa+=6):(t=null,nf===0&&lf(Jr)),t===null&&(e.substr(Qa,6)===Kr?(t=Kr,Qa+=6):(t=null,nf===0&&lf(Qr)),t===null&&(e.substr(Qa,6)===Gr?(t=Gr,Qa+=6):(t=null,nf===0&&lf(Yr)),t===null&&(e.substr(Qa,6)===Zr?(t=Zr,Qa+=6):(t=null,nf===0&&lf(ei)),t===null&&(e.substr(Qa,6)===ti?(t=ti,Qa+=6):(t=null,nf===0&&lf(ni)),t===null&&(e.substr(Qa,6)===ri?(t=ri,Qa+=6):(t=null,nf===0&&lf(ii)),t===null&&(e.substr(Qa,6)===si?(t=si,Qa+=6):(t=null,nf===0&&lf(oi)),t===null&&(e.substr(Qa,6)===ui?(t=ui,Qa+=6):(t=null,nf===0&&lf(ai)),t===null&&(e.substr(Qa,6)===fi?(t=fi,Qa+=6):(t=null,nf===0&&lf(li)),t===null&&(e.substr(Qa,6)===ci?(t=ci,Qa+=6):(t=null,nf===0&&lf(hi)),t===null&&(e.substr(Qa,6)===pi?(t=pi,Qa+=6):(t=null,nf===0&&lf(di)),t===null&&(e.substr(Qa,6)===vi?(t=vi,Qa+=6):(t=null,nf===0&&lf(mi)),t===null&&(e.substr(Qa,6)===gi?(t=gi,Qa+=6):(t=null,nf===0&&lf(yi)),t===null&&(e.substr(Qa,6)===bi?(t=bi,Qa+=6):(t=null,nf===0&&lf(wi)),t===null&&(e.substr(Qa,6)===Ei?(t=Ei,Qa+=6):(t=null,nf===0&&lf(Si)),t===null&&(e.substr(Qa,5)===xi?(t=xi,Qa+=5):(t=null,nf===0&&lf(Ti)),t===null&&(e.substr(Qa,5)===Ni?(t=Ni,Qa+=5):(t=null,nf===0&&lf(Ci)),t===null&&(e.substr(Qa,5)===ki?(t=ki,Qa+=5):(t=null,nf===0&&lf(Li)),t===null&&(e.substr(Qa,5)===Ai?(t=Ai,Qa+=5):(t=null,nf===0&&lf(Oi)),t===null&&(e.substr(Qa,5)===Mi?(t=Mi,Qa+=5):(t=null,nf===0&&lf(_i)),t===null&&(e.substr(Qa,5)===Di?(t=Di,Qa+=5):(t=null,nf===0&&lf(Pi)),t===null&&(e.substr(Qa,5)===Hi?(t=Hi,Qa+=5):(t=null,nf===0&&lf(Bi)),t===null&&(e.substr(Qa,5)===ji?(t=ji,Qa+=5):(t=null,nf===0&&lf(Fi)),t===null&&(e.substr(Qa,5)===Ii?(t=Ii,Qa+=5):(t=null,nf===0&&lf(qi)),t===null&&(e.substr(Qa,5)===Ri?(t=Ri,Qa+=5):(t=null,nf===0&&lf(Ui)),t===null&&(e.substr(Qa,5)===zi?(t=zi,Qa+=5):(t=null,nf===0&&lf(Wi)),t===null&&(e.substr(Qa,5)===Xi?(t=Xi,Qa+=5):(t=null,nf===0&&lf(Vi)),t===null&&(e.substr(Qa,5)===$i?(t=$i,Qa+=5):(t=null,nf===0&&lf(Ji)),t===null&&(e.substr(Qa,5)===Ki?(t=Ki,Qa+=5):(t=null,nf===0&&lf(Qi)),t===null&&(e.substr(Qa,5)===Gi?(t=Gi,Qa+=5):(t=null,nf===0&&lf(Yi)),t===null&&(e.substr(Qa,5)===Zi?(t=Zi,Qa+=5):(t=null,nf===0&&lf(es)),t===null&&(e.substr(Qa,5)===ts?(t=ts,Qa+=5):(t=null,nf===0&&lf(ns)),t===null&&(e.substr(Qa,5)===rs?(t=rs,Qa+=5):(t=null,nf===0&&lf(is)),t===null&&(e.substr(Qa,4)===ss?(t=ss,Qa+=4):(t=null,nf===0&&lf(os)),t===null&&(e.substr(Qa,4)===us?(t=us,Qa+=4):(t=null,nf===0&&lf(as)),t===null&&(e.substr(Qa,4)===fs?(t=fs,Qa+=4):(t=null,nf===0&&lf(ls)),t===null&&(e.substr(Qa,4)===cs?(t=cs,Qa+=4):(t=null,nf===0&&lf(hs)),t===null&&(e.substr(Qa,4)===ps?(t=ps,Qa+=4):(t=null,nf===0&&lf(ds)),t===null&&(e.substr(Qa,4)===vs?(t=vs,Qa+=4):(t=null,nf===0&&lf(ms)),t===null&&(e.substr(Qa,4)===gs?(t=gs,Qa+=4):(t=null,nf===0&&lf(ys)),t===null&&(e.substr(Qa,4)===bs?(t=bs,Qa+=4):(t=null,nf===0&&lf(ws)),t===null&&(e.substr(Qa,4)===Es?(t=Es,Qa+=4):(t=null,nf===0&&lf(Ss)),t===null&&(e.substr(Qa,4)===xs?(t=xs,Qa+=4):(t=null,nf===0&&lf(Ts)),t===null&&(e.substr(Qa,4)===Ns?(t=Ns,Qa+=4):(t=null,nf===0&&lf(Cs)),t===null&&(e.substr(Qa,4)===ks?(t=ks,Qa+=4):(t=null,nf===0&&lf(Ls)),t===null&&(e.substr(Qa,4)===As?(t=As,Qa+=4):(t=null,nf===0&&lf(Os)),t===null&&(e.substr(Qa,4)===Ms?(t=Ms,Qa+=4):(t=null,nf===0&&lf(_s)),t===null&&(e.substr(Qa,4)===Ds?(t=Ds,Qa+=4):(t=null,nf===0&&lf(Ps)),t===null&&(e.substr(Qa,4)===Hs?(t=Hs,Qa+=4):(t=null,nf===0&&lf(Bs)),t===null&&(e.substr(Qa,4)===js?(t=js,Qa+=4):(t=null,nf===0&&lf(Fs)),t===null&&(e.substr(Qa,4)===Is?(t=Is,Qa+=4):(t=null,nf===0&&lf(qs)),t===null&&(e.substr(Qa,4)===Rs?(t=Rs,Qa+=4):(t=null,nf===0&&lf(Us)),t===null&&(e.substr(Qa,4)===zs?(t=zs,Qa+=4):(t=null,nf===0&&lf(Ws)),t===null&&(e.substr(Qa,4)===Xs?(t=Xs,Qa+=4):(t=null,nf===0&&lf(Vs)),t===null&&(e.substr(Qa,3)===$s?(t=$s,Qa+=3):(t=null,nf===0&&lf(Js)),t===null&&(e.substr(Qa,3)===Ks?(t=Ks,Qa+=3):(t=null,nf===0&&lf(Qs)),t===null&&(e.substr(Qa,3)===Gs?(t=Gs,Qa+=3):(t=null,nf===0&&lf(Ys)),t===null&&(e.substr(Qa,3)===Zs?(t=Zs,Qa+=3):(t=null,nf===0&&lf(eo)),t===null&&(e.substr(Qa,3)===to?(t=to,Qa+=3):(t=null,nf===0&&lf(no)),t===null&&(e.substr(Qa,3)===ro?(t=ro,Qa+=3):(t=null,nf===0&&lf(io)),t===null&&(e.substr(Qa,3)===so?(t=so,Qa+=3):(t=null,nf===0&&lf(oo)),t===null&&(e.substr(Qa,3)===uo?(t=uo,Qa+=3):(t=null,nf===0&&lf(ao)),t===null&&(e.substr(Qa,3)===fo?(t=fo,Qa+=3):(t=null,nf===0&&lf(lo)),t===null&&(e.substr(Qa,3)===co?(t=co,Qa+=3):(t=null,nf===0&&lf(ho)),t===null&&(e.substr(Qa,3)===po?(t=po,Qa+=3):(t=null,nf===0&&lf(vo)),t===null&&(e.substr(Qa,3)===mo?(t=mo,Qa+=3):(t=null,nf===0&&lf(go)),t===null&&(e.substr(Qa,3)===yo?(t=yo,Qa+=3):(t=null,nf===0&&lf(bo)),t===null&&(e.substr(Qa,3)===wo?(t=wo,Qa+=3):(t=null,nf===0&&lf(Eo)),t===null&&(e.substr(Qa,3)===So?(t=So,Qa+=3):(t=null,nf===0&&lf(xo)),t===null&&(e.substr(Qa,3)===To?(t=To,Qa+=3):(t=null,nf===0&&lf(No)),t===null&&(e.substr(Qa,3)===Co?(t=Co,Qa+=3):(t=null,nf===0&&lf(ko)),t===null&&(e.substr(Qa,3)===Lo?(t=Lo,Qa+=3):(t=null,nf===0&&lf(Ao)),t===null&&(e.substr(Qa,3)===Oo?(t=Oo,Qa+=3):(t=null,nf===0&&lf(Mo)),t===null&&(e.substr(Qa,2)===_o?(t=_o,Qa+=2):(t=null,nf===0&&lf(Do)),t===null&&(e.substr(Qa,2)===Po?(t=Po,Qa+=2):(t=null,nf===0&&lf(Ho)),t===null&&(e.substr(Qa,2)===Bo?(t=Bo,Qa+=2):(t=null,nf===0&&lf(jo)),t===null&&(e.substr(Qa,2)===Fo?(t=Fo,Qa+=2):(t=null,nf===0&&lf(Io)),t===null&&(e.substr(Qa,2)===qo?(t=qo,Qa+=2):(t=null,nf===0&&lf(Ro)),t===null&&(e.substr(Qa,2)===Uo?(t=Uo,Qa+=2):(t=null,nf===0&&lf(zo)),t===null&&(e.substr(Qa,2)===Wo?(t=Wo,Qa+=2):(t=null,nf===0&&lf(Xo)),t===null&&(e.substr(Qa,2)===Vo?(t=Vo,Qa+=2):(t=null,nf===0&&lf($o)),t===null&&(e.substr(Qa,2)===Jo?(t=Jo,Qa+=2):(t=null,nf===0&&lf(Ko)),t===null&&(e.substr(Qa,2)===Qo?(t=Qo,Qa+=2):(t=null,nf===0&&lf(Go)),t===null&&(e.substr(Qa,2)===Yo?(t=Yo,Qa+=2):(t=null,nf===0&&lf(Zo)),t===null&&(e.substr(Qa,2)===eu?(t=eu,Qa+=2):(t=null,nf===0&&lf(tu)),t===null&&(e.substr(Qa,2)===nu?(t=nu,Qa+=2):(t=null,nf===0&&lf(ru)),t===null&&(e.substr(Qa,2)===iu?(t=iu,Qa+=2):(t=null,nf===0&&lf(su)),t===null&&(e.substr(Qa,2)===ou?(t=ou,Qa+=2):(t=null,nf===0&&lf(uu)),t===null&&(e.substr(Qa,2)===au?(t=au,Qa+=2):(t=null,nf===0&&lf(fu)),t===null&&(e.substr(Qa,2)===lu?(t=lu,Qa+=2):(t=null,nf===0&&lf(cu)),t===null&&(e.substr(Qa,2)===hu?(t=hu,Qa+=2):(t=null,nf===0&&lf(pu)),t===null&&(e.substr(Qa,2)===du?(t=du,Qa+=2):(t=null,nf===0&&lf(vu)),t===null&&(e.substr(Qa,2)===mu?(t=mu,Qa+=2):(t=null,nf===0&&lf(gu)),t===null&&(e.substr(Qa,2)===yu?(t=yu,Qa+=2):(t=null,nf===0&&lf(bu)),t===null&&(e.charCodeAt(Qa)===117?(t=wu,Qa++):(t=null,nf===0&&lf(Eu)),t===null&&(e.charCodeAt(Qa)===115?(t=Su,Qa++):(t=null,nf===0&&lf(xu)),t===null&&(e.charCodeAt(Qa)===113?(t=Tu,Qa++):(t=null,nf===0&&lf(Nu)),t===null&&(e.charCodeAt(Qa)===112?(t=Cu,Qa++):(t=null,nf===0&&lf(ku)),t===null&&(e.charCodeAt(Qa)===105?(t=Lu,Qa++):(t=null,nf===0&&lf(Au)),t===null&&(e.charCodeAt(Qa)===98?(t=Ou,Qa++):(t=null,nf===0&&lf(Mu)),t===null&&(e.charCodeAt(Qa)===97?(t=_u,Qa++):(t=null,nf===0&&lf(Du)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),nf--,t===null&&(n=null,nf===0&&lf(Fn)),t}function jl(){var t,n;return nf++,e.substr(Qa,10)===Hu?(t=Hu,Qa+=10):(t=null,nf===0&&lf(Bu)),t===null&&(e.substr(Qa,9)===ju?(t=ju,Qa+=9):(t=null,nf===0&&lf(Fu)),t===null&&(e.substr(Qa,8)===Iu?(t=Iu,Qa+=8):(t=null,nf===0&&lf(qu)),t===null&&(e.substr(Qa,11)===Ru?(t=Ru,Qa+=11):(t=null,nf===0&&lf(Uu)),t===null&&(e.substr(Qa,7)===zu?(t=zu,Qa+=7):(t=null,nf===0&&lf(Wu)),t===null&&(e.substr(Qa,5)===Xu?(t=Xu,Qa+=5):(t=null,nf===0&&lf(Vu)),t===null&&(e.substr(Qa,8)===$u?(t=$u,Qa+=8):(t=null,nf===0&&lf(Ju)),t===null&&(e.substr(Qa,9)===Ku?(t=Ku,Qa+=9):(t=null,nf===0&&lf(Qu)),t===null&&(e.substr(Qa,7)===Gu?(t=Gu,Qa+=7):(t=null,nf===0&&lf(Yu)),t===null&&(e.substr(Qa,11)===Zu?(t=Zu,Qa+=11):(t=null,nf===0&&lf(ea)),t===null&&(e.substr(Qa,5)===ta?(t=ta,Qa+=5):(t=null,nf===0&&lf(na)),t===null&&(e.substr(Qa,11)===ra?(t=ra,Qa+=11):(t=null,nf===0&&lf(ia)),t===null&&(e.substr(Qa,9)===sa?(t=sa,Qa+=9):(t=null,nf===0&&lf(oa)),t===null&&(e.substr(Qa,7)===ua?(t=ua,Qa+=7):(t=null,nf===0&&lf(aa)),t===null&&(e.substr(Qa,8)===fa?(t=fa,Qa+=8):(t= +null,nf===0&&lf(la)),t===null&&(e.substr(Qa,10)===ca?(t=ca,Qa+=10):(t=null,nf===0&&lf(ha)),t===null&&(e.substr(Qa,10)===pa?(t=pa,Qa+=10):(t=null,nf===0&&lf(da)),t===null&&(e.substr(Qa,6)===va?(t=va,Qa+=6):(t=null,nf===0&&lf(ma)),t===null&&(e.substr(Qa,5)===$i?(t=$i,Qa+=5):(t=null,nf===0&&lf(Ji)),t===null&&(e.substr(Qa,6)===ga?(t=ga,Qa+=6):(t=null,nf===0&&lf(ya)),t===null&&(e.substr(Qa,9)===ba?(t=ba,Qa+=9):(t=null,nf===0&&lf(wa)),t===null&&(e.substr(Qa,4)===Ea?(t=Ea,Qa+=4):(t=null,nf===0&&lf(Sa)),t===null&&(e.substr(Qa,9)===xa?(t=xa,Qa+=9):(t=null,nf===0&&lf(Ta)),t===null&&(e.substr(Qa,9)===Na?(t=Na,Qa+=9):(t=null,nf===0&&lf(Ca)),t===null&&(e.substr(Qa,8)===ka?(t=ka,Qa+=8):(t=null,nf===0&&lf(La)),t===null&&(e.substr(Qa,4)===Aa?(t=Aa,Qa+=4):(t=null,nf===0&&lf(Oa)),t===null&&(e.substr(Qa,7)===Ma?(t=Ma,Qa+=7):(t=null,nf===0&&lf(_a)))))))))))))))))))))))))))),nf--,t===null&&(n=null,nf===0&&lf(Pu)),t}function Fl(){var t,n;return nf++,t=Qa,e.charCodeAt(Qa)===61423?(n=Pa,Qa++):(n=null,nf===0&&lf(Ha)),n!==null&&(Ga=t,n=Ba()),n===null?(Qa=t,t=n):t=n,nf--,t===null&&(n=null,nf===0&&lf(Da)),t}function Il(){var t,n;return nf++,t=Qa,e.charCodeAt(Qa)===61438?(n=Fa,Qa++):(n=null,nf===0&&lf(Ia)),n!==null&&(Ga=t,n=Ba()),n===null?(Qa=t,t=n):t=n,nf--,t===null&&(n=null,nf===0&&lf(ja)),t}function ql(){var t,n,r;return nf++,t=Qa,e.charCodeAt(Qa)===10?(n=Ra,Qa++):(n=null,nf===0&&lf(Ua)),n!==null?(e.charCodeAt(Qa)===61439?(r=za,Qa++):(r=null,nf===0&&lf(Wa)),r!==null?(n=[n,r],t=n):(Qa=t,t=a)):(Qa=t,t=a),nf--,t===null&&(n=null,nf===0&&lf(qa)),t}function Rl(){var e,t;nf++,e=[],t=zl();if(t!==null)while(t!==null)e.push(t),t=zl();else e=a;return nf--,e===null&&(t=null,nf===0&&lf(Xa)),e}function Ul(){var e,t;nf++,e=[],t=zl();while(t!==null)e.push(t),t=zl();return nf--,e===null&&(t=null,nf===0&&lf(Va)),e}function zl(){var t,n;return nf++,Ja.test(e.charAt(Qa))?(t=e.charAt(Qa),Qa++):(t=null,nf===0&&lf(Ka)),nf--,t===null&&(n=null,nf===0&&lf($a)),t}function Wl(){var t,n,r;return t=Qa,n=Qa,nf++,r=Fl(),r===null&&(r=Il(),r===null&&(r=ql())),nf--,r===null?n=f:(Qa=n,n=a),n!==null?(e.length>Qa?(r=e.charAt(Qa),Qa++):(r=null,nf===0&&lf(Bt)),r!==null?(Ga=t,n=jt(r),n===null?(Qa=t,t=n):t=n):(Qa=t,t=a)):(Qa=t,t=a),t}function Xl(){var t,n,r;t=Qa,n=[],r=Wl();while(r!==null)n.push(r),r=Wl();return n!==null&&(n=e.substring(t,Qa)),t=n,t}function $l(e,t,n){var i=e.hash;if(n){i=i||new r.AST.HashNode([]);for(var s=0;s1?arguments[1]:{},i={start:hf},s=hf,o=[],u=function(e){var t=[],n=[];for(var i=0;i")),[a]):(a.push(new r.AST.ContentNode(">")),[a,new r.AST.ContentNode("")])},dn=function(e){return[new r.AST.ContentNode(" "),e]},vn=/^[A-Za-z.:0-9]/,mn="[A-Za-z.:0-9]",gn=function(e){return new r.AST.MustacheNode([e])},yn=function(e,t){return $l(t,"action",[["on",new r.AST.StringNode(e)]])},bn=function(e,t){var n=new r.AST.HashNode([[e,new r.AST.StringNode(t)]]),i=[new r.AST.IdNode(["bindAttr"])];return new r.AST.MustacheNode(i,n)},wn=function(e,t){var n=e+"="+'"'+t+'"';return new r.AST.ContentNode(n)},En="_",Sn='"_"',xn="-",Tn='"-"',Nn="%",Cn='"%"',kn="#",Ln='"#"',An=function(e){return e},On="CSSIdentifier",Mn=function(e,t){return e+t},_n=/^[_a-zA-Z0-9\-]/,Dn="[_a-zA-Z0-9\\-]",Pn=/^[_a-zA-Z]/,Hn="[_a-zA-Z]",Bn=/^[\x80-\xFF]/,jn="[\\x80-\\xFF]",Fn="KnownHTMLTagName",In=/^[:_a-zA-Z0-9\-]/,qn="[:_a-zA-Z0-9\\-]",Rn="figcaption",Un='"figcaption"',zn="blockquote",Wn='"blockquote"',Xn="plaintext",Vn='"plaintext"',$n="textarea",Jn='"textarea"',Kn="progress",Qn='"progress"',Gn="optgroup",Yn='"optgroup"',Zn="noscript",er='"noscript"',tr="noframes",nr='"noframes"',rr="frameset",ir='"frameset"',sr="fieldset",or='"fieldset"',ur="datalist",ar='"datalist"',fr="colgroup",lr='"colgroup"',cr="basefont",hr='"basefont"',pr="summary",dr='"summary"',vr="section",mr='"section"',gr="marquee",yr='"marquee"',br="listing",wr='"listing"',Er="isindex",Sr='"isindex"',xr="details",Tr='"details"',Nr="command",Cr='"command"',kr="caption",Lr='"caption"',Ar="bgsound",Or='"bgsound"',Mr="article",_r='"article"',Dr="address",Pr='"address"',Hr="acronym",Br='"acronym"',jr="strong",Fr='"strong"',Ir="strike",qr='"strike"',Rr="spacer",Ur='"spacer"',zr="source",Wr='"source"',Xr="select",Vr='"select"',$r="script",Jr='"script"',Kr="output",Qr='"output"',Gr="option",Yr='"option"',Zr="object",ei='"object"',ti="legend",ni='"legend"',ri="keygen",ii='"keygen"',si="iframe",oi='"iframe"',ui="hgroup",ai='"hgroup"',fi="header",li='"header"',ci="footer",hi='"footer"',pi="figure",di='"figure"',vi="center",mi='"center"',gi="canvas",yi='"canvas"',bi="button",wi='"button"',Ei="applet",Si='"applet"',xi="video",Ti='"video"',Ni="track",Ci='"track"',ki="title",Li='"title"',Ai="thead",Oi='"thead"',Mi="tfoot",_i='"tfoot"',Di="tbody",Pi='"tbody"',Hi="table",Bi='"table"',ji="style",Fi='"style"',Ii="small",qi='"small"',Ri="param",Ui='"param"',zi="meter",Wi='"meter"',Xi="label",Vi='"label"',$i="input",Ji='"input"',Ki="frame",Qi='"frame"',Gi="embed",Yi='"embed"',Zi="blink",es='"blink"',ts="audio",ns='"audio"',rs="aside",is='"aside"',ss="time",os='"time"',us="span",as='"span"',fs="samp",ls='"samp"',cs="ruby",hs='"ruby"',ps="nobr",ds='"nobr"',vs="meta",ms='"meta"',gs="menu",ys='"menu"',bs="mark",ws='"mark"',Es="main",Ss='"main"',xs="link",Ts='"link"',Ns="html",Cs='"html"',ks="head",Ls='"head"',As="form",Os='"form"',Ms="font",_s='"font"',Ds="data",Ps='"data"',Hs="code",Bs='"code"',js="cite",Fs='"cite"',Is="body",qs='"body"',Rs="base",Us='"base"',zs="area",Ws='"area"',Xs="abbr",Vs='"abbr"',$s="xmp",Js='"xmp"',Ks="wbr",Qs='"wbr"',Gs="var",Ys='"var"',Zs="sup",eo='"sup"',to="sub",no='"sub"',ro="pre",io='"pre"',so="nav",oo='"nav"',uo="map",ao='"map"',fo="kbd",lo='"kbd"',co="ins",ho='"ins"',po="img",vo='"img"',mo="div",go='"div"',yo="dir",bo='"dir"',wo="dfn",Eo='"dfn"',So="del",xo='"del"',To="col",No='"col"',Co="big",ko='"big"',Lo="bdo",Ao='"bdo"',Oo="bdi",Mo='"bdi"',_o="ul",Do='"ul"',Po="tt",Ho='"tt"',Bo="tr",jo='"tr"',Fo="th",Io='"th"',qo="td",Ro='"td"',Uo="rt",zo='"rt"',Wo="rp",Xo='"rp"',Vo="ol",$o='"ol"',Jo="li",Ko='"li"',Qo="hr",Go='"hr"',Yo="h6",Zo='"h6"',eu="h5",tu='"h5"',nu="h4",ru='"h4"',iu="h3",su='"h3"',ou="h2",uu='"h2"',au="h1",fu='"h1"',lu="em",cu='"em"',hu="dt",pu='"dt"',du="dl",vu='"dl"',mu="dd",gu='"dd"',yu="br",bu='"br"',wu="u",Eu='"u"',Su="s",xu='"s"',Tu="q",Nu='"q"',Cu="p",ku='"p"',Lu="i",Au='"i"',Ou="b",Mu='"b"',_u="a",Du='"a"',Pu="a JS event",Hu="touchStart",Bu='"touchStart"',ju="touchMove",Fu='"touchMove"',Iu="touchEnd",qu='"touchEnd"',Ru="touchCancel",Uu='"touchCancel"',zu="keyDown",Wu='"keyDown"',Xu="keyUp",Vu='"keyUp"',$u="keyPress",Ju='"keyPress"',Ku="mouseDown",Qu='"mouseDown"',Gu="mouseUp",Yu='"mouseUp"',Zu="contextMenu",ea='"contextMenu"',ta="click",na='"click"',ra="doubleClick",ia='"doubleClick"',sa="mouseMove",oa='"mouseMove"',ua="focusIn",aa='"focusIn"',fa="focusOut",la='"focusOut"',ca="mouseEnter",ha='"mouseEnter"',pa="mouseLeave",da='"mouseLeave"',va="submit",ma='"submit"',ga="change",ya='"change"',ba="dragStart",wa='"dragStart"',Ea="drag",Sa='"drag"',xa="dragEnter",Ta='"dragEnter"',Na="dragLeave",Ca='"dragLeave"',ka="dragOver",La='"dragOver"',Aa="drop",Oa='"drop"',Ma="dragEnd",_a='"dragEnd"',Da="INDENT",Pa="",Ha='"\\uEFEF"',Ba=function(){return""},ja="DEDENT",Fa="",Ia='"\\uEFFE"',qa="LineEnd",Ra="\n",Ua='"\\n"',za="",Wa='"\\uEFFF"',Xa="RequiredWhitespace",Va="OptionalWhitespace",$a="InlineWhitespace",Ja=/^[ \t]/,Ka="[ \\t]",Qa=0,Ga=0,Ya=0,Za={line:1,column:1,seenCR:!1},ef=0,tf=[],nf=0,rf;if("startRule"in n){if(!(n.startRule in i))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=i[n.startRule]}var Vl={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};rf=s();if(rf!==null&&Qa===e.length)return rf;throw cf(tf),Ga=Math.max(Qa,ef),new t(tf,Ga this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.0.3"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = "else", + peg$c3 = "\"else\"", + peg$c4 = function(c) {return c;}, + peg$c5 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c6 = [], + peg$c7 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c8 = ">", + peg$c9 = "\">\"", + peg$c10 = function(n, p) { return new AST.PartialNode(n, p); }, + peg$c11 = /^[a-zA-Z0-9_$-\/]/, + peg$c12 = "[a-zA-Z0-9_$-\\/]", + peg$c13 = function(s) { return new AST.PartialNameNode(s); }, + peg$c14 = function(m) { + return [m]; + }, + peg$c15 = "/", + peg$c16 = "\"/\"", + peg$c17 = function() { return []; }, + peg$c18 = /^[A-Z]/, + peg$c19 = "[A-Z]", + peg$c20 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c21 = function(h, c) { + var ret = h[0]; + if(c) { + ret = ret.concat(c[1]); + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c22 = " ", + peg$c23 = "\" \"", + peg$c24 = function(h, c, multilineContent) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(c) { + ret = ret.concat(c); + } + + if(multilineContent) { + // Handle multi-line content, e.g. + // span Hello, + // This is valid markup. + + multilineContent = multilineContent[1]; + for(var i = 0; i < multilineContent.length; ++i) { + ret = ret.concat(multilineContent[i]); + } + } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { + ret.push(h[1]); + } + + return ret; + }, + peg$c25 = function(mustacheNode, block) { + if(!block) return mustacheNode; + var programNode = block[1]; + return new AST.BlockNode(mustacheNode, programNode, programNode.inverse, mustacheNode.id); + }, + peg$c26 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c27 = function(path, tm, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + if(tm == '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm == '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm == '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c28 = function(p, m) { + var ret = new String(p); + ret.trailingModifier = m; + return ret; + }, + peg$c29 = function(t) { return ['tagName', t]; }, + peg$c30 = function(i) { return ['elementId', i]; }, + peg$c31 = function(c) { return ['class', c]; }, + peg$c32 = function(id, classes) { return [id, classes]; }, + peg$c33 = function(classes) { return [null, classes]; }, + peg$c34 = function(h) { return h; }, + peg$c35 = "TrailingModifier", + peg$c36 = /^[!?*\^]/, + peg$c37 = "[!?*\\^]", + peg$c38 = function(h) { return new AST.HashNode(h); }, + peg$c39 = "PathIdent", + peg$c40 = "..", + peg$c41 = "\"..\"", + peg$c42 = ".", + peg$c43 = "\".\"", + peg$c44 = /^[a-zA-Z0-9_$\-]/, + peg$c45 = "[a-zA-Z0-9_$\\-]", + peg$c46 = "=", + peg$c47 = "\"=\"", + peg$c48 = function(s) { return s; }, + peg$c49 = "Key", + peg$c50 = function(h) { return [h[0], h[2]]; }, + peg$c51 = function(p) { return p; }, + peg$c52 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c53 = "PathSeparator", + peg$c54 = /^[\/.]/, + peg$c55 = "[\\/.]", + peg$c56 = function(v) { return new AST.IdNode(v); }, + peg$c57 = function(v) { return new AST.StringNode(v); }, + peg$c58 = function(v) { return new AST.IntegerNode(v); }, + peg$c59 = function(v) { return new AST.BooleanNode(v); }, + peg$c60 = "Boolean", + peg$c61 = "true", + peg$c62 = "\"true\"", + peg$c63 = "false", + peg$c64 = "\"false\"", + peg$c65 = "Integer", + peg$c66 = /^[0-9]/, + peg$c67 = "[0-9]", + peg$c68 = function(s) { return parseInt(s); }, + peg$c69 = "\"", + peg$c70 = "\"\\\"\"", + peg$c71 = "'", + peg$c72 = "\"'\"", + peg$c73 = function(p) { return p[1]; }, + peg$c74 = /^[^"}]/, + peg$c75 = "[^\"}]", + peg$c76 = /^[^'}]/, + peg$c77 = "[^'}]", + peg$c78 = /^[A-Za-z]/, + peg$c79 = "[A-Za-z]", + peg$c80 = function(m) { return [m]; }, + peg$c81 = "|", + peg$c82 = "\"|\"", + peg$c83 = "<", + peg$c84 = "\"<\"", + peg$c85 = function(nodes, indentedNodes) { + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + nodes = nodes.concat(indentedNodes[i]); + } + } + return nodes; + }, + peg$c86 = function(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + }, + peg$c87 = function(m) { m.escaped = true; return m; }, + peg$c88 = function(m) { m.escaped = false; return m; }, + peg$c89 = function(a) { return new AST.ContentNode(a.join('')); }, + peg$c90 = "any character", + peg$c91 = function(c) { return c; }, + peg$c92 = "SingleMustacheOpen", + peg$c93 = "{", + peg$c94 = "\"{\"", + peg$c95 = "DoubleMustacheOpen", + peg$c96 = "{{", + peg$c97 = "\"{{\"", + peg$c98 = "TripleMustacheOpen", + peg$c99 = "{{{", + peg$c100 = "\"{{{\"", + peg$c101 = "SingleMustacheClose", + peg$c102 = "}", + peg$c103 = "\"}\"", + peg$c104 = "DoubleMustacheClose", + peg$c105 = "}}", + peg$c106 = "\"}}\"", + peg$c107 = "TripleMustacheClose", + peg$c108 = "}}}", + peg$c109 = "\"}}}\"", + peg$c110 = "InterpolationOpen", + peg$c111 = "#{", + peg$c112 = "\"#{\"", + peg$c113 = "InterpolationClose", + peg$c114 = "==", + peg$c115 = "\"==\"", + peg$c116 = function() { return false; }, + peg$c117 = function() { return true; }, + peg$c118 = function(h, s, m, f) { return [h, s, m, f]; }, + peg$c119 = function(s, m, f) { return [null, s, m, f] }, + peg$c120 = function(h) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + inTagMustaches = h[2], + fullAttributes = h[3], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c121 = function(a) { + return [new AST.ContentNode(' '), a]; + }, + peg$c122 = /^[A-Za-z.:0-9]/, + peg$c123 = "[A-Za-z.:0-9]", + peg$c124 = function(id) { return new AST.MustacheNode([id]); }, + peg$c125 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]]); + }, + peg$c126 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + + return new AST.MustacheNode(params, hashNode); + }, + peg$c127 = function(key, value) { + var s = key + '=' + '"' + value + '"'; + return new AST.ContentNode(s); + }, + peg$c128 = "_", + peg$c129 = "\"_\"", + peg$c130 = "-", + peg$c131 = "\"-\"", + peg$c132 = "%", + peg$c133 = "\"%\"", + peg$c134 = "#", + peg$c135 = "\"#\"", + peg$c136 = function(c) { return c;}, + peg$c137 = "CSSIdentifier", + peg$c138 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c139 = /^[_a-zA-Z0-9\-]/, + peg$c140 = "[_a-zA-Z0-9\\-]", + peg$c141 = /^[_a-zA-Z]/, + peg$c142 = "[_a-zA-Z]", + peg$c143 = /^[\x80-\xFF]/, + peg$c144 = "[\\x80-\\xFF]", + peg$c145 = "KnownHTMLTagName", + peg$c146 = /^[:_a-zA-Z0-9\-]/, + peg$c147 = "[:_a-zA-Z0-9\\-]", + peg$c148 = "figcaption", + peg$c149 = "\"figcaption\"", + peg$c150 = "blockquote", + peg$c151 = "\"blockquote\"", + peg$c152 = "plaintext", + peg$c153 = "\"plaintext\"", + peg$c154 = "textarea", + peg$c155 = "\"textarea\"", + peg$c156 = "progress", + peg$c157 = "\"progress\"", + peg$c158 = "optgroup", + peg$c159 = "\"optgroup\"", + peg$c160 = "noscript", + peg$c161 = "\"noscript\"", + peg$c162 = "noframes", + peg$c163 = "\"noframes\"", + peg$c164 = "frameset", + peg$c165 = "\"frameset\"", + peg$c166 = "fieldset", + peg$c167 = "\"fieldset\"", + peg$c168 = "datalist", + peg$c169 = "\"datalist\"", + peg$c170 = "colgroup", + peg$c171 = "\"colgroup\"", + peg$c172 = "basefont", + peg$c173 = "\"basefont\"", + peg$c174 = "summary", + peg$c175 = "\"summary\"", + peg$c176 = "section", + peg$c177 = "\"section\"", + peg$c178 = "marquee", + peg$c179 = "\"marquee\"", + peg$c180 = "listing", + peg$c181 = "\"listing\"", + peg$c182 = "isindex", + peg$c183 = "\"isindex\"", + peg$c184 = "details", + peg$c185 = "\"details\"", + peg$c186 = "command", + peg$c187 = "\"command\"", + peg$c188 = "caption", + peg$c189 = "\"caption\"", + peg$c190 = "bgsound", + peg$c191 = "\"bgsound\"", + peg$c192 = "article", + peg$c193 = "\"article\"", + peg$c194 = "address", + peg$c195 = "\"address\"", + peg$c196 = "acronym", + peg$c197 = "\"acronym\"", + peg$c198 = "strong", + peg$c199 = "\"strong\"", + peg$c200 = "strike", + peg$c201 = "\"strike\"", + peg$c202 = "spacer", + peg$c203 = "\"spacer\"", + peg$c204 = "source", + peg$c205 = "\"source\"", + peg$c206 = "select", + peg$c207 = "\"select\"", + peg$c208 = "script", + peg$c209 = "\"script\"", + peg$c210 = "output", + peg$c211 = "\"output\"", + peg$c212 = "option", + peg$c213 = "\"option\"", + peg$c214 = "object", + peg$c215 = "\"object\"", + peg$c216 = "legend", + peg$c217 = "\"legend\"", + peg$c218 = "keygen", + peg$c219 = "\"keygen\"", + peg$c220 = "iframe", + peg$c221 = "\"iframe\"", + peg$c222 = "hgroup", + peg$c223 = "\"hgroup\"", + peg$c224 = "header", + peg$c225 = "\"header\"", + peg$c226 = "footer", + peg$c227 = "\"footer\"", + peg$c228 = "figure", + peg$c229 = "\"figure\"", + peg$c230 = "center", + peg$c231 = "\"center\"", + peg$c232 = "canvas", + peg$c233 = "\"canvas\"", + peg$c234 = "button", + peg$c235 = "\"button\"", + peg$c236 = "applet", + peg$c237 = "\"applet\"", + peg$c238 = "video", + peg$c239 = "\"video\"", + peg$c240 = "track", + peg$c241 = "\"track\"", + peg$c242 = "title", + peg$c243 = "\"title\"", + peg$c244 = "thead", + peg$c245 = "\"thead\"", + peg$c246 = "tfoot", + peg$c247 = "\"tfoot\"", + peg$c248 = "tbody", + peg$c249 = "\"tbody\"", + peg$c250 = "table", + peg$c251 = "\"table\"", + peg$c252 = "style", + peg$c253 = "\"style\"", + peg$c254 = "small", + peg$c255 = "\"small\"", + peg$c256 = "param", + peg$c257 = "\"param\"", + peg$c258 = "meter", + peg$c259 = "\"meter\"", + peg$c260 = "label", + peg$c261 = "\"label\"", + peg$c262 = "input", + peg$c263 = "\"input\"", + peg$c264 = "frame", + peg$c265 = "\"frame\"", + peg$c266 = "embed", + peg$c267 = "\"embed\"", + peg$c268 = "blink", + peg$c269 = "\"blink\"", + peg$c270 = "audio", + peg$c271 = "\"audio\"", + peg$c272 = "aside", + peg$c273 = "\"aside\"", + peg$c274 = "time", + peg$c275 = "\"time\"", + peg$c276 = "span", + peg$c277 = "\"span\"", + peg$c278 = "samp", + peg$c279 = "\"samp\"", + peg$c280 = "ruby", + peg$c281 = "\"ruby\"", + peg$c282 = "nobr", + peg$c283 = "\"nobr\"", + peg$c284 = "meta", + peg$c285 = "\"meta\"", + peg$c286 = "menu", + peg$c287 = "\"menu\"", + peg$c288 = "mark", + peg$c289 = "\"mark\"", + peg$c290 = "main", + peg$c291 = "\"main\"", + peg$c292 = "link", + peg$c293 = "\"link\"", + peg$c294 = "html", + peg$c295 = "\"html\"", + peg$c296 = "head", + peg$c297 = "\"head\"", + peg$c298 = "form", + peg$c299 = "\"form\"", + peg$c300 = "font", + peg$c301 = "\"font\"", + peg$c302 = "data", + peg$c303 = "\"data\"", + peg$c304 = "code", + peg$c305 = "\"code\"", + peg$c306 = "cite", + peg$c307 = "\"cite\"", + peg$c308 = "body", + peg$c309 = "\"body\"", + peg$c310 = "base", + peg$c311 = "\"base\"", + peg$c312 = "area", + peg$c313 = "\"area\"", + peg$c314 = "abbr", + peg$c315 = "\"abbr\"", + peg$c316 = "xmp", + peg$c317 = "\"xmp\"", + peg$c318 = "wbr", + peg$c319 = "\"wbr\"", + peg$c320 = "var", + peg$c321 = "\"var\"", + peg$c322 = "sup", + peg$c323 = "\"sup\"", + peg$c324 = "sub", + peg$c325 = "\"sub\"", + peg$c326 = "pre", + peg$c327 = "\"pre\"", + peg$c328 = "nav", + peg$c329 = "\"nav\"", + peg$c330 = "map", + peg$c331 = "\"map\"", + peg$c332 = "kbd", + peg$c333 = "\"kbd\"", + peg$c334 = "ins", + peg$c335 = "\"ins\"", + peg$c336 = "img", + peg$c337 = "\"img\"", + peg$c338 = "div", + peg$c339 = "\"div\"", + peg$c340 = "dir", + peg$c341 = "\"dir\"", + peg$c342 = "dfn", + peg$c343 = "\"dfn\"", + peg$c344 = "del", + peg$c345 = "\"del\"", + peg$c346 = "col", + peg$c347 = "\"col\"", + peg$c348 = "big", + peg$c349 = "\"big\"", + peg$c350 = "bdo", + peg$c351 = "\"bdo\"", + peg$c352 = "bdi", + peg$c353 = "\"bdi\"", + peg$c354 = "ul", + peg$c355 = "\"ul\"", + peg$c356 = "tt", + peg$c357 = "\"tt\"", + peg$c358 = "tr", + peg$c359 = "\"tr\"", + peg$c360 = "th", + peg$c361 = "\"th\"", + peg$c362 = "td", + peg$c363 = "\"td\"", + peg$c364 = "rt", + peg$c365 = "\"rt\"", + peg$c366 = "rp", + peg$c367 = "\"rp\"", + peg$c368 = "ol", + peg$c369 = "\"ol\"", + peg$c370 = "li", + peg$c371 = "\"li\"", + peg$c372 = "hr", + peg$c373 = "\"hr\"", + peg$c374 = "h6", + peg$c375 = "\"h6\"", + peg$c376 = "h5", + peg$c377 = "\"h5\"", + peg$c378 = "h4", + peg$c379 = "\"h4\"", + peg$c380 = "h3", + peg$c381 = "\"h3\"", + peg$c382 = "h2", + peg$c383 = "\"h2\"", + peg$c384 = "h1", + peg$c385 = "\"h1\"", + peg$c386 = "em", + peg$c387 = "\"em\"", + peg$c388 = "dt", + peg$c389 = "\"dt\"", + peg$c390 = "dl", + peg$c391 = "\"dl\"", + peg$c392 = "dd", + peg$c393 = "\"dd\"", + peg$c394 = "br", + peg$c395 = "\"br\"", + peg$c396 = "u", + peg$c397 = "\"u\"", + peg$c398 = "s", + peg$c399 = "\"s\"", + peg$c400 = "q", + peg$c401 = "\"q\"", + peg$c402 = "p", + peg$c403 = "\"p\"", + peg$c404 = "i", + peg$c405 = "\"i\"", + peg$c406 = "b", + peg$c407 = "\"b\"", + peg$c408 = "a", + peg$c409 = "\"a\"", + peg$c410 = "a JS event", + peg$c411 = "touchStart", + peg$c412 = "\"touchStart\"", + peg$c413 = "touchMove", + peg$c414 = "\"touchMove\"", + peg$c415 = "touchEnd", + peg$c416 = "\"touchEnd\"", + peg$c417 = "touchCancel", + peg$c418 = "\"touchCancel\"", + peg$c419 = "keyDown", + peg$c420 = "\"keyDown\"", + peg$c421 = "keyUp", + peg$c422 = "\"keyUp\"", + peg$c423 = "keyPress", + peg$c424 = "\"keyPress\"", + peg$c425 = "mouseDown", + peg$c426 = "\"mouseDown\"", + peg$c427 = "mouseUp", + peg$c428 = "\"mouseUp\"", + peg$c429 = "contextMenu", + peg$c430 = "\"contextMenu\"", + peg$c431 = "click", + peg$c432 = "\"click\"", + peg$c433 = "doubleClick", + peg$c434 = "\"doubleClick\"", + peg$c435 = "mouseMove", + peg$c436 = "\"mouseMove\"", + peg$c437 = "focusIn", + peg$c438 = "\"focusIn\"", + peg$c439 = "focusOut", + peg$c440 = "\"focusOut\"", + peg$c441 = "mouseEnter", + peg$c442 = "\"mouseEnter\"", + peg$c443 = "mouseLeave", + peg$c444 = "\"mouseLeave\"", + peg$c445 = "submit", + peg$c446 = "\"submit\"", + peg$c447 = "change", + peg$c448 = "\"change\"", + peg$c449 = "dragStart", + peg$c450 = "\"dragStart\"", + peg$c451 = "drag", + peg$c452 = "\"drag\"", + peg$c453 = "dragEnter", + peg$c454 = "\"dragEnter\"", + peg$c455 = "dragLeave", + peg$c456 = "\"dragLeave\"", + peg$c457 = "dragOver", + peg$c458 = "\"dragOver\"", + peg$c459 = "drop", + peg$c460 = "\"drop\"", + peg$c461 = "dragEnd", + peg$c462 = "\"dragEnd\"", + peg$c463 = "INDENT", + peg$c464 = "\uEFEF", + peg$c465 = "\"\\uEFEF\"", + peg$c466 = function() { return ''; }, + peg$c467 = "DEDENT", + peg$c468 = "\uEFFE", + peg$c469 = "\"\\uEFFE\"", + peg$c470 = "LineEnd", + peg$c471 = "\n", + peg$c472 = "\"\\n\"", + peg$c473 = "\uEFFF", + peg$c474 = "\"\\uEFFF\"", + peg$c475 = "RequiredWhitespace", + peg$c476 = "OptionalWhitespace", + peg$c477 = "InlineWhitespace", + peg$c478 = /^[ \t]/, + peg$c479 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + if (input.substr(peg$currPos, 4) === peg$c2) { + s4 = peg$c2; + peg$currPos += 4; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c3); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseINDENT(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c4(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c5(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0; + + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c8; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsepath(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c10(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c11.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c12); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c11.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c12); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c13(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0; + + s0 = peg$parsehtmlElementMaybeBlock(); + if (s0 === null) { + s0 = peg$parsehtmlElementWithInlineContent(); + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c14(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c15; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c16); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = []; + s7 = peg$currPos; + s8 = peg$parselineContent(); + if (s8 !== null) { + s9 = peg$parseTERM(); + if (s9 !== null) { + s8 = [s8, s9]; + s7 = s8; + } else { + peg$currPos = s7; + s7 = peg$c0; + } + } else { + peg$currPos = s7; + s7 = peg$c0; + } + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$currPos; + s8 = peg$parselineContent(); + if (s8 !== null) { + s9 = peg$parseTERM(); + if (s9 !== null) { + s8 = [s8, s9]; + s7 = s8; + } else { + peg$currPos = s7; + s7 = peg$c0; + } + } else { + peg$currPos = s7; + s7 = peg$c0; + } + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheMaybeBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c18.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c19); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c20(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = peg$parsecontent(); + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlElementWithInlineContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagAndOptionalAttributes(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c22; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s2 !== null) { + s3 = peg$parsehtmlInlineContent(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsetextNodes(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsetextNodes(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheMaybeBlock() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$currPos; + s5 = peg$parseINDENT(); + if (s5 !== null) { + s6 = peg$parseinvertibleContent(); + if (s6 !== null) { + s7 = peg$parseDEDENT(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c25(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheMaybeBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c26(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = peg$parsetrailingModifier(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = []; + s4 = peg$parseinMustacheParam(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinMustacheParam(); + } + if (s3 !== null) { + s4 = peg$parsehash(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s1,s2,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemodifiedParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseparam(); + if (s1 !== null) { + s2 = peg$parsetrailingModifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetrailingModifier() { + var s0, s1; + + peg$silentFails++; + if (peg$c36.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c40) { + s0 = peg$c40; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c42; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c44.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c46; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c48(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c46; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c51(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c51(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c54.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c59(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c61) { + s0 = peg$c61; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c63) { + s0 = peg$c63; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c66.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c66.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c68(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c71; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c71; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c74.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c78.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + + return s0; + } + + function peg$parsehtmlInlineContent() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c22; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseINDENT(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsetextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsetextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsepreMustacheUnit(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsepreMustacheUnit(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsetripleOpen(); + if (s2 === null) { + s2 = peg$parsedoubleOpen(); + if (s2 === null) { + s2 = peg$parsehashStacheOpen(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c93; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c96) { + s0 = peg$c96; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c99) { + s0 = peg$c99; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c102; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c105) { + s0 = peg$c105; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c108) { + s0 = peg$c108; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c111) { + s0 = peg$c111; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c102; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c114) { + s1 = peg$c114; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c22; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c116(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c46; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c22; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlTagAndOptionalAttributes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsehtmlTagName(); + if (s2 !== null) { + s3 = peg$parseshorthandAttributes(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseinTagMustache(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinTagMustache(); + } + if (s4 !== null) { + s5 = []; + s6 = peg$parsefullAttribute(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsefullAttribute(); + } + if (s5 !== null) { + peg$reportedPos = s1; + s2 = peg$c118(s2,s3,s4,s5); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseshorthandAttributes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s1; + s2 = peg$c119(s2,s3,s4); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c120(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c22; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c22; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueText() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (peg$c122.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (peg$c122.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c69; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c69; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c71; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c71; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c46; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c46; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValueText(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c46; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s2 !== null) { + s3 = peg$parsestring(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c66.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c128; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c132; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c134; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c42; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c139.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c141.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c143.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3, s4; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c132; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsetagChar(); + if (s4 !== null) { + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsetagChar(); + } + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c146.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 10) === peg$c148) { + s0 = peg$c148; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c150) { + s0 = peg$c150; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c152) { + s0 = peg$c152; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c154) { + s0 = peg$c154; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c156) { + s0 = peg$c156; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c158) { + s0 = peg$c158; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c160) { + s0 = peg$c160; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c162) { + s0 = peg$c162; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c164) { + s0 = peg$c164; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c166) { + s0 = peg$c166; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c168) { + s0 = peg$c168; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c170) { + s0 = peg$c170; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c172) { + s0 = peg$c172; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c174) { + s0 = peg$c174; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c176) { + s0 = peg$c176; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c178) { + s0 = peg$c178; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c180) { + s0 = peg$c180; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c182) { + s0 = peg$c182; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c184) { + s0 = peg$c184; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c186) { + s0 = peg$c186; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c188) { + s0 = peg$c188; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c190) { + s0 = peg$c190; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c192) { + s0 = peg$c192; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c194) { + s0 = peg$c194; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c196) { + s0 = peg$c196; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c198) { + s0 = peg$c198; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c200) { + s0 = peg$c200; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c201); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c202) { + s0 = peg$c202; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c204) { + s0 = peg$c204; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c205); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c206) { + s0 = peg$c206; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c207); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c208) { + s0 = peg$c208; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c209); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c210) { + s0 = peg$c210; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c211); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c212) { + s0 = peg$c212; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c213); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c214) { + s0 = peg$c214; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c215); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c216) { + s0 = peg$c216; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c217); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c218) { + s0 = peg$c218; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c219); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c220) { + s0 = peg$c220; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c221); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c222) { + s0 = peg$c222; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c223); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c224) { + s0 = peg$c224; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c226) { + s0 = peg$c226; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c228) { + s0 = peg$c228; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c229); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c230) { + s0 = peg$c230; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c231); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c232) { + s0 = peg$c232; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c233); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c234) { + s0 = peg$c234; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c235); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c236) { + s0 = peg$c236; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c237); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c238) { + s0 = peg$c238; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c239); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c240) { + s0 = peg$c240; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c241); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c242) { + s0 = peg$c242; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c243); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c244) { + s0 = peg$c244; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c245); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c246) { + s0 = peg$c246; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c247); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c248) { + s0 = peg$c248; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c249); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c250) { + s0 = peg$c250; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c251); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c252) { + s0 = peg$c252; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c253); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c254) { + s0 = peg$c254; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c255); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c256) { + s0 = peg$c256; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c257); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c258) { + s0 = peg$c258; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c259); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c260) { + s0 = peg$c260; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c261); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c262) { + s0 = peg$c262; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c263); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c264) { + s0 = peg$c264; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c265); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c266) { + s0 = peg$c266; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c267); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c268) { + s0 = peg$c268; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c269); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c270) { + s0 = peg$c270; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c271); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c272) { + s0 = peg$c272; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c273); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c274) { + s0 = peg$c274; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c275); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c276) { + s0 = peg$c276; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c277); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c278) { + s0 = peg$c278; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c279); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c280) { + s0 = peg$c280; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c282) { + s0 = peg$c282; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c283); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c284) { + s0 = peg$c284; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c285); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c286) { + s0 = peg$c286; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c287); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c288) { + s0 = peg$c288; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c289); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c290) { + s0 = peg$c290; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c291); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c292) { + s0 = peg$c292; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c293); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c294) { + s0 = peg$c294; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c295); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c296) { + s0 = peg$c296; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c297); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c298) { + s0 = peg$c298; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c299); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c300) { + s0 = peg$c300; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c301); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c302) { + s0 = peg$c302; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c303); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c304) { + s0 = peg$c304; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c305); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c306) { + s0 = peg$c306; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c307); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c308) { + s0 = peg$c308; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c309); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c310) { + s0 = peg$c310; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c311); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c312) { + s0 = peg$c312; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c313); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c314) { + s0 = peg$c314; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c315); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c316) { + s0 = peg$c316; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c317); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c318) { + s0 = peg$c318; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c319); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c320) { + s0 = peg$c320; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c321); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c322) { + s0 = peg$c322; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c323); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c324) { + s0 = peg$c324; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c325); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c326) { + s0 = peg$c326; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c327); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c328) { + s0 = peg$c328; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c329); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c330) { + s0 = peg$c330; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c331); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c332) { + s0 = peg$c332; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c333); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c334) { + s0 = peg$c334; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c335); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c336) { + s0 = peg$c336; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c337); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c338) { + s0 = peg$c338; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c339); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c340) { + s0 = peg$c340; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c341); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c342) { + s0 = peg$c342; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c343); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c344) { + s0 = peg$c344; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c345); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c346) { + s0 = peg$c346; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c347); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c348) { + s0 = peg$c348; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c349); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c350) { + s0 = peg$c350; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c351); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 3) === peg$c352) { + s0 = peg$c352; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c353); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c354) { + s0 = peg$c354; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c355); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c356) { + s0 = peg$c356; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c357); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c358) { + s0 = peg$c358; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c359); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c360) { + s0 = peg$c360; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c361); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c362) { + s0 = peg$c362; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c363); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c364) { + s0 = peg$c364; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c365); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c366) { + s0 = peg$c366; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c367); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c368) { + s0 = peg$c368; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c369); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c370) { + s0 = peg$c370; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c371); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c372) { + s0 = peg$c372; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c373); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c374) { + s0 = peg$c374; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c375); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c376) { + s0 = peg$c376; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c377); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c378) { + s0 = peg$c378; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c379); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c380) { + s0 = peg$c380; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c381); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c382) { + s0 = peg$c382; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c383); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c384) { + s0 = peg$c384; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c385); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c386) { + s0 = peg$c386; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c387); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c388) { + s0 = peg$c388; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c389); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c390) { + s0 = peg$c390; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c391); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c392) { + s0 = peg$c392; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c393); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c394) { + s0 = peg$c394; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c395); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 117) { + s0 = peg$c396; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c397); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 115) { + s0 = peg$c398; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c399); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 113) { + s0 = peg$c400; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c401); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 112) { + s0 = peg$c402; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c403); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 105) { + s0 = peg$c404; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c405); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 98) { + s0 = peg$c406; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c407); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 97) { + s0 = peg$c408; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c409); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 10) === peg$c411) { + s0 = peg$c411; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c412); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c413) { + s0 = peg$c413; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c414); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c415) { + s0 = peg$c415; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c416); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c417) { + s0 = peg$c417; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c418); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c419) { + s0 = peg$c419; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c420); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c421) { + s0 = peg$c421; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c422); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c423) { + s0 = peg$c423; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c424); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c425) { + s0 = peg$c425; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c426); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c427) { + s0 = peg$c427; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c428); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c429) { + s0 = peg$c429; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c430); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c431) { + s0 = peg$c431; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c432); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 11) === peg$c433) { + s0 = peg$c433; + peg$currPos += 11; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c434); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c435) { + s0 = peg$c435; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c436); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c437) { + s0 = peg$c437; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c438); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c439) { + s0 = peg$c439; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c440); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c441) { + s0 = peg$c441; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c442); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 10) === peg$c443) { + s0 = peg$c443; + peg$currPos += 10; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c444); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c445) { + s0 = peg$c445; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c446); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c262) { + s0 = peg$c262; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c263); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 6) === peg$c447) { + s0 = peg$c447; + peg$currPos += 6; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c448); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c449) { + s0 = peg$c449; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c450); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c451) { + s0 = peg$c451; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c452); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c453) { + s0 = peg$c453; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c454); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 9) === peg$c455) { + s0 = peg$c455; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c456); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 8) === peg$c457) { + s0 = peg$c457; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c458); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 4) === peg$c459) { + s0 = peg$c459; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c460); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 7) === peg$c461) { + s0 = peg$c461; + peg$currPos += 7; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c462); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c410); } + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c464; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c465); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c466(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c463); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c468; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c469); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c466(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c467); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 10) { + s1 = peg$c471; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c472); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c473; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c474); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c470); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + if (s1 !== null) { + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + } else { + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c475); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c476); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c478.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c479); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c477); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, indent, lines, message, newIndent, tok; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (newIndent = this.discard(RegExp("[" + ws + "]+"))) { + this.indents.push(newIndent); + this.context.observe(INDENT); + this.p(INDENT); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (newIndent = this.discard(RegExp("(" + indent + "[" + ws + "]+)"))) { + this.indents.push(newIndent); + this.context.observe(INDENT); + this.p(INDENT); + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (this.ss.check(RegExp("[" + ws + "]+"))) { + lines = this.ss.str.substr(0, this.ss.pos).split(/\n/) || ['']; + message = "Invalid indentation"; + Emblem.throwCompileError(lines.length, message); + } + } + } + } + this.scan(/[^\n\\]+/); + if (tok = this.discard(/\//)) { + this.context.observe(tok); + } else if (this.scan(/\n/)) { + this.p("" + TERM); + } + this.discard(any_whitespaceFollowedByNewlines_); + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.enableEmber(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.1.6/emblem.min.js b/ajax/libs/emblem/0.1.6/emblem.min.js new file mode 100644 index 000000000..59f06115c --- /dev/null +++ b/ajax/libs/emblem/0.1.6/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.0.3",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function cf(){return e.substring(rf,nf)}function hf(){return rf}function pf(){return vf(rf).line}function df(){return vf(rf).column}function vf(t){function n(t,n){var r,i;for(r=0;rt&&(sf=0,of={line:1,column:1,seenCR:!1}),sf=t,n(of,sf)),of}function mf(e){if(nfuf&&(uf=nf,af=[]),af.push(e)}function gf(e){var t=0;e.sort();while(tnf?(r=e.charAt(nf),nf++):(r=null,ff===0&&mf(Ut)),r!==null?(rf=t,n=zt(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function pl(){var e;return e=al(),e===null&&(e=ll(),e===null&&(e=fl())),e}function dl(){var t,n;return ff++,e.charCodeAt(nf)===123?(t=Xt,nf++):(t=null,ff===0&&mf(Vt)),ff--,t===null&&(n=null,ff===0&&mf(Wt)),t}function vl(){var t,n;return ff++,e.substr(nf,2)===Jt?(t=Jt,nf+=2):(t=null,ff===0&&mf(Kt)),ff--,t===null&&(n=null,ff===0&&mf($t)),t}function ml(){var t,n;return ff++,e.substr(nf,3)===Gt?(t=Gt,nf+=3):(t=null,ff===0&&mf(Yt)),ff--,t===null&&(n=null,ff===0&&mf(Qt)),t}function gl(){var t,n;return ff++,e.charCodeAt(nf)===125?(t=en,nf++):(t=null,ff===0&&mf(tn)),ff--,t===null&&(n=null,ff===0&&mf(Zt)),t}function yl(){var t,n;return ff++,e.substr(nf,2)===rn?(t=rn,nf+=2):(t=null,ff===0&&mf(sn)),ff--,t===null&&(n=null,ff===0&&mf(nn)),t}function bl(){var t,n;return ff++,e.substr(nf,3)===un?(t=un,nf+=3):(t=null,ff===0&&mf(an)),ff--,t===null&&(n=null,ff===0&&mf(on)),t}function wl(){var t,n;return ff++,e.substr(nf,2)===ln?(t=ln,nf+=2):(t=null,ff===0&&mf(cn)),ff--,t===null&&(n=null,ff===0&&mf(fn)),t}function El(){var t,n;return ff++,e.charCodeAt(nf)===125?(t=en,nf++):(t=null,ff===0&&mf(tn)),ff--,t===null&&(n=null,ff===0&&mf(hn)),t}function Sl(){var t,n,r;return t=nf,e.substr(nf,2)===pn?(n=pn,nf+=2):(n=null,ff===0&&mf(dn)),n!==null?(e.charCodeAt(nf)===32?(r=L,nf++):(r=null,ff===0&&mf(A)),r===null&&(r=u),r!==null?(rf=t,n=vn(),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t===null&&(t=nf,e.charCodeAt(nf)===61?(n=Y,nf++):(n=null,ff===0&&mf(Z)),n!==null?(e.charCodeAt(nf)===32?(r=L,nf++):(r=null,ff===0&&mf(A)),r===null&&(r=u),r!==null?(rf=t,n=mn(),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o)),t}function xl(){var e,t,n,r,i,s,a;e=nf,t=nf,n=Ul();if(n!==null){r=Bf(),r===null&&(r=u);if(r!==null){i=[],s=pl();while(s!==null)i.push(s),s=pl();if(i!==null){s=[],a=Tl();while(a!==null)s.push(a),a=Tl();s!==null?(rf=t,n=gn(n,r,i,s),n===null?(nf=t,t=n):t=n):(nf=t,t=o)}else nf=t,t=o}else nf=t,t=o}else nf=t,t=o;if(t===null){t=nf,n=Bf();if(n!==null){r=[],i=pl();while(i!==null)r.push(i),i=pl();if(r!==null){i=[],s=Tl();while(s!==null)i.push(s),s=Tl();i!==null?(rf=t,n=yn(n,r,i),n===null?(nf=t,t=n):t=n):(nf=t,t=o)}else nf=t,t=o}else nf=t,t=o}return t!==null&&(rf=e,t=bn(t)),t===null?(nf=e,e=t):e=t,e}function Bf(){var e;return e=jf(),e===null&&(e=Ff()),e}function jf(){var e,t,n,r;e=nf,t=Hl();if(t!==null){n=[],r=Bl();while(r!==null)n.push(r),r=Bl();n!==null?(rf=e,t=F(t,n),t===null?(nf=e,e=t):e=t):(nf=e,e=o)}else nf=e,e=o;return e}function Ff(){var e,t,n;e=nf,t=[],n=Bl();if(n!==null)while(n!==null)t.push(n),n=Bl();else t=o;return t!==null&&(rf=e,t=I(t)),t===null?(nf=e,e=t):e=t,e}function Tl(){var t,n,r;t=nf,n=[],e.charCodeAt(nf)===32?(r=L,nf++):(r=null,ff===0&&mf(A));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(nf)===32?(r=L,nf++):(r=null,ff===0&&mf(A));else n=o;return n!==null?(r=Ll(),r===null&&(r=Al(),r===null&&(r=Ol())),r!==null?(rf=t,n=wn(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function Nl(){var t,n,r;t=nf,n=[],En.test(e.charAt(nf))?(r=e.charAt(nf),nf++):(r=null,ff===0&&mf(Sn));if(r!==null)while(r!==null)n.push(r),En.test(e.charAt(nf))?(r=e.charAt(nf),nf++):(r=null,ff===0&&mf(Sn));else n=o;return n!==null&&(n=e.substring(t,nf)),t=n,t}function Cl(){var e,t;return e=kl(),e===null&&(e=nf,t=Jf(),t!==null&&(rf=e,t=xn(t)),t===null?(nf=e,e=t):e=t),e}function kl(){var t,n,r,i,s;return t=nf,n=nf,e.charCodeAt(nf)===34?(r=Et,nf++):(r=null,ff===0&&mf(St)),r!==null?(i=Df(),i!==null?(e.charCodeAt(nf)===34?(s=Et,nf++):(s=null,ff===0&&mf(St)),s!==null?(r=[r,i,s],n=r):(nf=n,n=o)):(nf=n,n=o)):(nf=n,n=o),n===null&&(n=nf,e.charCodeAt(nf)===39?(r=xt,nf++):(r=null,ff===0&&mf(Tt)),r!==null?(i=Df(),i!==null?(e.charCodeAt(nf)===39?(s=xt,nf++):(s=null,ff===0&&mf(Tt)),s!==null?(r=[r,i,s],n=r):(nf=n,n=o)):(nf=n,n=o)):(nf=n,n=o)),n!==null&&(rf=t,n=Nt(n)),n===null?(nf=t,t=n):t=n,t}function Ll(){var t,n,r,i;return t=nf,n=Xl(),n!==null?(e.charCodeAt(nf)===61?(r=Y,nf++):(r=null,ff===0&&mf(Z)),r!==null?(i=Cl(),i!==null?(rf=t,n=Tn(n,i),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o)):(nf=t,t=o),t}function Al(){var t,n,r,i;return t=nf,n=zf(),n!==null?(e.charCodeAt(nf)===61?(r=Y,nf++):(r=null,ff===0&&mf(Z)),r!==null?(i=Nl(),i!==null?(rf=t,n=Nn(n,i),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o)):(nf=t,t=o),t}function Ol(){var t,n,r,i;return t=nf,n=zf(),n!==null?(e.charCodeAt(nf)===61?(r=Y,nf++):(r=null,ff===0&&mf(Z)),r!==null?(i=el(),i!==null?(rf=t,n=Cn(n,i),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o)):(nf=t,t=o),t}function Ml(){var t,n,r;t=nf,n=[],r=Dl();while(r!==null)n.push(r),r=Dl();return n!==null&&(n=e.substring(t,nf)),t=n,t}function _l(){var e;return e=el(),e===null&&(e=Xf()),e}function Dl(){var t;return t=rl(),t===null&&(yt.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(bt)),t===null&&(e.charCodeAt(nf)===95?(t=kn,nf++):(t=null,ff===0&&mf(Ln)),t===null&&(e.charCodeAt(nf)===45?(t=An,nf++):(t=null,ff===0&&mf(On))))),t}function Pl(){var t,n,r;return t=nf,e.charCodeAt(nf)===37?(n=Mn,nf++):(n=null,ff===0&&mf(_n)),n!==null?(r=jl(),r!==null?(rf=t,n=zt(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function Hl(){var t,n,r;return t=nf,e.charCodeAt(nf)===35?(n=Dn,nf++):(n=null,ff===0&&mf(Pn)),n!==null?(r=jl(),r!==null?(rf=t,n=Hn(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function Bl(){var t,n,r;return t=nf,e.charCodeAt(nf)===46?(n=J,nf++):(n=null,ff===0&&mf(K)),n!==null?(r=jl(),r!==null?(rf=t,n=zt(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function jl(){var e,t;return ff++,e=Fl(),ff--,e===null&&(t=null,ff===0&&mf(Bn)),e}function Fl(){var t,n,r,i,s;t=nf,n=ql();if(n!==null){r=nf,i=[],s=Il();while(s!==null)i.push(s),s=Il();i!==null&&(i=e.substring(r,nf)),r=i,r!==null?(rf=t,n=jn(n,r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)}else nf=t,t=o;return t}function Il(){var t;return Fn.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(In)),t===null&&(t=Rl()),t}function ql(){var t;return qn.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(Rn)),t===null&&(t=Rl()),t}function Rl(){var t;return Un.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(zn)),t}function Ul(){var t,n,r,i,s;ff++,t=nf,e.charCodeAt(nf)===37?(n=Mn,nf++):(n=null,ff===0&&mf(_n));if(n!==null){r=nf,i=[],s=zl();if(s!==null)while(s!==null)i.push(s),s=zl();else i=o;i!==null&&(i=e.substring(r,nf)),r=i,r!==null?(rf=t,n=zt(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)}else nf=t,t=o;return t===null&&(t=Wl()),ff--,t===null&&(n=null,ff===0&&mf(Wn)),t}function zl(){var t;return Xn.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(Vn)),t}function Wl(){var t,n;return ff++,e.substr(nf,10)===$n?(t=$n,nf+=10):(t=null,ff===0&&mf(Jn)),t===null&&(e.substr(nf,10)===Kn?(t=Kn,nf+=10):(t=null,ff===0&&mf(Qn)),t===null&&(e.substr(nf,9)===Gn?(t=Gn,nf+=9):(t=null,ff===0&&mf(Yn)),t===null&&(e.substr(nf,8)===Zn?(t=Zn,nf+=8):(t=null,ff===0&&mf(er)),t===null&&(e.substr(nf,8)===tr?(t=tr,nf+=8):(t=null,ff===0&&mf(nr)),t===null&&(e.substr(nf,8)===rr?(t=rr,nf+=8):(t=null,ff===0&&mf(ir)),t===null&&(e.substr(nf,8)===sr?(t=sr,nf+=8):(t=null,ff===0&&mf(or)),t===null&&(e.substr(nf,8)===ur?(t=ur,nf+=8):(t=null,ff===0&&mf(ar)),t===null&&(e.substr(nf,8)===fr?(t=fr,nf+=8):(t=null,ff===0&&mf(lr)),t===null&&(e.substr(nf,8)===cr?(t=cr,nf+=8):(t=null,ff===0&&mf(hr)),t===null&&(e.substr(nf,8)===pr?(t=pr,nf+=8):(t=null,ff===0&&mf(dr)),t===null&&(e.substr(nf,8)===vr?(t=vr,nf+=8):(t=null,ff===0&&mf(mr)),t===null&&(e.substr(nf,8)===gr?(t=gr,nf+=8):(t=null,ff===0&&mf(yr)),t===null&&(e.substr(nf,7)===br?(t=br,nf+=7):(t=null,ff===0&&mf(wr)),t===null&&(e.substr(nf,7)===Er?(t=Er,nf+=7):(t=null,ff===0&&mf(Sr)),t===null&&(e.substr(nf,7)===xr?(t=xr,nf+=7):(t=null,ff===0&&mf(Tr)),t===null&&(e.substr(nf,7)===Nr?(t=Nr,nf+=7):(t=null,ff===0&&mf(Cr)),t===null&&(e.substr(nf,7)===kr?(t=kr,nf+=7):(t=null,ff===0&&mf(Lr)),t===null&&(e.substr(nf,7)===Ar?(t=Ar,nf+=7):(t=null,ff===0&&mf(Or)),t===null&&(e.substr(nf,7)===Mr?(t=Mr,nf+=7):(t=null,ff===0&&mf(_r)),t===null&&(e.substr(nf,7)===Dr?(t=Dr,nf+=7):(t=null,ff===0&&mf(Pr)),t===null&&(e.substr(nf,7)===Hr?(t=Hr,nf+=7):(t=null,ff===0&&mf(Br)),t===null&&(e.substr(nf,7)===jr?(t=jr,nf+=7):(t=null,ff===0&&mf(Fr)),t===null&&(e.substr(nf,7)===Ir?(t=Ir,nf+=7):(t=null,ff===0&&mf(qr)),t===null&&(e.substr(nf,7)===Rr?(t=Rr,nf+=7):(t=null,ff===0&&mf(Ur)),t===null&&(e.substr(nf,6)===zr?(t=zr,nf+=6):(t=null,ff===0&&mf(Wr)),t===null&&(e.substr(nf,6)===Xr?(t=Xr,nf+=6):(t=null,ff===0&&mf(Vr)),t===null&&(e.substr(nf,6)===$r?(t=$r,nf+=6):(t=null,ff===0&&mf(Jr)),t===null&&(e.substr(nf,6)===Kr?(t=Kr,nf+=6):(t=null,ff===0&&mf(Qr)),t===null&&(e.substr(nf,6)===Gr?(t=Gr,nf+=6):(t=null,ff===0&&mf(Yr)),t===null&&(e.substr(nf,6)===Zr?(t=Zr,nf+=6):(t=null,ff===0&&mf(ei)),t===null&&(e.substr(nf,6)===ti?(t=ti,nf+=6):(t=null,ff===0&&mf(ni)),t===null&&(e.substr(nf,6)===ri?(t=ri,nf+=6):(t=null,ff===0&&mf(ii)),t===null&&(e.substr(nf,6)===si?(t=si,nf+=6):(t=null,ff===0&&mf(oi)),t===null&&(e.substr(nf,6)===ui?(t=ui,nf+=6):(t=null,ff===0&&mf(ai)),t===null&&(e.substr(nf,6)===fi?(t=fi,nf+=6):(t=null,ff===0&&mf(li)),t===null&&(e.substr(nf,6)===ci?(t=ci,nf+=6):(t=null,ff===0&&mf(hi)),t===null&&(e.substr(nf,6)===pi?(t=pi,nf+=6):(t=null,ff===0&&mf(di)),t===null&&(e.substr(nf,6)===vi?(t=vi,nf+=6):(t=null,ff===0&&mf(mi)),t===null&&(e.substr(nf,6)===gi?(t=gi,nf+=6):(t=null,ff===0&&mf(yi)),t===null&&(e.substr(nf,6)===bi?(t=bi,nf+=6):(t=null,ff===0&&mf(wi)),t===null&&(e.substr(nf,6)===Ei?(t=Ei,nf+=6):(t=null,ff===0&&mf(Si)),t===null&&(e.substr(nf,6)===xi?(t=xi,nf+=6):(t=null,ff===0&&mf(Ti)),t===null&&(e.substr(nf,6)===Ni?(t=Ni,nf+=6):(t=null,ff===0&&mf(Ci)),t===null&&(e.substr(nf,6)===ki?(t=ki,nf+=6):(t=null,ff===0&&mf(Li)),t===null&&(e.substr(nf,5)===Ai?(t=Ai,nf+=5):(t=null,ff===0&&mf(Oi)),t===null&&(e.substr(nf,5)===Mi?(t=Mi,nf+=5):(t=null,ff===0&&mf(_i)),t===null&&(e.substr(nf,5)===Di?(t=Di,nf+=5):(t=null,ff===0&&mf(Pi)),t===null&&(e.substr(nf,5)===Hi?(t=Hi,nf+=5):(t=null,ff===0&&mf(Bi)),t===null&&(e.substr(nf,5)===ji?(t=ji,nf+=5):(t=null,ff===0&&mf(Fi)),t===null&&(e.substr(nf,5)===Ii?(t=Ii,nf+=5):(t=null,ff===0&&mf(qi)),t===null&&(e.substr(nf,5)===Ri?(t=Ri,nf+=5):(t=null,ff===0&&mf(Ui)),t===null&&(e.substr(nf,5)===zi?(t=zi,nf+=5):(t=null,ff===0&&mf(Wi)),t===null&&(e.substr(nf,5)===Xi?(t=Xi,nf+=5):(t=null,ff===0&&mf(Vi)),t===null&&(e.substr(nf,5)===$i?(t=$i,nf+=5):(t=null,ff===0&&mf(Ji)),t===null&&(e.substr(nf,5)===Ki?(t=Ki,nf+=5):(t=null,ff===0&&mf(Qi)),t===null&&(e.substr(nf,5)===Gi?(t=Gi,nf+=5):(t=null,ff===0&&mf(Yi)),t===null&&(e.substr(nf,5)===Zi?(t=Zi,nf+=5):(t=null,ff===0&&mf(es)),t===null&&(e.substr(nf,5)===ts?(t=ts,nf+=5):(t=null,ff===0&&mf(ns)),t===null&&(e.substr(nf,5)===rs?(t=rs,nf+=5):(t=null,ff===0&&mf(is)),t===null&&(e.substr(nf,5)===ss?(t=ss,nf+=5):(t=null,ff===0&&mf(os)),t===null&&(e.substr(nf,5)===us?(t=us,nf+=5):(t=null,ff===0&&mf(as)),t===null&&(e.substr(nf,5)===fs?(t=fs,nf+=5):(t=null,ff===0&&mf(ls)),t===null&&(e.substr(nf,4)===cs?(t=cs,nf+=4):(t=null,ff===0&&mf(hs)),t===null&&(e.substr(nf,4)===ps?(t=ps,nf+=4):(t=null,ff===0&&mf(ds)),t===null&&(e.substr(nf,4)===vs?(t=vs,nf+=4):(t=null,ff===0&&mf(ms)),t===null&&(e.substr(nf,4)===gs?(t=gs,nf+=4):(t=null,ff===0&&mf(ys)),t===null&&(e.substr(nf,4)===bs?(t=bs,nf+=4):(t=null,ff===0&&mf(ws)),t===null&&(e.substr(nf,4)===Es?(t=Es,nf+=4):(t=null,ff===0&&mf(Ss)),t===null&&(e.substr(nf,4)===xs?(t=xs,nf+=4):(t=null,ff===0&&mf(Ts)),t===null&&(e.substr(nf,4)===Ns?(t=Ns,nf+=4):(t=null,ff===0&&mf(Cs)),t===null&&(e.substr(nf,4)===ks?(t=ks,nf+=4):(t=null,ff===0&&mf(Ls)),t===null&&(e.substr(nf,4)===As?(t=As,nf+=4):(t=null,ff===0&&mf(Os)),t===null&&(e.substr(nf,4)===Ms?(t=Ms,nf+=4):(t=null,ff===0&&mf(_s)),t===null&&(e.substr(nf,4)===Ds?(t=Ds,nf+=4):(t=null,ff===0&&mf(Ps)),t===null&&(e.substr(nf,4)===Hs?(t=Hs,nf+=4):(t=null,ff===0&&mf(Bs)),t===null&&(e.substr(nf,4)===js?(t=js,nf+=4):(t=null,ff===0&&mf(Fs)),t===null&&(e.substr(nf,4)===Is?(t=Is,nf+=4):(t=null,ff===0&&mf(qs)),t===null&&(e.substr(nf,4)===Rs?(t=Rs,nf+=4):(t=null,ff===0&&mf(Us)),t===null&&(e.substr(nf,4)===zs?(t=zs,nf+=4):(t=null,ff===0&&mf(Ws)),t===null&&(e.substr(nf,4)===Xs?(t=Xs,nf+=4):(t=null,ff===0&&mf(Vs)),t===null&&(e.substr(nf,4)===$s?(t=$s,nf+=4):(t=null,ff===0&&mf(Js)),t===null&&(e.substr(nf,4)===Ks?(t=Ks,nf+=4):(t=null,ff===0&&mf(Qs)),t===null&&(e.substr(nf,4)===Gs?(t=Gs,nf+=4):(t=null,ff===0&&mf(Ys)),t===null&&(e.substr(nf,3)===Zs?(t=Zs,nf+=3):(t=null,ff===0&&mf(eo)),t===null&&(e.substr(nf,3)===to?(t=to,nf+=3):(t=null,ff===0&&mf(no)),t===null&&(e.substr(nf,3)===ro?(t=ro,nf+=3):(t=null,ff===0&&mf(io)),t===null&&(e.substr(nf,3)===so?(t=so,nf+=3):(t=null,ff===0&&mf(oo)),t===null&&(e.substr(nf,3)===uo?(t=uo,nf+=3):(t=null,ff===0&&mf(ao)),t===null&&(e.substr(nf,3)===fo?(t=fo,nf+=3):(t=null,ff===0&&mf(lo)),t===null&&(e.substr(nf,3)===co?(t=co,nf+=3):(t=null,ff===0&&mf(ho)),t===null&&(e.substr(nf,3)===po?(t=po,nf+=3):(t=null,ff===0&&mf(vo)),t===null&&(e.substr(nf,3)===mo?(t=mo,nf+=3):(t=null,ff===0&&mf(go)),t===null&&(e.substr(nf,3)===yo?(t=yo,nf+=3):(t=null,ff===0&&mf(bo)),t===null&&(e.substr(nf,3)===wo?(t=wo,nf+=3):(t=null,ff===0&&mf(Eo)),t===null&&(e.substr(nf,3)===So?(t=So,nf+=3):(t=null,ff===0&&mf(xo)),t===null&&(e.substr(nf,3)===To?(t=To,nf+=3):(t=null,ff===0&&mf(No)),t===null&&(e.substr(nf,3)===Co?(t=Co,nf+=3):(t=null,ff===0&&mf(ko)),t===null&&(e.substr(nf,3)===Lo?(t=Lo,nf+=3):(t=null,ff===0&&mf(Ao)),t===null&&(e.substr(nf,3)===Oo?(t=Oo,nf+=3):(t=null,ff===0&&mf(Mo)),t===null&&(e.substr(nf,3)===_o?(t=_o,nf+=3):(t=null,ff===0&&mf(Do)),t===null&&(e.substr(nf,3)===Po?(t=Po,nf+=3):(t=null,ff===0&&mf(Ho)),t===null&&(e.substr(nf,3)===Bo?(t=Bo,nf+=3):(t=null,ff===0&&mf(jo)),t===null&&(e.substr(nf,2)===Fo?(t=Fo,nf+=2):(t=null,ff===0&&mf(Io)),t===null&&(e.substr(nf,2)===qo?(t=qo,nf+=2):(t=null,ff===0&&mf(Ro)),t===null&&(e.substr(nf,2)===Uo?(t=Uo,nf+=2):(t=null,ff===0&&mf(zo)),t===null&&(e.substr(nf,2)===Wo?(t=Wo,nf+=2):(t=null,ff===0&&mf(Xo)),t===null&&(e.substr(nf,2)===Vo?(t=Vo,nf+=2):(t=null,ff===0&&mf($o)),t===null&&(e.substr(nf,2)===Jo?(t=Jo,nf+=2):(t=null,ff===0&&mf(Ko)),t===null&&(e.substr(nf,2)===Qo?(t=Qo,nf+=2):(t=null,ff===0&&mf(Go)),t===null&&(e.substr(nf,2)===Yo?(t=Yo,nf+=2):(t=null,ff===0&&mf(Zo)),t===null&&(e.substr(nf,2)===eu?(t=eu,nf+=2):(t=null,ff===0&&mf(tu)),t===null&&(e.substr(nf,2)===nu?(t=nu,nf+=2):(t=null,ff===0&&mf(ru)),t===null&&(e.substr(nf,2)===iu?(t=iu,nf+=2):(t=null,ff===0&&mf(su)),t===null&&(e.substr(nf,2)===ou?(t=ou,nf+=2):(t=null,ff===0&&mf(uu)),t===null&&(e.substr(nf,2)===au?(t=au,nf+=2):(t=null,ff===0&&mf(fu)),t===null&&(e.substr(nf,2)===lu?(t=lu,nf+=2):(t=null,ff===0&&mf(cu)),t===null&&(e.substr(nf,2)===hu?(t=hu,nf+=2):(t=null,ff===0&&mf(pu)),t===null&&(e.substr(nf,2)===du?(t=du,nf+=2):(t=null,ff===0&&mf(vu)),t===null&&(e.substr(nf,2)===mu?(t=mu,nf+=2):(t=null,ff===0&&mf(gu)),t===null&&(e.substr(nf,2)===yu?(t=yu,nf+=2):(t=null,ff===0&&mf(bu)),t===null&&(e.substr(nf,2)===wu?(t=wu,nf+=2):(t=null,ff===0&&mf(Eu)),t===null&&(e.substr(nf,2)===Su?(t=Su,nf+=2):(t=null,ff===0&&mf(xu)),t===null&&(e.substr(nf,2)===Tu?(t=Tu,nf+=2):(t=null,ff===0&&mf(Nu)),t===null&&(e.charCodeAt(nf)===117?(t=Cu,nf++):(t=null,ff===0&&mf(ku)),t===null&&(e.charCodeAt(nf)===115?(t=Lu,nf++):(t=null,ff===0&&mf(Au)),t===null&&(e.charCodeAt(nf)===113?(t=Ou,nf++):(t=null,ff===0&&mf(Mu)),t===null&&(e.charCodeAt(nf)===112?(t=_u,nf++):(t=null,ff===0&&mf(Du)),t===null&&(e.charCodeAt(nf)===105?(t=Pu,nf++):(t=null,ff===0&&mf(Hu)),t===null&&(e.charCodeAt(nf)===98?(t=Bu,nf++):(t=null,ff===0&&mf(ju)),t===null&&(e.charCodeAt(nf)===97?(t=Fu,nf++):(t=null,ff===0&&mf(Iu)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))),ff--,t===null&&(n=null,ff===0&&mf(Wn)),t}function Xl(){var t,n;return ff++,e.substr(nf,10)===Ru?(t=Ru,nf+=10):(t=null,ff===0&&mf(Uu)),t===null&&(e.substr(nf,9)===zu?(t=zu,nf+=9):(t=null,ff===0&&mf(Wu)),t===null&&(e.substr(nf,8)===Xu?(t=Xu,nf+=8):(t=null,ff===0&&mf(Vu)),t===null&&(e.substr(nf,11)===$u?(t=$u,nf+=11):(t=null,ff===0&&mf(Ju)),t===null&&(e.substr(nf,7)===Ku?(t=Ku,nf+=7):(t=null,ff===0&&mf(Qu)), +t===null&&(e.substr(nf,5)===Gu?(t=Gu,nf+=5):(t=null,ff===0&&mf(Yu)),t===null&&(e.substr(nf,8)===Zu?(t=Zu,nf+=8):(t=null,ff===0&&mf(ea)),t===null&&(e.substr(nf,9)===ta?(t=ta,nf+=9):(t=null,ff===0&&mf(na)),t===null&&(e.substr(nf,7)===ra?(t=ra,nf+=7):(t=null,ff===0&&mf(ia)),t===null&&(e.substr(nf,11)===sa?(t=sa,nf+=11):(t=null,ff===0&&mf(oa)),t===null&&(e.substr(nf,5)===ua?(t=ua,nf+=5):(t=null,ff===0&&mf(aa)),t===null&&(e.substr(nf,11)===fa?(t=fa,nf+=11):(t=null,ff===0&&mf(la)),t===null&&(e.substr(nf,9)===ca?(t=ca,nf+=9):(t=null,ff===0&&mf(ha)),t===null&&(e.substr(nf,7)===pa?(t=pa,nf+=7):(t=null,ff===0&&mf(da)),t===null&&(e.substr(nf,8)===va?(t=va,nf+=8):(t=null,ff===0&&mf(ma)),t===null&&(e.substr(nf,10)===ga?(t=ga,nf+=10):(t=null,ff===0&&mf(ya)),t===null&&(e.substr(nf,10)===ba?(t=ba,nf+=10):(t=null,ff===0&&mf(wa)),t===null&&(e.substr(nf,6)===Ea?(t=Ea,nf+=6):(t=null,ff===0&&mf(Sa)),t===null&&(e.substr(nf,5)===Zi?(t=Zi,nf+=5):(t=null,ff===0&&mf(es)),t===null&&(e.substr(nf,6)===xa?(t=xa,nf+=6):(t=null,ff===0&&mf(Ta)),t===null&&(e.substr(nf,9)===Na?(t=Na,nf+=9):(t=null,ff===0&&mf(Ca)),t===null&&(e.substr(nf,4)===ka?(t=ka,nf+=4):(t=null,ff===0&&mf(La)),t===null&&(e.substr(nf,9)===Aa?(t=Aa,nf+=9):(t=null,ff===0&&mf(Oa)),t===null&&(e.substr(nf,9)===Ma?(t=Ma,nf+=9):(t=null,ff===0&&mf(_a)),t===null&&(e.substr(nf,8)===Da?(t=Da,nf+=8):(t=null,ff===0&&mf(Pa)),t===null&&(e.substr(nf,4)===Ha?(t=Ha,nf+=4):(t=null,ff===0&&mf(Ba)),t===null&&(e.substr(nf,7)===ja?(t=ja,nf+=7):(t=null,ff===0&&mf(Fa)))))))))))))))))))))))))))),ff--,t===null&&(n=null,ff===0&&mf(qu)),t}function Vl(){var t,n;return ff++,t=nf,e.charCodeAt(nf)===61423?(n=qa,nf++):(n=null,ff===0&&mf(Ra)),n!==null&&(rf=t,n=Ua()),n===null?(nf=t,t=n):t=n,ff--,t===null&&(n=null,ff===0&&mf(Ia)),t}function $l(){var t,n;return ff++,t=nf,e.charCodeAt(nf)===61438?(n=Wa,nf++):(n=null,ff===0&&mf(Xa)),n!==null&&(rf=t,n=Ua()),n===null?(nf=t,t=n):t=n,ff--,t===null&&(n=null,ff===0&&mf(za)),t}function Jl(){var t,n,r;return ff++,t=nf,e.charCodeAt(nf)===10?(n=$a,nf++):(n=null,ff===0&&mf(Ja)),n!==null?(e.charCodeAt(nf)===61439?(r=Ka,nf++):(r=null,ff===0&&mf(Qa)),r!==null?(n=[n,r],t=n):(nf=t,t=o)):(nf=t,t=o),ff--,t===null&&(n=null,ff===0&&mf(Va)),t}function Kl(){var e,t;ff++,e=[],t=Gl();if(t!==null)while(t!==null)e.push(t),t=Gl();else e=o;return ff--,e===null&&(t=null,ff===0&&mf(Ga)),e}function Ql(){var e,t;ff++,e=[],t=Gl();while(t!==null)e.push(t),t=Gl();return ff--,e===null&&(t=null,ff===0&&mf(Ya)),e}function Gl(){var t,n;return ff++,ef.test(e.charAt(nf))?(t=e.charAt(nf),nf++):(t=null,ff===0&&mf(tf)),ff--,t===null&&(n=null,ff===0&&mf(Za)),t}function Yl(){var t,n,r;return t=nf,n=nf,ff++,r=Vl(),r===null&&(r=$l(),r===null&&(r=Jl())),ff--,r===null?n=u:(nf=n,n=o),n!==null?(e.length>nf?(r=e.charAt(nf),nf++):(r=null,ff===0&&mf(Ut)),r!==null?(rf=t,n=zt(r),n===null?(nf=t,t=n):t=n):(nf=t,t=o)):(nf=t,t=o),t}function Zl(){var t,n,r;t=nf,n=[],r=Yl();while(r!==null)n.push(r),r=Yl();return n!==null&&(n=e.substring(t,nf)),t=n,t}function ic(e,t,n){var r=e.hash;if(n){r=r||new nc.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:yf},s=yf,o=null,u="",a="else",f='"else"',l=function(e){return e},c=function(e,t){return new nc.ProgramNode(e,t||[])},h=[],p=function(e){var t=[],n=[];for(var r=0;r")),[u]):(u.push(new nc.ContentNode(">")),[u,new nc.ContentNode("")])},wn=function(e){return[new nc.ContentNode(" "),e]},En=/^[A-Za-z.:0-9]/,Sn="[A-Za-z.:0-9]",xn=function(e){return new nc.MustacheNode([e])},Tn=function(e,t){return ic(t,"action",[["on",new nc.StringNode(e)]])},Nn=function(e,t){var n=new nc.HashNode([[e,new nc.StringNode(t)]]),r=[new nc.IdNode(["bindAttr"])];return new nc.MustacheNode(r,n)},Cn=function(e,t){var n=e+"="+'"'+t+'"';return new nc.ContentNode(n)},kn="_",Ln='"_"',An="-",On='"-"',Mn="%",_n='"%"',Dn="#",Pn='"#"',Hn=function(e){return e},Bn="CSSIdentifier",jn=function(e,t){return e+t},Fn=/^[_a-zA-Z0-9\-]/,In="[_a-zA-Z0-9\\-]",qn=/^[_a-zA-Z]/,Rn="[_a-zA-Z]",Un=/^[\x80-\xFF]/,zn="[\\x80-\\xFF]",Wn="KnownHTMLTagName",Xn=/^[:_a-zA-Z0-9\-]/,Vn="[:_a-zA-Z0-9\\-]",$n="figcaption",Jn='"figcaption"',Kn="blockquote",Qn='"blockquote"',Gn="plaintext",Yn='"plaintext"',Zn="textarea",er='"textarea"',tr="progress",nr='"progress"',rr="optgroup",ir='"optgroup"',sr="noscript",or='"noscript"',ur="noframes",ar='"noframes"',fr="frameset",lr='"frameset"',cr="fieldset",hr='"fieldset"',pr="datalist",dr='"datalist"',vr="colgroup",mr='"colgroup"',gr="basefont",yr='"basefont"',br="summary",wr='"summary"',Er="section",Sr='"section"',xr="marquee",Tr='"marquee"',Nr="listing",Cr='"listing"',kr="isindex",Lr='"isindex"',Ar="details",Or='"details"',Mr="command",_r='"command"',Dr="caption",Pr='"caption"',Hr="bgsound",Br='"bgsound"',jr="article",Fr='"article"',Ir="address",qr='"address"',Rr="acronym",Ur='"acronym"',zr="strong",Wr='"strong"',Xr="strike",Vr='"strike"',$r="spacer",Jr='"spacer"',Kr="source",Qr='"source"',Gr="select",Yr='"select"',Zr="script",ei='"script"',ti="output",ni='"output"',ri="option",ii='"option"',si="object",oi='"object"',ui="legend",ai='"legend"',fi="keygen",li='"keygen"',ci="iframe",hi='"iframe"',pi="hgroup",di='"hgroup"',vi="header",mi='"header"',gi="footer",yi='"footer"',bi="figure",wi='"figure"',Ei="center",Si='"center"',xi="canvas",Ti='"canvas"',Ni="button",Ci='"button"',ki="applet",Li='"applet"',Ai="video",Oi='"video"',Mi="track",_i='"track"',Di="title",Pi='"title"',Hi="thead",Bi='"thead"',ji="tfoot",Fi='"tfoot"',Ii="tbody",qi='"tbody"',Ri="table",Ui='"table"',zi="style",Wi='"style"',Xi="small",Vi='"small"',$i="param",Ji='"param"',Ki="meter",Qi='"meter"',Gi="label",Yi='"label"',Zi="input",es='"input"',ts="frame",ns='"frame"',rs="embed",is='"embed"',ss="blink",os='"blink"',us="audio",as='"audio"',fs="aside",ls='"aside"',cs="time",hs='"time"',ps="span",ds='"span"',vs="samp",ms='"samp"',gs="ruby",ys='"ruby"',bs="nobr",ws='"nobr"',Es="meta",Ss='"meta"',xs="menu",Ts='"menu"',Ns="mark",Cs='"mark"',ks="main",Ls='"main"',As="link",Os='"link"',Ms="html",_s='"html"',Ds="head",Ps='"head"',Hs="form",Bs='"form"',js="font",Fs='"font"',Is="data",qs='"data"',Rs="code",Us='"code"',zs="cite",Ws='"cite"',Xs="body",Vs='"body"',$s="base",Js='"base"',Ks="area",Qs='"area"',Gs="abbr",Ys='"abbr"',Zs="xmp",eo='"xmp"',to="wbr",no='"wbr"',ro="var",io='"var"',so="sup",oo='"sup"',uo="sub",ao='"sub"',fo="pre",lo='"pre"',co="nav",ho='"nav"',po="map",vo='"map"',mo="kbd",go='"kbd"',yo="ins",bo='"ins"',wo="img",Eo='"img"',So="div",xo='"div"',To="dir",No='"dir"',Co="dfn",ko='"dfn"',Lo="del",Ao='"del"',Oo="col",Mo='"col"',_o="big",Do='"big"',Po="bdo",Ho='"bdo"',Bo="bdi",jo='"bdi"',Fo="ul",Io='"ul"',qo="tt",Ro='"tt"',Uo="tr",zo='"tr"',Wo="th",Xo='"th"',Vo="td",$o='"td"',Jo="rt",Ko='"rt"',Qo="rp",Go='"rp"',Yo="ol",Zo='"ol"',eu="li",tu='"li"',nu="hr",ru='"hr"',iu="h6",su='"h6"',ou="h5",uu='"h5"',au="h4",fu='"h4"',lu="h3",cu='"h3"',hu="h2",pu='"h2"',du="h1",vu='"h1"',mu="em",gu='"em"',yu="dt",bu='"dt"',wu="dl",Eu='"dl"',Su="dd",xu='"dd"',Tu="br",Nu='"br"',Cu="u",ku='"u"',Lu="s",Au='"s"',Ou="q",Mu='"q"',_u="p",Du='"p"',Pu="i",Hu='"i"',Bu="b",ju='"b"',Fu="a",Iu='"a"',qu="a JS event",Ru="touchStart",Uu='"touchStart"',zu="touchMove",Wu='"touchMove"',Xu="touchEnd",Vu='"touchEnd"',$u="touchCancel",Ju='"touchCancel"',Ku="keyDown",Qu='"keyDown"',Gu="keyUp",Yu='"keyUp"',Zu="keyPress",ea='"keyPress"',ta="mouseDown",na='"mouseDown"',ra="mouseUp",ia='"mouseUp"',sa="contextMenu",oa='"contextMenu"',ua="click",aa='"click"',fa="doubleClick",la='"doubleClick"',ca="mouseMove",ha='"mouseMove"',pa="focusIn",da='"focusIn"',va="focusOut",ma='"focusOut"',ga="mouseEnter",ya='"mouseEnter"',ba="mouseLeave",wa='"mouseLeave"',Ea="submit",Sa='"submit"',xa="change",Ta='"change"',Na="dragStart",Ca='"dragStart"',ka="drag",La='"drag"',Aa="dragEnter",Oa='"dragEnter"',Ma="dragLeave",_a='"dragLeave"',Da="dragOver",Pa='"dragOver"',Ha="drop",Ba='"drop"',ja="dragEnd",Fa='"dragEnd"',Ia="INDENT",qa="",Ra='"\\uEFEF"',Ua=function(){return""},za="DEDENT",Wa="",Xa='"\\uEFFE"',Va="LineEnd",$a="\n",Ja='"\\n"',Ka="",Qa='"\\uEFFF"',Ga="RequiredWhitespace",Ya="OptionalWhitespace",Za="InlineWhitespace",ef=/^[ \t]/,tf="[ \\t]",nf=0,rf=0,sf=0,of={line:1,column:1,seenCR:!1},uf=0,af=[],ff=0,lf;if("startRule"in r){if(!(r.startRule in i))throw new Error("Can't start parsing from rule \""+r.startRule+'".');s=i[r.startRule]}var ec=n.handlebarsVariant,tc=ec.JavaScriptCompiler.prototype.namespace==="Ember.Handlebars",nc=ec.AST,rc={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};lf=s();if(lf!==null&&nf===e.length)return lf;throw gf(af),rf=Math.max(nf,uf),new t(af,rf this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.0"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = function(m) { m.escaped = true; return m; }, + peg$c94 = function(m) { m.escaped = false; return m; }, + peg$c95 = function(a) { return new AST.ContentNode(a); }, + peg$c96 = "any character", + peg$c97 = "SingleMustacheOpen", + peg$c98 = "{", + peg$c99 = "\"{\"", + peg$c100 = "DoubleMustacheOpen", + peg$c101 = "{{", + peg$c102 = "\"{{\"", + peg$c103 = "TripleMustacheOpen", + peg$c104 = "{{{", + peg$c105 = "\"{{{\"", + peg$c106 = "SingleMustacheClose", + peg$c107 = "}", + peg$c108 = "\"}\"", + peg$c109 = "DoubleMustacheClose", + peg$c110 = "}}", + peg$c111 = "\"}}\"", + peg$c112 = "TripleMustacheClose", + peg$c113 = "}}}", + peg$c114 = "\"}}}\"", + peg$c115 = "InterpolationOpen", + peg$c116 = "#{", + peg$c117 = "\"#{\"", + peg$c118 = "InterpolationClose", + peg$c119 = "==", + peg$c120 = "\"==\"", + peg$c121 = function() { return false; }, + peg$c122 = function() { return true; }, + peg$c123 = function(h, s) { return h || s; }, + peg$c124 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c125 = function(s) { return { shorthand: s, id: true}; }, + peg$c126 = function(s) { return { shorthand: s }; }, + peg$c127 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c128 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c129 = /^[A-Za-z.:0-9_\-]/, + peg$c130 = "[A-Za-z.:0-9_\\-]", + peg$c131 = function(id) { return new AST.MustacheNode([id]); }, + peg$c132 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c133 = function(value) { return value.replace(/ *$/, ''); }, + peg$c134 = "!", + peg$c135 = "\"!\"", + peg$c136 = function(key, value) { return IS_EMBER; }, + peg$c137 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + /* + if(whatever) { + mustacheNode = return unshiftParam(mustacheNode, 'unbound'); + } + */ + + return [mustacheNode]; + }, + peg$c138 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c139 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c140 = "_", + peg$c141 = "\"_\"", + peg$c142 = "-", + peg$c143 = "\"-\"", + peg$c144 = "%", + peg$c145 = "\"%\"", + peg$c146 = "#", + peg$c147 = "\"#\"", + peg$c148 = function(c) { return c;}, + peg$c149 = "CSSIdentifier", + peg$c150 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c151 = /^[_a-zA-Z0-9\-]/, + peg$c152 = "[_a-zA-Z0-9\\-]", + peg$c153 = /^[_a-zA-Z]/, + peg$c154 = "[_a-zA-Z]", + peg$c155 = /^[\x80-\xFF]/, + peg$c156 = "[\\x80-\\xFF]", + peg$c157 = "KnownHTMLTagName", + peg$c158 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c159 = function(t) { return t; }, + peg$c160 = ":", + peg$c161 = "\":\"", + peg$c162 = "a JS event", + peg$c163 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c164 = "INDENT", + peg$c165 = "\uEFEF", + peg$c166 = "\"\\uEFEF\"", + peg$c167 = function() { return ''; }, + peg$c168 = "DEDENT", + peg$c169 = "\uEFFE", + peg$c170 = "\"\\uEFFE\"", + peg$c171 = "Unmatched DEDENT", + peg$c172 = "\uEFEE", + peg$c173 = "\"\\uEFEE\"", + peg$c174 = "LineEnd", + peg$c175 = "\uEFFF", + peg$c176 = "\"\\uEFFF\"", + peg$c177 = "\n", + peg$c178 = "\"\\n\"", + peg$c179 = "ANYDEDENT", + peg$c180 = "RequiredWhitespace", + peg$c181 = "OptionalWhitespace", + peg$c182 = "InlineWhitespace", + peg$c183 = /^[ \t]/, + peg$c184 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = peg$parseindentedContent(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheNestedContent(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c98; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c101) { + s0 = peg$c101; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c104) { + s0 = peg$c104; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c116) { + s0 = peg$c116; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c119) { + s1 = peg$c119; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c123(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c129.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c107; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c134; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c136(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c146; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c151.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c158(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c159(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0, s1, s2, s3; + + if (peg$c151.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c163(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c159(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c165; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c175; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c177; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c183.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.0/emblem.min.js b/ajax/libs/emblem/0.2.0/emblem.min.js new file mode 100644 index 000000000..b73796ed8 --- /dev/null +++ b/ajax/libs/emblem/0.2.0/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.0",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Fr(){return e.substring(Mr,Or)}function Ir(){return Mr}function qr(){return Ur(Mr).line}function Rr(){return Ur(Mr).column}function Ur(t){function n(t,n){var r,i;for(r=0;rt&&(_r=0,Dr={line:1,column:1,seenCR:!1}),_r=t,n(Dr,_r)),Dr}function zr(e){if(OrPr&&(Pr=Or,Hr=[]),Hr.push(e)}function Wr(e){var t=0;e.sort();while(tOr?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Ki(){var t,n,r;return t=Or,n=Or,Br++,r=Yi(),r===null&&(e.charCodeAt(Or)===39?(r=kt,Or++):(r=null,Br===0&&zr(Lt))),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Qi(){var t,n,r,i;t=Or,n=Or,r=[],i=Gi();if(i!==null)while(i!==null)r.push(i),i=Gi();else r=o;return r!==null&&(r=e.substring(n,Or)),n=r,n!==null&&(Mr=t,n=$t(n)),n===null?(Or=t,t=n):t=n,t}function Gi(){var t,n,r;return t=Or,n=Or,Br++,r=Yi(),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Yi(){var e;return e=rs(),e===null&&(e=ns(),e===null&&(e=us(),e===null&&(e=Us(),e===null&&(e=Rs())))),e}function Zi(){var e,t,n,r,i,s;return e=Or,t=ts(),t!==null?(n=Ws(),n!==null?(r=pi(),r!==null?(i=Ws(),i!==null?(s=is(),s!==null?(Mr=e,t=Xt(r),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o),e}function es(){var e;return e=Zi(),e===null&&(e=Xi(),e===null&&(e=Wi())),e}function ts(){var t,n;return Br++,e.charCodeAt(Or)===123?(t=Qt,Or++):(t=null,Br===0&&zr(Gt)),Br--,t===null&&(n=null,Br===0&&zr(Kt)),t}function ns(){var t,n;return Br++,e.substr(Or,2)===Zt?(t=Zt,Or+=2):(t=null,Br===0&&zr(en)),Br--,t===null&&(n=null,Br===0&&zr(Yt)),t}function rs(){var t,n;return Br++,e.substr(Or,3)===nn?(t=nn,Or+=3):(t=null,Br===0&&zr(rn)),Br--,t===null&&(n=null,Br===0&&zr(tn)),t}function is(){var t,n;return Br++,e.charCodeAt(Or)===125?(t=on,Or++):(t=null,Br===0&&zr(un)),Br--,t===null&&(n=null,Br===0&&zr(sn)),t}function ss(){var t,n;return Br++,e.substr(Or,2)===fn?(t=fn,Or+=2):(t=null,Br===0&&zr(ln)),Br--,t===null&&(n=null,Br===0&&zr(an)),t}function os(){var t,n;return Br++,e.substr(Or,3)===hn?(t=hn,Or+=3):(t=null,Br===0&&zr(pn)),Br--,t===null&&(n=null,Br===0&&zr(cn)),t}function us(){var t,n;return Br++,e.substr(Or,2)===vn?(t=vn,Or+=2):(t=null,Br===0&&zr(mn)),Br--,t===null&&(n=null,Br===0&&zr(dn)),t}function as(){var t,n;return Br++,e.charCodeAt(Or)===125?(t=on,Or++):(t=null,Br===0&&zr(un)),Br--,t===null&&(n=null,Br===0&&zr(gn)),t}function fs(){var t,n,r;return t=Or,e.substr(Or,2)===yn?(n=yn,Or+=2):(n=null,Br===0&&zr(bn)),n!==null?(e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_)),r===null&&(r=u),r!==null?(Mr=t,n=wn(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t===null&&(t=Or,e.charCodeAt(Or)===61?(n=l,Or++):(n=null,Br===0&&zr(c)),n!==null?(e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_)),r===null&&(r=u),r!==null?(Mr=t,n=En(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)),t}function ls(){var e,t,n,r;return e=Or,t=Ds(),t===null&&(t=u),t!==null?(n=vi(),n===null&&(n=u),n!==null?(Mr=Or,r=Sn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o),e}function cs(){var e,t,n,r,i;e=Or,t=ls();if(t!==null){n=[],r=es();while(r!==null)n.push(r),r=es();if(n!==null){r=[],i=hs();while(i!==null)r.push(i),i=hs();r!==null?(Mr=e,t=xn(t,n,r),t===null?(Or=e,e=t):e=t):(Or=e,e=o)}else Or=e,e=o}else Or=e,e=o;return e}function vi(){var e,t,n,r;e=Or,t=[],n=Or,r=Ns(),r!==null&&(Mr=n,r=Tn(r)),r===null?(Or=n,n=r):n=r,n===null&&(n=Or,r=Cs(),r!==null&&(Mr=n,r=Nn(r)),r===null?(Or=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Or,r=Ns(),r!==null&&(Mr=n,r=Tn(r)),r===null?(Or=n,n=r):n=r,n===null&&(n=Or,r=Cs(),r!==null&&(Mr=n,r=Nn(r)),r===null?(Or=n,n=r):n=r);else t=o;return t!==null&&(Mr=e,t=Cn(t)),t===null?(Or=e,e=t):e=t,e}function hs(){var t,n,r;t=Or,n=[],e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_));else n=o;return n!==null?(r=ms(),r===null&&(r=ys(),r===null&&(r=bs(),r===null&&(r=ws()))),r!==null?(Mr=t,n=kn(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function ps(){var t;return Ln.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(An)),t}function ds(){var e,t;return e=vs(),e===null&&(e=Or,t=Ci(),t!==null&&(Mr=e,t=On(t)),t===null?(Or=e,e=t):e=t),e}function vs(){var t,n,r,i,s;return t=Or,n=Or,e.charCodeAt(Or)===34?(r=Nt,Or++):(r=null,Br===0&&zr(Ct)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Or)===34?(s=Nt,Or++):(s=null,Br===0&&zr(Ct)),s!==null?(r=[r,i,s],n=r):(Or=n,n=o)):(Or=n,n=o)):(Or=n,n=o),n===null&&(n=Or,e.charCodeAt(Or)===39?(r=kt,Or++):(r=null,Br===0&&zr(Lt)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Or)===39?(s=kt,Or++):(s=null,Br===0&&zr(Lt)),s!==null?(r=[r,i,s],n=r):(Or=n,n=o)):(Or=n,n=o)):(Or=n,n=o)),n!==null&&(Mr=t,n=At(n)),n===null?(Or=t,t=n):t=n,t}function ms(){var t,n,r,i;return t=Or,n=Bs(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=ds(),i!==null?(Mr=t,n=Mn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function gs(){var t,n,r,i,s,u;t=Or,e.charCodeAt(Or)===123?(n=Qt,Or++):(n=null,Br===0&&zr(Gt));if(n!==null){r=Ws();if(r!==null){i=Or,s=[],u=ps(),u===null&&(e.charCodeAt(Or)===32?(u=M,Or++):(u=null,Br===0&&zr(_)));if(u!==null)while(u!==null)s.push(u),u=ps(),u===null&&(e.charCodeAt(Or)===32?(u=M,Or++):(u=null,Br===0&&zr(_)));else s=o;s!==null&&(s=e.substring(i,Or)),i=s,i!==null?(s=Ws(),s!==null?(e.charCodeAt(Or)===125?(u=on,Or++):(u=null,Br===0&&zr(un)),u!==null?(Mr=t,n=_n(i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)}else Or=t,t=o}else Or=t,t=o;if(t===null){t=Or,n=[],r=ps();if(r!==null)while(r!==null)n.push(r),r=ps();else n=o;n!==null&&(n=e.substring(t,Or)),t=n}return t}function ys(){var t,n,r,i,s,a;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=gs(),i!==null?(s=Or,Br++,e.charCodeAt(Or)===33?(a=Dn,Or++):(a=null,Br===0&&zr(Pn)),Br--,a===null?s=u:(Or=s,s=o),s!==null?(Mr=Or,a=Hn(n,i),a?a=u:a=o,a!==null?(Mr=t,n=Bn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function bs(){var t,n,r,i;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=Ci(),i!==null?(Mr=t,n=jn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function ws(){var t,n,r,i;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=qi(),i!==null?(Mr=t,n=Fn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function Es(){var t,n,r;t=Or,n=[],r=xs();while(r!==null)n.push(r),r=xs();return n!==null&&(n=e.substring(t,Or)),t=n,t}function Ss(){var e;return e=_i(),e===null&&(e=xi()),e}function xs(){var t;return t=Hi(),t===null&&(St.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(xt)),t===null&&(e.charCodeAt(Or)===95?(t=In,Or++):(t=null,Br===0&&zr(qn)),t===null&&(e.charCodeAt(Or)===45?(t=Rn,Or++):(t=null,Br===0&&zr(Un))))),t}function Ts(){var t,n,r;return t=Or,e.charCodeAt(Or)===37?(n=zn,Or++):(n=null,Br===0&&zr(Wn)),n!==null?(r=ks(),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Ns(){var t,n,r;return t=Or,e.charCodeAt(Or)===35?(n=Xn,Or++):(n=null,Br===0&&zr(Vn)),n!==null?(r=ks(),r!==null?(Mr=t,n=$n(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Cs(){var t,n,r;return t=Or,e.charCodeAt(Or)===46?(n=et,Or++):(n=null,Br===0&&zr(tt)),n!==null?(r=ks(),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function ks(){var e,t;return Br++,e=Ls(),Br--,e===null&&(t=null,Br===0&&zr(Jn)),e}function Ls(){var t,n,r,i,s;t=Or,n=Os();if(n!==null){r=Or,i=[],s=As();while(s!==null)i.push(s),s=As();i!==null&&(i=e.substring(r,Or)),r=i,r!==null?(Mr=t,n=Kn(n,r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)}else Or=t,t=o;return t}function As(){var t;return Qn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Gn)),t===null&&(t=Ms()),t}function Os(){var t;return Yn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Zn)),t===null&&(t=Ms()),t}function Ms(){var t;return er.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(tr)),t}function _s(){var t,n,r;t=Or,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,Or)),t=n,t}function Ds(){var t,n,r,i;return Br++,t=Or,e.charCodeAt(Or)===37?(n=zn,Or++):(n=null,Br===0&&zr(Wn)),n!==null?(r=Ws(),r!==null?(i=_s(),i!==null?(Mr=t,n=it(i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t===null&&(t=Ps()),Br--,t===null&&(n=null,Br===0&&zr(nr)),t}function Ps(){var e,t,n;return e=Or,t=_s(),t!==null?(Mr=Or,n=rr(t),n?n=u:n=o,n!==null?(Mr=e,t=ir(t),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),e}function Hs(){var t,n,r,i;return Qn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Gn)),t===null&&(t=Or,e.charCodeAt(Or)===58?(n=sr,Or++):(n=null,Br===0&&zr(or)),n!==null?(r=Or,Br++,e.charCodeAt(Or)===32?(i=M,Or++):(i=null,Br===0&&zr(_)),Br--,i===null?r=u:(Or=r,r=o),r!==null?(Mr=t,n=P(n),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)),t}function Bs(){var e,t,n;return Br++,e=Or,t=_s(),t!==null?(Mr=Or,n=ar(t),n?n=u:n=o,n!==null?(Mr=e,t=ir(t),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),Br--,e===null&&(t=null,Br===0&&zr(ur)),e}function js(){var e,t,n;return e=Or,t=Fs(),t!==null?(n=zs(),n!==null?(Mr=e,t=it(n),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),e}function Fs(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61423?(n=lr,Or++):(n=null,Br===0&&zr(cr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(fr)),t}function Is(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61438?(n=dr,Or++):(n=null,Br===0&&zr(vr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(pr)),t}function qs(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61422?(n=gr,Or++):(n=null,Br===0&&zr(yr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(mr)),t}function Rs(){var t,n,r;return Br++,t=Or,e.charCodeAt(Or)===61439?(n=wr,Or++):(n=null,Br===0&&zr(Er)),n!==null?(e.charCodeAt(Or)===10?(r=Sr,Or++):(r=null,Br===0&&zr(xr)),r!==null?(Mr=t,n=wn(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),Br--,t===null&&(n=null,Br===0&&zr(br)),t}function Us(){var e,t;return Br++,e=Is(),e===null&&(e=qs()),Br--,e===null&&(t=null,Br===0&&zr(Tr)),e}function zs(){var t,n,r;Br++,t=Or,n=[],r=Xs();if(r!==null)while(r!==null)n.push(r),r=Xs();else n=o;return n!==null&&(n=e.substring(t,Or)),t=n,Br--,t===null&&(n=null,Br===0&&zr(Nr)),t}function Ws(){var e,t;Br++,e=[],t=Xs();while(t!==null)e.push(t),t=Xs();return Br--,e===null&&(t=null,Br===0&&zr(Cr)),e}function Xs(){var t,n;return Br++,Lr.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Ar)),Br--,t===null&&(n=null,Br===0&&zr(kr)),t}function Vs(){var t,n,r;return t=Or,n=Or,Br++,r=Fs(),r===null&&(r=Is(),r===null&&(r=Rs())),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function $s(){var t,n,r;t=Or,n=[],r=Vs();while(r!==null)n.push(r),r=Vs();return n!==null&&(n=e.substring(t,Or)),t=n,t}function eo(e,t,n){var r=e.hash;if(n){r=r||new Qs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Xr},s=Xr,o=null,u="",a=function(e){return e},f=function(e,t){return new Qs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new Qs.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new Qs.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Ks||!n.match(/[A-Z]/)?e:(e.mustache=eo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Ks||!n.match(/[A-Z]/)?e:eo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new Qs.ContentNode(">")),[u,new Qs.ContentNode("")])},Tn=function(e){return{shorthand:e,id:!0}},Nn=function(e){return{shorthand:e}},Cn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.1"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = function(m) { m.escaped = true; return m; }, + peg$c94 = function(m) { m.escaped = false; return m; }, + peg$c95 = function(a) { return new AST.ContentNode(a); }, + peg$c96 = "any character", + peg$c97 = "SingleMustacheOpen", + peg$c98 = "{", + peg$c99 = "\"{\"", + peg$c100 = "DoubleMustacheOpen", + peg$c101 = "{{", + peg$c102 = "\"{{\"", + peg$c103 = "TripleMustacheOpen", + peg$c104 = "{{{", + peg$c105 = "\"{{{\"", + peg$c106 = "SingleMustacheClose", + peg$c107 = "}", + peg$c108 = "\"}\"", + peg$c109 = "DoubleMustacheClose", + peg$c110 = "}}", + peg$c111 = "\"}}\"", + peg$c112 = "TripleMustacheClose", + peg$c113 = "}}}", + peg$c114 = "\"}}}\"", + peg$c115 = "InterpolationOpen", + peg$c116 = "#{", + peg$c117 = "\"#{\"", + peg$c118 = "InterpolationClose", + peg$c119 = "==", + peg$c120 = "\"==\"", + peg$c121 = function() { return false; }, + peg$c122 = function() { return true; }, + peg$c123 = function(h, s) { return h || s; }, + peg$c124 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c125 = function(s) { return { shorthand: s, id: true}; }, + peg$c126 = function(s) { return { shorthand: s }; }, + peg$c127 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c128 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c129 = /^[A-Za-z.0-9_\-]/, + peg$c130 = "[A-Za-z.0-9_\\-]", + peg$c131 = function(id) { return new AST.MustacheNode([id]); }, + peg$c132 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c133 = function(value) { return value.replace(/ *$/, ''); }, + peg$c134 = "!", + peg$c135 = "\"!\"", + peg$c136 = function(key, value) { return IS_EMBER; }, + peg$c137 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c138 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c139 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c140 = "_", + peg$c141 = "\"_\"", + peg$c142 = "-", + peg$c143 = "\"-\"", + peg$c144 = "%", + peg$c145 = "\"%\"", + peg$c146 = "#", + peg$c147 = "\"#\"", + peg$c148 = function(c) { return c;}, + peg$c149 = "CSSIdentifier", + peg$c150 = function(nmstart, nmchars) { return nmstart + nmchars; }, + peg$c151 = /^[_a-zA-Z0-9\-]/, + peg$c152 = "[_a-zA-Z0-9\\-]", + peg$c153 = /^[_a-zA-Z]/, + peg$c154 = "[_a-zA-Z]", + peg$c155 = /^[\x80-\xFF]/, + peg$c156 = "[\\x80-\\xFF]", + peg$c157 = "KnownHTMLTagName", + peg$c158 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c159 = function(t) { return t; }, + peg$c160 = ":", + peg$c161 = "\":\"", + peg$c162 = "a JS event", + peg$c163 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c164 = "INDENT", + peg$c165 = "\uEFEF", + peg$c166 = "\"\\uEFEF\"", + peg$c167 = function() { return ''; }, + peg$c168 = "DEDENT", + peg$c169 = "\uEFFE", + peg$c170 = "\"\\uEFFE\"", + peg$c171 = "Unmatched DEDENT", + peg$c172 = "\uEFEE", + peg$c173 = "\"\\uEFEE\"", + peg$c174 = "LineEnd", + peg$c175 = "\uEFFF", + peg$c176 = "\"\\uEFFF\"", + peg$c177 = "\n", + peg$c178 = "\"\\n\"", + peg$c179 = "ANYDEDENT", + peg$c180 = "RequiredWhitespace", + peg$c181 = "OptionalWhitespace", + peg$c182 = "InlineWhitespace", + peg$c183 = /^[ \t]/, + peg$c184 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = peg$parseindentedContent(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheNestedContent(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c98; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c101) { + s0 = peg$c101; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c104) { + s0 = peg$c104; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c116) { + s0 = peg$c116; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c119) { + s1 = peg$c119; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c123(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c129.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c107; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c134; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c136(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c146; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsenmstart(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parsenmchar(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsenmchar(); + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c151.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c158(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c159(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c151.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c163(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c159(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c165; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c175; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c177; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c183.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.1/emblem.min.js b/ajax/libs/emblem/0.2.1/emblem.min.js new file mode 100644 index 000000000..b46481ed9 --- /dev/null +++ b/ajax/libs/emblem/0.2.1/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.1",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Fr(){return e.substring(Mr,Or)}function Ir(){return Mr}function qr(){return Ur(Mr).line}function Rr(){return Ur(Mr).column}function Ur(t){function n(t,n){var r,i;for(r=0;rt&&(_r=0,Dr={line:1,column:1,seenCR:!1}),_r=t,n(Dr,_r)),Dr}function zr(e){if(OrPr&&(Pr=Or,Hr=[]),Hr.push(e)}function Wr(e){var t=0;e.sort();while(tOr?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Ki(){var t,n,r;return t=Or,n=Or,Br++,r=Yi(),r===null&&(e.charCodeAt(Or)===39?(r=kt,Or++):(r=null,Br===0&&zr(Lt))),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Qi(){var t,n,r,i;t=Or,n=Or,r=[],i=Gi();if(i!==null)while(i!==null)r.push(i),i=Gi();else r=o;return r!==null&&(r=e.substring(n,Or)),n=r,n!==null&&(Mr=t,n=$t(n)),n===null?(Or=t,t=n):t=n,t}function Gi(){var t,n,r;return t=Or,n=Or,Br++,r=Yi(),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Yi(){var e;return e=rs(),e===null&&(e=ns(),e===null&&(e=us(),e===null&&(e=zs(),e===null&&(e=Us())))),e}function Zi(){var e,t,n,r,i,s;return e=Or,t=ts(),t!==null?(n=Xs(),n!==null?(r=pi(),r!==null?(i=Xs(),i!==null?(s=is(),s!==null?(Mr=e,t=Xt(r),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o),e}function es(){var e;return e=Zi(),e===null&&(e=Xi(),e===null&&(e=Wi())),e}function ts(){var t,n;return Br++,e.charCodeAt(Or)===123?(t=Qt,Or++):(t=null,Br===0&&zr(Gt)),Br--,t===null&&(n=null,Br===0&&zr(Kt)),t}function ns(){var t,n;return Br++,e.substr(Or,2)===Zt?(t=Zt,Or+=2):(t=null,Br===0&&zr(en)),Br--,t===null&&(n=null,Br===0&&zr(Yt)),t}function rs(){var t,n;return Br++,e.substr(Or,3)===nn?(t=nn,Or+=3):(t=null,Br===0&&zr(rn)),Br--,t===null&&(n=null,Br===0&&zr(tn)),t}function is(){var t,n;return Br++,e.charCodeAt(Or)===125?(t=on,Or++):(t=null,Br===0&&zr(un)),Br--,t===null&&(n=null,Br===0&&zr(sn)),t}function ss(){var t,n;return Br++,e.substr(Or,2)===fn?(t=fn,Or+=2):(t=null,Br===0&&zr(ln)),Br--,t===null&&(n=null,Br===0&&zr(an)),t}function os(){var t,n;return Br++,e.substr(Or,3)===hn?(t=hn,Or+=3):(t=null,Br===0&&zr(pn)),Br--,t===null&&(n=null,Br===0&&zr(cn)),t}function us(){var t,n;return Br++,e.substr(Or,2)===vn?(t=vn,Or+=2):(t=null,Br===0&&zr(mn)),Br--,t===null&&(n=null,Br===0&&zr(dn)),t}function as(){var t,n;return Br++,e.charCodeAt(Or)===125?(t=on,Or++):(t=null,Br===0&&zr(un)),Br--,t===null&&(n=null,Br===0&&zr(gn)),t}function fs(){var t,n,r;return t=Or,e.substr(Or,2)===yn?(n=yn,Or+=2):(n=null,Br===0&&zr(bn)),n!==null?(e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_)),r===null&&(r=u),r!==null?(Mr=t,n=wn(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t===null&&(t=Or,e.charCodeAt(Or)===61?(n=l,Or++):(n=null,Br===0&&zr(c)),n!==null?(e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_)),r===null&&(r=u),r!==null?(Mr=t,n=En(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)),t}function ls(){var e,t,n,r;return e=Or,t=Ds(),t===null&&(t=u),t!==null?(n=vi(),n===null&&(n=u),n!==null?(Mr=Or,r=Sn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Or=e,e=o)):(Or=e,e=o)):(Or=e,e=o),e}function cs(){var e,t,n,r,i;e=Or,t=ls();if(t!==null){n=[],r=es();while(r!==null)n.push(r),r=es();if(n!==null){r=[],i=hs();while(i!==null)r.push(i),i=hs();r!==null?(Mr=e,t=xn(t,n,r),t===null?(Or=e,e=t):e=t):(Or=e,e=o)}else Or=e,e=o}else Or=e,e=o;return e}function vi(){var e,t,n,r;e=Or,t=[],n=Or,r=Ns(),r!==null&&(Mr=n,r=Tn(r)),r===null?(Or=n,n=r):n=r,n===null&&(n=Or,r=Cs(),r!==null&&(Mr=n,r=Nn(r)),r===null?(Or=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Or,r=Ns(),r!==null&&(Mr=n,r=Tn(r)),r===null?(Or=n,n=r):n=r,n===null&&(n=Or,r=Cs(),r!==null&&(Mr=n,r=Nn(r)),r===null?(Or=n,n=r):n=r);else t=o;return t!==null&&(Mr=e,t=Cn(t)),t===null?(Or=e,e=t):e=t,e}function hs(){var t,n,r;t=Or,n=[],e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Or)===32?(r=M,Or++):(r=null,Br===0&&zr(_));else n=o;return n!==null?(r=ms(),r===null&&(r=ys(),r===null&&(r=bs(),r===null&&(r=ws()))),r!==null?(Mr=t,n=kn(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function ps(){var t;return Ln.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(An)),t===null&&(t=Bs()),t}function ds(){var e,t;return e=vs(),e===null&&(e=Or,t=Ci(),t!==null&&(Mr=e,t=On(t)),t===null?(Or=e,e=t):e=t),e}function vs(){var t,n,r,i,s;return t=Or,n=Or,e.charCodeAt(Or)===34?(r=Nt,Or++):(r=null,Br===0&&zr(Ct)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Or)===34?(s=Nt,Or++):(s=null,Br===0&&zr(Ct)),s!==null?(r=[r,i,s],n=r):(Or=n,n=o)):(Or=n,n=o)):(Or=n,n=o),n===null&&(n=Or,e.charCodeAt(Or)===39?(r=kt,Or++):(r=null,Br===0&&zr(Lt)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Or)===39?(s=kt,Or++):(s=null,Br===0&&zr(Lt)),s!==null?(r=[r,i,s],n=r):(Or=n,n=o)):(Or=n,n=o)):(Or=n,n=o)),n!==null&&(Mr=t,n=At(n)),n===null?(Or=t,t=n):t=n,t}function ms(){var t,n,r,i;return t=Or,n=js(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=ds(),i!==null?(Mr=t,n=Mn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function gs(){var t,n,r,i,s,u;t=Or,e.charCodeAt(Or)===123?(n=Qt,Or++):(n=null,Br===0&&zr(Gt));if(n!==null){r=Xs();if(r!==null){i=Or,s=[],u=ps(),u===null&&(e.charCodeAt(Or)===32?(u=M,Or++):(u=null,Br===0&&zr(_)));if(u!==null)while(u!==null)s.push(u),u=ps(),u===null&&(e.charCodeAt(Or)===32?(u=M,Or++):(u=null,Br===0&&zr(_)));else s=o;s!==null&&(s=e.substring(i,Or)),i=s,i!==null?(s=Xs(),s!==null?(e.charCodeAt(Or)===125?(u=on,Or++):(u=null,Br===0&&zr(un)),u!==null?(Mr=t,n=_n(i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)}else Or=t,t=o}else Or=t,t=o;if(t===null){t=Or,n=[],r=ps();if(r!==null)while(r!==null)n.push(r),r=ps();else n=o;n!==null&&(n=e.substring(t,Or)),t=n}return t}function ys(){var t,n,r,i,s,a;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=gs(),i!==null?(s=Or,Br++,e.charCodeAt(Or)===33?(a=Dn,Or++):(a=null,Br===0&&zr(Pn)),Br--,a===null?s=u:(Or=s,s=o),s!==null?(Mr=Or,a=Hn(n,i),a?a=u:a=o,a!==null?(Mr=t,n=Bn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function bs(){var t,n,r,i;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=Ci(),i!==null?(Mr=t,n=jn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function ws(){var t,n,r,i;return t=Or,n=Ei(),n!==null?(e.charCodeAt(Or)===61?(r=l,Or++):(r=null,Br===0&&zr(c)),r!==null?(i=qi(),i!==null?(Mr=t,n=Fn(n,i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t}function Es(){var t,n,r;t=Or,n=[],r=xs();while(r!==null)n.push(r),r=xs();return n!==null&&(n=e.substring(t,Or)),t=n,t}function Ss(){var e;return e=_i(),e===null&&(e=xi()),e}function xs(){var t;return t=Hi(),t===null&&(St.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(xt)),t===null&&(e.charCodeAt(Or)===95?(t=In,Or++):(t=null,Br===0&&zr(qn)),t===null&&(e.charCodeAt(Or)===45?(t=Rn,Or++):(t=null,Br===0&&zr(Un))))),t}function Ts(){var t,n,r;return t=Or,e.charCodeAt(Or)===37?(n=zn,Or++):(n=null,Br===0&&zr(Wn)),n!==null?(r=ks(),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Ns(){var t,n,r;return t=Or,e.charCodeAt(Or)===35?(n=Xn,Or++):(n=null,Br===0&&zr(Vn)),n!==null?(r=ks(),r!==null?(Mr=t,n=$n(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Cs(){var t,n,r;return t=Or,e.charCodeAt(Or)===46?(n=et,Or++):(n=null,Br===0&&zr(tt)),n!==null?(r=ks(),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function ks(){var e,t;return Br++,e=Ls(),Br--,e===null&&(t=null,Br===0&&zr(Jn)),e}function Ls(){var t,n,r,i,s;t=Or,n=Os();if(n!==null){r=Or,i=[],s=As();while(s!==null)i.push(s),s=As();i!==null&&(i=e.substring(r,Or)),r=i,r!==null?(Mr=t,n=Kn(n,r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)}else Or=t,t=o;return t}function As(){var t;return Qn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Gn)),t===null&&(t=Ms()),t}function Os(){var t;return Yn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Zn)),t===null&&(t=Ms()),t}function Ms(){var t;return er.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(tr)),t}function _s(){var t,n,r;t=Or,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,Or)),t=n,t}function Ds(){var t,n,r,i;return Br++,t=Or,e.charCodeAt(Or)===37?(n=zn,Or++):(n=null,Br===0&&zr(Wn)),n!==null?(r=Xs(),r!==null?(i=_s(),i!==null?(Mr=t,n=it(i),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o)):(Or=t,t=o),t===null&&(t=Ps()),Br--,t===null&&(n=null,Br===0&&zr(nr)),t}function Ps(){var e,t,n;return e=Or,t=_s(),t!==null?(Mr=Or,n=rr(t),n?n=u:n=o,n!==null?(Mr=e,t=ir(t),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),e}function Hs(){var t;return Qn.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Gn)),t===null&&(t=Bs()),t}function Bs(){var t,n,r,i;return t=Or,e.charCodeAt(Or)===58?(n=sr,Or++):(n=null,Br===0&&zr(or)),n!==null?(r=Or,Br++,e.charCodeAt(Or)===32?(i=M,Or++):(i=null,Br===0&&zr(_)),Br--,i===null?r=u:(Or=r,r=o),r!==null?(Mr=t,n=P(n),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function js(){var e,t,n;return Br++,e=Or,t=_s(),t!==null?(Mr=Or,n=ar(t),n?n=u:n=o,n!==null?(Mr=e,t=ir(t),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),Br--,e===null&&(t=null,Br===0&&zr(ur)),e}function Fs(){var e,t,n;return e=Or,t=Is(),t!==null?(n=Ws(),n!==null?(Mr=e,t=it(n),t===null?(Or=e,e=t):e=t):(Or=e,e=o)):(Or=e,e=o),e}function Is(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61423?(n=lr,Or++):(n=null,Br===0&&zr(cr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(fr)),t}function qs(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61438?(n=dr,Or++):(n=null,Br===0&&zr(vr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(pr)),t}function Rs(){var t,n;return Br++,t=Or,e.charCodeAt(Or)===61422?(n=gr,Or++):(n=null,Br===0&&zr(yr)),n!==null&&(Mr=t,n=hr()),n===null?(Or=t,t=n):t=n,Br--,t===null&&(n=null,Br===0&&zr(mr)),t}function Us(){var t,n,r;return Br++,t=Or,e.charCodeAt(Or)===61439?(n=wr,Or++):(n=null,Br===0&&zr(Er)),n!==null?(e.charCodeAt(Or)===10?(r=Sr,Or++):(r=null,Br===0&&zr(xr)),r!==null?(Mr=t,n=wn(),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),Br--,t===null&&(n=null,Br===0&&zr(br)),t}function zs(){var e,t;return Br++,e=qs(),e===null&&(e=Rs()),Br--,e===null&&(t=null,Br===0&&zr(Tr)),e}function Ws(){var t,n,r;Br++,t=Or,n=[],r=Vs();if(r!==null)while(r!==null)n.push(r),r=Vs();else n=o;return n!==null&&(n=e.substring(t,Or)),t=n,Br--,t===null&&(n=null,Br===0&&zr(Nr)),t}function Xs(){var e,t;Br++,e=[],t=Vs();while(t!==null)e.push(t),t=Vs();return Br--,e===null&&(t=null,Br===0&&zr(Cr)),e}function Vs(){var t,n;return Br++,Lr.test(e.charAt(Or))?(t=e.charAt(Or),Or++):(t=null,Br===0&&zr(Ar)),Br--,t===null&&(n=null,Br===0&&zr(kr)),t}function $s(){var t,n,r;return t=Or,n=Or,Br++,r=Is(),r===null&&(r=qs(),r===null&&(r=Us())),Br--,r===null?n=u:(Or=n,n=o),n!==null?(e.length>Or?(r=e.charAt(Or),Or++):(r=null,Br===0&&zr(Jt)),r!==null?(Mr=t,n=P(r),n===null?(Or=t,t=n):t=n):(Or=t,t=o)):(Or=t,t=o),t}function Js(){var t,n,r;t=Or,n=[],r=$s();while(r!==null)n.push(r),r=$s();return n!==null&&(n=e.substring(t,Or)),t=n,t}function to(e,t,n){var r=e.hash;if(n){r=r||new Gs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Xr},s=Xr,o=null,u="",a=function(e){return e},f=function(e,t){return new Gs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new Gs.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new Gs.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:(e.mustache=to(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:to(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new Gs.ContentNode(">")),[u,new Gs.ContentNode("")])},Tn=function(e){return{shorthand:e,id:!0}},Nn=function(e){return{shorthand:e}},Cn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.2"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = function(m) { m.escaped = true; return m; }, + peg$c94 = function(m) { m.escaped = false; return m; }, + peg$c95 = function(a) { return new AST.ContentNode(a); }, + peg$c96 = "any character", + peg$c97 = "SingleMustacheOpen", + peg$c98 = "{", + peg$c99 = "\"{\"", + peg$c100 = "DoubleMustacheOpen", + peg$c101 = "{{", + peg$c102 = "\"{{\"", + peg$c103 = "TripleMustacheOpen", + peg$c104 = "{{{", + peg$c105 = "\"{{{\"", + peg$c106 = "SingleMustacheClose", + peg$c107 = "}", + peg$c108 = "\"}\"", + peg$c109 = "DoubleMustacheClose", + peg$c110 = "}}", + peg$c111 = "\"}}\"", + peg$c112 = "TripleMustacheClose", + peg$c113 = "}}}", + peg$c114 = "\"}}}\"", + peg$c115 = "InterpolationOpen", + peg$c116 = "#{", + peg$c117 = "\"#{\"", + peg$c118 = "InterpolationClose", + peg$c119 = "==", + peg$c120 = "\"==\"", + peg$c121 = function() { return false; }, + peg$c122 = function() { return true; }, + peg$c123 = function(h, s) { return h || s; }, + peg$c124 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c125 = function(s) { return { shorthand: s, id: true}; }, + peg$c126 = function(s) { return { shorthand: s }; }, + peg$c127 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c128 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c129 = /^[A-Za-z.0-9_\-]/, + peg$c130 = "[A-Za-z.0-9_\\-]", + peg$c131 = function(id) { return new AST.MustacheNode([id]); }, + peg$c132 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c133 = function(value) { return value.replace(/ *$/, ''); }, + peg$c134 = "!", + peg$c135 = "\"!\"", + peg$c136 = function(key, value) { return IS_EMBER; }, + peg$c137 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c138 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c139 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c140 = "_", + peg$c141 = "\"_\"", + peg$c142 = "-", + peg$c143 = "\"-\"", + peg$c144 = "%", + peg$c145 = "\"%\"", + peg$c146 = "#", + peg$c147 = "\"#\"", + peg$c148 = function(c) { return c;}, + peg$c149 = "CSSIdentifier", + peg$c150 = /^[_a-zA-Z0-9\-]/, + peg$c151 = "[_a-zA-Z0-9\\-]", + peg$c152 = /^[_a-zA-Z]/, + peg$c153 = "[_a-zA-Z]", + peg$c154 = /^[\x80-\xFF]/, + peg$c155 = "[\\x80-\\xFF]", + peg$c156 = "KnownHTMLTagName", + peg$c157 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c158 = function(t) { return t; }, + peg$c159 = ":", + peg$c160 = "\":\"", + peg$c161 = "a JS event", + peg$c162 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c163 = "INDENT", + peg$c164 = "\uEFEF", + peg$c165 = "\"\\uEFEF\"", + peg$c166 = function() { return ''; }, + peg$c167 = "DEDENT", + peg$c168 = "\uEFFE", + peg$c169 = "\"\\uEFFE\"", + peg$c170 = "Unmatched DEDENT", + peg$c171 = "\uEFEE", + peg$c172 = "\"\\uEFEE\"", + peg$c173 = "LineEnd", + peg$c174 = "\uEFFF", + peg$c175 = "\"\\uEFFF\"", + peg$c176 = "\n", + peg$c177 = "\"\\n\"", + peg$c178 = "ANYDEDENT", + peg$c179 = "RequiredWhitespace", + peg$c180 = "OptionalWhitespace", + peg$c181 = "InlineWhitespace", + peg$c182 = /^[ \t]/, + peg$c183 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = peg$parseindentedContent(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheNestedContent(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c98; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c101) { + s0 = peg$c101; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c104) { + s0 = peg$c104; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c116) { + s0 = peg$c116; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c119) { + s1 = peg$c119; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c123(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c129.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c107; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c134; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c136(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c146; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c154.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c157(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c159; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c164; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c168; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c176; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c182.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.2/emblem.min.js b/ajax/libs/emblem/0.2.2/emblem.min.js new file mode 100644 index 000000000..38d5d69c4 --- /dev/null +++ b/ajax/libs/emblem/0.2.2/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.2",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function jr(){return e.substring(Or,Ar)}function Fr(){return Or}function Ir(){return Rr(Or).line}function qr(){return Rr(Or).column}function Rr(t){function n(t,n){var r,i;for(r=0;rt&&(Mr=0,_r={line:1,column:1,seenCR:!1}),Mr=t,n(_r,Mr)),_r}function Ur(e){if(ArDr&&(Dr=Ar,Pr=[]),Pr.push(e)}function zr(e){var t=0;e.sort();while(tAr?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ji(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Gi(),r===null&&(e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt))),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ki(){var t,n,r,i;t=Ar,n=Ar,r=[],i=Qi();if(i!==null)while(i!==null)r.push(i),i=Qi();else r=o;return r!==null&&(r=e.substring(n,Ar)),n=r,n!==null&&(Or=t,n=$t(n)),n===null?(Ar=t,t=n):t=n,t}function Qi(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Gi(),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Gi(){var e;return e=ns(),e===null&&(e=ts(),e===null&&(e=os(),e===null&&(e=Us(),e===null&&(e=Rs())))),e}function Yi(){var e,t,n,r,i,s;return e=Ar,t=es(),t!==null?(n=Ws(),n!==null?(r=hi(),r!==null?(i=Ws(),i!==null?(s=rs(),s!==null?(Or=e,t=Xt(r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function Zi(){var e;return e=Yi(),e===null&&(e=Wi(),e===null&&(e=zi())),e}function es(){var t,n;return Hr++,e.charCodeAt(Ar)===123?(t=Qt,Ar++):(t=null,Hr===0&&Ur(Gt)),Hr--,t===null&&(n=null,Hr===0&&Ur(Kt)),t}function ts(){var t,n;return Hr++,e.substr(Ar,2)===Zt?(t=Zt,Ar+=2):(t=null,Hr===0&&Ur(en)),Hr--,t===null&&(n=null,Hr===0&&Ur(Yt)),t}function ns(){var t,n;return Hr++,e.substr(Ar,3)===nn?(t=nn,Ar+=3):(t=null,Hr===0&&Ur(rn)),Hr--,t===null&&(n=null,Hr===0&&Ur(tn)),t}function rs(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(sn)),t}function is(){var t,n;return Hr++,e.substr(Ar,2)===fn?(t=fn,Ar+=2):(t=null,Hr===0&&Ur(ln)),Hr--,t===null&&(n=null,Hr===0&&Ur(an)),t}function ss(){var t,n;return Hr++,e.substr(Ar,3)===hn?(t=hn,Ar+=3):(t=null,Hr===0&&Ur(pn)),Hr--,t===null&&(n=null,Hr===0&&Ur(cn)),t}function os(){var t,n;return Hr++,e.substr(Ar,2)===vn?(t=vn,Ar+=2):(t=null,Hr===0&&Ur(mn)),Hr--,t===null&&(n=null,Hr===0&&Ur(dn)),t}function us(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(gn)),t}function as(){var t,n,r;return t=Ar,e.substr(Ar,2)===yn?(n=yn,Ar+=2):(n=null,Hr===0&&Ur(bn)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ar,e.charCodeAt(Ar)===61?(n=l,Ar++):(n=null,Hr===0&&Ur(c)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=En(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)),t}function fs(){var e,t,n,r;return e=Ar,t=_s(),t===null&&(t=u),t!==null?(n=di(),n===null&&(n=u),n!==null?(Or=Ar,r=Sn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function ls(){var e,t,n,r,i;e=Ar,t=fs();if(t!==null){n=[],r=Zi();while(r!==null)n.push(r),r=Zi();if(n!==null){r=[],i=cs();while(i!==null)r.push(i),i=cs();r!==null?(Or=e,t=xn(t,n,r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)}else Ar=e,e=o}else Ar=e,e=o;return e}function di(){var e,t,n,r;e=Ar,t=[],n=Ar,r=Ts(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Ns(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Ar,r=Ts(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Ns(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);else t=o;return t!==null&&(Or=e,t=Cn(t)),t===null?(Ar=e,e=t):e=t,e}function cs(){var t,n,r;t=Ar,n=[],e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));else n=o;return n!==null?(r=vs(),r===null&&(r=gs(),r===null&&(r=ys(),r===null&&(r=bs()))),r!==null?(Or=t,n=kn(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function hs(){var t;return Ln.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(An)),t===null&&(t=Hs()),t}function ps(){var e,t;return e=ds(),e===null&&(e=Ar,t=Ni(),t!==null&&(Or=e,t=On(t)),t===null?(Ar=e,e=t):e=t),e}function ds(){var t,n,r,i,s;return t=Ar,n=Ar,e.charCodeAt(Ar)===34?(r=Nt,Ar++):(r=null,Hr===0&&Ur(Ct)),r!==null?(i=hi(),i!==null?(e.charCodeAt(Ar)===34?(s=Nt,Ar++):(s=null,Hr===0&&Ur(Ct)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o),n===null&&(n=Ar,e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt)),r!==null?(i=hi(),i!==null?(e.charCodeAt(Ar)===39?(s=kt,Ar++):(s=null,Hr===0&&Ur(Lt)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o)),n!==null&&(Or=t,n=At(n)),n===null?(Ar=t,t=n):t=n,t}function vs(){var t,n,r,i;return t=Ar,n=Bs(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=ps(),i!==null?(Or=t,n=Mn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function ms(){var t,n,r,i,s,u;t=Ar,e.charCodeAt(Ar)===123?(n=Qt,Ar++):(n=null,Hr===0&&Ur(Gt));if(n!==null){r=Ws();if(r!==null){i=Ar,s=[],u=hs(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));if(u!==null)while(u!==null)s.push(u),u=hs(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));else s=o;s!==null&&(s=e.substring(i,Ar)),i=s,i!==null?(s=Ws(),s!==null?(e.charCodeAt(Ar)===125?(u=on,Ar++):(u=null,Hr===0&&Ur(un)),u!==null?(Or=t,n=_n(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)}else Ar=t,t=o}else Ar=t,t=o;if(t===null){t=Ar,n=[],r=hs();if(r!==null)while(r!==null)n.push(r),r=hs();else n=o;n!==null&&(n=e.substring(t,Ar)),t=n}return t}function gs(){var t,n,r,i,s,a;return t=Ar,n=wi(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=ms(),i!==null?(s=Ar,Hr++,e.charCodeAt(Ar)===33?(a=Dn,Ar++):(a=null,Hr===0&&Ur(Pn)),Hr--,a===null?s=u:(Ar=s,s=o),s!==null?(Or=Ar,a=Hn(n,i),a?a=u:a=o,a!==null?(Or=t,n=Bn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function ys(){var t,n,r,i;return t=Ar,n=wi(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=Ni(),i!==null?(Or=t,n=jn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function bs(){var t,n,r,i;return t=Ar,n=wi(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=Ii(),i!==null?(Or=t,n=Fn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function ws(){var t,n,r;t=Ar,n=[],r=Ss();while(r!==null)n.push(r),r=Ss();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Es(){var e;return e=Mi(),e===null&&(e=Si()),e}function Ss(){var t;return t=Pi(),t===null&&(St.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(xt)),t===null&&(e.charCodeAt(Ar)===95?(t=In,Ar++):(t=null,Hr===0&&Ur(qn)),t===null&&(e.charCodeAt(Ar)===45?(t=Rn,Ar++):(t=null,Hr===0&&Ur(Un))))),t}function xs(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=Cs(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ts(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===35?(n=Xn,Ar++):(n=null,Hr===0&&Ur(Vn)),n!==null?(r=Cs(),r!==null?(Or=t,n=$n(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ns(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===46?(n=et,Ar++):(n=null,Hr===0&&Ur(tt)),n!==null?(r=Cs(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Cs(){var e,t;return Hr++,e=ks(),Hr--,e===null&&(t=null,Hr===0&&Ur(Jn)),e}function ks(){var t,n,r;t=Ar,n=[],r=Ls();while(r!==null)n.push(r),r=Ls();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Ls(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Os()),t}function As(){var t;return Gn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Yn)),t===null&&(t=Os()),t}function Os(){var t;return Zn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(er)),t}function Ms(){var t,n,r;t=Ar,n=[],r=Ps();if(r!==null)while(r!==null)n.push(r),r=Ps();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,t}function _s(){var t,n,r,i;return Hr++,t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=Ws(),r!==null?(i=Ms(),i!==null?(Or=t,n=it(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ds()),Hr--,t===null&&(n=null,Hr===0&&Ur(tr)),t}function Ds(){var e,t,n;return e=Ar,t=Ms(),t!==null?(Or=Ar,n=nr(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Ps(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Hs()),t}function Hs(){var t,n,r,i;return t=Ar,e.charCodeAt(Ar)===58?(n=ir,Ar++):(n=null,Hr===0&&Ur(sr)),n!==null?(r=Ar,Hr++,e.charCodeAt(Ar)===32?(i=M,Ar++):(i=null,Hr===0&&Ur(_)),Hr--,i===null?r=u:(Ar=r,r=o),r!==null?(Or=t,n=P(n),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Bs(){var e,t,n;return Hr++,e=Ar,t=Ms(),t!==null?(Or=Ar,n=ur(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),Hr--,e===null&&(t=null,Hr===0&&Ur(or)),e}function js(){var e,t,n;return e=Ar,t=Fs(),t!==null?(n=zs(),n!==null?(Or=e,t=it(n),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Fs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61423?(n=fr,Ar++):(n=null,Hr===0&&Ur(lr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(ar)),t}function Is(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61438?(n=pr,Ar++):(n=null,Hr===0&&Ur(dr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(hr)),t}function qs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61422?(n=mr,Ar++):(n=null,Hr===0&&Ur(gr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(vr)),t}function Rs(){var t,n,r;return Hr++,t=Ar,e.charCodeAt(Ar)===61439?(n=br,Ar++):(n=null,Hr===0&&Ur(wr)),n!==null?(e.charCodeAt(Ar)===10?(r=Er,Ar++):(r=null,Hr===0&&Ur(Sr)),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),Hr--,t===null&&(n=null,Hr===0&&Ur(yr)),t}function Us(){var e,t;return Hr++,e=Is(),e===null&&(e=qs()),Hr--,e===null&&(t=null,Hr===0&&Ur(xr)),e}function zs(){var t,n,r;Hr++,t=Ar,n=[],r=Xs();if(r!==null)while(r!==null)n.push(r),r=Xs();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(Tr)),t}function Ws(){var e,t;Hr++,e=[],t=Xs();while(t!==null)e.push(t),t=Xs();return Hr--,e===null&&(t=null,Hr===0&&Ur(Nr)),e}function Xs(){var t,n;return Hr++,kr.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Lr)),Hr--,t===null&&(n=null,Hr===0&&Ur(Cr)),t}function Vs(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Fs(),r===null&&(r=Is(),r===null&&(r=Rs())),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function $s(){var t,n,r;t=Ar,n=[],r=Vs();while(r!==null)n.push(r),r=Vs();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function eo(e,t,n){var r=e.hash;if(n){r=r||new Qs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Wr},s=Wr,o=null,u="",a=function(e){return e},f=function(e,t){return new Qs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new Qs.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new Qs.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Ks||!n.match(/[A-Z]/)?e:(e.mustache=eo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Ks||!n.match(/[A-Z]/)?e:eo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new Qs.ContentNode(">")),[u,new Qs.ContentNode("")])},Tn=function(e){return{shorthand:e,id:!0}},Nn=function(e){return{shorthand:e}},Cn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.3"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = function(m) { m.escaped = true; return m; }, + peg$c94 = function(m) { m.escaped = false; return m; }, + peg$c95 = function(a) { return new AST.ContentNode(a); }, + peg$c96 = "any character", + peg$c97 = "SingleMustacheOpen", + peg$c98 = "{", + peg$c99 = "\"{\"", + peg$c100 = "DoubleMustacheOpen", + peg$c101 = "{{", + peg$c102 = "\"{{\"", + peg$c103 = "TripleMustacheOpen", + peg$c104 = "{{{", + peg$c105 = "\"{{{\"", + peg$c106 = "SingleMustacheClose", + peg$c107 = "}", + peg$c108 = "\"}\"", + peg$c109 = "DoubleMustacheClose", + peg$c110 = "}}", + peg$c111 = "\"}}\"", + peg$c112 = "TripleMustacheClose", + peg$c113 = "}}}", + peg$c114 = "\"}}}\"", + peg$c115 = "InterpolationOpen", + peg$c116 = "#{", + peg$c117 = "\"#{\"", + peg$c118 = "InterpolationClose", + peg$c119 = "==", + peg$c120 = "\"==\"", + peg$c121 = function() { return false; }, + peg$c122 = function() { return true; }, + peg$c123 = function(h, s) { return h || s; }, + peg$c124 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c125 = function(s) { return { shorthand: s, id: true}; }, + peg$c126 = function(s) { return { shorthand: s }; }, + peg$c127 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c128 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c129 = /^[A-Za-z.0-9_\-]/, + peg$c130 = "[A-Za-z.0-9_\\-]", + peg$c131 = function(id) { return new AST.MustacheNode([id]); }, + peg$c132 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c133 = function(value) { return value.replace(/ *$/, ''); }, + peg$c134 = "!", + peg$c135 = "\"!\"", + peg$c136 = function(key, value) { return IS_EMBER; }, + peg$c137 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c138 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c139 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c140 = "_", + peg$c141 = "\"_\"", + peg$c142 = "-", + peg$c143 = "\"-\"", + peg$c144 = "%", + peg$c145 = "\"%\"", + peg$c146 = "#", + peg$c147 = "\"#\"", + peg$c148 = function(c) { return c;}, + peg$c149 = "CSSIdentifier", + peg$c150 = /^[_a-zA-Z0-9\-]/, + peg$c151 = "[_a-zA-Z0-9\\-]", + peg$c152 = /^[_a-zA-Z]/, + peg$c153 = "[_a-zA-Z]", + peg$c154 = /^[\x80-\xFF]/, + peg$c155 = "[\\x80-\\xFF]", + peg$c156 = "KnownHTMLTagName", + peg$c157 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c158 = function(t) { return t; }, + peg$c159 = ":", + peg$c160 = "\":\"", + peg$c161 = "a JS event", + peg$c162 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c163 = "INDENT", + peg$c164 = "\uEFEF", + peg$c165 = "\"\\uEFEF\"", + peg$c166 = function() { return ''; }, + peg$c167 = "DEDENT", + peg$c168 = "\uEFFE", + peg$c169 = "\"\\uEFFE\"", + peg$c170 = "Unmatched DEDENT", + peg$c171 = "\uEFEE", + peg$c172 = "\"\\uEFEE\"", + peg$c173 = "LineEnd", + peg$c174 = "\uEFFF", + peg$c175 = "\"\\uEFFF\"", + peg$c176 = "\n", + peg$c177 = "\"\\n\"", + peg$c178 = "ANYDEDENT", + peg$c179 = "RequiredWhitespace", + peg$c180 = "OptionalWhitespace", + peg$c181 = "InlineWhitespace", + peg$c182 = /^[ \t]/, + peg$c183 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsebooleanNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c98; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c101) { + s0 = peg$c101; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c104) { + s0 = peg$c104; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c116) { + s0 = peg$c116; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c119) { + s1 = peg$c119; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c123(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c129.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c107; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c134; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c136(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c146; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c154.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c157(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c159; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c164; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c168; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c176; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c182.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.3/emblem.min.js b/ajax/libs/emblem/0.2.3/emblem.min.js new file mode 100644 index 000000000..245c5de85 --- /dev/null +++ b/ajax/libs/emblem/0.2.3/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.3",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function jr(){return e.substring(Or,Ar)}function Fr(){return Or}function Ir(){return Rr(Or).line}function qr(){return Rr(Or).column}function Rr(t){function n(t,n){var r,i;for(r=0;rt&&(Mr=0,_r={line:1,column:1,seenCR:!1}),Mr=t,n(_r,Mr)),_r}function Ur(e){if(ArDr&&(Dr=Ar,Pr=[]),Pr.push(e)}function zr(e){var t=0;e.sort();while(tAr?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ki(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Yi(),r===null&&(e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt))),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Qi(){var t,n,r,i;t=Ar,n=Ar,r=[],i=Gi();if(i!==null)while(i!==null)r.push(i),i=Gi();else r=o;return r!==null&&(r=e.substring(n,Ar)),n=r,n!==null&&(Or=t,n=$t(n)),n===null?(Ar=t,t=n):t=n,t}function Gi(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Yi(),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Yi(){var e;return e=rs(),e===null&&(e=ns(),e===null&&(e=us(),e===null&&(e=zs(),e===null&&(e=Us())))),e}function Zi(){var e,t,n,r,i,s;return e=Ar,t=ts(),t!==null?(n=Xs(),n!==null?(r=pi(),r!==null?(i=Xs(),i!==null?(s=is(),s!==null?(Or=e,t=Xt(r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function es(){var e;return e=Zi(),e===null&&(e=Xi(),e===null&&(e=Wi())),e}function ts(){var t,n;return Hr++,e.charCodeAt(Ar)===123?(t=Qt,Ar++):(t=null,Hr===0&&Ur(Gt)),Hr--,t===null&&(n=null,Hr===0&&Ur(Kt)),t}function ns(){var t,n;return Hr++,e.substr(Ar,2)===Zt?(t=Zt,Ar+=2):(t=null,Hr===0&&Ur(en)),Hr--,t===null&&(n=null,Hr===0&&Ur(Yt)),t}function rs(){var t,n;return Hr++,e.substr(Ar,3)===nn?(t=nn,Ar+=3):(t=null,Hr===0&&Ur(rn)),Hr--,t===null&&(n=null,Hr===0&&Ur(tn)),t}function is(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(sn)),t}function ss(){var t,n;return Hr++,e.substr(Ar,2)===fn?(t=fn,Ar+=2):(t=null,Hr===0&&Ur(ln)),Hr--,t===null&&(n=null,Hr===0&&Ur(an)),t}function os(){var t,n;return Hr++,e.substr(Ar,3)===hn?(t=hn,Ar+=3):(t=null,Hr===0&&Ur(pn)),Hr--,t===null&&(n=null,Hr===0&&Ur(cn)),t}function us(){var t,n;return Hr++,e.substr(Ar,2)===vn?(t=vn,Ar+=2):(t=null,Hr===0&&Ur(mn)),Hr--,t===null&&(n=null,Hr===0&&Ur(dn)),t}function as(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(gn)),t}function fs(){var t,n,r;return t=Ar,e.substr(Ar,2)===yn?(n=yn,Ar+=2):(n=null,Hr===0&&Ur(bn)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ar,e.charCodeAt(Ar)===61?(n=l,Ar++):(n=null,Hr===0&&Ur(c)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=En(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)),t}function ls(){var e,t,n,r;return e=Ar,t=Ds(),t===null&&(t=u),t!==null?(n=vi(),n===null&&(n=u),n!==null?(Or=Ar,r=Sn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function cs(){var e,t,n,r,i;e=Ar,t=ls();if(t!==null){n=[],r=es();while(r!==null)n.push(r),r=es();if(n!==null){r=[],i=hs();while(i!==null)r.push(i),i=hs();r!==null?(Or=e,t=xn(t,n,r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)}else Ar=e,e=o}else Ar=e,e=o;return e}function vi(){var e,t,n,r;e=Ar,t=[],n=Ar,r=Ns(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Cs(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Ar,r=Ns(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Cs(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);else t=o;return t!==null&&(Or=e,t=Cn(t)),t===null?(Ar=e,e=t):e=t,e}function hs(){var t,n,r;t=Ar,n=[],e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));else n=o;return n!==null?(r=ms(),r===null&&(r=ys(),r===null&&(r=bs(),r===null&&(r=ws()))),r!==null?(Or=t,n=kn(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function ps(){var t;return Ln.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(An)),t===null&&(t=Bs()),t}function ds(){var e,t;return e=vs(),e===null&&(e=Ar,t=Ci(),t!==null&&(Or=e,t=On(t)),t===null?(Ar=e,e=t):e=t),e}function vs(){var t,n,r,i,s;return t=Ar,n=Ar,e.charCodeAt(Ar)===34?(r=Nt,Ar++):(r=null,Hr===0&&Ur(Ct)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Ar)===34?(s=Nt,Ar++):(s=null,Hr===0&&Ur(Ct)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o),n===null&&(n=Ar,e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Ar)===39?(s=kt,Ar++):(s=null,Hr===0&&Ur(Lt)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o)),n!==null&&(Or=t,n=At(n)),n===null?(Ar=t,t=n):t=n,t}function ms(){var t,n,r,i;return t=Ar,n=js(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=ds(),i!==null?(Or=t,n=Mn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function gs(){var t,n,r,i,s,u;t=Ar,e.charCodeAt(Ar)===123?(n=Qt,Ar++):(n=null,Hr===0&&Ur(Gt));if(n!==null){r=Xs();if(r!==null){i=Ar,s=[],u=ps(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));if(u!==null)while(u!==null)s.push(u),u=ps(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));else s=o;s!==null&&(s=e.substring(i,Ar)),i=s,i!==null?(s=Xs(),s!==null?(e.charCodeAt(Ar)===125?(u=on,Ar++):(u=null,Hr===0&&Ur(un)),u!==null?(Or=t,n=_n(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)}else Ar=t,t=o}else Ar=t,t=o;if(t===null){t=Ar,n=[],r=ps();if(r!==null)while(r!==null)n.push(r),r=ps();else n=o;n!==null&&(n=e.substring(t,Ar)),t=n}return t}function ys(){var t,n,r,i,s,a;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=gs(),i!==null?(s=Ar,Hr++,e.charCodeAt(Ar)===33?(a=Dn,Ar++):(a=null,Hr===0&&Ur(Pn)),Hr--,a===null?s=u:(Ar=s,s=o),s!==null?(Or=Ar,a=Hn(n,i),a?a=u:a=o,a!==null?(Or=t,n=Bn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function bs(){var t,n,r,i;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=Ci(),i!==null?(Or=t,n=jn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function ws(){var t,n,r,i;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=qi(),i!==null?(Or=t,n=Fn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function Es(){var t,n,r;t=Ar,n=[],r=xs();while(r!==null)n.push(r),r=xs();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Ss(){var e;return e=_i(),e===null&&(e=xi()),e}function xs(){var t;return t=Hi(),t===null&&(St.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(xt)),t===null&&(e.charCodeAt(Ar)===95?(t=In,Ar++):(t=null,Hr===0&&Ur(qn)),t===null&&(e.charCodeAt(Ar)===45?(t=Rn,Ar++):(t=null,Hr===0&&Ur(Un))))),t}function Ts(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=ks(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ns(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===35?(n=Xn,Ar++):(n=null,Hr===0&&Ur(Vn)),n!==null?(r=ks(),r!==null?(Or=t,n=$n(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Cs(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===46?(n=et,Ar++):(n=null,Hr===0&&Ur(tt)),n!==null?(r=ks(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function ks(){var e,t;return Hr++,e=Ls(),Hr--,e===null&&(t=null,Hr===0&&Ur(Jn)),e}function Ls(){var t,n,r;t=Ar,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function As(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Ms()),t}function Os(){var t;return Gn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Yn)),t===null&&(t=Ms()),t}function Ms(){var t;return Zn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(er)),t}function _s(){var t,n,r;t=Ar,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Ds(){var t,n,r,i;return Hr++,t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=Xs(),r!==null?(i=_s(),i!==null?(Or=t,n=it(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ps()),Hr--,t===null&&(n=null,Hr===0&&Ur(tr)),t}function Ps(){var e,t,n;return e=Ar,t=_s(),t!==null?(Or=Ar,n=nr(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Hs(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Bs()),t}function Bs(){var t,n,r,i;return t=Ar,e.charCodeAt(Ar)===58?(n=ir,Ar++):(n=null,Hr===0&&Ur(sr)),n!==null?(r=Ar,Hr++,e.charCodeAt(Ar)===32?(i=M,Ar++):(i=null,Hr===0&&Ur(_)),Hr--,i===null?r=u:(Ar=r,r=o),r!==null?(Or=t,n=P(n),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function js(){var e,t,n;return Hr++,e=Ar,t=_s(),t!==null?(Or=Ar,n=ur(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),Hr--,e===null&&(t=null,Hr===0&&Ur(or)),e}function Fs(){var e,t,n;return e=Ar,t=Is(),t!==null?(n=Ws(),n!==null?(Or=e,t=it(n),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Is(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61423?(n=fr,Ar++):(n=null,Hr===0&&Ur(lr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(ar)),t}function qs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61438?(n=pr,Ar++):(n=null,Hr===0&&Ur(dr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(hr)),t}function Rs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61422?(n=mr,Ar++):(n=null,Hr===0&&Ur(gr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(vr)),t}function Us(){var t,n,r;return Hr++,t=Ar,e.charCodeAt(Ar)===61439?(n=br,Ar++):(n=null,Hr===0&&Ur(wr)),n!==null?(e.charCodeAt(Ar)===10?(r=Er,Ar++):(r=null,Hr===0&&Ur(Sr)),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),Hr--,t===null&&(n=null,Hr===0&&Ur(yr)),t}function zs(){var e,t;return Hr++,e=qs(),e===null&&(e=Rs()),Hr--,e===null&&(t=null,Hr===0&&Ur(xr)),e}function Ws(){var t,n,r;Hr++,t=Ar,n=[],r=Vs();if(r!==null)while(r!==null)n.push(r),r=Vs();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(Tr)),t}function Xs(){var e,t;Hr++,e=[],t=Vs();while(t!==null)e.push(t),t=Vs();return Hr--,e===null&&(t=null,Hr===0&&Ur(Nr)),e}function Vs(){var t,n;return Hr++,kr.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Lr)),Hr--,t===null&&(n=null,Hr===0&&Ur(Cr)),t}function $s(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Is(),r===null&&(r=qs(),r===null&&(r=Us())),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Js(){var t,n,r;t=Ar,n=[],r=$s();while(r!==null)n.push(r),r=$s();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function to(e,t,n){var r=e.hash;if(n){r=r||new Gs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Wr},s=Wr,o=null,u="",a=function(e){return e},f=function(e,t){return new Gs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new Gs.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new Gs.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:(e.mustache=to(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:to(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new Gs.ContentNode(">")),[u,new Gs.ContentNode("")])},Tn=function(e){return{shorthand:e,id:!0}},Nn=function(e){return{shorthand:e}},Cn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.4"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = function(m) { m.escaped = true; return m; }, + peg$c94 = function(m) { m.escaped = false; return m; }, + peg$c95 = function(a) { return new AST.ContentNode(a); }, + peg$c96 = "any character", + peg$c97 = "SingleMustacheOpen", + peg$c98 = "{", + peg$c99 = "\"{\"", + peg$c100 = "DoubleMustacheOpen", + peg$c101 = "{{", + peg$c102 = "\"{{\"", + peg$c103 = "TripleMustacheOpen", + peg$c104 = "{{{", + peg$c105 = "\"{{{\"", + peg$c106 = "SingleMustacheClose", + peg$c107 = "}", + peg$c108 = "\"}\"", + peg$c109 = "DoubleMustacheClose", + peg$c110 = "}}", + peg$c111 = "\"}}\"", + peg$c112 = "TripleMustacheClose", + peg$c113 = "}}}", + peg$c114 = "\"}}}\"", + peg$c115 = "InterpolationOpen", + peg$c116 = "#{", + peg$c117 = "\"#{\"", + peg$c118 = "InterpolationClose", + peg$c119 = "==", + peg$c120 = "\"==\"", + peg$c121 = function() { return false; }, + peg$c122 = function() { return true; }, + peg$c123 = function(h, s) { return h || s; }, + peg$c124 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c125 = function(s) { return { shorthand: s, id: true}; }, + peg$c126 = function(s) { return { shorthand: s }; }, + peg$c127 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c128 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c129 = /^[A-Za-z.0-9_\-]/, + peg$c130 = "[A-Za-z.0-9_\\-]", + peg$c131 = function(id) { return new AST.MustacheNode([id]); }, + peg$c132 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c133 = function(value) { return value.replace(/ *$/, ''); }, + peg$c134 = "!", + peg$c135 = "\"!\"", + peg$c136 = function(key, value) { return IS_EMBER; }, + peg$c137 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c138 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c139 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c140 = "_", + peg$c141 = "\"_\"", + peg$c142 = "-", + peg$c143 = "\"-\"", + peg$c144 = "%", + peg$c145 = "\"%\"", + peg$c146 = "#", + peg$c147 = "\"#\"", + peg$c148 = function(c) { return c;}, + peg$c149 = "CSSIdentifier", + peg$c150 = /^[_a-zA-Z0-9\-]/, + peg$c151 = "[_a-zA-Z0-9\\-]", + peg$c152 = /^[_a-zA-Z]/, + peg$c153 = "[_a-zA-Z]", + peg$c154 = /^[\x80-\xFF]/, + peg$c155 = "[\\x80-\\xFF]", + peg$c156 = "KnownHTMLTagName", + peg$c157 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c158 = function(t) { return t; }, + peg$c159 = ":", + peg$c160 = "\":\"", + peg$c161 = "a JS event", + peg$c162 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c163 = "INDENT", + peg$c164 = "\uEFEF", + peg$c165 = "\"\\uEFEF\"", + peg$c166 = function() { return ''; }, + peg$c167 = "DEDENT", + peg$c168 = "\uEFFE", + peg$c169 = "\"\\uEFFE\"", + peg$c170 = "Unmatched DEDENT", + peg$c171 = "\uEFEE", + peg$c172 = "\"\\uEFEE\"", + peg$c173 = "LineEnd", + peg$c174 = "\uEFFF", + peg$c175 = "\"\\uEFFF\"", + peg$c176 = "\n", + peg$c177 = "\"\\n\"", + peg$c178 = "ANYDEDENT", + peg$c179 = "RequiredWhitespace", + peg$c180 = "OptionalWhitespace", + peg$c181 = "InlineWhitespace", + peg$c182 = /^[ \t]/, + peg$c183 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c98; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c101) { + s0 = peg$c101; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c104) { + s0 = peg$c104; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c116) { + s0 = peg$c116; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c107; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c119) { + s1 = peg$c119; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c122(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c123(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c125(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c126(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c128(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c129.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c107; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c134; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c136(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c140; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c146; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c152.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c154.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c144; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c157(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c150.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c159; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c164; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c168; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c176; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c121(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c182.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.4/emblem.min.js b/ajax/libs/emblem/0.2.4/emblem.min.js new file mode 100644 index 000000000..8b483991e --- /dev/null +++ b/ajax/libs/emblem/0.2.4/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.4",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function jr(){return e.substring(Or,Ar)}function Fr(){return Or}function Ir(){return Rr(Or).line}function qr(){return Rr(Or).column}function Rr(t){function n(t,n){var r,i;for(r=0;rt&&(Mr=0,_r={line:1,column:1,seenCR:!1}),Mr=t,n(_r,Mr)),_r}function Ur(e){if(ArDr&&(Dr=Ar,Pr=[]),Pr.push(e)}function zr(e){var t=0;e.sort();while(tAr?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ki(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Yi(),r===null&&(e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt))),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Qi(){var t,n,r,i;t=Ar,n=Ar,r=[],i=Gi();if(i!==null)while(i!==null)r.push(i),i=Gi();else r=o;return r!==null&&(r=e.substring(n,Ar)),n=r,n!==null&&(Or=t,n=$t(n)),n===null?(Ar=t,t=n):t=n,t}function Gi(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Yi(),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Yi(){var e;return e=rs(),e===null&&(e=ns(),e===null&&(e=us(),e===null&&(e=zs(),e===null&&(e=Us())))),e}function Zi(){var e,t,n,r,i,s;return e=Ar,t=ts(),t!==null?(n=Xs(),n!==null?(r=pi(),r!==null?(i=Xs(),i!==null?(s=is(),s!==null?(Or=e,t=Xt(r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function es(){var e;return e=Zi(),e===null&&(e=Xi(),e===null&&(e=Wi())),e}function ts(){var t,n;return Hr++,e.charCodeAt(Ar)===123?(t=Qt,Ar++):(t=null,Hr===0&&Ur(Gt)),Hr--,t===null&&(n=null,Hr===0&&Ur(Kt)),t}function ns(){var t,n;return Hr++,e.substr(Ar,2)===Zt?(t=Zt,Ar+=2):(t=null,Hr===0&&Ur(en)),Hr--,t===null&&(n=null,Hr===0&&Ur(Yt)),t}function rs(){var t,n;return Hr++,e.substr(Ar,3)===nn?(t=nn,Ar+=3):(t=null,Hr===0&&Ur(rn)),Hr--,t===null&&(n=null,Hr===0&&Ur(tn)),t}function is(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(sn)),t}function ss(){var t,n;return Hr++,e.substr(Ar,2)===fn?(t=fn,Ar+=2):(t=null,Hr===0&&Ur(ln)),Hr--,t===null&&(n=null,Hr===0&&Ur(an)),t}function os(){var t,n;return Hr++,e.substr(Ar,3)===hn?(t=hn,Ar+=3):(t=null,Hr===0&&Ur(pn)),Hr--,t===null&&(n=null,Hr===0&&Ur(cn)),t}function us(){var t,n;return Hr++,e.substr(Ar,2)===vn?(t=vn,Ar+=2):(t=null,Hr===0&&Ur(mn)),Hr--,t===null&&(n=null,Hr===0&&Ur(dn)),t}function as(){var t,n;return Hr++,e.charCodeAt(Ar)===125?(t=on,Ar++):(t=null,Hr===0&&Ur(un)),Hr--,t===null&&(n=null,Hr===0&&Ur(gn)),t}function fs(){var t,n,r;return t=Ar,e.substr(Ar,2)===yn?(n=yn,Ar+=2):(n=null,Hr===0&&Ur(bn)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ar,e.charCodeAt(Ar)===61?(n=l,Ar++):(n=null,Hr===0&&Ur(c)),n!==null?(e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_)),r===null&&(r=u),r!==null?(Or=t,n=En(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)),t}function ls(){var e,t,n,r;return e=Ar,t=Ds(),t===null&&(t=u),t!==null?(n=vi(),n===null&&(n=u),n!==null?(Or=Ar,r=Sn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Ar=e,e=o)):(Ar=e,e=o)):(Ar=e,e=o),e}function cs(){var e,t,n,r,i;e=Ar,t=ls();if(t!==null){n=[],r=es();while(r!==null)n.push(r),r=es();if(n!==null){r=[],i=hs();while(i!==null)r.push(i),i=hs();r!==null?(Or=e,t=xn(t,n,r),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)}else Ar=e,e=o}else Ar=e,e=o;return e}function vi(){var e,t,n,r;e=Ar,t=[],n=Ar,r=Ns(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Cs(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Ar,r=Ns(),r!==null&&(Or=n,r=Tn(r)),r===null?(Ar=n,n=r):n=r,n===null&&(n=Ar,r=Cs(),r!==null&&(Or=n,r=Nn(r)),r===null?(Ar=n,n=r):n=r);else t=o;return t!==null&&(Or=e,t=Cn(t)),t===null?(Ar=e,e=t):e=t,e}function hs(){var t,n,r;t=Ar,n=[],e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Ar)===32?(r=M,Ar++):(r=null,Hr===0&&Ur(_));else n=o;return n!==null?(r=ms(),r===null&&(r=ys(),r===null&&(r=bs(),r===null&&(r=ws()))),r!==null?(Or=t,n=kn(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function ps(){var t;return Ln.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(An)),t===null&&(t=Bs()),t}function ds(){var e,t;return e=vs(),e===null&&(e=Ar,t=Ci(),t!==null&&(Or=e,t=On(t)),t===null?(Ar=e,e=t):e=t),e}function vs(){var t,n,r,i,s;return t=Ar,n=Ar,e.charCodeAt(Ar)===34?(r=Nt,Ar++):(r=null,Hr===0&&Ur(Ct)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Ar)===34?(s=Nt,Ar++):(s=null,Hr===0&&Ur(Ct)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o),n===null&&(n=Ar,e.charCodeAt(Ar)===39?(r=kt,Ar++):(r=null,Hr===0&&Ur(Lt)),r!==null?(i=pi(),i!==null?(e.charCodeAt(Ar)===39?(s=kt,Ar++):(s=null,Hr===0&&Ur(Lt)),s!==null?(r=[r,i,s],n=r):(Ar=n,n=o)):(Ar=n,n=o)):(Ar=n,n=o)),n!==null&&(Or=t,n=At(n)),n===null?(Ar=t,t=n):t=n,t}function ms(){var t,n,r,i;return t=Ar,n=js(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=ds(),i!==null?(Or=t,n=Mn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function gs(){var t,n,r,i,s,u;t=Ar,e.charCodeAt(Ar)===123?(n=Qt,Ar++):(n=null,Hr===0&&Ur(Gt));if(n!==null){r=Xs();if(r!==null){i=Ar,s=[],u=ps(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));if(u!==null)while(u!==null)s.push(u),u=ps(),u===null&&(e.charCodeAt(Ar)===32?(u=M,Ar++):(u=null,Hr===0&&Ur(_)));else s=o;s!==null&&(s=e.substring(i,Ar)),i=s,i!==null?(s=Xs(),s!==null?(e.charCodeAt(Ar)===125?(u=on,Ar++):(u=null,Hr===0&&Ur(un)),u!==null?(Or=t,n=_n(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)}else Ar=t,t=o}else Ar=t,t=o;if(t===null){t=Ar,n=[],r=ps();if(r!==null)while(r!==null)n.push(r),r=ps();else n=o;n!==null&&(n=e.substring(t,Ar)),t=n}return t}function ys(){var t,n,r,i,s,a;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=gs(),i!==null?(s=Ar,Hr++,e.charCodeAt(Ar)===33?(a=Dn,Ar++):(a=null,Hr===0&&Ur(Pn)),Hr--,a===null?s=u:(Ar=s,s=o),s!==null?(Or=Ar,a=Hn(n,i),a?a=u:a=o,a!==null?(Or=t,n=Bn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function bs(){var t,n,r,i;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=Ci(),i!==null?(Or=t,n=jn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function ws(){var t,n,r,i;return t=Ar,n=Ei(),n!==null?(e.charCodeAt(Ar)===61?(r=l,Ar++):(r=null,Hr===0&&Ur(c)),r!==null?(i=qi(),i!==null?(Or=t,n=Fn(n,i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t}function Es(){var t,n,r;t=Ar,n=[],r=xs();while(r!==null)n.push(r),r=xs();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Ss(){var e;return e=_i(),e===null&&(e=xi()),e}function xs(){var t;return t=Hi(),t===null&&(St.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(xt)),t===null&&(e.charCodeAt(Ar)===95?(t=In,Ar++):(t=null,Hr===0&&Ur(qn)),t===null&&(e.charCodeAt(Ar)===45?(t=Rn,Ar++):(t=null,Hr===0&&Ur(Un))))),t}function Ts(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=ks(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Ns(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===35?(n=Xn,Ar++):(n=null,Hr===0&&Ur(Vn)),n!==null?(r=ks(),r!==null?(Or=t,n=$n(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Cs(){var t,n,r;return t=Ar,e.charCodeAt(Ar)===46?(n=et,Ar++):(n=null,Hr===0&&Ur(tt)),n!==null?(r=ks(),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function ks(){var e,t;return Hr++,e=Ls(),Hr--,e===null&&(t=null,Hr===0&&Ur(Jn)),e}function Ls(){var t,n,r;t=Ar,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function As(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Ms()),t}function Os(){var t;return Gn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Yn)),t===null&&(t=Ms()),t}function Ms(){var t;return Zn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(er)),t}function _s(){var t,n,r;t=Ar,n=[],r=Hs();if(r!==null)while(r!==null)n.push(r),r=Hs();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,t}function Ds(){var t,n,r,i;return Hr++,t=Ar,e.charCodeAt(Ar)===37?(n=zn,Ar++):(n=null,Hr===0&&Ur(Wn)),n!==null?(r=Xs(),r!==null?(i=_s(),i!==null?(Or=t,n=it(i),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o)):(Ar=t,t=o),t===null&&(t=Ps()),Hr--,t===null&&(n=null,Hr===0&&Ur(tr)),t}function Ps(){var e,t,n;return e=Ar,t=_s(),t!==null?(Or=Ar,n=nr(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Hs(){var t;return Kn.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Qn)),t===null&&(t=Bs()),t}function Bs(){var t,n,r,i;return t=Ar,e.charCodeAt(Ar)===58?(n=ir,Ar++):(n=null,Hr===0&&Ur(sr)),n!==null?(r=Ar,Hr++,e.charCodeAt(Ar)===32?(i=M,Ar++):(i=null,Hr===0&&Ur(_)),Hr--,i===null?r=u:(Ar=r,r=o),r!==null?(Or=t,n=P(n),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function js(){var e,t,n;return Hr++,e=Ar,t=_s(),t!==null?(Or=Ar,n=ur(t),n?n=u:n=o,n!==null?(Or=e,t=rr(t),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),Hr--,e===null&&(t=null,Hr===0&&Ur(or)),e}function Fs(){var e,t,n;return e=Ar,t=Is(),t!==null?(n=Ws(),n!==null?(Or=e,t=it(n),t===null?(Ar=e,e=t):e=t):(Ar=e,e=o)):(Ar=e,e=o),e}function Is(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61423?(n=fr,Ar++):(n=null,Hr===0&&Ur(lr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(ar)),t}function qs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61438?(n=pr,Ar++):(n=null,Hr===0&&Ur(dr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(hr)),t}function Rs(){var t,n;return Hr++,t=Ar,e.charCodeAt(Ar)===61422?(n=mr,Ar++):(n=null,Hr===0&&Ur(gr)),n!==null&&(Or=t,n=cr()),n===null?(Ar=t,t=n):t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(vr)),t}function Us(){var t,n,r;return Hr++,t=Ar,e.charCodeAt(Ar)===61439?(n=br,Ar++):(n=null,Hr===0&&Ur(wr)),n!==null?(e.charCodeAt(Ar)===10?(r=Er,Ar++):(r=null,Hr===0&&Ur(Sr)),r!==null?(Or=t,n=wn(),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),Hr--,t===null&&(n=null,Hr===0&&Ur(yr)),t}function zs(){var e,t;return Hr++,e=qs(),e===null&&(e=Rs()),Hr--,e===null&&(t=null,Hr===0&&Ur(xr)),e}function Ws(){var t,n,r;Hr++,t=Ar,n=[],r=Vs();if(r!==null)while(r!==null)n.push(r),r=Vs();else n=o;return n!==null&&(n=e.substring(t,Ar)),t=n,Hr--,t===null&&(n=null,Hr===0&&Ur(Tr)),t}function Xs(){var e,t;Hr++,e=[],t=Vs();while(t!==null)e.push(t),t=Vs();return Hr--,e===null&&(t=null,Hr===0&&Ur(Nr)),e}function Vs(){var t,n;return Hr++,kr.test(e.charAt(Ar))?(t=e.charAt(Ar),Ar++):(t=null,Hr===0&&Ur(Lr)),Hr--,t===null&&(n=null,Hr===0&&Ur(Cr)),t}function $s(){var t,n,r;return t=Ar,n=Ar,Hr++,r=Is(),r===null&&(r=qs(),r===null&&(r=Us())),Hr--,r===null?n=u:(Ar=n,n=o),n!==null?(e.length>Ar?(r=e.charAt(Ar),Ar++):(r=null,Hr===0&&Ur(Jt)),r!==null?(Or=t,n=P(r),n===null?(Ar=t,t=n):t=n):(Ar=t,t=o)):(Ar=t,t=o),t}function Js(){var t,n,r;t=Ar,n=[],r=$s();while(r!==null)n.push(r),r=$s();return n!==null&&(n=e.substring(t,Ar)),t=n,t}function to(e,t,n){var r=e.hash;if(n){r=r||new Gs.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Wr},s=Wr,o=null,u="",a=function(e){return e},f=function(e,t){return new Gs.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new Gs.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new Gs.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:(e.mustache=to(e.mustache,t),e)}var n=e.id.string.charAt(0);return!Qs||!n.match(/[A-Z]/)?e:to(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new Gs.ContentNode(">")),[u,new Gs.ContentNode("")])},Tn=function(e){return{shorthand:e,id:!0}},Nn=function(e){return{shorthand:e}},Cn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.5"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = "{", + peg$c94 = "\"{\"", + peg$c95 = /^[^}]/, + peg$c96 = "[^}]", + peg$c97 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c98 = function(m) { m.escaped = true; return m; }, + peg$c99 = function(m) { m.escaped = false; return m; }, + peg$c100 = function(a) { return new AST.ContentNode(a); }, + peg$c101 = "any character", + peg$c102 = "SingleMustacheOpen", + peg$c103 = "DoubleMustacheOpen", + peg$c104 = "{{", + peg$c105 = "\"{{\"", + peg$c106 = "TripleMustacheOpen", + peg$c107 = "{{{", + peg$c108 = "\"{{{\"", + peg$c109 = "SingleMustacheClose", + peg$c110 = "}", + peg$c111 = "\"}\"", + peg$c112 = "DoubleMustacheClose", + peg$c113 = "}}", + peg$c114 = "\"}}\"", + peg$c115 = "TripleMustacheClose", + peg$c116 = "}}}", + peg$c117 = "\"}}}\"", + peg$c118 = "InterpolationOpen", + peg$c119 = "#{", + peg$c120 = "\"#{\"", + peg$c121 = "InterpolationClose", + peg$c122 = "==", + peg$c123 = "\"==\"", + peg$c124 = function() { return false; }, + peg$c125 = function() { return true; }, + peg$c126 = function(h, s) { return h || s; }, + peg$c127 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c128 = function(s) { return { shorthand: s, id: true}; }, + peg$c129 = function(s) { return { shorthand: s }; }, + peg$c130 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c131 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c132 = /^[A-Za-z.0-9_\-]/, + peg$c133 = "[A-Za-z.0-9_\\-]", + peg$c134 = function(id) { return new AST.MustacheNode([id]); }, + peg$c135 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c136 = function(value) { return value.replace(/ *$/, ''); }, + peg$c137 = "!", + peg$c138 = "\"!\"", + peg$c139 = function(key, value) { return IS_EMBER; }, + peg$c140 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c141 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c142 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c143 = "_", + peg$c144 = "\"_\"", + peg$c145 = "-", + peg$c146 = "\"-\"", + peg$c147 = "%", + peg$c148 = "\"%\"", + peg$c149 = "#", + peg$c150 = "\"#\"", + peg$c151 = function(c) { return c;}, + peg$c152 = "CSSIdentifier", + peg$c153 = /^[_a-zA-Z0-9\-]/, + peg$c154 = "[_a-zA-Z0-9\\-]", + peg$c155 = /^[_a-zA-Z]/, + peg$c156 = "[_a-zA-Z]", + peg$c157 = /^[\x80-\xFF]/, + peg$c158 = "[\\x80-\\xFF]", + peg$c159 = "KnownHTMLTagName", + peg$c160 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c161 = function(t) { return t; }, + peg$c162 = ":", + peg$c163 = "\":\"", + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\uEFFF", + peg$c178 = "\"\\uEFFF\"", + peg$c179 = "\n", + peg$c180 = "\"\\n\"", + peg$c181 = "ANYDEDENT", + peg$c182 = "RequiredWhitespace", + peg$c183 = "OptionalWhitespace", + peg$c184 = "InlineWhitespace", + peg$c185 = /^[ \t]/, + peg$c186 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c93; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c104) { + s0 = peg$c104; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c107) { + s0 = peg$c107; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c113) { + s0 = peg$c113; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c116) { + s0 = peg$c116; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c122) { + s1 = peg$c122; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c126(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c132.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c93; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c110; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c137; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c139(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c143; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61439) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c185.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.5/emblem.min.js b/ajax/libs/emblem/0.2.5/emblem.min.js new file mode 100644 index 000000000..ecd15e758 --- /dev/null +++ b/ajax/libs/emblem/0.2.5/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.5",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function qr(){return e.substring(Dr,_r)}function Rr(){return Dr}function Ur(){return Wr(Dr).line}function zr(){return Wr(Dr).column}function Wr(t){function n(t,n){var r,i;for(r=0;rt&&(Pr=0,Hr={line:1,column:1,seenCR:!1}),Pr=t,n(Hr,Pr)),Hr}function Xr(e){if(_rBr&&(Br=_r,jr=[]),jr.push(e)}function Vr(e){var t=0;e.sort();while(t_r?(r=e.charAt(_r),_r++):(r=null,Fr===0&&Xr(Zt)),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function Zi(){var t,n,r;return t=_r,n=_r,Fr++,r=ns(),r===null&&(e.charCodeAt(_r)===39?(r=kt,_r++):(r=null,Fr===0&&Xr(Lt))),Fr--,r===null?n=u:(_r=n,n=o),n!==null?(e.length>_r?(r=e.charAt(_r),_r++):(r=null,Fr===0&&Xr(Zt)),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function es(){var t,n,r,i;t=_r,n=_r,r=[],i=ts();if(i!==null)while(i!==null)r.push(i),i=ts();else r=o;return r!==null&&(r=e.substring(n,_r)),n=r,n!==null&&(Dr=t,n=Yt(n)),n===null?(_r=t,t=n):t=n,t}function ts(){var t,n,r;return t=_r,n=_r,Fr++,r=ns(),Fr--,r===null?n=u:(_r=n,n=o),n!==null?(e.length>_r?(r=e.charAt(_r),_r++):(r=null,Fr===0&&Xr(Zt)),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function ns(){var e;return e=us(),e===null&&(e=os(),e===null&&(e=cs(),e===null&&(e=$s(),e===null&&(e=Vs())))),e}function rs(){var e,t,n,r,i,s;return e=_r,t=ss(),t!==null?(n=Ks(),n!==null?(r=$i(),r!==null?(i=Ks(),i!==null?(s=as(),s!==null?(Dr=e,t=Qt(r),t===null?(_r=e,e=t):e=t):(_r=e,e=o)):(_r=e,e=o)):(_r=e,e=o)):(_r=e,e=o)):(_r=e,e=o),e}function is(){var e;return e=rs(),e===null&&(e=Ki(),e===null&&(e=Ji())),e}function ss(){var t,n;return Fr++,e.charCodeAt(_r)===123?(t=Xt,_r++):(t=null,Fr===0&&Xr(Vt)),Fr--,t===null&&(n=null,Fr===0&&Xr(en)),t}function os(){var t,n;return Fr++,e.substr(_r,2)===nn?(t=nn,_r+=2):(t=null,Fr===0&&Xr(rn)),Fr--,t===null&&(n=null,Fr===0&&Xr(tn)),t}function us(){var t,n;return Fr++,e.substr(_r,3)===on?(t=on,_r+=3):(t=null,Fr===0&&Xr(un)),Fr--,t===null&&(n=null,Fr===0&&Xr(sn)),t}function as(){var t,n;return Fr++,e.charCodeAt(_r)===125?(t=fn,_r++):(t=null,Fr===0&&Xr(ln)),Fr--,t===null&&(n=null,Fr===0&&Xr(an)),t}function fs(){var t,n;return Fr++,e.substr(_r,2)===hn?(t=hn,_r+=2):(t=null,Fr===0&&Xr(pn)),Fr--,t===null&&(n=null,Fr===0&&Xr(cn)),t}function ls(){var t,n;return Fr++,e.substr(_r,3)===vn?(t=vn,_r+=3):(t=null,Fr===0&&Xr(mn)),Fr--,t===null&&(n=null,Fr===0&&Xr(dn)),t}function cs(){var t,n;return Fr++,e.substr(_r,2)===yn?(t=yn,_r+=2):(t=null,Fr===0&&Xr(bn)),Fr--,t===null&&(n=null,Fr===0&&Xr(gn)),t}function hs(){var t,n;return Fr++,e.charCodeAt(_r)===125?(t=fn,_r++):(t=null,Fr===0&&Xr(ln)),Fr--,t===null&&(n=null,Fr===0&&Xr(wn)),t}function ps(){var t,n,r;return t=_r,e.substr(_r,2)===En?(n=En,_r+=2):(n=null,Fr===0&&Xr(Sn)),n!==null?(e.charCodeAt(_r)===32?(r=M,_r++):(r=null,Fr===0&&Xr(_)),r===null&&(r=u),r!==null?(Dr=t,n=xn(),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t===null&&(t=_r,e.charCodeAt(_r)===61?(n=l,_r++):(n=null,Fr===0&&Xr(c)),n!==null?(e.charCodeAt(_r)===32?(r=M,_r++):(r=null,Fr===0&&Xr(_)),r===null&&(r=u),r!==null?(Dr=t,n=Tn(),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)),t}function ds(){var e,t,n,r;return e=_r,t=js(),t===null&&(t=u),t!==null?(n=yi(),n===null&&(n=u),n!==null?(Dr=_r,r=Nn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(_r=e,e=o)):(_r=e,e=o)):(_r=e,e=o),e}function vs(){var e,t,n,r,i;e=_r,t=ds();if(t!==null){n=[],r=is();while(r!==null)n.push(r),r=is();if(n!==null){r=[],i=ms();while(i!==null)r.push(i),i=ms();r!==null?(Dr=e,t=Cn(t,n,r),t===null?(_r=e,e=t):e=t):(_r=e,e=o)}else _r=e,e=o}else _r=e,e=o;return e}function yi(){var e,t,n,r;e=_r,t=[],n=_r,r=As(),r!==null&&(Dr=n,r=kn(r)),r===null?(_r=n,n=r):n=r,n===null&&(n=_r,r=Os(),r!==null&&(Dr=n,r=Ln(r)),r===null?(_r=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=_r,r=As(),r!==null&&(Dr=n,r=kn(r)),r===null?(_r=n,n=r):n=r,n===null&&(n=_r,r=Os(),r!==null&&(Dr=n,r=Ln(r)),r===null?(_r=n,n=r):n=r);else t=o;return t!==null&&(Dr=e,t=An(t)),t===null?(_r=e,e=t):e=t,e}function ms(){var t,n,r;t=_r,n=[],e.charCodeAt(_r)===32?(r=M,_r++):(r=null,Fr===0&&Xr(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(_r)===32?(r=M,_r++):(r=null,Fr===0&&Xr(_));else n=o;return n!==null?(r=ws(),r===null&&(r=Ss(),r===null&&(r=xs(),r===null&&(r=Ts()))),r!==null?(Dr=t,n=On(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function gs(){var t;return Mn.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(_n)),t===null&&(t=qs()),t}function ys(){var e,t;return e=bs(),e===null&&(e=_r,t=Ai(),t!==null&&(Dr=e,t=Dn(t)),t===null?(_r=e,e=t):e=t),e}function bs(){var t,n,r,i,s;return t=_r,n=_r,e.charCodeAt(_r)===34?(r=Nt,_r++):(r=null,Fr===0&&Xr(Ct)),r!==null?(i=mi(),i!==null?(e.charCodeAt(_r)===34?(s=Nt,_r++):(s=null,Fr===0&&Xr(Ct)),s!==null?(r=[r,i,s],n=r):(_r=n,n=o)):(_r=n,n=o)):(_r=n,n=o),n===null&&(n=_r,e.charCodeAt(_r)===39?(r=kt,_r++):(r=null,Fr===0&&Xr(Lt)),r!==null?(i=mi(),i!==null?(e.charCodeAt(_r)===39?(s=kt,_r++):(s=null,Fr===0&&Xr(Lt)),s!==null?(r=[r,i,s],n=r):(_r=n,n=o)):(_r=n,n=o)):(_r=n,n=o)),n!==null&&(Dr=t,n=At(n)),n===null?(_r=t,t=n):t=n,t}function ws(){var t,n,r,i;return t=_r,n=Rs(),n!==null?(e.charCodeAt(_r)===61?(r=l,_r++):(r=null,Fr===0&&Xr(c)),r!==null?(i=ys(),i!==null?(Dr=t,n=Pn(n,i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o),t}function Es(){var t,n,r,i,s,u;t=_r,e.charCodeAt(_r)===123?(n=Xt,_r++):(n=null,Fr===0&&Xr(Vt));if(n!==null){r=Ks();if(r!==null){i=_r,s=[],u=gs(),u===null&&(e.charCodeAt(_r)===32?(u=M,_r++):(u=null,Fr===0&&Xr(_)));if(u!==null)while(u!==null)s.push(u),u=gs(),u===null&&(e.charCodeAt(_r)===32?(u=M,_r++):(u=null,Fr===0&&Xr(_)));else s=o;s!==null&&(s=e.substring(i,_r)),i=s,i!==null?(s=Ks(),s!==null?(e.charCodeAt(_r)===125?(u=fn,_r++):(u=null,Fr===0&&Xr(ln)),u!==null?(Dr=t,n=Hn(i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o)}else _r=t,t=o}else _r=t,t=o;if(t===null){t=_r,n=[],r=gs();if(r!==null)while(r!==null)n.push(r),r=gs();else n=o;n!==null&&(n=e.substring(t,_r)),t=n}return t}function Ss(){var t,n,r,i,s,a;return t=_r,n=Ti(),n!==null?(e.charCodeAt(_r)===61?(r=l,_r++):(r=null,Fr===0&&Xr(c)),r!==null?(i=Es(),i!==null?(s=_r,Fr++,e.charCodeAt(_r)===33?(a=Bn,_r++):(a=null,Fr===0&&Xr(jn)),Fr--,a===null?s=u:(_r=s,s=o),s!==null?(Dr=_r,a=Fn(n,i),a?a=u:a=o,a!==null?(Dr=t,n=In(n,i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o),t}function xs(){var t,n,r,i;return t=_r,n=Ti(),n!==null?(e.charCodeAt(_r)===61?(r=l,_r++):(r=null,Fr===0&&Xr(c)),r!==null?(i=Ai(),i!==null?(Dr=t,n=qn(n,i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o),t}function Ts(){var t,n,r,i;return t=_r,n=Ti(),n!==null?(e.charCodeAt(_r)===61?(r=l,_r++):(r=null,Fr===0&&Xr(c)),r!==null?(i=zi(),i!==null?(Dr=t,n=Rn(n,i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o),t}function Ns(){var t,n,r;t=_r,n=[],r=ks();while(r!==null)n.push(r),r=ks();return n!==null&&(n=e.substring(t,_r)),t=n,t}function Cs(){var e;return e=Hi(),e===null&&(e=Ci()),e}function ks(){var t;return t=Fi(),t===null&&(St.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(xt)),t===null&&(e.charCodeAt(_r)===95?(t=Un,_r++):(t=null,Fr===0&&Xr(zn)),t===null&&(e.charCodeAt(_r)===45?(t=Wn,_r++):(t=null,Fr===0&&Xr(Xn))))),t}function Ls(){var t,n,r;return t=_r,e.charCodeAt(_r)===37?(n=Vn,_r++):(n=null,Fr===0&&Xr($n)),n!==null?(r=Ms(),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function As(){var t,n,r;return t=_r,e.charCodeAt(_r)===35?(n=Jn,_r++):(n=null,Fr===0&&Xr(Kn)),n!==null?(r=Ms(),r!==null?(Dr=t,n=Qn(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function Os(){var t,n,r;return t=_r,e.charCodeAt(_r)===46?(n=et,_r++):(n=null,Fr===0&&Xr(tt)),n!==null?(r=Ms(),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function Ms(){var e,t;return Fr++,e=_s(),Fr--,e===null&&(t=null,Fr===0&&Xr(Gn)),e}function _s(){var t,n,r;t=_r,n=[],r=Ds();while(r!==null)n.push(r),r=Ds();return n!==null&&(n=e.substring(t,_r)),t=n,t}function Ds(){var t;return Yn.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(Zn)),t===null&&(t=Hs()),t}function Ps(){var t;return er.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(tr)),t===null&&(t=Hs()),t}function Hs(){var t;return nr.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(rr)),t}function Bs(){var t,n,r;t=_r,n=[],r=Is();if(r!==null)while(r!==null)n.push(r),r=Is();else n=o;return n!==null&&(n=e.substring(t,_r)),t=n,t}function js(){var t,n,r,i;return Fr++,t=_r,e.charCodeAt(_r)===37?(n=Vn,_r++):(n=null,Fr===0&&Xr($n)),n!==null?(r=Ks(),r!==null?(i=Bs(),i!==null?(Dr=t,n=it(i),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o)):(_r=t,t=o),t===null&&(t=Fs()),Fr--,t===null&&(n=null,Fr===0&&Xr(ir)),t}function Fs(){var e,t,n;return e=_r,t=Bs(),t!==null?(Dr=_r,n=sr(t),n?n=u:n=o,n!==null?(Dr=e,t=or(t),t===null?(_r=e,e=t):e=t):(_r=e,e=o)):(_r=e,e=o),e}function Is(){var t;return Yn.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(Zn)),t===null&&(t=qs()),t}function qs(){var t,n,r,i;return t=_r,e.charCodeAt(_r)===58?(n=ur,_r++):(n=null,Fr===0&&Xr(ar)),n!==null?(r=_r,Fr++,e.charCodeAt(_r)===32?(i=M,_r++):(i=null,Fr===0&&Xr(_)),Fr--,i===null?r=u:(_r=r,r=o),r!==null?(Dr=t,n=P(n),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function Rs(){var e,t,n;return Fr++,e=_r,t=Bs(),t!==null?(Dr=_r,n=lr(t),n?n=u:n=o,n!==null?(Dr=e,t=or(t),t===null?(_r=e,e=t):e=t):(_r=e,e=o)):(_r=e,e=o),Fr--,e===null&&(t=null,Fr===0&&Xr(fr)),e}function Us(){var e,t,n;return e=_r,t=zs(),t!==null?(n=Js(),n!==null?(Dr=e,t=it(n),t===null?(_r=e,e=t):e=t):(_r=e,e=o)):(_r=e,e=o),e}function zs(){var t,n;return Fr++,t=_r,e.charCodeAt(_r)===61423?(n=hr,_r++):(n=null,Fr===0&&Xr(pr)),n!==null&&(Dr=t,n=dr()),n===null?(_r=t,t=n):t=n,Fr--,t===null&&(n=null,Fr===0&&Xr(cr)),t}function Ws(){var t,n;return Fr++,t=_r,e.charCodeAt(_r)===61438?(n=mr,_r++):(n=null,Fr===0&&Xr(gr)),n!==null&&(Dr=t,n=dr()),n===null?(_r=t,t=n):t=n,Fr--,t===null&&(n=null,Fr===0&&Xr(vr)),t}function Xs(){var t,n;return Fr++,t=_r,e.charCodeAt(_r)===61422?(n=br,_r++):(n=null,Fr===0&&Xr(wr)),n!==null&&(Dr=t,n=dr()),n===null?(_r=t,t=n):t=n,Fr--,t===null&&(n=null,Fr===0&&Xr(yr)),t}function Vs(){var t,n,r;return Fr++,t=_r,e.charCodeAt(_r)===61439?(n=Sr,_r++):(n=null,Fr===0&&Xr(xr)),n!==null?(e.charCodeAt(_r)===10?(r=Tr,_r++):(r=null,Fr===0&&Xr(Nr)),r!==null?(Dr=t,n=xn(),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),Fr--,t===null&&(n=null,Fr===0&&Xr(Er)),t}function $s(){var e,t;return Fr++,e=Ws(),e===null&&(e=Xs()),Fr--,e===null&&(t=null,Fr===0&&Xr(Cr)),e}function Js(){var t,n,r;Fr++,t=_r,n=[],r=Qs();if(r!==null)while(r!==null)n.push(r),r=Qs();else n=o;return n!==null&&(n=e.substring(t,_r)),t=n,Fr--,t===null&&(n=null,Fr===0&&Xr(kr)),t}function Ks(){var e,t;Fr++,e=[],t=Qs();while(t!==null)e.push(t),t=Qs();return Fr--,e===null&&(t=null,Fr===0&&Xr(Lr)),e}function Qs(){var t,n;return Fr++,Or.test(e.charAt(_r))?(t=e.charAt(_r),_r++):(t=null,Fr===0&&Xr(Mr)),Fr--,t===null&&(n=null,Fr===0&&Xr(Ar)),t}function Gs(){var t,n,r;return t=_r,n=_r,Fr++,r=zs(),r===null&&(r=Ws(),r===null&&(r=Vs())),Fr--,r===null?n=u:(_r=n,n=o),n!==null?(e.length>_r?(r=e.charAt(_r),_r++):(r=null,Fr===0&&Xr(Zt)),r!==null?(Dr=t,n=P(r),n===null?(_r=t,t=n):t=n):(_r=t,t=o)):(_r=t,t=o),t}function Ys(){var t,n,r;t=_r,n=[],r=Gs();while(r!==null)n.push(r),r=Gs();return n!==null&&(n=e.substring(t,_r)),t=n,t}function so(e,t,n){var r=e.hash;if(n){r=r||new to.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:$r},s=$r,o=null,u="",a=function(e){return e},f=function(e,t){return new to.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new to.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new to.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!eo||!n.match(/[A-Z]/)?e:(e.mustache=so(e.mustache +,t),e)}var n=e.id.string.charAt(0);return!eo||!n.match(/[A-Z]/)?e:so(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new to.ContentNode(">")),[u,new to.ContentNode("")])},kn=function(e){return{shorthand:e,id:!0}},Ln=function(e){return{shorthand:e}},An=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.6"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = "{", + peg$c94 = "\"{\"", + peg$c95 = /^[^}]/, + peg$c96 = "[^}]", + peg$c97 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c98 = function(m) { m.escaped = true; return m; }, + peg$c99 = function(m) { m.escaped = false; return m; }, + peg$c100 = function(a) { return new AST.ContentNode(a); }, + peg$c101 = "any character", + peg$c102 = "SingleMustacheOpen", + peg$c103 = "DoubleMustacheOpen", + peg$c104 = "{{", + peg$c105 = "\"{{\"", + peg$c106 = "TripleMustacheOpen", + peg$c107 = "{{{", + peg$c108 = "\"{{{\"", + peg$c109 = "SingleMustacheClose", + peg$c110 = "}", + peg$c111 = "\"}\"", + peg$c112 = "DoubleMustacheClose", + peg$c113 = "}}", + peg$c114 = "\"}}\"", + peg$c115 = "TripleMustacheClose", + peg$c116 = "}}}", + peg$c117 = "\"}}}\"", + peg$c118 = "InterpolationOpen", + peg$c119 = "#{", + peg$c120 = "\"#{\"", + peg$c121 = "InterpolationClose", + peg$c122 = "==", + peg$c123 = "\"==\"", + peg$c124 = function() { return false; }, + peg$c125 = function() { return true; }, + peg$c126 = function(h, s) { return h || s; }, + peg$c127 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + if(SELF_CLOSING_TAG[tagName]) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c128 = function(s) { return { shorthand: s, id: true}; }, + peg$c129 = function(s) { return { shorthand: s }; }, + peg$c130 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c131 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c132 = /^[A-Za-z.0-9_\-]/, + peg$c133 = "[A-Za-z.0-9_\\-]", + peg$c134 = function(id) { return new AST.MustacheNode([id]); }, + peg$c135 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c136 = function(value) { return value.replace(/ *$/, ''); }, + peg$c137 = "!", + peg$c138 = "\"!\"", + peg$c139 = function(key, value) { return IS_EMBER; }, + peg$c140 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c141 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c142 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c143 = "_", + peg$c144 = "\"_\"", + peg$c145 = "-", + peg$c146 = "\"-\"", + peg$c147 = "%", + peg$c148 = "\"%\"", + peg$c149 = "#", + peg$c150 = "\"#\"", + peg$c151 = function(c) { return c;}, + peg$c152 = "CSSIdentifier", + peg$c153 = /^[_a-zA-Z0-9\-]/, + peg$c154 = "[_a-zA-Z0-9\\-]", + peg$c155 = /^[_a-zA-Z]/, + peg$c156 = "[_a-zA-Z]", + peg$c157 = /^[\x80-\xFF]/, + peg$c158 = "[\\x80-\\xFF]", + peg$c159 = "KnownHTMLTagName", + peg$c160 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c161 = function(t) { return t; }, + peg$c162 = ":", + peg$c163 = "\":\"", + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c93; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c104) { + s0 = peg$c104; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c107) { + s0 = peg$c107; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c113) { + s0 = peg$c113; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c116) { + s0 = peg$c116; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c122) { + s1 = peg$c122; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = peg$currPos; + s3 = peg$c126(s1,s2); + if (s3) { + s3 = peg$c1; + } else { + s3 = peg$c0; + } + if (s3 !== null) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c132.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c93; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c110; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c137; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c139(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c143; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n\\]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.6/emblem.min.js b/ajax/libs/emblem/0.2.6/emblem.min.js new file mode 100644 index 000000000..d8361784d --- /dev/null +++ b/ajax/libs/emblem/0.2.6/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.6",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Ur(){return e.substring(Hr,Pr)}function zr(){return Hr}function Wr(){return Vr(Hr).line}function Xr(){return Vr(Hr).column}function Vr(t){function n(t,n){var r,i;for(r=0;rt&&(Br=0,jr={line:1,column:1,seenCR:!1}),Br=t,n(jr,Br)),jr}function $r(e){if(PrFr&&(Fr=Pr,Ir=[]),Ir.push(e)}function Jr(e){var t=0;e.sort();while(tPr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ts(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),r===null&&(e.charCodeAt(Pr)===39?(r=kt,Pr++):(r=null,qr===0&&$r(Lt))),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ns(){var t,n,r,i;t=Pr,n=Pr,r=[],i=rs();if(i!==null)while(i!==null)r.push(i),i=rs();else r=o;return r!==null&&(r=e.substring(n,Pr)),n=r,n!==null&&(Hr=t,n=Yt(n)),n===null?(Pr=t,t=n):t=n,t}function rs(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function is(){var e;return e=fs(),e===null&&(e=as(),e===null&&(e=ps(),e===null&&(e=Ks(),e===null&&(e=Js())))),e}function ss(){var e,t,n,r,i,s;return e=Pr,t=us(),t!==null?(n=Gs(),n!==null?(r=Ki(),r!==null?(i=Gs(),i!==null?(s=ls(),s!==null?(Hr=e,t=Qt(r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function os(){var e;return e=ss(),e===null&&(e=Gi(),e===null&&(e=Qi())),e}function us(){var t,n;return qr++,e.charCodeAt(Pr)===123?(t=Xt,Pr++):(t=null,qr===0&&$r(Vt)),qr--,t===null&&(n=null,qr===0&&$r(en)),t}function as(){var t,n;return qr++,e.substr(Pr,2)===nn?(t=nn,Pr+=2):(t=null,qr===0&&$r(rn)),qr--,t===null&&(n=null,qr===0&&$r(tn)),t}function fs(){var t,n;return qr++,e.substr(Pr,3)===on?(t=on,Pr+=3):(t=null,qr===0&&$r(un)),qr--,t===null&&(n=null,qr===0&&$r(sn)),t}function ls(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=fn,Pr++):(t=null,qr===0&&$r(ln)),qr--,t===null&&(n=null,qr===0&&$r(an)),t}function cs(){var t,n;return qr++,e.substr(Pr,2)===hn?(t=hn,Pr+=2):(t=null,qr===0&&$r(pn)),qr--,t===null&&(n=null,qr===0&&$r(cn)),t}function hs(){var t,n;return qr++,e.substr(Pr,3)===vn?(t=vn,Pr+=3):(t=null,qr===0&&$r(mn)),qr--,t===null&&(n=null,qr===0&&$r(dn)),t}function ps(){var t,n;return qr++,e.substr(Pr,2)===yn?(t=yn,Pr+=2):(t=null,qr===0&&$r(bn)),qr--,t===null&&(n=null,qr===0&&$r(gn)),t}function ds(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=fn,Pr++):(t=null,qr===0&&$r(ln)),qr--,t===null&&(n=null,qr===0&&$r(wn)),t}function vs(){var t,n,r;return t=Pr,e.substr(Pr,2)===En?(n=En,Pr+=2):(n=null,qr===0&&$r(Sn)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=xn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=Pr,e.charCodeAt(Pr)===61?(n=l,Pr++):(n=null,qr===0&&$r(c)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Tn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)),t}function ms(){var e,t,n,r;return e=Pr,t=Is(),t===null&&(t=u),t!==null?(n=wi(),n===null&&(n=u),n!==null?(Hr=Pr,r=Nn(t,n),r?r=u:r=o,r!==null?(t=[t,n,r],e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function gs(){var e,t,n,r,i;e=Pr,t=ms();if(t!==null){n=[],r=os();while(r!==null)n.push(r),r=os();if(n!==null){r=[],i=ys();while(i!==null)r.push(i),i=ys();r!==null?(Hr=e,t=Cn(t,n,r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)}else Pr=e,e=o}else Pr=e,e=o;return e}function wi(){var e,t,n,r;e=Pr,t=[],n=Pr,r=Ms(),r!==null&&(Hr=n,r=kn(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=Ln(r)),r===null?(Pr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Pr,r=Ms(),r!==null&&(Hr=n,r=kn(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=Ln(r)),r===null?(Pr=n,n=r):n=r);else t=o;return t!==null&&(Hr=e,t=An(t)),t===null?(Pr=e,e=t):e=t,e}function ys(){var t,n,r;t=Pr,n=[],e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));else n=o;return n!==null?(r=Ss(),r===null&&(r=Ts(),r===null&&(r=Ns(),r===null&&(r=Cs()))),r!==null?(Hr=t,n=On(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function bs(){var t;return Mn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(_n)),t===null&&(t=Us()),t}function ws(){var e,t;return e=Es(),e===null&&(e=Pr,t=Mi(),t!==null&&(Hr=e,t=Dn(t)),t===null?(Pr=e,e=t):e=t),e}function Es(){var t,n,r,i,s;return t=Pr,n=Pr,e.charCodeAt(Pr)===34?(r=Nt,Pr++):(r=null,qr===0&&$r(Ct)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===34?(s=Nt,Pr++):(s=null,qr===0&&$r(Ct)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o),n===null&&(n=Pr,e.charCodeAt(Pr)===39?(r=kt,Pr++):(r=null,qr===0&&$r(Lt)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===39?(s=kt,Pr++):(s=null,qr===0&&$r(Lt)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o)),n!==null&&(Hr=t,n=At(n)),n===null?(Pr=t,t=n):t=n,t}function Ss(){var t,n,r,i;return t=Pr,n=zs(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=ws(),i!==null?(Hr=t,n=Pn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function xs(){var t,n,r,i,s,u;t=Pr,e.charCodeAt(Pr)===123?(n=Xt,Pr++):(n=null,qr===0&&$r(Vt));if(n!==null){r=Gs();if(r!==null){i=Pr,s=[],u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));if(u!==null)while(u!==null)s.push(u),u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));else s=o;s!==null&&(s=e.substring(i,Pr)),i=s,i!==null?(s=Gs(),s!==null?(e.charCodeAt(Pr)===125?(u=fn,Pr++):(u=null,qr===0&&$r(ln)),u!==null?(Hr=t,n=Hn(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)}else Pr=t,t=o}else Pr=t,t=o;if(t===null){t=Pr,n=[],r=bs();if(r!==null)while(r!==null)n.push(r),r=bs();else n=o;n!==null&&(n=e.substring(t,Pr)),t=n}return t}function Ts(){var t,n,r,i,s,a;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=xs(),i!==null?(s=Pr,qr++,e.charCodeAt(Pr)===33?(a=Bn,Pr++):(a=null,qr===0&&$r(jn)),qr--,a===null?s=u:(Pr=s,s=o),s!==null?(Hr=Pr,a=Fn(n,i),a?a=u:a=o,a!==null?(Hr=t,n=In(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Ns(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Mi(),i!==null?(Hr=t,n=qn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Cs(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Xi(),i!==null?(Hr=t,n=Rn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function ks(){var t,n,r;t=Pr,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Ls(){var e;return e=ji(),e===null&&(e=Li()),e}function As(){var t;return t=qi(),t===null&&(St.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(xt)),t===null&&(e.charCodeAt(Pr)===95?(t=Un,Pr++):(t=null,qr===0&&$r(zn)),t===null&&(e.charCodeAt(Pr)===45?(t=Wn,Pr++):(t=null,qr===0&&$r(Xn))))),t}function Os(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===37?(n=Vn,Pr++):(n=null,qr===0&&$r($n)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ms(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===35?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=Qn(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function _s(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===46?(n=et,Pr++):(n=null,qr===0&&$r(tt)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ds(){var e,t;return qr++,e=Ps(),qr--,e===null&&(t=null,qr===0&&$r(Gn)),e}function Ps(){var t,n,r;t=Pr,n=[],r=Hs();while(r!==null)n.push(r),r=Hs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Hs(){var t;return Yn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Zn)),t===null&&(t=js()),t}function Bs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=js()),t}function js(){var t;return nr.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(rr)),t}function Fs(){var t,n,r;t=Pr,n=[],r=Rs();if(r!==null)while(r!==null)n.push(r),r=Rs();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Is(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===37?(n=Vn,Pr++):(n=null,qr===0&&$r($n)),n!==null?(r=Gs(),r!==null?(i=Fs(),i!==null?(Hr=t,n=it(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=qs()),qr--,t===null&&(n=null,qr===0&&$r(ir)),t}function qs(){var e,t,n;return e=Pr,t=Fs(),t!==null?(Hr=Pr,n=sr(t),n?n=u:n=o,n!==null?(Hr=e,t=or(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Rs(){var t;return Yn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Zn)),t===null&&(t=Us()),t}function Us(){var t,n,r,i;return t=Pr,e.charCodeAt(Pr)===58?(n=ur,Pr++):(n=null,qr===0&&$r(ar)),n!==null?(r=Pr,qr++,e.charCodeAt(Pr)===32?(i=M,Pr++):(i=null,qr===0&&$r(_)),qr--,i===null?r=u:(Pr=r,r=o),r!==null?(Hr=t,n=P(n),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function zs(){var e,t,n;return qr++,e=Pr,t=Fs(),t!==null?(Hr=Pr,n=lr(t),n?n=u:n=o,n!==null?(Hr=e,t=or(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),qr--,e===null&&(t=null,qr===0&&$r(fr)),e}function Ws(){var e,t,n;return e=Pr,t=Xs(),t!==null?(n=Qs(),n!==null?(Hr=e,t=it(n),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Xs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61423?(n=hr,Pr++):(n=null,qr===0&&$r(pr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(cr)),t}function Vs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61438?(n=mr,Pr++):(n=null,qr===0&&$r(gr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(vr)),t}function $s(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61422?(n=br,Pr++):(n=null,qr===0&&$r(wr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(yr)),t}function Js(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===13?(n=Sr,Pr++):(n=null,qr===0&&$r(xr)),n===null&&(n=u),n!==null?(e.charCodeAt(Pr)===61439?(r=Tr,Pr++):(r=null,qr===0&&$r(Nr)),r!==null?(e.charCodeAt(Pr)===10?(i=Cr,Pr++):(i=null,qr===0&&$r(kr)),i!==null?(Hr=t,n=xn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),qr--,t===null&&(n=null,qr===0&&$r(Er)),t}function Ks(){var e,t;return qr++,e=Vs(),e===null&&(e=$s()),qr--,e===null&&(t=null,qr===0&&$r(Lr)),e}function Qs(){var t,n,r;qr++,t=Pr,n=[],r=Ys();if(r!==null)while(r!==null)n.push(r),r=Ys();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,qr--,t===null&&(n=null,qr===0&&$r(Ar)),t}function Gs(){var e,t;qr++,e=[],t=Ys();while(t!==null)e.push(t),t=Ys();return qr--,e===null&&(t=null,qr===0&&$r(Or)),e}function Ys(){var t,n;return qr++,_r.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Dr)),qr--,t===null&&(n=null,qr===0&&$r(Mr)),t}function Zs(){var t,n,r;return t=Pr,n=Pr,qr++,r=Xs(),r===null&&(r=Vs(),r===null&&(r=Js())),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function eo(){var t,n,r;t=Pr,n=[],r=Zs();while(r!==null)n.push(r),r=Zs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function uo(e,t,n){var r=e.hash;if(n){r=r||new ro.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Kr},s=Kr,o=null,u="",a=function(e){return e},f=function(e,t){return new ro.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new ro.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new ro.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache +){var n=e.mustache.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:(e.mustache=uo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:uo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new ro.ContentNode(">")),[u,new ro.ContentNode("")])},kn=function(e){return{shorthand:e,id:!0}},Ln=function(e){return{shorthand:e}},An=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.7"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = function(h) { return [h[0], h[2]]; }, + peg$c55 = function(p) { return p; }, + peg$c56 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c57 = "PathSeparator", + peg$c58 = /^[\/.]/, + peg$c59 = "[\\/.]", + peg$c60 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c61 = function(v) { return new AST.StringNode(v); }, + peg$c62 = function(v) { return new AST.IntegerNode(v); }, + peg$c63 = function(v) { return new AST.BooleanNode(v); }, + peg$c64 = "Boolean", + peg$c65 = "true", + peg$c66 = "\"true\"", + peg$c67 = "false", + peg$c68 = "\"false\"", + peg$c69 = "Integer", + peg$c70 = /^[0-9]/, + peg$c71 = "[0-9]", + peg$c72 = function(s) { return parseInt(s); }, + peg$c73 = "\"", + peg$c74 = "\"\\\"\"", + peg$c75 = "'", + peg$c76 = "\"'\"", + peg$c77 = function(p) { return p[1]; }, + peg$c78 = /^[^"}]/, + peg$c79 = "[^\"}]", + peg$c80 = /^[^'}]/, + peg$c81 = "[^'}]", + peg$c82 = /^[A-Za-z]/, + peg$c83 = "[A-Za-z]", + peg$c84 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c85 = /^[|`']/, + peg$c86 = "[|`']", + peg$c87 = "<", + peg$c88 = "\"<\"", + peg$c89 = function() { return '<'; }, + peg$c90 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c91 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c92 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c93 = "{", + peg$c94 = "\"{\"", + peg$c95 = /^[^}]/, + peg$c96 = "[^}]", + peg$c97 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c98 = function(m) { m.escaped = true; return m; }, + peg$c99 = function(m) { m.escaped = false; return m; }, + peg$c100 = function(a) { return new AST.ContentNode(a); }, + peg$c101 = "any character", + peg$c102 = "SingleMustacheOpen", + peg$c103 = "DoubleMustacheOpen", + peg$c104 = "{{", + peg$c105 = "\"{{\"", + peg$c106 = "TripleMustacheOpen", + peg$c107 = "{{{", + peg$c108 = "\"{{{\"", + peg$c109 = "SingleMustacheClose", + peg$c110 = "}", + peg$c111 = "\"}\"", + peg$c112 = "DoubleMustacheClose", + peg$c113 = "}}", + peg$c114 = "\"}}\"", + peg$c115 = "TripleMustacheClose", + peg$c116 = "}}}", + peg$c117 = "\"}}}\"", + peg$c118 = "InterpolationOpen", + peg$c119 = "#{", + peg$c120 = "\"#{\"", + peg$c121 = "InterpolationClose", + peg$c122 = "==", + peg$c123 = "\"==\"", + peg$c124 = function() { return false; }, + peg$c125 = function() { return true; }, + peg$c126 = function(h, s) { return h || s; }, + peg$c127 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c128 = function(s) { return { shorthand: s, id: true}; }, + peg$c129 = function(s) { return { shorthand: s }; }, + peg$c130 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c131 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c132 = /^[A-Za-z.0-9_\-]/, + peg$c133 = "[A-Za-z.0-9_\\-]", + peg$c134 = function(id) { return new AST.MustacheNode([id]); }, + peg$c135 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c136 = function(value) { return value.replace(/ *$/, ''); }, + peg$c137 = "!", + peg$c138 = "\"!\"", + peg$c139 = function(key, value) { return IS_EMBER; }, + peg$c140 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c141 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c142 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c143 = "_", + peg$c144 = "\"_\"", + peg$c145 = "-", + peg$c146 = "\"-\"", + peg$c147 = "%", + peg$c148 = "\"%\"", + peg$c149 = "#", + peg$c150 = "\"#\"", + peg$c151 = function(c) { return c;}, + peg$c152 = "CSSIdentifier", + peg$c153 = /^[_a-zA-Z0-9\-]/, + peg$c154 = "[_a-zA-Z0-9\\-]", + peg$c155 = /^[_a-zA-Z]/, + peg$c156 = "[_a-zA-Z]", + peg$c157 = /^[\x80-\xFF]/, + peg$c158 = "[\\x80-\\xFF]", + peg$c159 = "KnownHTMLTagName", + peg$c160 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c161 = function(t) { return t; }, + peg$c162 = ":", + peg$c163 = "\":\"", + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c55(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c58.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c65) { + s0 = peg$c65; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c67) { + s0 = peg$c67; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c70.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c82.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c85.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c87; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c73; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c73; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c93; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c104) { + s0 = peg$c104; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c107) { + s0 = peg$c107; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c113) { + s0 = peg$c113; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c116) { + s0 = peg$c116; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c122) { + s1 = peg$c122; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c125(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c126(s1,s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c128(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c129(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c132.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c134(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c73; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c73; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c77(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c135(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c93; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c110; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c137; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c139(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c70.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c143; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c147; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c160(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c124(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, var: true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\n]+/); + if (this.discard(/\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.7/emblem.min.js b/ajax/libs/emblem/0.2.7/emblem.min.js new file mode 100644 index 000000000..3992272b7 --- /dev/null +++ b/ajax/libs/emblem/0.2.7/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.7",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Ur(){return e.substring(Hr,Pr)}function zr(){return Hr}function Wr(){return Vr(Hr).line}function Xr(){return Vr(Hr).column}function Vr(t){function n(t,n){var r,i;for(r=0;rt&&(Br=0,jr={line:1,column:1,seenCR:!1}),Br=t,n(jr,Br)),jr}function $r(e){if(PrFr&&(Fr=Pr,Ir=[]),Ir.push(e)}function Jr(e){var t=0;e.sort();while(tPr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ts(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),r===null&&(e.charCodeAt(Pr)===39?(r=kt,Pr++):(r=null,qr===0&&$r(Lt))),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ns(){var t,n,r,i;t=Pr,n=Pr,r=[],i=rs();if(i!==null)while(i!==null)r.push(i),i=rs();else r=o;return r!==null&&(r=e.substring(n,Pr)),n=r,n!==null&&(Hr=t,n=Yt(n)),n===null?(Pr=t,t=n):t=n,t}function rs(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function is(){var e;return e=fs(),e===null&&(e=as(),e===null&&(e=ps(),e===null&&(e=Ks(),e===null&&(e=Js())))),e}function ss(){var e,t,n,r,i,s;return e=Pr,t=us(),t!==null?(n=Gs(),n!==null?(r=Ki(),r!==null?(i=Gs(),i!==null?(s=ls(),s!==null?(Hr=e,t=Qt(r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function os(){var e;return e=ss(),e===null&&(e=Gi(),e===null&&(e=Qi())),e}function us(){var t,n;return qr++,e.charCodeAt(Pr)===123?(t=Xt,Pr++):(t=null,qr===0&&$r(Vt)),qr--,t===null&&(n=null,qr===0&&$r(en)),t}function as(){var t,n;return qr++,e.substr(Pr,2)===nn?(t=nn,Pr+=2):(t=null,qr===0&&$r(rn)),qr--,t===null&&(n=null,qr===0&&$r(tn)),t}function fs(){var t,n;return qr++,e.substr(Pr,3)===on?(t=on,Pr+=3):(t=null,qr===0&&$r(un)),qr--,t===null&&(n=null,qr===0&&$r(sn)),t}function ls(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=fn,Pr++):(t=null,qr===0&&$r(ln)),qr--,t===null&&(n=null,qr===0&&$r(an)),t}function cs(){var t,n;return qr++,e.substr(Pr,2)===hn?(t=hn,Pr+=2):(t=null,qr===0&&$r(pn)),qr--,t===null&&(n=null,qr===0&&$r(cn)),t}function hs(){var t,n;return qr++,e.substr(Pr,3)===vn?(t=vn,Pr+=3):(t=null,qr===0&&$r(mn)),qr--,t===null&&(n=null,qr===0&&$r(dn)),t}function ps(){var t,n;return qr++,e.substr(Pr,2)===yn?(t=yn,Pr+=2):(t=null,qr===0&&$r(bn)),qr--,t===null&&(n=null,qr===0&&$r(gn)),t}function ds(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=fn,Pr++):(t=null,qr===0&&$r(ln)),qr--,t===null&&(n=null,qr===0&&$r(wn)),t}function vs(){var t,n,r;return t=Pr,e.substr(Pr,2)===En?(n=En,Pr+=2):(n=null,qr===0&&$r(Sn)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=xn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=Pr,e.charCodeAt(Pr)===61?(n=l,Pr++):(n=null,qr===0&&$r(c)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Tn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)),t}function ms(){var t,n,r,i,s;return t=Pr,n=Is(),n===null&&(n=u),n!==null?(r=wi(),r===null&&(r=u),r!==null?(e.charCodeAt(Pr)===47?(i=C,Pr++):(i=null,qr===0&&$r(k)),i===null&&(i=u),i!==null?(Hr=Pr,s=Nn(n,r),s?s=u:s=o,s!==null?(n=[n,r,i,s],t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function gs(){var e,t,n,r,i;e=Pr,t=ms();if(t!==null){n=[],r=os();while(r!==null)n.push(r),r=os();if(n!==null){r=[],i=ys();while(i!==null)r.push(i),i=ys();r!==null?(Hr=e,t=Cn(t,n,r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)}else Pr=e,e=o}else Pr=e,e=o;return e}function wi(){var e,t,n,r;e=Pr,t=[],n=Pr,r=Ms(),r!==null&&(Hr=n,r=kn(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=Ln(r)),r===null?(Pr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Pr,r=Ms(),r!==null&&(Hr=n,r=kn(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=Ln(r)),r===null?(Pr=n,n=r):n=r);else t=o;return t!==null&&(Hr=e,t=An(t)),t===null?(Pr=e,e=t):e=t,e}function ys(){var t,n,r;t=Pr,n=[],e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));else n=o;return n!==null?(r=Ss(),r===null&&(r=Ts(),r===null&&(r=Ns(),r===null&&(r=Cs()))),r!==null?(Hr=t,n=On(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function bs(){var t;return Mn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(_n)),t===null&&(t=Us()),t}function ws(){var e,t;return e=Es(),e===null&&(e=Pr,t=Mi(),t!==null&&(Hr=e,t=Dn(t)),t===null?(Pr=e,e=t):e=t),e}function Es(){var t,n,r,i,s;return t=Pr,n=Pr,e.charCodeAt(Pr)===34?(r=Nt,Pr++):(r=null,qr===0&&$r(Ct)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===34?(s=Nt,Pr++):(s=null,qr===0&&$r(Ct)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o),n===null&&(n=Pr,e.charCodeAt(Pr)===39?(r=kt,Pr++):(r=null,qr===0&&$r(Lt)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===39?(s=kt,Pr++):(s=null,qr===0&&$r(Lt)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o)),n!==null&&(Hr=t,n=At(n)),n===null?(Pr=t,t=n):t=n,t}function Ss(){var t,n,r,i;return t=Pr,n=zs(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=ws(),i!==null?(Hr=t,n=Pn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function xs(){var t,n,r,i,s,u;t=Pr,e.charCodeAt(Pr)===123?(n=Xt,Pr++):(n=null,qr===0&&$r(Vt));if(n!==null){r=Gs();if(r!==null){i=Pr,s=[],u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));if(u!==null)while(u!==null)s.push(u),u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));else s=o;s!==null&&(s=e.substring(i,Pr)),i=s,i!==null?(s=Gs(),s!==null?(e.charCodeAt(Pr)===125?(u=fn,Pr++):(u=null,qr===0&&$r(ln)),u!==null?(Hr=t,n=Hn(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)}else Pr=t,t=o}else Pr=t,t=o;if(t===null){t=Pr,n=[],r=bs();if(r!==null)while(r!==null)n.push(r),r=bs();else n=o;n!==null&&(n=e.substring(t,Pr)),t=n}return t}function Ts(){var t,n,r,i,s,a;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=xs(),i!==null?(s=Pr,qr++,e.charCodeAt(Pr)===33?(a=Bn,Pr++):(a=null,qr===0&&$r(jn)),qr--,a===null?s=u:(Pr=s,s=o),s!==null?(Hr=Pr,a=Fn(n,i),a?a=u:a=o,a!==null?(Hr=t,n=In(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Ns(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Mi(),i!==null?(Hr=t,n=qn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Cs(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Xi(),i!==null?(Hr=t,n=Rn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function ks(){var t,n,r;t=Pr,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Ls(){var e;return e=ji(),e===null&&(e=Li()),e}function As(){var t;return t=qi(),t===null&&(St.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(xt)),t===null&&(e.charCodeAt(Pr)===95?(t=Un,Pr++):(t=null,qr===0&&$r(zn)),t===null&&(e.charCodeAt(Pr)===45?(t=Wn,Pr++):(t=null,qr===0&&$r(Xn))))),t}function Os(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===37?(n=Vn,Pr++):(n=null,qr===0&&$r($n)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ms(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===35?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=Qn(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function _s(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===46?(n=et,Pr++):(n=null,qr===0&&$r(tt)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ds(){var e,t;return qr++,e=Ps(),qr--,e===null&&(t=null,qr===0&&$r(Gn)),e}function Ps(){var t,n,r;t=Pr,n=[],r=Hs();while(r!==null)n.push(r),r=Hs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Hs(){var t;return Yn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Zn)),t===null&&(t=js()),t}function Bs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=js()),t}function js(){var t;return nr.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(rr)),t}function Fs(){var t,n,r;t=Pr,n=[],r=Rs();if(r!==null)while(r!==null)n.push(r),r=Rs();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Is(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===37?(n=Vn,Pr++):(n=null,qr===0&&$r($n)),n!==null?(r=Gs(),r!==null?(i=Fs(),i!==null?(Hr=t,n=it(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=qs()),qr--,t===null&&(n=null,qr===0&&$r(ir)),t}function qs(){var e,t,n;return e=Pr,t=Fs(),t!==null?(Hr=Pr,n=sr(t),n?n=u:n=o,n!==null?(Hr=e,t=or(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Rs(){var t;return Yn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Zn)),t===null&&(t=Us()),t}function Us(){var t,n,r,i;return t=Pr,e.charCodeAt(Pr)===58?(n=ur,Pr++):(n=null,qr===0&&$r(ar)),n!==null?(r=Pr,qr++,e.charCodeAt(Pr)===32?(i=M,Pr++):(i=null,qr===0&&$r(_)),qr--,i===null?r=u:(Pr=r,r=o),r!==null?(Hr=t,n=P(n),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function zs(){var e,t,n;return qr++,e=Pr,t=Fs(),t!==null?(Hr=Pr,n=lr(t),n?n=u:n=o,n!==null?(Hr=e,t=or(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),qr--,e===null&&(t=null,qr===0&&$r(fr)),e}function Ws(){var e,t,n;return e=Pr,t=Xs(),t!==null?(n=Qs(),n!==null?(Hr=e,t=it(n),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Xs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61423?(n=hr,Pr++):(n=null,qr===0&&$r(pr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(cr)),t}function Vs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61438?(n=mr,Pr++):(n=null,qr===0&&$r(gr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(vr)),t}function $s(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61422?(n=br,Pr++):(n=null,qr===0&&$r(wr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(yr)),t}function Js(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===13?(n=Sr,Pr++):(n=null,qr===0&&$r(xr)),n===null&&(n=u),n!==null?(e.charCodeAt(Pr)===61439?(r=Tr,Pr++):(r=null,qr===0&&$r(Nr)),r!==null?(e.charCodeAt(Pr)===10?(i=Cr,Pr++):(i=null,qr===0&&$r(kr)),i!==null?(Hr=t,n=xn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),qr--,t===null&&(n=null,qr===0&&$r(Er)),t}function Ks(){var e,t;return qr++,e=Vs(),e===null&&(e=$s()),qr--,e===null&&(t=null,qr===0&&$r(Lr)),e}function Qs(){var t,n,r;qr++,t=Pr,n=[],r=Ys();if(r!==null)while(r!==null)n.push(r),r=Ys();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,qr--,t===null&&(n=null,qr===0&&$r(Ar)),t}function Gs(){var e,t;qr++,e=[],t=Ys();while(t!==null)e.push(t),t=Ys();return qr--,e===null&&(t=null,qr===0&&$r(Or)),e}function Ys(){var t,n;return qr++,_r.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Dr)),qr--,t===null&&(n=null,qr===0&&$r(Mr)),t}function Zs(){var t,n,r;return t=Pr,n=Pr,qr++,r=Xs(),r===null&&(r=Vs(),r===null&&(r=Js())),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(Zt)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function eo(){var t,n,r;t=Pr,n=[],r=Zs();while(r!==null)n.push(r),r=Zs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function uo(e,t,n){var r=e.hash;if(n){r=r||new ro.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Kr},s=Kr,o=null,u="",a=function(e){return e},f=function(e,t){return new ro.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new ro.PartialNode(e,t[0 +])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new ro.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:(e.mustache=uo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:uo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new ro.ContentNode(">")),[u,new ro.ContentNode("")])},kn=function(e){return{shorthand:e,id:!0}},Ln=function(e){return{shorthand:e}},An=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.9"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(s); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(path.string); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = ":", + peg$c55 = "\":\"", + peg$c56 = function(h) { return [h[0], h[2]]; }, + peg$c57 = function(p) { return p; }, + peg$c58 = function(first, tail) { + var ret = [first]; + for(var i = 0; i < tail.length; ++i) { + //ret = ret.concat(tail[i]); + ret.push(tail[i]); + } + return ret; + }, + peg$c59 = "PathSeparator", + peg$c60 = /^[\/.]/, + peg$c61 = "[\\/.]", + peg$c62 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + v[v.length - 1] = last.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c63 = function(v) { return new AST.StringNode(v); }, + peg$c64 = function(v) { return new AST.IntegerNode(v); }, + peg$c65 = function(v) { return new AST.BooleanNode(v); }, + peg$c66 = "Boolean", + peg$c67 = "true", + peg$c68 = "\"true\"", + peg$c69 = "false", + peg$c70 = "\"false\"", + peg$c71 = "Integer", + peg$c72 = /^[0-9]/, + peg$c73 = "[0-9]", + peg$c74 = function(s) { return parseInt(s); }, + peg$c75 = "\"", + peg$c76 = "\"\\\"\"", + peg$c77 = "'", + peg$c78 = "\"'\"", + peg$c79 = function(p) { return p[1]; }, + peg$c80 = /^[^"}]/, + peg$c81 = "[^\"}]", + peg$c82 = /^[^'}]/, + peg$c83 = "[^'}]", + peg$c84 = /^[A-Za-z]/, + peg$c85 = "[A-Za-z]", + peg$c86 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c87 = /^[|`']/, + peg$c88 = "[|`']", + peg$c89 = "<", + peg$c90 = "\"<\"", + peg$c91 = function() { return '<'; }, + peg$c92 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c93 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c94 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c95 = "{", + peg$c96 = "\"{\"", + peg$c97 = /^[^}]/, + peg$c98 = "[^}]", + peg$c99 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c100 = function(m) { m.escaped = true; return m; }, + peg$c101 = function(m) { m.escaped = false; return m; }, + peg$c102 = function(a) { return new AST.ContentNode(a); }, + peg$c103 = "any character", + peg$c104 = "SingleMustacheOpen", + peg$c105 = "DoubleMustacheOpen", + peg$c106 = "{{", + peg$c107 = "\"{{\"", + peg$c108 = "TripleMustacheOpen", + peg$c109 = "{{{", + peg$c110 = "\"{{{\"", + peg$c111 = "SingleMustacheClose", + peg$c112 = "}", + peg$c113 = "\"}\"", + peg$c114 = "DoubleMustacheClose", + peg$c115 = "}}", + peg$c116 = "\"}}\"", + peg$c117 = "TripleMustacheClose", + peg$c118 = "}}}", + peg$c119 = "\"}}}\"", + peg$c120 = "InterpolationOpen", + peg$c121 = "#{", + peg$c122 = "\"#{\"", + peg$c123 = "InterpolationClose", + peg$c124 = "==", + peg$c125 = "\"==\"", + peg$c126 = function() { return false; }, + peg$c127 = function() { return true; }, + peg$c128 = function(h, s) { return h || s; }, + peg$c129 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c130 = function(s) { return { shorthand: s, id: true}; }, + peg$c131 = function(s) { return { shorthand: s }; }, + peg$c132 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c133 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c134 = /^[A-Za-z.0-9_\-]/, + peg$c135 = "[A-Za-z.0-9_\\-]", + peg$c136 = function(id) { return new AST.MustacheNode([id]); }, + peg$c137 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c138 = function(value) { return value.replace(/ *$/, ''); }, + peg$c139 = "!", + peg$c140 = "\"!\"", + peg$c141 = function(key, value) { return IS_EMBER; }, + peg$c142 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode(['bindAttr'])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c143 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c144 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c145 = "_", + peg$c146 = "\"_\"", + peg$c147 = "-", + peg$c148 = "\"-\"", + peg$c149 = "%", + peg$c150 = "\"%\"", + peg$c151 = "#", + peg$c152 = "\"#\"", + peg$c153 = function(c) { return c;}, + peg$c154 = "CSSIdentifier", + peg$c155 = /^[_a-zA-Z0-9\-]/, + peg$c156 = "[_a-zA-Z0-9\\-]", + peg$c157 = /^[_a-zA-Z]/, + peg$c158 = "[_a-zA-Z]", + peg$c159 = /^[\x80-\xFF]/, + peg$c160 = "[\\x80-\\xFF]", + peg$c161 = "KnownHTMLTagName", + peg$c162 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c163 = function(t) { return t; }, + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c60.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c67) { + s0 = peg$c67; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c69) { + s0 = peg$c69; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c84.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c87.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c89; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c77; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c77; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c95; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c115) { + s0 = peg$c115; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c118) { + s0 = peg$c118; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c128(s1,s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c134.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c112; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c139; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c141(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c147; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c151; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c159.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c54; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([helperName])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + oiasoijdoiaj.asdasd.asdasd; + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.2.9/emblem.min.js b/ajax/libs/emblem/0.2.9/emblem.min.js new file mode 100644 index 000000000..d4d469b00 --- /dev/null +++ b/ajax/libs/emblem/0.2.9/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.9",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Ur(){return e.substring(Hr,Pr)}function zr(){return Hr}function Wr(){return Vr(Hr).line}function Xr(){return Vr(Hr).column}function Vr(t){function n(t,n){var r,i;for(r=0;rt&&(Br=0,jr={line:1,column:1,seenCR:!1}),Br=t,n(jr,Br)),jr}function $r(e){if(PrFr&&(Fr=Pr,Ir=[]),Ir.push(e)}function Jr(e){var t=0;e.sort();while(tPr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ts(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),r===null&&(e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot))),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ns(){var t,n,r,i;t=Pr,n=Pr,r=[],i=rs();if(i!==null)while(i!==null)r.push(i),i=rs();else r=o;return r!==null&&(r=e.substring(n,Pr)),n=r,n!==null&&(Hr=t,n=en(n)),n===null?(Pr=t,t=n):t=n,t}function rs(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function is(){var e;return e=fs(),e===null&&(e=as(),e===null&&(e=ps(),e===null&&(e=Ks(),e===null&&(e=Js())))),e}function ss(){var e,t,n,r,i,s;return e=Pr,t=us(),t!==null?(n=Gs(),n!==null?(r=Ki(),r!==null?(i=Gs(),i!==null?(s=ls(),s!==null?(Hr=e,t=Yt(r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function os(){var e;return e=ss(),e===null&&(e=Gi(),e===null&&(e=Qi())),e}function us(){var t,n;return qr++,e.charCodeAt(Pr)===123?(t=$t,Pr++):(t=null,qr===0&&$r(Jt)),qr--,t===null&&(n=null,qr===0&&$r(nn)),t}function as(){var t,n;return qr++,e.substr(Pr,2)===sn?(t=sn,Pr+=2):(t=null,qr===0&&$r(on)),qr--,t===null&&(n=null,qr===0&&$r(rn)),t}function fs(){var t,n;return qr++,e.substr(Pr,3)===an?(t=an,Pr+=3):(t=null,qr===0&&$r(fn)),qr--,t===null&&(n=null,qr===0&&$r(un)),t}function ls(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(ln)),t}function cs(){var t,n;return qr++,e.substr(Pr,2)===dn?(t=dn,Pr+=2):(t=null,qr===0&&$r(vn)),qr--,t===null&&(n=null,qr===0&&$r(pn)),t}function hs(){var t,n;return qr++,e.substr(Pr,3)===gn?(t=gn,Pr+=3):(t=null,qr===0&&$r(yn)),qr--,t===null&&(n=null,qr===0&&$r(mn)),t}function ps(){var t,n;return qr++,e.substr(Pr,2)===wn?(t=wn,Pr+=2):(t=null,qr===0&&$r(En)),qr--,t===null&&(n=null,qr===0&&$r(bn)),t}function ds(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(Sn)),t}function vs(){var t,n,r;return t=Pr,e.substr(Pr,2)===xn?(n=xn,Pr+=2):(n=null,qr===0&&$r(Tn)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=Pr,e.charCodeAt(Pr)===61?(n=l,Pr++):(n=null,qr===0&&$r(c)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Cn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)),t}function ms(){var t,n,r,i,s;return t=Pr,n=Is(),n===null&&(n=u),n!==null?(r=wi(),r===null&&(r=u),r!==null?(e.charCodeAt(Pr)===47?(i=C,Pr++):(i=null,qr===0&&$r(k)),i===null&&(i=u),i!==null?(Hr=Pr,s=kn(n,r),s?s=u:s=o,s!==null?(n=[n,r,i,s],t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function gs(){var e,t,n,r,i;e=Pr,t=ms();if(t!==null){n=[],r=os();while(r!==null)n.push(r),r=os();if(n!==null){r=[],i=ys();while(i!==null)r.push(i),i=ys();r!==null?(Hr=e,t=Ln(t,n,r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)}else Pr=e,e=o}else Pr=e,e=o;return e}function wi(){var e,t,n,r;e=Pr,t=[],n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);else t=o;return t!==null&&(Hr=e,t=Mn(t)),t===null?(Pr=e,e=t):e=t,e}function ys(){var t,n,r;t=Pr,n=[],e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));else n=o;return n!==null?(r=Ss(),r===null&&(r=Ts(),r===null&&(r=Ns(),r===null&&(r=Cs()))),r!==null?(Hr=t,n=_n(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function bs(){var t;return Dn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Pn)),t===null&&(t=Us()),t}function ws(){var e,t;return e=Es(),e===null&&(e=Pr,t=Mi(),t!==null&&(Hr=e,t=Hn(t)),t===null?(Pr=e,e=t):e=t),e}function Es(){var t,n,r,i,s;return t=Pr,n=Pr,e.charCodeAt(Pr)===34?(r=kt,Pr++):(r=null,qr===0&&$r(Lt)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===34?(s=kt,Pr++):(s=null,qr===0&&$r(Lt)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o),n===null&&(n=Pr,e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===39?(s=At,Pr++):(s=null,qr===0&&$r(Ot)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o)),n!==null&&(Hr=t,n=Mt(n)),n===null?(Pr=t,t=n):t=n,t}function Ss(){var t,n,r,i;return t=Pr,n=zs(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=ws(),i!==null?(Hr=t,n=Bn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function xs(){var t,n,r,i,s,u;t=Pr,e.charCodeAt(Pr)===123?(n=$t,Pr++):(n=null,qr===0&&$r(Jt));if(n!==null){r=Gs();if(r!==null){i=Pr,s=[],u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));if(u!==null)while(u!==null)s.push(u),u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));else s=o;s!==null&&(s=e.substring(i,Pr)),i=s,i!==null?(s=Gs(),s!==null?(e.charCodeAt(Pr)===125?(u=cn,Pr++):(u=null,qr===0&&$r(hn)),u!==null?(Hr=t,n=jn(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)}else Pr=t,t=o}else Pr=t,t=o;if(t===null){t=Pr,n=[],r=bs();if(r!==null)while(r!==null)n.push(r),r=bs();else n=o;n!==null&&(n=e.substring(t,Pr)),t=n}return t}function Ts(){var t,n,r,i,s,a;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=xs(),i!==null?(s=Pr,qr++,e.charCodeAt(Pr)===33?(a=Fn,Pr++):(a=null,qr===0&&$r(In)),qr--,a===null?s=u:(Pr=s,s=o),s!==null?(Hr=Pr,a=qn(n,i),a?a=u:a=o,a!==null?(Hr=t,n=Rn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Ns(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Mi(),i!==null?(Hr=t,n=Un(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Cs(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Xi(),i!==null?(Hr=t,n=zn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function ks(){var t,n,r;t=Pr,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Ls(){var e;return e=ji(),e===null&&(e=Li()),e}function As(){var t;return t=qi(),t===null&&(Tt.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Nt)),t===null&&(e.charCodeAt(Pr)===95?(t=Wn,Pr++):(t=null,qr===0&&$r(Xn)),t===null&&(e.charCodeAt(Pr)===45?(t=Vn,Pr++):(t=null,qr===0&&$r($n))))),t}function Os(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ms(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===35?(n=Qn,Pr++):(n=null,qr===0&&$r(Gn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=Yn(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function _s(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===46?(n=et,Pr++):(n=null,qr===0&&$r(tt)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ds(){var e,t;return qr++,e=Ps(),qr--,e===null&&(t=null,qr===0&&$r(Zn)),e}function Ps(){var t,n,r;t=Pr,n=[],r=Hs();while(r!==null)n.push(r),r=Hs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Hs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=js()),t}function Bs(){var t;return nr.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(rr)),t===null&&(t=js()),t}function js(){var t;return ir.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(sr)),t}function Fs(){var t,n,r;t=Pr,n=[],r=Rs();if(r!==null)while(r!==null)n.push(r),r=Rs();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Is(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Gs(),r!==null?(i=Fs(),i!==null?(Hr=t,n=it(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=qs()),qr--,t===null&&(n=null,qr===0&&$r(or)),t}function qs(){var e,t,n;return e=Pr,t=Fs(),t!==null?(Hr=Pr,n=ur(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Rs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=Us()),t}function Us(){var t,n,r,i;return t=Pr,e.charCodeAt(Pr)===58?(n=ot,Pr++):(n=null,qr===0&&$r(ut)),n!==null?(r=Pr,qr++,e.charCodeAt(Pr)===32?(i=M,Pr++):(i=null,qr===0&&$r(_)),qr--,i===null?r=u:(Pr=r,r=o),r!==null?(Hr=t,n=P(n),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function zs(){var e,t,n;return qr++,e=Pr,t=Fs(),t!==null?(Hr=Pr,n=lr(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),qr--,e===null&&(t=null,qr===0&&$r(fr)),e}function Ws(){var e,t,n;return e=Pr,t=Xs(),t!==null?(n=Qs(),n!==null?(Hr=e,t=it(n),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Xs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61423?(n=hr,Pr++):(n=null,qr===0&&$r(pr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(cr)),t}function Vs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61438?(n=mr,Pr++):(n=null,qr===0&&$r(gr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(vr)),t}function $s(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61422?(n=br,Pr++):(n=null,qr===0&&$r(wr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(yr)),t}function Js(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===13?(n=Sr,Pr++):(n=null,qr===0&&$r(xr)),n===null&&(n=u),n!==null?(e.charCodeAt(Pr)===61439?(r=Tr,Pr++):(r=null,qr===0&&$r(Nr)),r!==null?(e.charCodeAt(Pr)===10?(i=Cr,Pr++):(i=null,qr===0&&$r(kr)),i!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),qr--,t===null&&(n=null,qr===0&&$r(Er)),t}function Ks(){var e,t;return qr++,e=Vs(),e===null&&(e=$s()),qr--,e===null&&(t=null,qr===0&&$r(Lr)),e}function Qs(){var t,n,r;qr++,t=Pr,n=[],r=Ys();if(r!==null)while(r!==null)n.push(r),r=Ys();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,qr--,t===null&&(n=null,qr===0&&$r(Ar)),t}function Gs(){var e,t;qr++,e=[],t=Ys();while(t!==null)e.push(t),t=Ys();return qr--,e===null&&(t=null,qr===0&&$r(Or)),e}function Ys(){var t,n;return qr++,_r.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Dr)),qr--,t===null&&(n=null,qr===0&&$r(Mr)),t}function Zs(){var t,n,r;return t=Pr,n=Pr,qr++,r=Xs(),r===null&&(r=Vs(),r===null&&(r=Js())),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function eo(){var t,n,r;t=Pr,n=[],r=Zs();while(r!==null)n.push(r),r=Zs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function uo(e,t,n){var r=e.hash;if(n){r=r||new ro.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Kr},s=Kr,o=null,u="",a=function(e){return e},f=function(e,t){return new ro.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new ro.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new ro.PartialNameNode(e)},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:(e.mustache=uo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:uo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new ro.ContentNode(">")),[u,new ro.ContentNode("")])},An=function(e){return{shorthand:e,id:!0}},On=function(e){return{shorthand:e}},Mn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.2.9"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = ":", + peg$c55 = "\":\"", + peg$c56 = function(h) { return [h[0], h[2]]; }, + peg$c57 = function(s, p) { return { part: p, separator: s }; }, + peg$c58 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c59 = "PathSeparator", + peg$c60 = /^[\/.]/, + peg$c61 = "[\\/.]", + peg$c62 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c63 = function(v) { return new AST.StringNode(v); }, + peg$c64 = function(v) { return new AST.IntegerNode(v); }, + peg$c65 = function(v) { return new AST.BooleanNode(v); }, + peg$c66 = "Boolean", + peg$c67 = "true", + peg$c68 = "\"true\"", + peg$c69 = "false", + peg$c70 = "\"false\"", + peg$c71 = "Integer", + peg$c72 = /^[0-9]/, + peg$c73 = "[0-9]", + peg$c74 = function(s) { return parseInt(s); }, + peg$c75 = "\"", + peg$c76 = "\"\\\"\"", + peg$c77 = "'", + peg$c78 = "\"'\"", + peg$c79 = function(p) { return p[1]; }, + peg$c80 = /^[^"}]/, + peg$c81 = "[^\"}]", + peg$c82 = /^[^'}]/, + peg$c83 = "[^'}]", + peg$c84 = /^[A-Za-z]/, + peg$c85 = "[A-Za-z]", + peg$c86 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c87 = /^[|`']/, + peg$c88 = "[|`']", + peg$c89 = "<", + peg$c90 = "\"<\"", + peg$c91 = function() { return '<'; }, + peg$c92 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c93 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c94 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c95 = "{", + peg$c96 = "\"{\"", + peg$c97 = /^[^}]/, + peg$c98 = "[^}]", + peg$c99 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c100 = function(m) { m.escaped = true; return m; }, + peg$c101 = function(m) { m.escaped = false; return m; }, + peg$c102 = function(a) { return new AST.ContentNode(a); }, + peg$c103 = "any character", + peg$c104 = "SingleMustacheOpen", + peg$c105 = "DoubleMustacheOpen", + peg$c106 = "{{", + peg$c107 = "\"{{\"", + peg$c108 = "TripleMustacheOpen", + peg$c109 = "{{{", + peg$c110 = "\"{{{\"", + peg$c111 = "SingleMustacheClose", + peg$c112 = "}", + peg$c113 = "\"}\"", + peg$c114 = "DoubleMustacheClose", + peg$c115 = "}}", + peg$c116 = "\"}}\"", + peg$c117 = "TripleMustacheClose", + peg$c118 = "}}}", + peg$c119 = "\"}}}\"", + peg$c120 = "InterpolationOpen", + peg$c121 = "#{", + peg$c122 = "\"#{\"", + peg$c123 = "InterpolationClose", + peg$c124 = "==", + peg$c125 = "\"==\"", + peg$c126 = function() { return false; }, + peg$c127 = function() { return true; }, + peg$c128 = function(h, s) { return h || s; }, + peg$c129 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c130 = function(s) { return { shorthand: s, id: true}; }, + peg$c131 = function(s) { return { shorthand: s }; }, + peg$c132 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c133 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c134 = /^[A-Za-z.0-9_\-]/, + peg$c135 = "[A-Za-z.0-9_\\-]", + peg$c136 = function(id) { return new AST.MustacheNode([id]); }, + peg$c137 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c138 = function(value) { return value.replace(/ *$/, ''); }, + peg$c139 = "!", + peg$c140 = "\"!\"", + peg$c141 = function(key, value) { return IS_EMBER; }, + peg$c142 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bindAttr'}])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c143 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c144 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c145 = "_", + peg$c146 = "\"_\"", + peg$c147 = "-", + peg$c148 = "\"-\"", + peg$c149 = "%", + peg$c150 = "\"%\"", + peg$c151 = "#", + peg$c152 = "\"#\"", + peg$c153 = function(c) { return c;}, + peg$c154 = "CSSIdentifier", + peg$c155 = /^[_a-zA-Z0-9\-]/, + peg$c156 = "[_a-zA-Z0-9\\-]", + peg$c157 = /^[_a-zA-Z]/, + peg$c158 = "[_a-zA-Z]", + peg$c159 = /^[\x80-\xFF]/, + peg$c160 = "[\\x80-\\xFF]", + peg$c161 = "KnownHTMLTagName", + peg$c162 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c163 = function(t) { return t; }, + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4,s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4,s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c60.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c67) { + s0 = peg$c67; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c69) { + s0 = peg$c69; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c84.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c87.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c89; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c77; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c77; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c95; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c115) { + s0 = peg$c115; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c118) { + s0 = peg$c118; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c128(s1,s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c134.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c112; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c139; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c141(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c147; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c151; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c159.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c54; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +ENV.EMBER_LOAD_HOOKS.application.push(function() { + return Emblem.compileScriptTags(); +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.3.0/emblem.min.js b/ajax/libs/emblem/0.3.0/emblem.min.js new file mode 100644 index 000000000..9652d8ff7 --- /dev/null +++ b/ajax/libs/emblem/0.3.0/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.2.9",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Ur(){return e.substring(Hr,Pr)}function zr(){return Hr}function Wr(){return Vr(Hr).line}function Xr(){return Vr(Hr).column}function Vr(t){function n(t,n){var r,i;for(r=0;rt&&(Br=0,jr={line:1,column:1,seenCR:!1}),Br=t,n(jr,Br)),jr}function $r(e){if(PrFr&&(Fr=Pr,Ir=[]),Ir.push(e)}function Jr(e){var t=0;e.sort();while(tPr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ts(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),r===null&&(e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot))),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ns(){var t,n,r,i;t=Pr,n=Pr,r=[],i=rs();if(i!==null)while(i!==null)r.push(i),i=rs();else r=o;return r!==null&&(r=e.substring(n,Pr)),n=r,n!==null&&(Hr=t,n=en(n)),n===null?(Pr=t,t=n):t=n,t}function rs(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function is(){var e;return e=fs(),e===null&&(e=as(),e===null&&(e=ps(),e===null&&(e=Ks(),e===null&&(e=Js())))),e}function ss(){var e,t,n,r,i,s;return e=Pr,t=us(),t!==null?(n=Gs(),n!==null?(r=Ki(),r!==null?(i=Gs(),i!==null?(s=ls(),s!==null?(Hr=e,t=Yt(r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function os(){var e;return e=ss(),e===null&&(e=Gi(),e===null&&(e=Qi())),e}function us(){var t,n;return qr++,e.charCodeAt(Pr)===123?(t=$t,Pr++):(t=null,qr===0&&$r(Jt)),qr--,t===null&&(n=null,qr===0&&$r(nn)),t}function as(){var t,n;return qr++,e.substr(Pr,2)===sn?(t=sn,Pr+=2):(t=null,qr===0&&$r(on)),qr--,t===null&&(n=null,qr===0&&$r(rn)),t}function fs(){var t,n;return qr++,e.substr(Pr,3)===an?(t=an,Pr+=3):(t=null,qr===0&&$r(fn)),qr--,t===null&&(n=null,qr===0&&$r(un)),t}function ls(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(ln)),t}function cs(){var t,n;return qr++,e.substr(Pr,2)===dn?(t=dn,Pr+=2):(t=null,qr===0&&$r(vn)),qr--,t===null&&(n=null,qr===0&&$r(pn)),t}function hs(){var t,n;return qr++,e.substr(Pr,3)===gn?(t=gn,Pr+=3):(t=null,qr===0&&$r(yn)),qr--,t===null&&(n=null,qr===0&&$r(mn)),t}function ps(){var t,n;return qr++,e.substr(Pr,2)===wn?(t=wn,Pr+=2):(t=null,qr===0&&$r(En)),qr--,t===null&&(n=null,qr===0&&$r(bn)),t}function ds(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(Sn)),t}function vs(){var t,n,r;return t=Pr,e.substr(Pr,2)===xn?(n=xn,Pr+=2):(n=null,qr===0&&$r(Tn)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=Pr,e.charCodeAt(Pr)===61?(n=l,Pr++):(n=null,qr===0&&$r(c)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Cn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)),t}function ms(){var t,n,r,i,s;return t=Pr,n=Is(),n===null&&(n=u),n!==null?(r=wi(),r===null&&(r=u),r!==null?(e.charCodeAt(Pr)===47?(i=C,Pr++):(i=null,qr===0&&$r(k)),i===null&&(i=u),i!==null?(Hr=Pr,s=kn(n,r),s?s=u:s=o,s!==null?(n=[n,r,i,s],t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function gs(){var e,t,n,r,i;e=Pr,t=ms();if(t!==null){n=[],r=os();while(r!==null)n.push(r),r=os();if(n!==null){r=[],i=ys();while(i!==null)r.push(i),i=ys();r!==null?(Hr=e,t=Ln(t,n,r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)}else Pr=e,e=o}else Pr=e,e=o;return e}function wi(){var e,t,n,r;e=Pr,t=[],n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);else t=o;return t!==null&&(Hr=e,t=Mn(t)),t===null?(Pr=e,e=t):e=t,e}function ys(){var t,n,r;t=Pr,n=[],e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));else n=o;return n!==null?(r=Ss(),r===null&&(r=Ts(),r===null&&(r=Ns(),r===null&&(r=Cs()))),r!==null?(Hr=t,n=_n(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function bs(){var t;return Dn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Pn)),t===null&&(t=Us()),t}function ws(){var e,t;return e=Es(),e===null&&(e=Pr,t=Mi(),t!==null&&(Hr=e,t=Hn(t)),t===null?(Pr=e,e=t):e=t),e}function Es(){var t,n,r,i,s;return t=Pr,n=Pr,e.charCodeAt(Pr)===34?(r=kt,Pr++):(r=null,qr===0&&$r(Lt)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===34?(s=kt,Pr++):(s=null,qr===0&&$r(Lt)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o),n===null&&(n=Pr,e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===39?(s=At,Pr++):(s=null,qr===0&&$r(Ot)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o)),n!==null&&(Hr=t,n=Mt(n)),n===null?(Pr=t,t=n):t=n,t}function Ss(){var t,n,r,i;return t=Pr,n=zs(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=ws(),i!==null?(Hr=t,n=Bn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function xs(){var t,n,r,i,s,u;t=Pr,e.charCodeAt(Pr)===123?(n=$t,Pr++):(n=null,qr===0&&$r(Jt));if(n!==null){r=Gs();if(r!==null){i=Pr,s=[],u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));if(u!==null)while(u!==null)s.push(u),u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));else s=o;s!==null&&(s=e.substring(i,Pr)),i=s,i!==null?(s=Gs(),s!==null?(e.charCodeAt(Pr)===125?(u=cn,Pr++):(u=null,qr===0&&$r(hn)),u!==null?(Hr=t,n=jn(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)}else Pr=t,t=o}else Pr=t,t=o;if(t===null){t=Pr,n=[],r=bs();if(r!==null)while(r!==null)n.push(r),r=bs();else n=o;n!==null&&(n=e.substring(t,Pr)),t=n}return t}function Ts(){var t,n,r,i,s,a;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=xs(),i!==null?(s=Pr,qr++,e.charCodeAt(Pr)===33?(a=Fn,Pr++):(a=null,qr===0&&$r(In)),qr--,a===null?s=u:(Pr=s,s=o),s!==null?(Hr=Pr,a=qn(n,i),a?a=u:a=o,a!==null?(Hr=t,n=Rn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Ns(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Mi(),i!==null?(Hr=t,n=Un(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Cs(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Xi(),i!==null?(Hr=t,n=zn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function ks(){var t,n,r;t=Pr,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Ls(){var e;return e=ji(),e===null&&(e=Li()),e}function As(){var t;return t=qi(),t===null&&(Tt.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Nt)),t===null&&(e.charCodeAt(Pr)===95?(t=Wn,Pr++):(t=null,qr===0&&$r(Xn)),t===null&&(e.charCodeAt(Pr)===45?(t=Vn,Pr++):(t=null,qr===0&&$r($n))))),t}function Os(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ms(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===35?(n=Qn,Pr++):(n=null,qr===0&&$r(Gn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=Yn(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function _s(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===46?(n=et,Pr++):(n=null,qr===0&&$r(tt)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ds(){var e,t;return qr++,e=Ps(),qr--,e===null&&(t=null,qr===0&&$r(Zn)),e}function Ps(){var t,n,r;t=Pr,n=[],r=Hs();while(r!==null)n.push(r),r=Hs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Hs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=js()),t}function Bs(){var t;return nr.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(rr)),t===null&&(t=js()),t}function js(){var t;return ir.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(sr)),t}function Fs(){var t,n,r;t=Pr,n=[],r=Rs();if(r!==null)while(r!==null)n.push(r),r=Rs();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Is(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Gs(),r!==null?(i=Fs(),i!==null?(Hr=t,n=it(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=qs()),qr--,t===null&&(n=null,qr===0&&$r(or)),t}function qs(){var e,t,n;return e=Pr,t=Fs(),t!==null?(Hr=Pr,n=ur(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Rs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=Us()),t}function Us(){var t,n,r,i;return t=Pr,e.charCodeAt(Pr)===58?(n=ot,Pr++):(n=null,qr===0&&$r(ut)),n!==null?(r=Pr,qr++,e.charCodeAt(Pr)===32?(i=M,Pr++):(i=null,qr===0&&$r(_)),qr--,i===null?r=u:(Pr=r,r=o),r!==null?(Hr=t,n=P(n),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function zs(){var e,t,n;return qr++,e=Pr,t=Fs(),t!==null?(Hr=Pr,n=lr(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),qr--,e===null&&(t=null,qr===0&&$r(fr)),e}function Ws(){var e,t,n;return e=Pr,t=Xs(),t!==null?(n=Qs(),n!==null?(Hr=e,t=it(n),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Xs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61423?(n=hr,Pr++):(n=null,qr===0&&$r(pr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(cr)),t}function Vs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61438?(n=mr,Pr++):(n=null,qr===0&&$r(gr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(vr)),t}function $s(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61422?(n=br,Pr++):(n=null,qr===0&&$r(wr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(yr)),t}function Js(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===13?(n=Sr,Pr++):(n=null,qr===0&&$r(xr)),n===null&&(n=u),n!==null?(e.charCodeAt(Pr)===61439?(r=Tr,Pr++):(r=null,qr===0&&$r(Nr)),r!==null?(e.charCodeAt(Pr)===10?(i=Cr,Pr++):(i=null,qr===0&&$r(kr)),i!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),qr--,t===null&&(n=null,qr===0&&$r(Er)),t}function Ks(){var e,t;return qr++,e=Vs(),e===null&&(e=$s()),qr--,e===null&&(t=null,qr===0&&$r(Lr)),e}function Qs(){var t,n,r;qr++,t=Pr,n=[],r=Ys();if(r!==null)while(r!==null)n.push(r),r=Ys();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,qr--,t===null&&(n=null,qr===0&&$r(Ar)),t}function Gs(){var e,t;qr++,e=[],t=Ys();while(t!==null)e.push(t),t=Ys();return qr--,e===null&&(t=null,qr===0&&$r(Or)),e}function Ys(){var t,n;return qr++,_r.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Dr)),qr--,t===null&&(n=null,qr===0&&$r(Mr)),t}function Zs(){var t,n,r;return t=Pr,n=Pr,qr++,r=Xs(),r===null&&(r=Vs(),r===null&&(r=Js())),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function eo(){var t,n,r;t=Pr,n=[],r=Zs();while(r!==null)n.push(r),r=Zs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function uo(e,t,n){var r=e.hash;if(n){r=r||new ro.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Kr},s=Kr,o=null,u="",a=function(e){return e},f=function(e,t){return new ro.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new ro.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new ro.PartialNameNode(new ro.StringNode(e))},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:(e.mustache=uo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:uo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new ro.ContentNode(">")),[u,new ro.ContentNode("")])},An=function(e){return{shorthand:e,id:!0}},On=function(e){return{shorthand:e}},Mn=function(e){var t,n=[];for(var r=0,i=e.length;r this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + this.StringScanner = StringScanner; +})(this); + +var StringScanner = this.StringScanner; + + +// lib/emblem.js +var Emblem; + +this.Emblem = {}; + +Emblem = this.Emblem; + +Emblem.VERSION = "0.3.1"; + + + + + + + + + + +; +// lib/parser.js + + +Emblem.Parser = (function() { + /* + * Generated by PEG.js 0.7.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(expected, found, offset, line, column) { + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDesc, foundDesc; + + switch (expected.length) { + case 0: + expectedDesc = "end of input"; + break; + + case 1: + expectedDesc = expected[0]; + break; + + default: + expectedDesc = expected.slice(0, -1).join(", ") + + " or " + + expected[expected.length - 1]; + } + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + this.message = buildMessage(expected, found); + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = ":", + peg$c55 = "\":\"", + peg$c56 = function(h) { return [h[0], h[2]]; }, + peg$c57 = function(s, p) { return { part: p, separator: s }; }, + peg$c58 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c59 = "PathSeparator", + peg$c60 = /^[\/.]/, + peg$c61 = "[\\/.]", + peg$c62 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c63 = function(v) { return new AST.StringNode(v); }, + peg$c64 = function(v) { return new AST.IntegerNode(v); }, + peg$c65 = function(v) { return new AST.BooleanNode(v); }, + peg$c66 = "Boolean", + peg$c67 = "true", + peg$c68 = "\"true\"", + peg$c69 = "false", + peg$c70 = "\"false\"", + peg$c71 = "Integer", + peg$c72 = /^[0-9]/, + peg$c73 = "[0-9]", + peg$c74 = function(s) { return parseInt(s); }, + peg$c75 = "\"", + peg$c76 = "\"\\\"\"", + peg$c77 = "'", + peg$c78 = "\"'\"", + peg$c79 = function(p) { return p[1]; }, + peg$c80 = /^[^"}]/, + peg$c81 = "[^\"}]", + peg$c82 = /^[^'}]/, + peg$c83 = "[^'}]", + peg$c84 = /^[A-Za-z]/, + peg$c85 = "[A-Za-z]", + peg$c86 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c87 = /^[|`']/, + peg$c88 = "[|`']", + peg$c89 = "<", + peg$c90 = "\"<\"", + peg$c91 = function() { return '<'; }, + peg$c92 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c93 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c94 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c95 = "{", + peg$c96 = "\"{\"", + peg$c97 = /^[^}]/, + peg$c98 = "[^}]", + peg$c99 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c100 = function(m) { m.escaped = true; return m; }, + peg$c101 = function(m) { m.escaped = false; return m; }, + peg$c102 = function(a) { return new AST.ContentNode(a); }, + peg$c103 = "any character", + peg$c104 = "SingleMustacheOpen", + peg$c105 = "DoubleMustacheOpen", + peg$c106 = "{{", + peg$c107 = "\"{{\"", + peg$c108 = "TripleMustacheOpen", + peg$c109 = "{{{", + peg$c110 = "\"{{{\"", + peg$c111 = "SingleMustacheClose", + peg$c112 = "}", + peg$c113 = "\"}\"", + peg$c114 = "DoubleMustacheClose", + peg$c115 = "}}", + peg$c116 = "\"}}\"", + peg$c117 = "TripleMustacheClose", + peg$c118 = "}}}", + peg$c119 = "\"}}}\"", + peg$c120 = "InterpolationOpen", + peg$c121 = "#{", + peg$c122 = "\"#{\"", + peg$c123 = "InterpolationClose", + peg$c124 = "==", + peg$c125 = "\"==\"", + peg$c126 = function() { return false; }, + peg$c127 = function() { return true; }, + peg$c128 = function(h, s) { return h || s; }, + peg$c129 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c130 = function(s) { return { shorthand: s, id: true}; }, + peg$c131 = function(s) { return { shorthand: s }; }, + peg$c132 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c133 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c134 = /^[A-Za-z.0-9_\-]/, + peg$c135 = "[A-Za-z.0-9_\\-]", + peg$c136 = function(id) { return new AST.MustacheNode([id]); }, + peg$c137 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c138 = function(value) { return value.replace(/ *$/, ''); }, + peg$c139 = "!", + peg$c140 = "\"!\"", + peg$c141 = function(key, value) { return IS_EMBER; }, + peg$c142 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bindAttr'}])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c143 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c144 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c145 = "_", + peg$c146 = "\"_\"", + peg$c147 = "-", + peg$c148 = "\"-\"", + peg$c149 = "%", + peg$c150 = "\"%\"", + peg$c151 = "#", + peg$c152 = "\"#\"", + peg$c153 = function(c) { return c;}, + peg$c154 = "CSSIdentifier", + peg$c155 = /^[_a-zA-Z0-9\-]/, + peg$c156 = "[_a-zA-Z0-9\\-]", + peg$c157 = /^[_a-zA-Z]/, + peg$c158 = "[_a-zA-Z]", + peg$c159 = /^[\x80-\xFF]/, + peg$c160 = "[\\x80-\\xFF]", + peg$c161 = "KnownHTMLTagName", + peg$c162 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c163 = function(t) { return t; }, + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1,s3,s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4,s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4,s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c60.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c67) { + s0 = peg$c67; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c69) { + s0 = peg$c69; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c84.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c87.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c89; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c77; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c77; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c95; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c115) { + s0 = peg$c115; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c118) { + s0 = peg$c118; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c128(s1,s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c134.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c112; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c139; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c141(s1,s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c147; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c151; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c159.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c54; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + + +; +// lib/compiler.js +var Emblem; + + + +Emblem.throwCompileError = function(line, msg) { + throw new Error("Emblem syntax error, line " + line + ": " + msg); +}; + +Emblem.registerPartial = function(handlebarsVariant, partialName, text) { + if (!text) { + text = partialName; + partialName = handlebarsVariant; + handlebarsVariant = Handlebars; + } + return handlebarsVariant.registerPartial(partialName, Emblem.compile(handlebarsVariant, text)); +}; + +Emblem.parse = function(string) { + var line, lines, msg, processed; + try { + processed = Emblem.Preprocessor.processSync(string); + return Emblem.Parser.parse(processed); + } catch (e) { + if (e instanceof Emblem.Parser.SyntaxError) { + lines = string.split("\n"); + line = lines[e.line - 1]; + msg = "" + e.message + "\n" + line + "\n"; + msg += new Array(e.column).join("-"); + msg += "^"; + return Emblem.throwCompileError(e.line, msg); + } else { + throw e; + } + } +}; + +Emblem.precompile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.precompile(ast, options); +}; + +Emblem.compile = function(handlebarsVariant, string, options) { + var ast; + if (options == null) { + options = {}; + } + Emblem.handlebarsVariant = handlebarsVariant; + ast = Emblem.parse(string); + return handlebarsVariant.compile(ast, options); +}; +; +// lib/preprocessor.js +var Emblem, Preprocessor, StringScanner; + + + + + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); +; +// lib/emberties.js +var ENV, Emblem, _base, _base1; + + + +Emblem.compileScriptTags = function() { + if (typeof Ember === "undefined" || Ember === null) { + throw new Error("Can't run Emblem.enableEmber before Ember has been defined"); + } + if (typeof document !== "undefined" && document !== null) { + return Ember.$('script[type="text/x-emblem"], script[type="text/x-raw-emblem"]', Ember.$(document)).each(function() { + var handlebarsVariant, script, templateName; + script = Ember.$(this); + handlebarsVariant = script.attr('type') === 'text/x-raw-handlebars' ? Handlebars : Ember.Handlebars; + templateName = script.attr('data-template-name') || script.attr('id') || 'application'; + Ember.TEMPLATES[templateName] = Emblem.compile(handlebarsVariant, script.html()); + return script.remove(); + }); + } +}; + +this.ENV || (this.ENV = {}); + +ENV = this.ENV; + +ENV.EMBER_LOAD_HOOKS || (ENV.EMBER_LOAD_HOOKS = {}); + +(_base = ENV.EMBER_LOAD_HOOKS).application || (_base.application = []); + +(_base1 = ENV.EMBER_LOAD_HOOKS)['Ember.Application'] || (_base1['Ember.Application'] = []); + +ENV.EMBER_LOAD_HOOKS.application.push(Emblem.compileScriptTags); + +ENV.EMBER_LOAD_HOOKS['Ember.Application'].push(function(Application) { + if (Application.initializer) { + return Application.initializer({ + name: 'emblemDomTemplates', + before: 'registerComponents', + initialize: Emblem.compileScriptTags + }); + } else { + return Ember.onLoad('application', Emblem.compileScriptTags); + } +}); +; + + root.Emblem = Emblem; + + }(this)); diff --git a/ajax/libs/emblem/0.3.1/emblem.min.js b/ajax/libs/emblem/0.3.1/emblem.min.js new file mode 100644 index 000000000..a7143a072 --- /dev/null +++ b/ajax/libs/emblem/0.3.1/emblem.min.js @@ -0,0 +1,2 @@ +(function(e){(function(e){var t;t=function(){function e(e){this.str=e!=null?e:"",this.str=""+this.str,this.pos=0,this.lastMatch={reset:function(){return this.str=null,this.captures=[],this}}.reset(),this}return e.prototype.bol=function(){return this.pos<=0||this.str[this.pos-1]==="\n"},e.prototype.captures=function(){return this.lastMatch.captures},e.prototype.check=function(e){var t;return this.str.substr(this.pos).search(e)!==0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),this.lastMatch.str)},e.prototype.checkUntil=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.captures=t.slice(1),this.lastMatch.str=this.str.substr(this.pos,n)+t[0])},e.prototype.clone=function(){var e,t,n,r;e=new this.constructor(this.str),e.pos=this.pos,e.lastMatch={},r=this.lastMatch;for(t in r)n=r[t],e.lastMatch[t]=n;return e},e.prototype.concat=function(e){return this.str+=e,this},e.prototype.eos=function(){return this.pos===this.str.length},e.prototype.exists=function(e){var t,n;return n=this.str.substr(this.pos).search(e),n<0?(this.lastMatch.reset(),null):(t=this.str.substr(this.pos+n).match(e),this.lastMatch.str=t[0],this.lastMatch.captures=t.slice(1),n)},e.prototype.getch=function(){return this.scan(/./)},e.prototype.match=function(){return this.lastMatch.str},e.prototype.matches=function(e){return this.check(e),this.matchSize()},e.prototype.matched=function(){return this.lastMatch.str!=null},e.prototype.matchSize=function(){return this.matched()?this.match().length:null},e.prototype.peek=function(e){return this.str.substr(this.pos,e)},e.prototype.pointer=function(){return this.pos},e.prototype.setPointer=function(e){return e=+e,e<0&&(e=0),e>this.str.length&&(e=this.str.length),this.pos=e},e.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},e.prototype.rest=function(){return this.str.substr(this.pos)},e.prototype.scan=function(e){var t;return t=this.check(e),t!=null&&(this.pos+=t.length),t},e.prototype.scanUntil=function(e){var t;return t=this.checkUntil(e),t!=null&&(this.pos+=t.length),t},e.prototype.skip=function(e){return this.scan(e),this.matchSize()},e.prototype.skipUntil=function(e){return this.scanUntil(e),this.matchSize()},e.prototype.string=function(){return this.str},e.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},e.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},e}(),t.prototype.beginningOfLine=t.prototype.bol,t.prototype.clear=t.prototype.terminate,t.prototype.dup=t.prototype.clone,t.prototype.endOfString=t.prototype.eos,t.prototype.exist=t.prototype.exists,t.prototype.getChar=t.prototype.getch,t.prototype.position=t.prototype.pointer,t.StringScanner=t,this.StringScanner=t})(this);var t=this.StringScanner,n;this.Emblem={},n=this.Emblem,n.VERSION="0.3.1",n.Parser=function(){function e(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function t(e,t,n,r,i){function s(e,t){function n(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0180-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1080-\uFFFF]/g,function(e){return"\\u"+t(e)})}var r,i;switch(e.length){case 0:r="end of input";break;case 1:r=e[0];break;default:r=e.slice(0,-1).join(", ")+" or "+e[e.length-1]}return i=t?'"'+n(t)+'"':"end of input","Expected "+r+" but "+i+" found."}this.expected=e,this.found=t,this.offset=n,this.line=r,this.column=i,this.name="SyntaxError",this.message=s(e,t)}function r(e){function Ur(){return e.substring(Hr,Pr)}function zr(){return Hr}function Wr(){return Vr(Hr).line}function Xr(){return Vr(Hr).column}function Vr(t){function n(t,n){var r,i;for(r=0;rt&&(Br=0,jr={line:1,column:1,seenCR:!1}),Br=t,n(jr,Br)),jr}function $r(e){if(PrFr&&(Fr=Pr,Ir=[]),Ir.push(e)}function Jr(e){var t=0;e.sort();while(tPr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ts(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),r===null&&(e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot))),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function ns(){var t,n,r,i;t=Pr,n=Pr,r=[],i=rs();if(i!==null)while(i!==null)r.push(i),i=rs();else r=o;return r!==null&&(r=e.substring(n,Pr)),n=r,n!==null&&(Hr=t,n=en(n)),n===null?(Pr=t,t=n):t=n,t}function rs(){var t,n,r;return t=Pr,n=Pr,qr++,r=is(),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function is(){var e;return e=fs(),e===null&&(e=as(),e===null&&(e=ps(),e===null&&(e=Ks(),e===null&&(e=Js())))),e}function ss(){var e,t,n,r,i,s;return e=Pr,t=us(),t!==null?(n=Gs(),n!==null?(r=Ki(),r!==null?(i=Gs(),i!==null?(s=ls(),s!==null?(Hr=e,t=Yt(r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o)):(Pr=e,e=o),e}function os(){var e;return e=ss(),e===null&&(e=Gi(),e===null&&(e=Qi())),e}function us(){var t,n;return qr++,e.charCodeAt(Pr)===123?(t=$t,Pr++):(t=null,qr===0&&$r(Jt)),qr--,t===null&&(n=null,qr===0&&$r(nn)),t}function as(){var t,n;return qr++,e.substr(Pr,2)===sn?(t=sn,Pr+=2):(t=null,qr===0&&$r(on)),qr--,t===null&&(n=null,qr===0&&$r(rn)),t}function fs(){var t,n;return qr++,e.substr(Pr,3)===an?(t=an,Pr+=3):(t=null,qr===0&&$r(fn)),qr--,t===null&&(n=null,qr===0&&$r(un)),t}function ls(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(ln)),t}function cs(){var t,n;return qr++,e.substr(Pr,2)===dn?(t=dn,Pr+=2):(t=null,qr===0&&$r(vn)),qr--,t===null&&(n=null,qr===0&&$r(pn)),t}function hs(){var t,n;return qr++,e.substr(Pr,3)===gn?(t=gn,Pr+=3):(t=null,qr===0&&$r(yn)),qr--,t===null&&(n=null,qr===0&&$r(mn)),t}function ps(){var t,n;return qr++,e.substr(Pr,2)===wn?(t=wn,Pr+=2):(t=null,qr===0&&$r(En)),qr--,t===null&&(n=null,qr===0&&$r(bn)),t}function ds(){var t,n;return qr++,e.charCodeAt(Pr)===125?(t=cn,Pr++):(t=null,qr===0&&$r(hn)),qr--,t===null&&(n=null,qr===0&&$r(Sn)),t}function vs(){var t,n,r;return t=Pr,e.substr(Pr,2)===xn?(n=xn,Pr+=2):(n=null,qr===0&&$r(Tn)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=Pr,e.charCodeAt(Pr)===61?(n=l,Pr++):(n=null,qr===0&&$r(c)),n!==null?(e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_)),r===null&&(r=u),r!==null?(Hr=t,n=Cn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)),t}function ms(){var t,n,r,i,s;return t=Pr,n=Is(),n===null&&(n=u),n!==null?(r=wi(),r===null&&(r=u),r!==null?(e.charCodeAt(Pr)===47?(i=C,Pr++):(i=null,qr===0&&$r(k)),i===null&&(i=u),i!==null?(Hr=Pr,s=kn(n,r),s?s=u:s=o,s!==null?(n=[n,r,i,s],t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function gs(){var e,t,n,r,i;e=Pr,t=ms();if(t!==null){n=[],r=os();while(r!==null)n.push(r),r=os();if(n!==null){r=[],i=ys();while(i!==null)r.push(i),i=ys();r!==null?(Hr=e,t=Ln(t,n,r),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)}else Pr=e,e=o}else Pr=e,e=o;return e}function wi(){var e,t,n,r;e=Pr,t=[],n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);if(n!==null)while(n!==null)t.push(n),n=Pr,r=Ms(),r!==null&&(Hr=n,r=An(r)),r===null?(Pr=n,n=r):n=r,n===null&&(n=Pr,r=_s(),r!==null&&(Hr=n,r=On(r)),r===null?(Pr=n,n=r):n=r);else t=o;return t!==null&&(Hr=e,t=Mn(t)),t===null?(Pr=e,e=t):e=t,e}function ys(){var t,n,r;t=Pr,n=[],e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));if(r!==null)while(r!==null)n.push(r),e.charCodeAt(Pr)===32?(r=M,Pr++):(r=null,qr===0&&$r(_));else n=o;return n!==null?(r=Ss(),r===null&&(r=Ts(),r===null&&(r=Ns(),r===null&&(r=Cs()))),r!==null?(Hr=t,n=_n(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function bs(){var t;return Dn.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Pn)),t===null&&(t=Us()),t}function ws(){var e,t;return e=Es(),e===null&&(e=Pr,t=Mi(),t!==null&&(Hr=e,t=Hn(t)),t===null?(Pr=e,e=t):e=t),e}function Es(){var t,n,r,i,s;return t=Pr,n=Pr,e.charCodeAt(Pr)===34?(r=kt,Pr++):(r=null,qr===0&&$r(Lt)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===34?(s=kt,Pr++):(s=null,qr===0&&$r(Lt)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o),n===null&&(n=Pr,e.charCodeAt(Pr)===39?(r=At,Pr++):(r=null,qr===0&&$r(Ot)),r!==null?(i=yi(),i!==null?(e.charCodeAt(Pr)===39?(s=At,Pr++):(s=null,qr===0&&$r(Ot)),s!==null?(r=[r,i,s],n=r):(Pr=n,n=o)):(Pr=n,n=o)):(Pr=n,n=o)),n!==null&&(Hr=t,n=Mt(n)),n===null?(Pr=t,t=n):t=n,t}function Ss(){var t,n,r,i;return t=Pr,n=zs(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=ws(),i!==null?(Hr=t,n=Bn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function xs(){var t,n,r,i,s,u;t=Pr,e.charCodeAt(Pr)===123?(n=$t,Pr++):(n=null,qr===0&&$r(Jt));if(n!==null){r=Gs();if(r!==null){i=Pr,s=[],u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));if(u!==null)while(u!==null)s.push(u),u=bs(),u===null&&(e.charCodeAt(Pr)===32?(u=M,Pr++):(u=null,qr===0&&$r(_)));else s=o;s!==null&&(s=e.substring(i,Pr)),i=s,i!==null?(s=Gs(),s!==null?(e.charCodeAt(Pr)===125?(u=cn,Pr++):(u=null,qr===0&&$r(hn)),u!==null?(Hr=t,n=jn(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)}else Pr=t,t=o}else Pr=t,t=o;if(t===null){t=Pr,n=[],r=bs();if(r!==null)while(r!==null)n.push(r),r=bs();else n=o;n!==null&&(n=e.substring(t,Pr)),t=n}return t}function Ts(){var t,n,r,i,s,a;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=xs(),i!==null?(s=Pr,qr++,e.charCodeAt(Pr)===33?(a=Fn,Pr++):(a=null,qr===0&&$r(In)),qr--,a===null?s=u:(Pr=s,s=o),s!==null?(Hr=Pr,a=qn(n,i),a?a=u:a=o,a!==null?(Hr=t,n=Rn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Ns(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Mi(),i!==null?(Hr=t,n=Un(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function Cs(){var t,n,r,i;return t=Pr,n=Ci(),n!==null?(e.charCodeAt(Pr)===61?(r=l,Pr++):(r=null,qr===0&&$r(c)),r!==null?(i=Xi(),i!==null?(Hr=t,n=zn(n,i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t}function ks(){var t,n,r;t=Pr,n=[],r=As();while(r!==null)n.push(r),r=As();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Ls(){var e;return e=ji(),e===null&&(e=Li()),e}function As(){var t;return t=qi(),t===null&&(Tt.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Nt)),t===null&&(e.charCodeAt(Pr)===95?(t=Wn,Pr++):(t=null,qr===0&&$r(Xn)),t===null&&(e.charCodeAt(Pr)===45?(t=Vn,Pr++):(t=null,qr===0&&$r($n))))),t}function Os(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ms(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===35?(n=Qn,Pr++):(n=null,qr===0&&$r(Gn)),n!==null?(r=Ds(),r!==null?(Hr=t,n=Yn(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function _s(){var t,n,r;return t=Pr,e.charCodeAt(Pr)===46?(n=et,Pr++):(n=null,qr===0&&$r(tt)),n!==null?(r=Ds(),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function Ds(){var e,t;return qr++,e=Ps(),qr--,e===null&&(t=null,qr===0&&$r(Zn)),e}function Ps(){var t,n,r;t=Pr,n=[],r=Hs();while(r!==null)n.push(r),r=Hs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Hs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=js()),t}function Bs(){var t;return nr.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(rr)),t===null&&(t=js()),t}function js(){var t;return ir.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(sr)),t}function Fs(){var t,n,r;t=Pr,n=[],r=Rs();if(r!==null)while(r!==null)n.push(r),r=Rs();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,t}function Is(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===37?(n=Jn,Pr++):(n=null,qr===0&&$r(Kn)),n!==null?(r=Gs(),r!==null?(i=Fs(),i!==null?(Hr=t,n=it(i),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),t===null&&(t=qs()),qr--,t===null&&(n=null,qr===0&&$r(or)),t}function qs(){var e,t,n;return e=Pr,t=Fs(),t!==null?(Hr=Pr,n=ur(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Rs(){var t;return er.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(tr)),t===null&&(t=Us()),t}function Us(){var t,n,r,i;return t=Pr,e.charCodeAt(Pr)===58?(n=ot,Pr++):(n=null,qr===0&&$r(ut)),n!==null?(r=Pr,qr++,e.charCodeAt(Pr)===32?(i=M,Pr++):(i=null,qr===0&&$r(_)),qr--,i===null?r=u:(Pr=r,r=o),r!==null?(Hr=t,n=P(n),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function zs(){var e,t,n;return qr++,e=Pr,t=Fs(),t!==null?(Hr=Pr,n=lr(t),n?n=u:n=o,n!==null?(Hr=e,t=ar(t),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),qr--,e===null&&(t=null,qr===0&&$r(fr)),e}function Ws(){var e,t,n;return e=Pr,t=Xs(),t!==null?(n=Qs(),n!==null?(Hr=e,t=it(n),t===null?(Pr=e,e=t):e=t):(Pr=e,e=o)):(Pr=e,e=o),e}function Xs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61423?(n=hr,Pr++):(n=null,qr===0&&$r(pr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(cr)),t}function Vs(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61438?(n=mr,Pr++):(n=null,qr===0&&$r(gr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(vr)),t}function $s(){var t,n;return qr++,t=Pr,e.charCodeAt(Pr)===61422?(n=br,Pr++):(n=null,qr===0&&$r(wr)),n!==null&&(Hr=t,n=dr()),n===null?(Pr=t,t=n):t=n,qr--,t===null&&(n=null,qr===0&&$r(yr)),t}function Js(){var t,n,r,i;return qr++,t=Pr,e.charCodeAt(Pr)===13?(n=Sr,Pr++):(n=null,qr===0&&$r(xr)),n===null&&(n=u),n!==null?(e.charCodeAt(Pr)===61439?(r=Tr,Pr++):(r=null,qr===0&&$r(Nr)),r!==null?(e.charCodeAt(Pr)===10?(i=Cr,Pr++):(i=null,qr===0&&$r(kr)),i!==null?(Hr=t,n=Nn(),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o)):(Pr=t,t=o),qr--,t===null&&(n=null,qr===0&&$r(Er)),t}function Ks(){var e,t;return qr++,e=Vs(),e===null&&(e=$s()),qr--,e===null&&(t=null,qr===0&&$r(Lr)),e}function Qs(){var t,n,r;qr++,t=Pr,n=[],r=Ys();if(r!==null)while(r!==null)n.push(r),r=Ys();else n=o;return n!==null&&(n=e.substring(t,Pr)),t=n,qr--,t===null&&(n=null,qr===0&&$r(Ar)),t}function Gs(){var e,t;qr++,e=[],t=Ys();while(t!==null)e.push(t),t=Ys();return qr--,e===null&&(t=null,qr===0&&$r(Or)),e}function Ys(){var t,n;return qr++,_r.test(e.charAt(Pr))?(t=e.charAt(Pr),Pr++):(t=null,qr===0&&$r(Dr)),qr--,t===null&&(n=null,qr===0&&$r(Mr)),t}function Zs(){var t,n,r;return t=Pr,n=Pr,qr++,r=Xs(),r===null&&(r=Vs(),r===null&&(r=Js())),qr--,r===null?n=u:(Pr=n,n=o),n!==null?(e.length>Pr?(r=e.charAt(Pr),Pr++):(r=null,qr===0&&$r(tn)),r!==null?(Hr=t,n=P(r),n===null?(Pr=t,t=n):t=n):(Pr=t,t=o)):(Pr=t,t=o),t}function eo(){var t,n,r;t=Pr,n=[],r=Zs();while(r!==null)n.push(r),r=Zs();return n!==null&&(n=e.substring(t,Pr)),t=n,t}function uo(e,t,n){var r=e.hash;if(n){r=r||new ro.HashNode([]);for(var i=0;i1?arguments[1]:{},i={start:Kr},s=Kr,o=null,u="",a=function(e){return e},f=function(e,t){return new ro.ProgramNode(e,t||[])},l="=",c='"="',h="else",p='"else"',d=[],v=function(e){var t=[],n=[];for(var r=0;r",w='">"',E=function(e,t){return[new ro.PartialNode(e,t[0])]},S=/^[a-zA-Z0-9_$-\/]/,x="[a-zA-Z0-9_$-\\/]",T=function(e){return new ro.PartialNameNode(new ro.StringNode(e))},N=function(e){return[e]},C="/",k='"/"',L=/^[A-Z]/,A="[A-Z]",O=function(e){var t="view";if(e.mustache){var n=e.mustache.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:(e.mustache=uo(e.mustache,t),e)}var n=e.id.string.charAt(0);return!no||!n.match(/[A-Z]/)?e:uo(e,t)},M=" ",_='" "',D=function(e,t){if(t){t=t[1];for(var n=0,r=t.length;n")),[u]):(u.push(new ro.ContentNode(">")),[u,new ro.ContentNode("")])},An=function(e){return{shorthand:e,id:!0}},On=function(e){return{shorthand:e}},Mn=function(e){var t,n=[];for(var r=0,i=e.length;r 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c55 = function(s) { return s; }, + peg$c56 = "Key", + peg$c57 = ":", + peg$c58 = "\":\"", + peg$c59 = function(h) { return [h[0], h[2]]; }, + peg$c60 = function(s) { s.isHelper = true; return s; }, + peg$c61 = function(s, p) { return { part: p, separator: s }; }, + peg$c62 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c63 = "PathSeparator", + peg$c64 = /^[\/.]/, + peg$c65 = "[\\/.]", + peg$c66 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c67 = function(v) { return new AST.StringNode(v); }, + peg$c68 = function(v) { return new AST.IntegerNode(v); }, + peg$c69 = function(v) { return new AST.BooleanNode(v); }, + peg$c70 = "Boolean", + peg$c71 = "true", + peg$c72 = "\"true\"", + peg$c73 = "false", + peg$c74 = "\"false\"", + peg$c75 = "Integer", + peg$c76 = "-", + peg$c77 = "\"-\"", + peg$c78 = /^[0-9]/, + peg$c79 = "[0-9]", + peg$c80 = function(s) { return parseInt(s); }, + peg$c81 = "\"", + peg$c82 = "\"\\\"\"", + peg$c83 = "'", + peg$c84 = "\"'\"", + peg$c85 = function(p) { return p[1]; }, + peg$c86 = /^[^"}]/, + peg$c87 = "[^\"}]", + peg$c88 = /^[^'}]/, + peg$c89 = "[^'}]", + peg$c90 = /^[A-Za-z]/, + peg$c91 = "[A-Za-z]", + peg$c92 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c93 = /^[|`']/, + peg$c94 = "[|`']", + peg$c95 = "<", + peg$c96 = "\"<\"", + peg$c97 = function() { return '<'; }, + peg$c98 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c99 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c100 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c101 = "{", + peg$c102 = "\"{\"", + peg$c103 = /^[^}]/, + peg$c104 = "[^}]", + peg$c105 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c106 = function(m) { m.escaped = true; return m; }, + peg$c107 = function(m) { m.escaped = false; return m; }, + peg$c108 = function(a) { return new AST.ContentNode(a); }, + peg$c109 = "any character", + peg$c110 = "SingleMustacheOpen", + peg$c111 = "DoubleMustacheOpen", + peg$c112 = "{{", + peg$c113 = "\"{{\"", + peg$c114 = "TripleMustacheOpen", + peg$c115 = "{{{", + peg$c116 = "\"{{{\"", + peg$c117 = "SingleMustacheClose", + peg$c118 = "}", + peg$c119 = "\"}\"", + peg$c120 = "DoubleMustacheClose", + peg$c121 = "}}", + peg$c122 = "\"}}\"", + peg$c123 = "TripleMustacheClose", + peg$c124 = "}}}", + peg$c125 = "\"}}}\"", + peg$c126 = "SubexpressionOpen", + peg$c127 = "(", + peg$c128 = "\"(\"", + peg$c129 = "SubexpressionClose", + peg$c130 = ")", + peg$c131 = "\")\"", + peg$c132 = "InterpolationOpen", + peg$c133 = "#{", + peg$c134 = "\"#{\"", + peg$c135 = "InterpolationClose", + peg$c136 = "==", + peg$c137 = "\"==\"", + peg$c138 = function() { return false; }, + peg$c139 = function() { return true; }, + peg$c140 = function(h, s) { return h || s; }, + peg$c141 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c142 = function(s) { return { shorthand: s, id: true}; }, + peg$c143 = function(s) { return { shorthand: s }; }, + peg$c144 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c145 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c146 = /^[A-Za-z.0-9_\-]/, + peg$c147 = "[A-Za-z.0-9_\\-]", + peg$c148 = function(id) { return createMustacheNode([id], null, true); }, + peg$c149 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c150 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c151 = function(value) { return value.replace(/ *$/, ''); }, + peg$c152 = "!", + peg$c153 = "\"!\"", + peg$c154 = function(key, value) { return IS_EMBER; }, + peg$c155 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c156 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c157 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c158 = "_", + peg$c159 = "\"_\"", + peg$c160 = "%", + peg$c161 = "\"%\"", + peg$c162 = "#", + peg$c163 = "\"#\"", + peg$c164 = function(c) { return c;}, + peg$c165 = "CSSIdentifier", + peg$c166 = /^[_a-zA-Z0-9\-]/, + peg$c167 = "[_a-zA-Z0-9\\-]", + peg$c168 = /^[_a-zA-Z]/, + peg$c169 = "[_a-zA-Z]", + peg$c170 = /^[\x80-\xFF]/, + peg$c171 = "[\\x80-\\xFF]", + peg$c172 = "KnownHTMLTagName", + peg$c173 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c174 = function(t) { return t; }, + peg$c175 = "a JS event", + peg$c176 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c177 = "INDENT", + peg$c178 = "\uEFEF", + peg$c179 = "\"\\uEFEF\"", + peg$c180 = function() { return ''; }, + peg$c181 = "DEDENT", + peg$c182 = "\uEFFE", + peg$c183 = "\"\\uEFFE\"", + peg$c184 = "Unmatched DEDENT", + peg$c185 = "\uEFEE", + peg$c186 = "\"\\uEFEE\"", + peg$c187 = "LineEnd", + peg$c188 = "\r", + peg$c189 = "\"\\r\"", + peg$c190 = "\uEFFF", + peg$c191 = "\"\\uEFFF\"", + peg$c192 = "\n", + peg$c193 = "\"\\n\"", + peg$c194 = "ANYDEDENT", + peg$c195 = "RequiredWhitespace", + peg$c196 = "OptionalWhitespace", + peg$c197 = "InlineWhitespace", + peg$c198 = /^[ \t]/, + peg$c199 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c68(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c71) { + s0 = peg$c71; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s0 = peg$c73; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c76; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c90.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c93.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c83; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c101; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c101; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c115) { + s0 = peg$c115; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c124) { + s0 = peg$c124; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c127; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c133) { + s0 = peg$c133; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c136) { + s1 = peg$c136; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c140(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c146.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c71) { + s3 = peg$c71; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s3 = peg$c73; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c118; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c152; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c154(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c155(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c158; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c76; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c168.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c170.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c173(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c176(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c178; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c182; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c188; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c190; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c192; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c198.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.11/emblem.min.js b/ajax/libs/emblem/0.3.11/emblem.min.js new file mode 100644 index 000000000..1a6d8814a --- /dev/null +++ b/ajax/libs/emblem/0.3.11/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return _f!==b&&(_f>b&&(_f=0,ag={line:1,column:1,seenCR:!1}),c(ag,_f,b),_f=b),ag}function e(a){bg>Zf||(Zf>bg&&(bg=Zf,cg=[]),cg.push(a))}function f(a){var b=0;for(a.sort();bZf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function mb(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),null===d&&(39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd))),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function nb(){var b,c,d,e;if(b=Zf,c=Zf,d=[],e=ob(),null!==e)for(;null!==e;)d.push(e),e=ob();else d=tc;return null!==d&&(d=a.substring(c,Zf)),c=d,null!==c&&($f=b,c=qe(c)),null===c?(Zf=b,b=c):b=c,b}function ob(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function pb(){var a;return a=ub(),null===a&&(a=tb(),null===a&&(a=Ab(),null===a&&(a=fc(),null===a&&(a=ec())))),a}function qb(){var a,b,c,d,e,f;return a=Zf,b=sb(),null!==b?(c=hc(),null!==c?(d=gb(),null!==d?(e=hc(),null!==e?(f=vb(),null!==f?($f=a,b=oe(d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc),a}function rb(){var a;return a=qb(),null===a&&(a=ib(),null===a&&(a=hb())),a}function sb(){var b,c;return dg++,123===a.charCodeAt(Zf)?(b=je,Zf++):(b=null,0===dg&&e(ke)),dg--,null===b&&(c=null,0===dg&&e(se)),b}function tb(){var b,c;return dg++,a.substr(Zf,2)===ue?(b=ue,Zf+=2):(b=null,0===dg&&e(ve)),dg--,null===b&&(c=null,0===dg&&e(te)),b}function ub(){var b,c;return dg++,a.substr(Zf,3)===xe?(b=xe,Zf+=3):(b=null,0===dg&&e(ye)),dg--,null===b&&(c=null,0===dg&&e(we)),b}function vb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(ze)),b}function wb(){var b,c;return dg++,a.substr(Zf,2)===De?(b=De,Zf+=2):(b=null,0===dg&&e(Ee)),dg--,null===b&&(c=null,0===dg&&e(Ce)),b}function xb(){var b,c;return dg++,a.substr(Zf,3)===Ge?(b=Ge,Zf+=3):(b=null,0===dg&&e(He)),dg--,null===b&&(c=null,0===dg&&e(Fe)),b}function yb(){var b,c;return dg++,40===a.charCodeAt(Zf)?(b=Je,Zf++):(b=null,0===dg&&e(Ke)),dg--,null===b&&(c=null,0===dg&&e(Ie)),b}function zb(){var b,c;return dg++,41===a.charCodeAt(Zf)?(b=Me,Zf++):(b=null,0===dg&&e(Ne)),dg--,null===b&&(c=null,0===dg&&e(Le)),b}function Ab(){var b,c;return dg++,a.substr(Zf,2)===Pe?(b=Pe,Zf+=2):(b=null,0===dg&&e(Qe)),dg--,null===b&&(c=null,0===dg&&e(Oe)),b}function Bb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(Re)),b}function Cb(){var b,c,d;return b=Zf,a.substr(Zf,2)===Se?(c=Se,Zf+=2):(c=null,0===dg&&e(Te)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Zf,61===a.charCodeAt(Zf)?(c=xc,Zf++):(c=null,0===dg&&e(yc)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ve(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)),b}function Db(){var b,c,d,f,g;return b=Zf,c=Xb(),null===c&&(c=uc),null!==c?(d=G(),null===d&&(d=uc),null!==d?(47===a.charCodeAt(Zf)?(f=Mc,Zf++):(f=null,0===dg&&e(Nc)),null===f&&(f=uc),null!==f?($f=Zf,g=We(c,d),g=g?uc:tc,null!==g?(c=[c,d,f,g],b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Eb(){var a,b,c,d,e;if(a=Zf,b=Db(),null!==b){for(c=[],d=rb();null!==d;)c.push(d),d=rb();if(null!==c){for(d=[],e=Fb();null!==e;)d.push(e),e=Fb();null!==d?($f=a,b=Xe(b,c,d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)}else Zf=a,a=tc}else Zf=a,a=tc;return a}function G(){var a,b,c,d;if(a=Zf,b=[],c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d);else b=tc;return null!==b&&($f=a,b=$e(b)),null===b?(Zf=a,a=b):a=b,a}function Fb(){var b,c,d;if(b=Zf,c=[],32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc));else c=tc;return null!==c?(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Mb(),null===d&&(d=Nb(),null===d&&(d=Ob())))),null!==d?($f=b,c=_e(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Gb(){var b;return af.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(bf)),null===b&&(b=$b()),b}function Hb(){var a,b;return a=Ib(),null===a&&(a=Zf,b=R(),null!==b&&($f=a,b=cf(b)),null===b?(Zf=a,a=b):a=b),a}function Ib(){var b,c,d,f,g;return b=Zf,c=Zf,34===a.charCodeAt(Zf)?(d=Td,Zf++):(d=null,0===dg&&e(Ud)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Zf)?(g=Td,Zf++):(g=null,0===dg&&e(Ud)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc),null===c&&(c=Zf,39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Zf)?(g=Vd,Zf++):(g=null,0===dg&&e(Wd)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc)),null!==c&&($f=b,c=Xd(c)),null===c?(Zf=b,b=c):b=c,b}function Jb(){var b,c,d,f;return b=Zf,c=_b(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Hb(),null!==f?($f=b,c=df(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Kb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(a.substr(Zf,4)===Jd?(f=Jd,Zf+=4):(f=null,0===dg&&e(Kd)),null===f&&(a.substr(Zf,5)===Ld?(f=Ld,Zf+=5):(f=null,0===dg&&e(Md))),null!==f?($f=b,c=ef(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Lb(){var b,c,d,f,g,h;if(b=Zf,123===a.charCodeAt(Zf)?(c=je,Zf++):(c=null,0===dg&&e(ke)),null!==c)if(d=hc(),null!==d){if(f=Zf,g=[],h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc))),null!==h)for(;null!==h;)g.push(h),h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc)));else g=tc;null!==g&&(g=a.substring(f,Zf)),f=g,null!==f?(g=hc(),null!==g?(125===a.charCodeAt(Zf)?(h=Ae,Zf++):(h=null,0===dg&&e(Be)),null!==h?($f=b,c=ff(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)}else Zf=b,b=tc;else Zf=b,b=tc;if(null===b){if(b=Zf,c=[],d=Gb(),null!==d)for(;null!==d;)c.push(d),d=Gb();else c=tc;null!==c&&(c=a.substring(b,Zf)),b=c}return b}function Mb(){var b,c,d,f,g,h;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Lb(),null!==f?(g=Zf,dg++,33===a.charCodeAt(Zf)?(h=gf,Zf++):(h=null,0===dg&&e(hf)),dg--,null===h?g=uc:(Zf=g,g=tc),null!==g?($f=Zf,h=jf(c,f),h=h?uc:tc,null!==h?($f=b,c=kf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Nb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=R(),null!==f?($f=b,c=lf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Ob(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=cb(),null!==f?($f=b,c=mf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Pb(){var b,c,d;return b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Qb(){var b,c,d;return b=Zf,35===a.charCodeAt(Zf)?(c=pf,Zf++):(c=null,0===dg&&e(qf)),null!==c?(d=Sb(),null!==d?($f=b,c=rf(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Rb(){var b,c,d;return b=Zf,46===a.charCodeAt(Zf)?(c=pd,Zf++):(c=null,0===dg&&e(qd)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Sb(){var a,b;return dg++,a=Tb(),dg--,null===a&&(b=null,0===dg&&e(sf)),a}function Tb(){var b,c,d;for(b=Zf,c=[],d=Ub();null!==d;)c.push(d),d=Ub();return null!==c&&(c=a.substring(b,Zf)),b=c}function Ub(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=Vb()),b}function Vb(){var b;return vf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(wf)),b}function Wb(){var b,c,d;if(b=Zf,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c}function Xb(){var b,c,d,f;return dg++,b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=hc(),null!==d?(f=Wb(),null!==f?($f=b,c=td(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Yb()),dg--,null===b&&(c=null,0===dg&&e(xf)),b}function Yb(){var a,b,c;return a=Zf,b=Wb(),null!==b?($f=Zf,c=yf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function Zb(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=$b()),b}function $b(){var b,c,d,f;return b=Zf,58===a.charCodeAt(Zf)?(c=vd,Zf++):(c=null,0===dg&&e(wd)),null!==c?(d=Zf,dg++,32===a.charCodeAt(Zf)?(f=Rc,Zf++):(f=null,0===dg&&e(Sc)),dg--,null===f?d=uc:(Zf=d,d=tc),null!==d?($f=b,c=Uc(c),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function _b(){var a,b,c;return dg++,a=Zf,b=Wb(),null!==b?($f=Zf,c=Bf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),dg--,null===a&&(b=null,0===dg&&e(Af)),a}function ac(){var a,b,c;return a=Zf,b=bc(),null!==b?(c=gc(),null!==c?($f=a,b=td(c),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function bc(){var b,c;return dg++,b=Zf,61423===a.charCodeAt(Zf)?(c=Df,Zf++):(c=null,0===dg&&e(Ef)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Cf)),b}function cc(){var b,c;return dg++,b=Zf,61438===a.charCodeAt(Zf)?(c=Hf,Zf++):(c=null,0===dg&&e(If)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Gf)),b}function dc(){var b,c;return dg++,b=Zf,61422===a.charCodeAt(Zf)?(c=Kf,Zf++):(c=null,0===dg&&e(Lf)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Jf)),b}function ec(){var b,c,d,f;return dg++,b=Zf,13===a.charCodeAt(Zf)?(c=Nf,Zf++):(c=null,0===dg&&e(Of)),null===c&&(c=uc),null!==c?(61439===a.charCodeAt(Zf)?(d=Pf,Zf++):(d=null,0===dg&&e(Qf)),null!==d?(10===a.charCodeAt(Zf)?(f=Rf,Zf++):(f=null,0===dg&&e(Sf)),null!==f?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),dg--,null===b&&(c=null,0===dg&&e(Mf)),b}function fc(){var a,b;return dg++,a=cc(),null===a&&(a=dc()),dg--,null===a&&(b=null,0===dg&&e(Tf)),a}function gc(){var b,c,d;if(dg++,b=Zf,c=[],d=ic(),null!==d)for(;null!==d;)c.push(d),d=ic();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c,dg--,null===b&&(c=null,0===dg&&e(Uf)),b}function hc(){var a,b;for(dg++,a=[],b=ic();null!==b;)a.push(b),b=ic();return dg--,null===a&&(b=null,0===dg&&e(Vf)),a}function ic(){var b,c;return dg++,Xf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(Yf)),dg--,null===b&&(c=null,0===dg&&e(Wf)),b}function jc(){var b,c,d;return b=Zf,c=Zf,dg++,d=bc(),null===d&&(d=cc(),null===d&&(d=ec())),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function kc(){var b,c,d;for(b=Zf,c=[],d=jc();null!==d;)c.push(d),d=jc();return null!==c&&(c=a.substring(b,Zf)),b=c}function lc(a,b,c){if(ng){var d=c?lg:mg;return new gg.MustacheNode(a,b,d,{left:!1,right:!1})}return new gg.MustacheNode(a,b,!c)}function mc(a,b){return ng?new gg.ProgramNode(a,{left:!1,right:!1},b,null):new gg.ProgramNode(a,b)}function nc(a,b,c){var d=a.hash;if(c){d=d||new gg.HashNode([]);for(var e=0;e1?arguments[1]:{},rc={start:g},sc=g,tc=null,uc="",vc=function(a){return a},wc=function(a,b){return mc(a,b||[])},xc="=",yc='"="',zc="else",Ac='"else"',Bc=function(a){for(var b=[],c=[],d=0;d",Gc='">"',Hc=function(a,b){return[new gg.PartialNode(a,b[0])]},Ic=/^[a-zA-Z0-9_$-\/]/,Jc="[a-zA-Z0-9_$-\\/]",Kc=function(a){return new gg.PartialNameNode(new gg.StringNode(a))},Lc=function(a){return[a]},Mc="/",Nc='"/"',Oc=/^[A-Z]/,Pc="[A-Z]",Qc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?(a.mustache=nc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?nc(a,b):a},Rc=" ",Sc='" "',Tc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new gg.ContentNode(" ")),a=a.concat(b[c])}return a},Uc=function(a){return a},Vc=function(a){return[a]},Wc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Xc=function(a,b){if(!b)return a;var c=a.id;ng&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new gg.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Yc=": ",Zc='": "',$c=function(a){return mc(a,[])},_c=function(a){return a&&a[2]},ad=function(a,b){var c=b.mustache||b;return c.escaped=a,b},bd=function(a,b){if(a){var c=new gg.PartialNameNode(new gg.StringNode(b.id.string));return new gg.PartialNode(c,b.params[0])}var d;d=og?lc(b,null,!0):lc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?nc(d,"unbound"):"?"===e?nc(d,"if"):"^"===e?nc(d,"unless"):d},cd=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new gg.ContentNode(">")),[i,new gg.ContentNode("")])},Ye=function(a){return{shorthand:a,id:!0}},Ze=function(a){return{shorthand:a}},$e=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},_e=function(a){return a.length?[new gg.ContentNode(" ")].concat(a):[]},af=/^[A-Za-z.0-9_\-]/,bf="[A-Za-z.0-9_\\-]",cf=function(a){return lc([a],null,!0)},df=function(a,b){return[nc(b,"action",[["on",new gg.StringNode(a)]])]},ef=function(a,b){return"true"===b?[new gg.ContentNode(a)]:[]},ff=function(a){return a.replace(/ *$/,"")},gf="!",hf='"!"',jf=function(){return fg},kf=function(a,b){var c=new gg.HashNode([[a,new gg.StringNode(b)]]),d=[new gg.IdNode([{part:"bind-attr"}])],e=lc(d,c);return[e]},lf=function(a,b){var c=lc([b],null,!0);return fg&&"!"===b._emblemSuffixModifier&&(c=nc(c,"unbound")),[new gg.ContentNode(a+'="'),c,new gg.ContentNode('"')]},mf=function(a,b){var c=[new gg.ContentNode(a+'="')].concat(b);return c.concat([new gg.ContentNode('"')])},nf="%",of='"%"',pf="#",qf='"#"',rf=function(a){return a},sf="CSSIdentifier",tf=/^[_a-zA-Z0-9\-]/,uf="[_a-zA-Z0-9\\-]",vf=/^[\x80-\xFF]/,wf="[\\x80-\\xFF]",xf="KnownHTMLTagName",yf=function(a){return!!ig[a]},zf=function(a){return a},Af="a JS event",Bf=function(a){return!!jg[a]},Cf="INDENT",Df="\uefef",Ef='"\\uEFEF"',Ff=function(){return""},Gf="DEDENT",Hf="\ueffe",If='"\\uEFFE"',Jf="Unmatched DEDENT",Kf="\uefee",Lf='"\\uEFEE"',Mf="LineEnd",Nf="\r",Of='"\\r"',Pf="\uefff",Qf='"\\uEFFF"',Rf="\n",Sf='"\\n"',Tf="ANYDEDENT",Uf="RequiredWhitespace",Vf="OptionalWhitespace",Wf="InlineWhitespace",Xf=/^[ \t]/,Yf="[ \\t]",Zf=0,$f=0,_f=0,ag={line:1,column:1,seenCR:!1},bg=0,cg=[],dg=0;if("startRule"in qc){if(!(qc.startRule in rc))throw new Error("Can't start parsing from rule \""+qc.startRule+'".');sc=rc[qc.startRule]}var eg=c.handlebarsVariant,fg="Ember.Handlebars"===eg.JavaScriptCompiler.prototype.namespace,gg=eg.AST,hg={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ig={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},jg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},kg=String.fromCharCode(125),lg=kg+kg,mg=lg+kg,ng=eg.VERSION.slice(0,3)>=1.1,og=eg.VERSION.slice(0,3)>=1.3;if(pc=sc(),null!==pc&&Zf===a.length)return pc;throw f(cg),$f=Math.max(Zf,bg),new b(cg,$fc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.12/emblem.js b/ajax/libs/emblem/0.3.12/emblem.js new file mode 100644 index 000000000..5820d7446 --- /dev/null +++ b/ajax/libs/emblem/0.3.12/emblem.js @@ -0,0 +1,6295 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c55 = function(s) { return s; }, + peg$c56 = "Key", + peg$c57 = ":", + peg$c58 = "\":\"", + peg$c59 = function(h) { return [h[0], h[2]]; }, + peg$c60 = function(s) { s.isHelper = true; return s; }, + peg$c61 = function(s, p) { return { part: p, separator: s }; }, + peg$c62 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c63 = "PathSeparator", + peg$c64 = /^[\/.]/, + peg$c65 = "[\\/.]", + peg$c66 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c67 = function(v) { return new AST.StringNode(v); }, + peg$c68 = function(v) { return new AST.IntegerNode(v); }, + peg$c69 = function(v) { return new AST.BooleanNode(v); }, + peg$c70 = "Boolean", + peg$c71 = "true", + peg$c72 = "\"true\"", + peg$c73 = "false", + peg$c74 = "\"false\"", + peg$c75 = "Integer", + peg$c76 = "-", + peg$c77 = "\"-\"", + peg$c78 = /^[0-9]/, + peg$c79 = "[0-9]", + peg$c80 = function(s) { return parseInt(s); }, + peg$c81 = "\"", + peg$c82 = "\"\\\"\"", + peg$c83 = "'", + peg$c84 = "\"'\"", + peg$c85 = function(p) { return p[1]; }, + peg$c86 = /^[^"}]/, + peg$c87 = "[^\"}]", + peg$c88 = /^[^'}]/, + peg$c89 = "[^'}]", + peg$c90 = /^[A-Za-z]/, + peg$c91 = "[A-Za-z]", + peg$c92 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c93 = /^[|`']/, + peg$c94 = "[|`']", + peg$c95 = "<", + peg$c96 = "\"<\"", + peg$c97 = function() { return '<'; }, + peg$c98 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c99 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c100 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c101 = "{", + peg$c102 = "\"{\"", + peg$c103 = /^[^}]/, + peg$c104 = "[^}]", + peg$c105 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c106 = function(m) { m.escaped = true; return m; }, + peg$c107 = function(m) { m.escaped = false; return m; }, + peg$c108 = function(a) { return new AST.ContentNode(a); }, + peg$c109 = "any character", + peg$c110 = "SingleMustacheOpen", + peg$c111 = "DoubleMustacheOpen", + peg$c112 = "{{", + peg$c113 = "\"{{\"", + peg$c114 = "TripleMustacheOpen", + peg$c115 = "{{{", + peg$c116 = "\"{{{\"", + peg$c117 = "SingleMustacheClose", + peg$c118 = "}", + peg$c119 = "\"}\"", + peg$c120 = "DoubleMustacheClose", + peg$c121 = "}}", + peg$c122 = "\"}}\"", + peg$c123 = "TripleMustacheClose", + peg$c124 = "}}}", + peg$c125 = "\"}}}\"", + peg$c126 = "SubexpressionOpen", + peg$c127 = "(", + peg$c128 = "\"(\"", + peg$c129 = "SubexpressionClose", + peg$c130 = ")", + peg$c131 = "\")\"", + peg$c132 = "InterpolationOpen", + peg$c133 = "#{", + peg$c134 = "\"#{\"", + peg$c135 = "InterpolationClose", + peg$c136 = "==", + peg$c137 = "\"==\"", + peg$c138 = function() { return false; }, + peg$c139 = function() { return true; }, + peg$c140 = function(h, s) { return h || s; }, + peg$c141 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c142 = function(s) { return { shorthand: s, id: true}; }, + peg$c143 = function(s) { return { shorthand: s }; }, + peg$c144 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c145 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c146 = /^[A-Za-z.0-9_\-]/, + peg$c147 = "[A-Za-z.0-9_\\-]", + peg$c148 = function(id) { return createMustacheNode([id], null, true); }, + peg$c149 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c150 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c151 = function(value) { return value.replace(/ *$/, ''); }, + peg$c152 = "!", + peg$c153 = "\"!\"", + peg$c154 = function(key, value) { return IS_EMBER; }, + peg$c155 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c156 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c157 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c158 = "_", + peg$c159 = "\"_\"", + peg$c160 = "%", + peg$c161 = "\"%\"", + peg$c162 = "#", + peg$c163 = "\"#\"", + peg$c164 = function(c) { return c;}, + peg$c165 = "CSSIdentifier", + peg$c166 = /^[_a-zA-Z0-9\-]/, + peg$c167 = "[_a-zA-Z0-9\\-]", + peg$c168 = /^[_a-zA-Z]/, + peg$c169 = "[_a-zA-Z]", + peg$c170 = /^[\x80-\xFF]/, + peg$c171 = "[\\x80-\\xFF]", + peg$c172 = "KnownHTMLTagName", + peg$c173 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c174 = function(t) { return t; }, + peg$c175 = "a JS event", + peg$c176 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c177 = "INDENT", + peg$c178 = "\uEFEF", + peg$c179 = "\"\\uEFEF\"", + peg$c180 = function() { return ''; }, + peg$c181 = "DEDENT", + peg$c182 = "\uEFFE", + peg$c183 = "\"\\uEFFE\"", + peg$c184 = "Unmatched DEDENT", + peg$c185 = "\uEFEE", + peg$c186 = "\"\\uEFEE\"", + peg$c187 = "LineEnd", + peg$c188 = "\r", + peg$c189 = "\"\\r\"", + peg$c190 = "\uEFFF", + peg$c191 = "\"\\uEFFF\"", + peg$c192 = "\n", + peg$c193 = "\"\\n\"", + peg$c194 = "ANYDEDENT", + peg$c195 = "RequiredWhitespace", + peg$c196 = "OptionalWhitespace", + peg$c197 = "InlineWhitespace", + peg$c198 = /^[ \t]/, + peg$c199 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c68(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c71) { + s0 = peg$c71; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s0 = peg$c73; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c76; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c90.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c93.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c83; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c101; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c101; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c115) { + s0 = peg$c115; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c124) { + s0 = peg$c124; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c127; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c133) { + s0 = peg$c133; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c136) { + s1 = peg$c136; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c140(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c146.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c71) { + s3 = peg$c71; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s3 = peg$c73; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c118; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c152; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c154(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c155(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c158; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c76; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c168.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c170.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c173(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c176(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c178; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c182; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c188; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c190; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c192; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c198.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.12/emblem.min.js b/ajax/libs/emblem/0.3.12/emblem.min.js new file mode 100644 index 000000000..f7d4ad0a3 --- /dev/null +++ b/ajax/libs/emblem/0.3.12/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return _f!==b&&(_f>b&&(_f=0,ag={line:1,column:1,seenCR:!1}),c(ag,_f,b),_f=b),ag}function e(a){bg>Zf||(Zf>bg&&(bg=Zf,cg=[]),cg.push(a))}function f(a){var b=0;for(a.sort();bZf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function mb(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),null===d&&(39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd))),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function nb(){var b,c,d,e;if(b=Zf,c=Zf,d=[],e=ob(),null!==e)for(;null!==e;)d.push(e),e=ob();else d=tc;return null!==d&&(d=a.substring(c,Zf)),c=d,null!==c&&($f=b,c=qe(c)),null===c?(Zf=b,b=c):b=c,b}function ob(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function pb(){var a;return a=ub(),null===a&&(a=tb(),null===a&&(a=Ab(),null===a&&(a=fc(),null===a&&(a=ec())))),a}function qb(){var a,b,c,d,e,f;return a=Zf,b=sb(),null!==b?(c=hc(),null!==c?(d=gb(),null!==d?(e=hc(),null!==e?(f=vb(),null!==f?($f=a,b=oe(d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc),a}function rb(){var a;return a=qb(),null===a&&(a=ib(),null===a&&(a=hb())),a}function sb(){var b,c;return dg++,123===a.charCodeAt(Zf)?(b=je,Zf++):(b=null,0===dg&&e(ke)),dg--,null===b&&(c=null,0===dg&&e(se)),b}function tb(){var b,c;return dg++,a.substr(Zf,2)===ue?(b=ue,Zf+=2):(b=null,0===dg&&e(ve)),dg--,null===b&&(c=null,0===dg&&e(te)),b}function ub(){var b,c;return dg++,a.substr(Zf,3)===xe?(b=xe,Zf+=3):(b=null,0===dg&&e(ye)),dg--,null===b&&(c=null,0===dg&&e(we)),b}function vb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(ze)),b}function wb(){var b,c;return dg++,a.substr(Zf,2)===De?(b=De,Zf+=2):(b=null,0===dg&&e(Ee)),dg--,null===b&&(c=null,0===dg&&e(Ce)),b}function xb(){var b,c;return dg++,a.substr(Zf,3)===Ge?(b=Ge,Zf+=3):(b=null,0===dg&&e(He)),dg--,null===b&&(c=null,0===dg&&e(Fe)),b}function yb(){var b,c;return dg++,40===a.charCodeAt(Zf)?(b=Je,Zf++):(b=null,0===dg&&e(Ke)),dg--,null===b&&(c=null,0===dg&&e(Ie)),b}function zb(){var b,c;return dg++,41===a.charCodeAt(Zf)?(b=Me,Zf++):(b=null,0===dg&&e(Ne)),dg--,null===b&&(c=null,0===dg&&e(Le)),b}function Ab(){var b,c;return dg++,a.substr(Zf,2)===Pe?(b=Pe,Zf+=2):(b=null,0===dg&&e(Qe)),dg--,null===b&&(c=null,0===dg&&e(Oe)),b}function Bb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(Re)),b}function Cb(){var b,c,d;return b=Zf,a.substr(Zf,2)===Se?(c=Se,Zf+=2):(c=null,0===dg&&e(Te)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Zf,61===a.charCodeAt(Zf)?(c=xc,Zf++):(c=null,0===dg&&e(yc)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ve(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)),b}function Db(){var b,c,d,f,g;return b=Zf,c=Xb(),null===c&&(c=uc),null!==c?(d=G(),null===d&&(d=uc),null!==d?(47===a.charCodeAt(Zf)?(f=Mc,Zf++):(f=null,0===dg&&e(Nc)),null===f&&(f=uc),null!==f?($f=Zf,g=We(c,d),g=g?uc:tc,null!==g?(c=[c,d,f,g],b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Eb(){var a,b,c,d,e;if(a=Zf,b=Db(),null!==b){for(c=[],d=rb();null!==d;)c.push(d),d=rb();if(null!==c){for(d=[],e=Fb();null!==e;)d.push(e),e=Fb();null!==d?($f=a,b=Xe(b,c,d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)}else Zf=a,a=tc}else Zf=a,a=tc;return a}function G(){var a,b,c,d;if(a=Zf,b=[],c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d);else b=tc;return null!==b&&($f=a,b=$e(b)),null===b?(Zf=a,a=b):a=b,a}function Fb(){var b,c,d;if(b=Zf,c=[],32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc));else c=tc;return null!==c?(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Mb(),null===d&&(d=Nb(),null===d&&(d=Ob())))),null!==d?($f=b,c=_e(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Gb(){var b;return af.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(bf)),null===b&&(b=$b()),b}function Hb(){var a,b;return a=Ib(),null===a&&(a=Zf,b=R(),null!==b&&($f=a,b=cf(b)),null===b?(Zf=a,a=b):a=b),a}function Ib(){var b,c,d,f,g;return b=Zf,c=Zf,34===a.charCodeAt(Zf)?(d=Td,Zf++):(d=null,0===dg&&e(Ud)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Zf)?(g=Td,Zf++):(g=null,0===dg&&e(Ud)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc),null===c&&(c=Zf,39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Zf)?(g=Vd,Zf++):(g=null,0===dg&&e(Wd)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc)),null!==c&&($f=b,c=Xd(c)),null===c?(Zf=b,b=c):b=c,b}function Jb(){var b,c,d,f;return b=Zf,c=_b(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Hb(),null!==f?($f=b,c=df(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Kb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(a.substr(Zf,4)===Jd?(f=Jd,Zf+=4):(f=null,0===dg&&e(Kd)),null===f&&(a.substr(Zf,5)===Ld?(f=Ld,Zf+=5):(f=null,0===dg&&e(Md))),null!==f?($f=b,c=ef(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Lb(){var b,c,d,f,g,h;if(b=Zf,123===a.charCodeAt(Zf)?(c=je,Zf++):(c=null,0===dg&&e(ke)),null!==c)if(d=hc(),null!==d){if(f=Zf,g=[],h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc))),null!==h)for(;null!==h;)g.push(h),h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc)));else g=tc;null!==g&&(g=a.substring(f,Zf)),f=g,null!==f?(g=hc(),null!==g?(125===a.charCodeAt(Zf)?(h=Ae,Zf++):(h=null,0===dg&&e(Be)),null!==h?($f=b,c=ff(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)}else Zf=b,b=tc;else Zf=b,b=tc;if(null===b){if(b=Zf,c=[],d=Gb(),null!==d)for(;null!==d;)c.push(d),d=Gb();else c=tc;null!==c&&(c=a.substring(b,Zf)),b=c}return b}function Mb(){var b,c,d,f,g,h;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Lb(),null!==f?(g=Zf,dg++,33===a.charCodeAt(Zf)?(h=gf,Zf++):(h=null,0===dg&&e(hf)),dg--,null===h?g=uc:(Zf=g,g=tc),null!==g?($f=Zf,h=jf(c,f),h=h?uc:tc,null!==h?($f=b,c=kf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Nb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=R(),null!==f?($f=b,c=lf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Ob(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=cb(),null!==f?($f=b,c=mf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Pb(){var b,c,d;return b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Qb(){var b,c,d;return b=Zf,35===a.charCodeAt(Zf)?(c=pf,Zf++):(c=null,0===dg&&e(qf)),null!==c?(d=Sb(),null!==d?($f=b,c=rf(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Rb(){var b,c,d;return b=Zf,46===a.charCodeAt(Zf)?(c=pd,Zf++):(c=null,0===dg&&e(qd)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Sb(){var a,b;return dg++,a=Tb(),dg--,null===a&&(b=null,0===dg&&e(sf)),a}function Tb(){var b,c,d;for(b=Zf,c=[],d=Ub();null!==d;)c.push(d),d=Ub();return null!==c&&(c=a.substring(b,Zf)),b=c}function Ub(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=Vb()),b}function Vb(){var b;return vf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(wf)),b}function Wb(){var b,c,d;if(b=Zf,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c}function Xb(){var b,c,d,f;return dg++,b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=hc(),null!==d?(f=Wb(),null!==f?($f=b,c=td(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Yb()),dg--,null===b&&(c=null,0===dg&&e(xf)),b}function Yb(){var a,b,c;return a=Zf,b=Wb(),null!==b?($f=Zf,c=yf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function Zb(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=$b()),b}function $b(){var b,c,d,f;return b=Zf,58===a.charCodeAt(Zf)?(c=vd,Zf++):(c=null,0===dg&&e(wd)),null!==c?(d=Zf,dg++,32===a.charCodeAt(Zf)?(f=Rc,Zf++):(f=null,0===dg&&e(Sc)),dg--,null===f?d=uc:(Zf=d,d=tc),null!==d?($f=b,c=Uc(c),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function _b(){var a,b,c;return dg++,a=Zf,b=Wb(),null!==b?($f=Zf,c=Bf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),dg--,null===a&&(b=null,0===dg&&e(Af)),a}function ac(){var a,b,c;return a=Zf,b=bc(),null!==b?(c=gc(),null!==c?($f=a,b=td(c),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function bc(){var b,c;return dg++,b=Zf,61423===a.charCodeAt(Zf)?(c=Df,Zf++):(c=null,0===dg&&e(Ef)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Cf)),b}function cc(){var b,c;return dg++,b=Zf,61438===a.charCodeAt(Zf)?(c=Hf,Zf++):(c=null,0===dg&&e(If)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Gf)),b}function dc(){var b,c;return dg++,b=Zf,61422===a.charCodeAt(Zf)?(c=Kf,Zf++):(c=null,0===dg&&e(Lf)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Jf)),b}function ec(){var b,c,d,f;return dg++,b=Zf,13===a.charCodeAt(Zf)?(c=Nf,Zf++):(c=null,0===dg&&e(Of)),null===c&&(c=uc),null!==c?(61439===a.charCodeAt(Zf)?(d=Pf,Zf++):(d=null,0===dg&&e(Qf)),null!==d?(10===a.charCodeAt(Zf)?(f=Rf,Zf++):(f=null,0===dg&&e(Sf)),null!==f?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),dg--,null===b&&(c=null,0===dg&&e(Mf)),b}function fc(){var a,b;return dg++,a=cc(),null===a&&(a=dc()),dg--,null===a&&(b=null,0===dg&&e(Tf)),a}function gc(){var b,c,d;if(dg++,b=Zf,c=[],d=ic(),null!==d)for(;null!==d;)c.push(d),d=ic();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c,dg--,null===b&&(c=null,0===dg&&e(Uf)),b}function hc(){var a,b;for(dg++,a=[],b=ic();null!==b;)a.push(b),b=ic();return dg--,null===a&&(b=null,0===dg&&e(Vf)),a}function ic(){var b,c;return dg++,Xf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(Yf)),dg--,null===b&&(c=null,0===dg&&e(Wf)),b}function jc(){var b,c,d;return b=Zf,c=Zf,dg++,d=bc(),null===d&&(d=cc(),null===d&&(d=ec())),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function kc(){var b,c,d;for(b=Zf,c=[],d=jc();null!==d;)c.push(d),d=jc();return null!==c&&(c=a.substring(b,Zf)),b=c}function lc(a,b,c){if(ng){var d=c?lg:mg;return new gg.MustacheNode(a,b,d,{left:!1,right:!1})}return new gg.MustacheNode(a,b,!c)}function mc(a,b){return ng?new gg.ProgramNode(a,{left:!1,right:!1},b,null):new gg.ProgramNode(a,b)}function nc(a,b,c){var d=a.hash;if(c){d=d||new gg.HashNode([]);for(var e=0;e1?arguments[1]:{},rc={start:g},sc=g,tc=null,uc="",vc=function(a){return a},wc=function(a,b){return mc(a,b||[])},xc="=",yc='"="',zc="else",Ac='"else"',Bc=function(a){for(var b=[],c=[],d=0;d",Gc='">"',Hc=function(a,b){return[new gg.PartialNode(a,b[0])]},Ic=/^[a-zA-Z0-9_$-\/]/,Jc="[a-zA-Z0-9_$-\\/]",Kc=function(a){return new gg.PartialNameNode(new gg.StringNode(a))},Lc=function(a){return[a]},Mc="/",Nc='"/"',Oc=/^[A-Z]/,Pc="[A-Z]",Qc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?(a.mustache=nc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?nc(a,b):a},Rc=" ",Sc='" "',Tc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new gg.ContentNode(" ")),a=a.concat(b[c])}return a},Uc=function(a){return a},Vc=function(a){return[a]},Wc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Xc=function(a,b){if(!b)return a;var c=a.id;ng&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new gg.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Yc=": ",Zc='": "',$c=function(a){return mc(a,[])},_c=function(a){return a&&a[2]},ad=function(a,b){var c=b.mustache||b;return c.escaped=a,b},bd=function(a,b){if(a){var c=new gg.PartialNameNode(new gg.StringNode(b.id.string));return new gg.PartialNode(c,b.params[0])}var d;d=og?lc(b,null,!0):lc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?nc(d,"unbound"):"?"===e?nc(d,"if"):"^"===e?nc(d,"unless"):d},cd=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new gg.ContentNode(">")),[i,new gg.ContentNode("")])},Ye=function(a){return{shorthand:a,id:!0}},Ze=function(a){return{shorthand:a}},$e=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},_e=function(a){return a.length?[new gg.ContentNode(" ")].concat(a):[]},af=/^[A-Za-z.0-9_\-]/,bf="[A-Za-z.0-9_\\-]",cf=function(a){return lc([a],null,!0)},df=function(a,b){return b.id=new gg.StringNode(b.id.string),[nc(b,"action",[["on",new gg.StringNode(a)]])]},ef=function(a,b){return"true"===b?[new gg.ContentNode(a)]:[]},ff=function(a){return a.replace(/ *$/,"")},gf="!",hf='"!"',jf=function(){return fg},kf=function(a,b){var c=new gg.HashNode([[a,new gg.StringNode(b)]]),d=[new gg.IdNode([{part:"bind-attr"}])],e=lc(d,c);return[e]},lf=function(a,b){var c=lc([b],null,!0);return fg&&"!"===b._emblemSuffixModifier&&(c=nc(c,"unbound")),[new gg.ContentNode(a+'="'),c,new gg.ContentNode('"')]},mf=function(a,b){var c=[new gg.ContentNode(a+'="')].concat(b);return c.concat([new gg.ContentNode('"')])},nf="%",of='"%"',pf="#",qf='"#"',rf=function(a){return a},sf="CSSIdentifier",tf=/^[_a-zA-Z0-9\-]/,uf="[_a-zA-Z0-9\\-]",vf=/^[\x80-\xFF]/,wf="[\\x80-\\xFF]",xf="KnownHTMLTagName",yf=function(a){return!!ig[a]},zf=function(a){return a},Af="a JS event",Bf=function(a){return!!jg[a]},Cf="INDENT",Df="\uefef",Ef='"\\uEFEF"',Ff=function(){return""},Gf="DEDENT",Hf="\ueffe",If='"\\uEFFE"',Jf="Unmatched DEDENT",Kf="\uefee",Lf='"\\uEFEE"',Mf="LineEnd",Nf="\r",Of='"\\r"',Pf="\uefff",Qf='"\\uEFFF"',Rf="\n",Sf='"\\n"',Tf="ANYDEDENT",Uf="RequiredWhitespace",Vf="OptionalWhitespace",Wf="InlineWhitespace",Xf=/^[ \t]/,Yf="[ \\t]",Zf=0,$f=0,_f=0,ag={line:1,column:1,seenCR:!1},bg=0,cg=[],dg=0;if("startRule"in qc){if(!(qc.startRule in rc))throw new Error("Can't start parsing from rule \""+qc.startRule+'".');sc=rc[qc.startRule]}var eg=c.handlebarsVariant,fg="Ember.Handlebars"===eg.JavaScriptCompiler.prototype.namespace,gg=eg.AST,hg={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ig={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},jg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},kg=String.fromCharCode(125),lg=kg+kg,mg=lg+kg,ng=eg.VERSION.slice(0,3)>=1.1,og=eg.VERSION.slice(0,3)>=1.3;if(pc=sc(),null!==pc&&Zf===a.length)return pc;throw f(cg),$f=Math.max(Zf,bg),new b(cg,$fc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.13/emblem.js b/ajax/libs/emblem/0.3.13/emblem.js new file mode 100644 index 000000000..251bf996a --- /dev/null +++ b/ajax/libs/emblem/0.3.13/emblem.js @@ -0,0 +1,6371 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c55 = function(s) { return s; }, + peg$c56 = "Key", + peg$c57 = ":", + peg$c58 = "\":\"", + peg$c59 = function(h) { return [h[0], h[2]]; }, + peg$c60 = function(s) { s.isHelper = true; return s; }, + peg$c61 = function(s, p) { return { part: p, separator: s }; }, + peg$c62 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c63 = "PathSeparator", + peg$c64 = /^[\/.]/, + peg$c65 = "[\\/.]", + peg$c66 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c67 = function(v) { return new AST.StringNode(v); }, + peg$c68 = function(v) { return new AST.IntegerNode(v); }, + peg$c69 = function(v) { return new AST.BooleanNode(v); }, + peg$c70 = "Boolean", + peg$c71 = "true", + peg$c72 = "\"true\"", + peg$c73 = "false", + peg$c74 = "\"false\"", + peg$c75 = "Integer", + peg$c76 = "-", + peg$c77 = "\"-\"", + peg$c78 = /^[0-9]/, + peg$c79 = "[0-9]", + peg$c80 = function(s) { return parseInt(s); }, + peg$c81 = "\"", + peg$c82 = "\"\\\"\"", + peg$c83 = "'", + peg$c84 = "\"'\"", + peg$c85 = function(p) { return p[1]; }, + peg$c86 = /^[^"}]/, + peg$c87 = "[^\"}]", + peg$c88 = /^[^'}]/, + peg$c89 = "[^'}]", + peg$c90 = /^[A-Za-z]/, + peg$c91 = "[A-Za-z]", + peg$c92 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c93 = /^[|`']/, + peg$c94 = "[|`']", + peg$c95 = "<", + peg$c96 = "\"<\"", + peg$c97 = function() { return '<'; }, + peg$c98 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c99 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c100 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c101 = "{", + peg$c102 = "\"{\"", + peg$c103 = "@index", + peg$c104 = "\"@index\"", + peg$c105 = function() { + + var params = {}; + var idNode = new AST.IdNode([{part: "index"}]); + var dataNode = new AST.DataNode(idNode); + params = dataNode; + return new AST.MustacheNode([params], null, false); + }, + peg$c106 = /^[^}]/, + peg$c107 = "[^}]", + peg$c108 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c109 = function(m) { m.escaped = true; return m; }, + peg$c110 = function(m) { m.escaped = false; return m; }, + peg$c111 = function(a) { return new AST.ContentNode(a); }, + peg$c112 = "any character", + peg$c113 = "SingleMustacheOpen", + peg$c114 = "DoubleMustacheOpen", + peg$c115 = "{{", + peg$c116 = "\"{{\"", + peg$c117 = "TripleMustacheOpen", + peg$c118 = "{{{", + peg$c119 = "\"{{{\"", + peg$c120 = "SingleMustacheClose", + peg$c121 = "}", + peg$c122 = "\"}\"", + peg$c123 = "DoubleMustacheClose", + peg$c124 = "}}", + peg$c125 = "\"}}\"", + peg$c126 = "TripleMustacheClose", + peg$c127 = "}}}", + peg$c128 = "\"}}}\"", + peg$c129 = "SubexpressionOpen", + peg$c130 = "(", + peg$c131 = "\"(\"", + peg$c132 = "SubexpressionClose", + peg$c133 = ")", + peg$c134 = "\")\"", + peg$c135 = "InterpolationOpen", + peg$c136 = "#{", + peg$c137 = "\"#{\"", + peg$c138 = "InterpolationClose", + peg$c139 = "==", + peg$c140 = "\"==\"", + peg$c141 = function() { return false; }, + peg$c142 = function() { return true; }, + peg$c143 = function(h, s) { return h || s; }, + peg$c144 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c145 = function(s) { return { shorthand: s, id: true}; }, + peg$c146 = function(s) { return { shorthand: s }; }, + peg$c147 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c148 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c149 = /^[A-Za-z.0-9_\-]/, + peg$c150 = "[A-Za-z.0-9_\\-]", + peg$c151 = function(id) { return createMustacheNode([id], null, true); }, + peg$c152 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c153 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c154 = function(value) { return value.replace(/ *$/, ''); }, + peg$c155 = "!", + peg$c156 = "\"!\"", + peg$c157 = function(key, value) { return IS_EMBER; }, + peg$c158 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c159 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c160 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c161 = "_", + peg$c162 = "\"_\"", + peg$c163 = "%", + peg$c164 = "\"%\"", + peg$c165 = "#", + peg$c166 = "\"#\"", + peg$c167 = function(c) { return c;}, + peg$c168 = "CSSIdentifier", + peg$c169 = /^[_a-zA-Z0-9\-]/, + peg$c170 = "[_a-zA-Z0-9\\-]", + peg$c171 = /^[_a-zA-Z]/, + peg$c172 = "[_a-zA-Z]", + peg$c173 = /^[\x80-\xFF]/, + peg$c174 = "[\\x80-\\xFF]", + peg$c175 = "KnownHTMLTagName", + peg$c176 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c177 = function(t) { return t; }, + peg$c178 = "a JS event", + peg$c179 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c180 = "INDENT", + peg$c181 = "\uEFEF", + peg$c182 = "\"\\uEFEF\"", + peg$c183 = function() { return ''; }, + peg$c184 = "DEDENT", + peg$c185 = "\uEFFE", + peg$c186 = "\"\\uEFFE\"", + peg$c187 = "Unmatched DEDENT", + peg$c188 = "\uEFEE", + peg$c189 = "\"\\uEFEE\"", + peg$c190 = "LineEnd", + peg$c191 = "\r", + peg$c192 = "\"\\r\"", + peg$c193 = "\uEFFF", + peg$c194 = "\"\\uEFFF\"", + peg$c195 = "\n", + peg$c196 = "\"\\n\"", + peg$c197 = "ANYDEDENT", + peg$c198 = "RequiredWhitespace", + peg$c199 = "OptionalWhitespace", + peg$c200 = "InlineWhitespace", + peg$c201 = /^[ \t]/, + peg$c202 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c68(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c71) { + s0 = peg$c71; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s0 = peg$c73; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c76; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c90.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c93.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c83; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parseeachIndex() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c101; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.substr(peg$currPos, 6) === peg$c103) { + s3 = peg$c103; + peg$currPos += 6; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c101; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c106.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c106.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheContent() { + var s0; + + s0 = peg$parseeachIndex(); + if (s0 === null) { + s0 = peg$parserecursivelyParsedMustacheContent(); + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c109(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c109(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c110(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c111(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c111(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c111(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsemustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c109(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c101; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c115) { + s0 = peg$c115; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c118) { + s0 = peg$c118; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c121; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c124) { + s0 = peg$c124; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c127) { + s0 = peg$c127; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c133; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c136) { + s0 = peg$c136; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c121; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c139) { + s1 = peg$c139; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c143(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c145(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c146(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c145(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c146(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c149.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c152(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c71) { + s3 = peg$c71; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s3 = peg$c73; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c121; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c154(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c155; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c157(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c159(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c160(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c161; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c76; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c163; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c165; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c169.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c171.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c173.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c163; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c176(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c177(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c169.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c179(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c177(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c181; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c183(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c183(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c188; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c183(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c191; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c192); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c193; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c195; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c190); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c201.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c202); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c200); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.13/emblem.min.js b/ajax/libs/emblem/0.3.13/emblem.min.js new file mode 100644 index 000000000..d457a8de8 --- /dev/null +++ b/ajax/libs/emblem/0.3.13/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return eg!==b&&(eg>b&&(eg=0,fg={line:1,column:1,seenCR:!1}),c(fg,eg,b),eg=b),fg}function e(a){gg>cg||(cg>gg&&(gg=cg,hg=[]),hg.push(a))}function f(a){var b=0;for(a.sort();bcg?(d=a.charAt(cg),cg++):(d=null,0===ig&&e(we)),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function ob(){var b,c,d;return b=cg,c=cg,ig++,d=rb(),null===d&&(39===a.charCodeAt(cg)?(d=Xd,cg++):(d=null,0===ig&&e(Yd))),ig--,null===d?c=wc:(cg=c,c=vc),null!==c?(a.length>cg?(d=a.charAt(cg),cg++):(d=null,0===ig&&e(we)),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function pb(){var b,c,d,e;if(b=cg,c=cg,d=[],e=qb(),null!==e)for(;null!==e;)d.push(e),e=qb();else d=vc;return null!==d&&(d=a.substring(c,cg)),c=d,null!==c&&(dg=b,c=ve(c)),null===c?(cg=b,b=c):b=c,b}function qb(){var b,c,d;return b=cg,c=cg,ig++,d=rb(),ig--,null===d?c=wc:(cg=c,c=vc),null!==c?(a.length>cg?(d=a.charAt(cg),cg++):(d=null,0===ig&&e(we)),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function rb(){var a;return a=wb(),null===a&&(a=vb(),null===a&&(a=Cb(),null===a&&(a=hc(),null===a&&(a=gc())))),a}function sb(){var a,b,c,d,e,f;return a=cg,b=ub(),null!==b?(c=jc(),null!==c?(d=ib(),null!==d?(e=jc(),null!==e?(f=xb(),null!==f?(dg=a,b=te(d),null===b?(cg=a,a=b):a=b):(cg=a,a=vc)):(cg=a,a=vc)):(cg=a,a=vc)):(cg=a,a=vc)):(cg=a,a=vc),a}function tb(){var a;return a=sb(),null===a&&(a=kb(),null===a&&(a=jb())),a}function ub(){var b,c;return ig++,123===a.charCodeAt(cg)?(b=le,cg++):(b=null,0===ig&&e(me)),ig--,null===b&&(c=null,0===ig&&e(xe)),b}function vb(){var b,c;return ig++,a.substr(cg,2)===ze?(b=ze,cg+=2):(b=null,0===ig&&e(Ae)),ig--,null===b&&(c=null,0===ig&&e(ye)),b}function wb(){var b,c;return ig++,a.substr(cg,3)===Ce?(b=Ce,cg+=3):(b=null,0===ig&&e(De)),ig--,null===b&&(c=null,0===ig&&e(Be)),b}function xb(){var b,c;return ig++,125===a.charCodeAt(cg)?(b=Fe,cg++):(b=null,0===ig&&e(Ge)),ig--,null===b&&(c=null,0===ig&&e(Ee)),b}function yb(){var b,c;return ig++,a.substr(cg,2)===Ie?(b=Ie,cg+=2):(b=null,0===ig&&e(Je)),ig--,null===b&&(c=null,0===ig&&e(He)),b}function zb(){var b,c;return ig++,a.substr(cg,3)===Le?(b=Le,cg+=3):(b=null,0===ig&&e(Me)),ig--,null===b&&(c=null,0===ig&&e(Ke)),b}function Ab(){var b,c;return ig++,40===a.charCodeAt(cg)?(b=Oe,cg++):(b=null,0===ig&&e(Pe)),ig--,null===b&&(c=null,0===ig&&e(Ne)),b}function Bb(){var b,c;return ig++,41===a.charCodeAt(cg)?(b=Re,cg++):(b=null,0===ig&&e(Se)),ig--,null===b&&(c=null,0===ig&&e(Qe)),b}function Cb(){var b,c;return ig++,a.substr(cg,2)===Ue?(b=Ue,cg+=2):(b=null,0===ig&&e(Ve)),ig--,null===b&&(c=null,0===ig&&e(Te)),b}function Db(){var b,c;return ig++,125===a.charCodeAt(cg)?(b=Fe,cg++):(b=null,0===ig&&e(Ge)),ig--,null===b&&(c=null,0===ig&&e(We)),b}function Eb(){var b,c,d;return b=cg,a.substr(cg,2)===Xe?(c=Xe,cg+=2):(c=null,0===ig&&e(Ye)),null!==c?(32===a.charCodeAt(cg)?(d=Tc,cg++):(d=null,0===ig&&e(Uc)),null===d&&(d=wc),null!==d?(dg=b,c=Ze(),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),null===b&&(b=cg,61===a.charCodeAt(cg)?(c=zc,cg++):(c=null,0===ig&&e(Ac)),null!==c?(32===a.charCodeAt(cg)?(d=Tc,cg++):(d=null,0===ig&&e(Uc)),null===d&&(d=wc),null!==d?(dg=b,c=$e(),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)),b}function Fb(){var b,c,d,f,g;return b=cg,c=Zb(),null===c&&(c=wc),null!==c?(d=G(),null===d&&(d=wc),null!==d?(47===a.charCodeAt(cg)?(f=Oc,cg++):(f=null,0===ig&&e(Pc)),null===f&&(f=wc),null!==f?(dg=cg,g=_e(c,d),g=g?wc:vc,null!==g?(c=[c,d,f,g],b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Gb(){var a,b,c,d,e;if(a=cg,b=Fb(),null!==b){for(c=[],d=tb();null!==d;)c.push(d),d=tb();if(null!==c){for(d=[],e=Hb();null!==e;)d.push(e),e=Hb();null!==d?(dg=a,b=af(b,c,d),null===b?(cg=a,a=b):a=b):(cg=a,a=vc)}else cg=a,a=vc}else cg=a,a=vc;return a}function G(){var a,b,c,d;if(a=cg,b=[],c=cg,d=Sb(),null!==d&&(dg=c,d=bf(d)),null===d?(cg=c,c=d):c=d,null===c&&(c=cg,d=Tb(),null!==d&&(dg=c,d=cf(d)),null===d?(cg=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=cg,d=Sb(),null!==d&&(dg=c,d=bf(d)),null===d?(cg=c,c=d):c=d,null===c&&(c=cg,d=Tb(),null!==d&&(dg=c,d=cf(d)),null===d?(cg=c,c=d):c=d);else b=vc;return null!==b&&(dg=a,b=df(b)),null===b?(cg=a,a=b):a=b,a}function Hb(){var b,c,d;if(b=cg,c=[],32===a.charCodeAt(cg)?(d=Tc,cg++):(d=null,0===ig&&e(Uc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(cg)?(d=Tc,cg++):(d=null,0===ig&&e(Uc));else c=vc;return null!==c?(d=Lb(),null===d&&(d=Mb(),null===d&&(d=Ob(),null===d&&(d=Pb(),null===d&&(d=Qb())))),null!==d?(dg=b,c=ef(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function Ib(){var b;return ff.test(a.charAt(cg))?(b=a.charAt(cg),cg++):(b=null,0===ig&&e(gf)),null===b&&(b=ac()),b}function Jb(){var a,b;return a=Kb(),null===a&&(a=cg,b=R(),null!==b&&(dg=a,b=hf(b)),null===b?(cg=a,a=b):a=b),a}function Kb(){var b,c,d,f,g;return b=cg,c=cg,34===a.charCodeAt(cg)?(d=Vd,cg++):(d=null,0===ig&&e(Wd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(cg)?(g=Vd,cg++):(g=null,0===ig&&e(Wd)),null!==g?(d=[d,f,g],c=d):(cg=c,c=vc)):(cg=c,c=vc)):(cg=c,c=vc),null===c&&(c=cg,39===a.charCodeAt(cg)?(d=Xd,cg++):(d=null,0===ig&&e(Yd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(cg)?(g=Xd,cg++):(g=null,0===ig&&e(Yd)),null!==g?(d=[d,f,g],c=d):(cg=c,c=vc)):(cg=c,c=vc)):(cg=c,c=vc)),null!==c&&(dg=b,c=Zd(c)),null===c?(cg=b,b=c):b=c,b}function Lb(){var b,c,d,f;return b=cg,c=bc(),null!==c?(61===a.charCodeAt(cg)?(d=zc,cg++):(d=null,0===ig&&e(Ac)),null!==d?(f=Jb(),null!==f?(dg=b,c=jf(c,f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Mb(){var b,c,d,f;return b=cg,c=M(),null!==c?(61===a.charCodeAt(cg)?(d=zc,cg++):(d=null,0===ig&&e(Ac)),null!==d?(a.substr(cg,4)===Ld?(f=Ld,cg+=4):(f=null,0===ig&&e(Md)),null===f&&(a.substr(cg,5)===Nd?(f=Nd,cg+=5):(f=null,0===ig&&e(Od))),null!==f?(dg=b,c=kf(c,f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Nb(){var b,c,d,f,g,h;if(b=cg,123===a.charCodeAt(cg)?(c=le,cg++):(c=null,0===ig&&e(me)),null!==c)if(d=jc(),null!==d){if(f=cg,g=[],h=Ib(),null===h&&(32===a.charCodeAt(cg)?(h=Tc,cg++):(h=null,0===ig&&e(Uc))),null!==h)for(;null!==h;)g.push(h),h=Ib(),null===h&&(32===a.charCodeAt(cg)?(h=Tc,cg++):(h=null,0===ig&&e(Uc)));else g=vc;null!==g&&(g=a.substring(f,cg)),f=g,null!==f?(g=jc(),null!==g?(125===a.charCodeAt(cg)?(h=Fe,cg++):(h=null,0===ig&&e(Ge)),null!==h?(dg=b,c=lf(f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc)}else cg=b,b=vc;else cg=b,b=vc;if(null===b){if(b=cg,c=[],d=Ib(),null!==d)for(;null!==d;)c.push(d),d=Ib();else c=vc;null!==c&&(c=a.substring(b,cg)),b=c}return b}function Ob(){var b,c,d,f,g,h;return b=cg,c=M(),null!==c?(61===a.charCodeAt(cg)?(d=zc,cg++):(d=null,0===ig&&e(Ac)),null!==d?(f=Nb(),null!==f?(g=cg,ig++,33===a.charCodeAt(cg)?(h=mf,cg++):(h=null,0===ig&&e(nf)),ig--,null===h?g=wc:(cg=g,g=vc),null!==g?(dg=cg,h=of(c,f),h=h?wc:vc,null!==h?(dg=b,c=pf(c,f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Pb(){var b,c,d,f;return b=cg,c=M(),null!==c?(61===a.charCodeAt(cg)?(d=zc,cg++):(d=null,0===ig&&e(Ac)),null!==d?(f=R(),null!==f?(dg=b,c=qf(c,f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Qb(){var b,c,d,f;return b=cg,c=M(),null!==c?(61===a.charCodeAt(cg)?(d=zc,cg++):(d=null,0===ig&&e(Ac)),null!==d?(f=cb(),null!==f?(dg=b,c=rf(c,f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),b}function Rb(){var b,c,d;return b=cg,37===a.charCodeAt(cg)?(c=sf,cg++):(c=null,0===ig&&e(tf)),null!==c?(d=Ub(),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function Sb(){var b,c,d;return b=cg,35===a.charCodeAt(cg)?(c=uf,cg++):(c=null,0===ig&&e(vf)),null!==c?(d=Ub(),null!==d?(dg=b,c=wf(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function Tb(){var b,c,d;return b=cg,46===a.charCodeAt(cg)?(c=rd,cg++):(c=null,0===ig&&e(sd)),null!==c?(d=Ub(),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function Ub(){var a,b;return ig++,a=Vb(),ig--,null===a&&(b=null,0===ig&&e(xf)),a}function Vb(){var b,c,d;for(b=cg,c=[],d=Wb();null!==d;)c.push(d),d=Wb();return null!==c&&(c=a.substring(b,cg)),b=c}function Wb(){var b;return yf.test(a.charAt(cg))?(b=a.charAt(cg),cg++):(b=null,0===ig&&e(zf)),null===b&&(b=Xb()),b}function Xb(){var b;return Af.test(a.charAt(cg))?(b=a.charAt(cg),cg++):(b=null,0===ig&&e(Bf)),b}function Yb(){var b,c,d;if(b=cg,c=[],d=_b(),null!==d)for(;null!==d;)c.push(d),d=_b();else c=vc;return null!==c&&(c=a.substring(b,cg)),b=c}function Zb(){var b,c,d,f;return ig++,b=cg,37===a.charCodeAt(cg)?(c=sf,cg++):(c=null,0===ig&&e(tf)),null!==c?(d=jc(),null!==d?(f=Yb(),null!==f?(dg=b,c=vd(f),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),null===b&&(b=$b()),ig--,null===b&&(c=null,0===ig&&e(Cf)),b}function $b(){var a,b,c;return a=cg,b=Yb(),null!==b?(dg=cg,c=Df(b),c=c?wc:vc,null!==c?(dg=a,b=Ef(b),null===b?(cg=a,a=b):a=b):(cg=a,a=vc)):(cg=a,a=vc),a}function _b(){var b;return yf.test(a.charAt(cg))?(b=a.charAt(cg),cg++):(b=null,0===ig&&e(zf)),null===b&&(b=ac()),b}function ac(){var b,c,d,f;return b=cg,58===a.charCodeAt(cg)?(c=xd,cg++):(c=null,0===ig&&e(yd)),null!==c?(d=cg,ig++,32===a.charCodeAt(cg)?(f=Tc,cg++):(f=null,0===ig&&e(Uc)),ig--,null===f?d=wc:(cg=d,d=vc),null!==d?(dg=b,c=Wc(c),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function bc(){var a,b,c;return ig++,a=cg,b=Yb(),null!==b?(dg=cg,c=Gf(b),c=c?wc:vc,null!==c?(dg=a,b=Ef(b),null===b?(cg=a,a=b):a=b):(cg=a,a=vc)):(cg=a,a=vc),ig--,null===a&&(b=null,0===ig&&e(Ff)),a}function cc(){var a,b,c;return a=cg,b=dc(),null!==b?(c=ic(),null!==c?(dg=a,b=vd(c),null===b?(cg=a,a=b):a=b):(cg=a,a=vc)):(cg=a,a=vc),a}function dc(){var b,c;return ig++,b=cg,61423===a.charCodeAt(cg)?(c=If,cg++):(c=null,0===ig&&e(Jf)),null!==c&&(dg=b,c=Kf()),null===c?(cg=b,b=c):b=c,ig--,null===b&&(c=null,0===ig&&e(Hf)),b}function ec(){var b,c;return ig++,b=cg,61438===a.charCodeAt(cg)?(c=Mf,cg++):(c=null,0===ig&&e(Nf)),null!==c&&(dg=b,c=Kf()),null===c?(cg=b,b=c):b=c,ig--,null===b&&(c=null,0===ig&&e(Lf)),b}function fc(){var b,c;return ig++,b=cg,61422===a.charCodeAt(cg)?(c=Pf,cg++):(c=null,0===ig&&e(Qf)),null!==c&&(dg=b,c=Kf()),null===c?(cg=b,b=c):b=c,ig--,null===b&&(c=null,0===ig&&e(Of)),b}function gc(){var b,c,d,f;return ig++,b=cg,13===a.charCodeAt(cg)?(c=Sf,cg++):(c=null,0===ig&&e(Tf)),null===c&&(c=wc),null!==c?(61439===a.charCodeAt(cg)?(d=Uf,cg++):(d=null,0===ig&&e(Vf)),null!==d?(10===a.charCodeAt(cg)?(f=Wf,cg++):(f=null,0===ig&&e(Xf)),null!==f?(dg=b,c=Ze(),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc)):(cg=b,b=vc),ig--,null===b&&(c=null,0===ig&&e(Rf)),b}function hc(){var a,b;return ig++,a=ec(),null===a&&(a=fc()),ig--,null===a&&(b=null,0===ig&&e(Yf)),a}function ic(){var b,c,d;if(ig++,b=cg,c=[],d=kc(),null!==d)for(;null!==d;)c.push(d),d=kc();else c=vc;return null!==c&&(c=a.substring(b,cg)),b=c,ig--,null===b&&(c=null,0===ig&&e(Zf)),b}function jc(){var a,b;for(ig++,a=[],b=kc();null!==b;)a.push(b),b=kc();return ig--,null===a&&(b=null,0===ig&&e($f)),a}function kc(){var b,c;return ig++,ag.test(a.charAt(cg))?(b=a.charAt(cg),cg++):(b=null,0===ig&&e(bg)),ig--,null===b&&(c=null,0===ig&&e(_f)),b}function lc(){var b,c,d;return b=cg,c=cg,ig++,d=dc(),null===d&&(d=ec(),null===d&&(d=gc())),ig--,null===d?c=wc:(cg=c,c=vc),null!==c?(a.length>cg?(d=a.charAt(cg),cg++):(d=null,0===ig&&e(we)),null!==d?(dg=b,c=Wc(d),null===c?(cg=b,b=c):b=c):(cg=b,b=vc)):(cg=b,b=vc),b}function mc(){var b,c,d;for(b=cg,c=[],d=lc();null!==d;)c.push(d),d=lc();return null!==c&&(c=a.substring(b,cg)),b=c}function nc(a,b,c){if(sg){var d=c?qg:rg; +return new lg.MustacheNode(a,b,d,{left:!1,right:!1})}return new lg.MustacheNode(a,b,!c)}function oc(a,b){return sg?new lg.ProgramNode(a,{left:!1,right:!1},b,null):new lg.ProgramNode(a,b)}function pc(a,b,c){var d=a.hash;if(c){d=d||new lg.HashNode([]);for(var e=0;e1?arguments[1]:{},tc={start:g},uc=g,vc=null,wc="",xc=function(a){return a},yc=function(a,b){return oc(a,b||[])},zc="=",Ac='"="',Bc="else",Cc='"else"',Dc=function(a){for(var b=[],c=[],d=0;d",Ic='">"',Jc=function(a,b){return[new lg.PartialNode(a,b[0])]},Kc=/^[a-zA-Z0-9_$-\/]/,Lc="[a-zA-Z0-9_$-\\/]",Mc=function(a){return new lg.PartialNameNode(new lg.StringNode(a))},Nc=function(a){return[a]},Oc="/",Pc='"/"',Qc=/^[A-Z]/,Rc="[A-Z]",Sc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return kg&&c.match(/[A-Z]/)?(a.mustache=pc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return kg&&c.match(/[A-Z]/)?pc(a,b):a},Tc=" ",Uc='" "',Vc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new lg.ContentNode(" ")),a=a.concat(b[c])}return a},Wc=function(a){return a},Xc=function(a){return[a]},Yc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Zc=function(a,b){if(!b)return a;var c=a.id;sg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new lg.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},$c=": ",_c='": "',ad=function(a){return oc(a,[])},bd=function(a){return a&&a[2]},cd=function(a,b){var c=b.mustache||b;return c.escaped=a,b},dd=function(a,b){if(a){var c=new lg.PartialNameNode(new lg.StringNode(b.id.string));return new lg.PartialNode(c,b.params[0])}var d;d=tg?nc(b,null,!0):nc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?pc(d,"unbound"):"?"===e?pc(d,"if"):"^"===e?pc(d,"unless"):d},ed=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new lg.ContentNode(">")),[i,new lg.ContentNode("")])},bf=function(a){return{shorthand:a,id:!0}},cf=function(a){return{shorthand:a}},df=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},ef=function(a){return a.length?[new lg.ContentNode(" ")].concat(a):[]},ff=/^[A-Za-z.0-9_\-]/,gf="[A-Za-z.0-9_\\-]",hf=function(a){return nc([a],null,!0)},jf=function(a,b){return b.id=new lg.StringNode(b.id.string),[pc(b,"action",[["on",new lg.StringNode(a)]])]},kf=function(a,b){return"true"===b?[new lg.ContentNode(a)]:[]},lf=function(a){return a.replace(/ *$/,"")},mf="!",nf='"!"',of=function(){return kg},pf=function(a,b){var c=new lg.HashNode([[a,new lg.StringNode(b)]]),d=[new lg.IdNode([{part:"bind-attr"}])],e=nc(d,c);return[e]},qf=function(a,b){var c=nc([b],null,!0);return kg&&"!"===b._emblemSuffixModifier&&(c=pc(c,"unbound")),[new lg.ContentNode(a+'="'),c,new lg.ContentNode('"')]},rf=function(a,b){var c=[new lg.ContentNode(a+'="')].concat(b);return c.concat([new lg.ContentNode('"')])},sf="%",tf='"%"',uf="#",vf='"#"',wf=function(a){return a},xf="CSSIdentifier",yf=/^[_a-zA-Z0-9\-]/,zf="[_a-zA-Z0-9\\-]",Af=/^[\x80-\xFF]/,Bf="[\\x80-\\xFF]",Cf="KnownHTMLTagName",Df=function(a){return!!ng[a]},Ef=function(a){return a},Ff="a JS event",Gf=function(a){return!!og[a]},Hf="INDENT",If="\uefef",Jf='"\\uEFEF"',Kf=function(){return""},Lf="DEDENT",Mf="\ueffe",Nf='"\\uEFFE"',Of="Unmatched DEDENT",Pf="\uefee",Qf='"\\uEFEE"',Rf="LineEnd",Sf="\r",Tf='"\\r"',Uf="\uefff",Vf='"\\uEFFF"',Wf="\n",Xf='"\\n"',Yf="ANYDEDENT",Zf="RequiredWhitespace",$f="OptionalWhitespace",_f="InlineWhitespace",ag=/^[ \t]/,bg="[ \\t]",cg=0,dg=0,eg=0,fg={line:1,column:1,seenCR:!1},gg=0,hg=[],ig=0;if("startRule"in sc){if(!(sc.startRule in tc))throw new Error("Can't start parsing from rule \""+sc.startRule+'".');uc=tc[sc.startRule]}var jg=c.handlebarsVariant,kg="Ember.Handlebars"===jg.JavaScriptCompiler.prototype.namespace,lg=jg.AST,mg={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ng={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},og={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},pg=String.fromCharCode(125),qg=pg+pg,rg=qg+pg,sg=jg.VERSION.slice(0,3)>=1.1,tg=jg.VERSION.slice(0,3)>=1.3;if(rc=uc(),null!==rc&&cg===a.length)return rc;throw f(hg),dg=Math.max(cg,gg),new b(hg,dgc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.14/emblem.js b/ajax/libs/emblem/0.3.14/emblem.js new file mode 100644 index 000000000..b951bf637 --- /dev/null +++ b/ajax/libs/emblem/0.3.14/emblem.js @@ -0,0 +1,6305 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^@]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^@]", + peg$c55 = function(s) { return s; }, + peg$c56 = "Key", + peg$c57 = ":", + peg$c58 = "\":\"", + peg$c59 = function(h) { return [h[0], h[2]]; }, + peg$c60 = function(s) { s.isHelper = true; return s; }, + peg$c61 = function(s, p) { return { part: p, separator: s }; }, + peg$c62 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c63 = "PathSeparator", + peg$c64 = /^[\/.]/, + peg$c65 = "[\\/.]", + peg$c66 = function(v) { + var last = v[v.length - 1]; + + // Support for data keywords that are prefixed with @ in the each + // block helper such as @index, @key, @first, @last + if (last.part.charAt(0) === '@') { + last.part = last.part.slice(1); + var idNode = new AST.IdNode(v); + var dataNode = new AST.DataNode(idNode); + return dataNode; + } + + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c67 = function(v) { return new AST.StringNode(v); }, + peg$c68 = function(v) { return new AST.IntegerNode(v); }, + peg$c69 = function(v) { return new AST.BooleanNode(v); }, + peg$c70 = "Boolean", + peg$c71 = "true", + peg$c72 = "\"true\"", + peg$c73 = "false", + peg$c74 = "\"false\"", + peg$c75 = "Integer", + peg$c76 = "-", + peg$c77 = "\"-\"", + peg$c78 = /^[0-9]/, + peg$c79 = "[0-9]", + peg$c80 = function(s) { return parseInt(s); }, + peg$c81 = "\"", + peg$c82 = "\"\\\"\"", + peg$c83 = "'", + peg$c84 = "\"'\"", + peg$c85 = function(p) { return p[1]; }, + peg$c86 = /^[^"}]/, + peg$c87 = "[^\"}]", + peg$c88 = /^[^'}]/, + peg$c89 = "[^'}]", + peg$c90 = /^[A-Za-z]/, + peg$c91 = "[A-Za-z]", + peg$c92 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c93 = /^[|`']/, + peg$c94 = "[|`']", + peg$c95 = "<", + peg$c96 = "\"<\"", + peg$c97 = function() { return '<'; }, + peg$c98 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c99 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c100 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c101 = "{", + peg$c102 = "\"{\"", + peg$c103 = /^[^}]/, + peg$c104 = "[^}]", + peg$c105 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c106 = function(m) { m.escaped = true; return m; }, + peg$c107 = function(m) { m.escaped = false; return m; }, + peg$c108 = function(a) { return new AST.ContentNode(a); }, + peg$c109 = "any character", + peg$c110 = "SingleMustacheOpen", + peg$c111 = "DoubleMustacheOpen", + peg$c112 = "{{", + peg$c113 = "\"{{\"", + peg$c114 = "TripleMustacheOpen", + peg$c115 = "{{{", + peg$c116 = "\"{{{\"", + peg$c117 = "SingleMustacheClose", + peg$c118 = "}", + peg$c119 = "\"}\"", + peg$c120 = "DoubleMustacheClose", + peg$c121 = "}}", + peg$c122 = "\"}}\"", + peg$c123 = "TripleMustacheClose", + peg$c124 = "}}}", + peg$c125 = "\"}}}\"", + peg$c126 = "SubexpressionOpen", + peg$c127 = "(", + peg$c128 = "\"(\"", + peg$c129 = "SubexpressionClose", + peg$c130 = ")", + peg$c131 = "\")\"", + peg$c132 = "InterpolationOpen", + peg$c133 = "#{", + peg$c134 = "\"#{\"", + peg$c135 = "InterpolationClose", + peg$c136 = "==", + peg$c137 = "\"==\"", + peg$c138 = function() { return false; }, + peg$c139 = function() { return true; }, + peg$c140 = function(h, s) { return h || s; }, + peg$c141 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c142 = function(s) { return { shorthand: s, id: true}; }, + peg$c143 = function(s) { return { shorthand: s }; }, + peg$c144 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c145 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c146 = /^[A-Za-z.0-9_\-]/, + peg$c147 = "[A-Za-z.0-9_\\-]", + peg$c148 = function(id) { return createMustacheNode([id], null, true); }, + peg$c149 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c150 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c151 = function(value) { return value.replace(/ *$/, ''); }, + peg$c152 = "!", + peg$c153 = "\"!\"", + peg$c154 = function(key, value) { return IS_EMBER; }, + peg$c155 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c156 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c157 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c158 = "_", + peg$c159 = "\"_\"", + peg$c160 = "%", + peg$c161 = "\"%\"", + peg$c162 = "#", + peg$c163 = "\"#\"", + peg$c164 = function(c) { return c;}, + peg$c165 = "CSSIdentifier", + peg$c166 = /^[_a-zA-Z0-9\-]/, + peg$c167 = "[_a-zA-Z0-9\\-]", + peg$c168 = /^[_a-zA-Z]/, + peg$c169 = "[_a-zA-Z]", + peg$c170 = /^[\x80-\xFF]/, + peg$c171 = "[\\x80-\\xFF]", + peg$c172 = "KnownHTMLTagName", + peg$c173 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c174 = function(t) { return t; }, + peg$c175 = "a JS event", + peg$c176 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c177 = "INDENT", + peg$c178 = "\uEFEF", + peg$c179 = "\"\\uEFEF\"", + peg$c180 = function() { return ''; }, + peg$c181 = "DEDENT", + peg$c182 = "\uEFFE", + peg$c183 = "\"\\uEFFE\"", + peg$c184 = "Unmatched DEDENT", + peg$c185 = "\uEFEE", + peg$c186 = "\"\\uEFEE\"", + peg$c187 = "LineEnd", + peg$c188 = "\r", + peg$c189 = "\"\\r\"", + peg$c190 = "\uEFFF", + peg$c191 = "\"\\uEFFF\"", + peg$c192 = "\n", + peg$c193 = "\"\\n\"", + peg$c194 = "ANYDEDENT", + peg$c195 = "RequiredWhitespace", + peg$c196 = "OptionalWhitespace", + peg$c197 = "InlineWhitespace", + peg$c198 = /^[ \t]/, + peg$c199 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c57; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c61(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c64.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c68(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c71) { + s0 = peg$c71; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s0 = peg$c73; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c76; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c78.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c88.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c90.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c93.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c83; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c101; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c103.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c108(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c101; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c112) { + s0 = peg$c112; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c115) { + s0 = peg$c115; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c124) { + s0 = peg$c124; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c127; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c133) { + s0 = peg$c133; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c118; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c136) { + s1 = peg$c136; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c139(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c140(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c142(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c143(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c146.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c83; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c71) { + s3 = peg$c71; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c73) { + s3 = peg$c73; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c74); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c101; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c118; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c152; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c154(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c155(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c78.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c158; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c76; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c162; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c168.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c170.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c160; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c173(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c166.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c57; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c176(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c174(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c178; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c182; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c180(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c188; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c190; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c192; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c198.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c197); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.14/emblem.min.js b/ajax/libs/emblem/0.3.14/emblem.min.js new file mode 100644 index 000000000..6afa13f95 --- /dev/null +++ b/ajax/libs/emblem/0.3.14/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return _f!==b&&(_f>b&&(_f=0,ag={line:1,column:1,seenCR:!1}),c(ag,_f,b),_f=b),ag}function e(a){bg>Zf||(Zf>bg&&(bg=Zf,cg=[]),cg.push(a))}function f(a){var b=0;for(a.sort();bZf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function mb(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),null===d&&(39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd))),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function nb(){var b,c,d,e;if(b=Zf,c=Zf,d=[],e=ob(),null!==e)for(;null!==e;)d.push(e),e=ob();else d=tc;return null!==d&&(d=a.substring(c,Zf)),c=d,null!==c&&($f=b,c=qe(c)),null===c?(Zf=b,b=c):b=c,b}function ob(){var b,c,d;return b=Zf,c=Zf,dg++,d=pb(),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function pb(){var a;return a=ub(),null===a&&(a=tb(),null===a&&(a=Ab(),null===a&&(a=fc(),null===a&&(a=ec())))),a}function qb(){var a,b,c,d,e,f;return a=Zf,b=sb(),null!==b?(c=hc(),null!==c?(d=gb(),null!==d?(e=hc(),null!==e?(f=vb(),null!==f?($f=a,b=oe(d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc)):(Zf=a,a=tc),a}function rb(){var a;return a=qb(),null===a&&(a=ib(),null===a&&(a=hb())),a}function sb(){var b,c;return dg++,123===a.charCodeAt(Zf)?(b=je,Zf++):(b=null,0===dg&&e(ke)),dg--,null===b&&(c=null,0===dg&&e(se)),b}function tb(){var b,c;return dg++,a.substr(Zf,2)===ue?(b=ue,Zf+=2):(b=null,0===dg&&e(ve)),dg--,null===b&&(c=null,0===dg&&e(te)),b}function ub(){var b,c;return dg++,a.substr(Zf,3)===xe?(b=xe,Zf+=3):(b=null,0===dg&&e(ye)),dg--,null===b&&(c=null,0===dg&&e(we)),b}function vb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(ze)),b}function wb(){var b,c;return dg++,a.substr(Zf,2)===De?(b=De,Zf+=2):(b=null,0===dg&&e(Ee)),dg--,null===b&&(c=null,0===dg&&e(Ce)),b}function xb(){var b,c;return dg++,a.substr(Zf,3)===Ge?(b=Ge,Zf+=3):(b=null,0===dg&&e(He)),dg--,null===b&&(c=null,0===dg&&e(Fe)),b}function yb(){var b,c;return dg++,40===a.charCodeAt(Zf)?(b=Je,Zf++):(b=null,0===dg&&e(Ke)),dg--,null===b&&(c=null,0===dg&&e(Ie)),b}function zb(){var b,c;return dg++,41===a.charCodeAt(Zf)?(b=Me,Zf++):(b=null,0===dg&&e(Ne)),dg--,null===b&&(c=null,0===dg&&e(Le)),b}function Ab(){var b,c;return dg++,a.substr(Zf,2)===Pe?(b=Pe,Zf+=2):(b=null,0===dg&&e(Qe)),dg--,null===b&&(c=null,0===dg&&e(Oe)),b}function Bb(){var b,c;return dg++,125===a.charCodeAt(Zf)?(b=Ae,Zf++):(b=null,0===dg&&e(Be)),dg--,null===b&&(c=null,0===dg&&e(Re)),b}function Cb(){var b,c,d;return b=Zf,a.substr(Zf,2)===Se?(c=Se,Zf+=2):(c=null,0===dg&&e(Te)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Zf,61===a.charCodeAt(Zf)?(c=xc,Zf++):(c=null,0===dg&&e(yc)),null!==c?(32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null===d&&(d=uc),null!==d?($f=b,c=Ve(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)),b}function Db(){var b,c,d,f,g;return b=Zf,c=Xb(),null===c&&(c=uc),null!==c?(d=G(),null===d&&(d=uc),null!==d?(47===a.charCodeAt(Zf)?(f=Mc,Zf++):(f=null,0===dg&&e(Nc)),null===f&&(f=uc),null!==f?($f=Zf,g=We(c,d),g=g?uc:tc,null!==g?(c=[c,d,f,g],b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Eb(){var a,b,c,d,e;if(a=Zf,b=Db(),null!==b){for(c=[],d=rb();null!==d;)c.push(d),d=rb();if(null!==c){for(d=[],e=Fb();null!==e;)d.push(e),e=Fb();null!==d?($f=a,b=Xe(b,c,d),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)}else Zf=a,a=tc}else Zf=a,a=tc;return a}function G(){var a,b,c,d;if(a=Zf,b=[],c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Zf,d=Qb(),null!==d&&($f=c,d=Ye(d)),null===d?(Zf=c,c=d):c=d,null===c&&(c=Zf,d=Rb(),null!==d&&($f=c,d=Ze(d)),null===d?(Zf=c,c=d):c=d);else b=tc;return null!==b&&($f=a,b=$e(b)),null===b?(Zf=a,a=b):a=b,a}function Fb(){var b,c,d;if(b=Zf,c=[],32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Zf)?(d=Rc,Zf++):(d=null,0===dg&&e(Sc));else c=tc;return null!==c?(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Mb(),null===d&&(d=Nb(),null===d&&(d=Ob())))),null!==d?($f=b,c=_e(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Gb(){var b;return af.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(bf)),null===b&&(b=$b()),b}function Hb(){var a,b;return a=Ib(),null===a&&(a=Zf,b=R(),null!==b&&($f=a,b=cf(b)),null===b?(Zf=a,a=b):a=b),a}function Ib(){var b,c,d,f,g;return b=Zf,c=Zf,34===a.charCodeAt(Zf)?(d=Td,Zf++):(d=null,0===dg&&e(Ud)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Zf)?(g=Td,Zf++):(g=null,0===dg&&e(Ud)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc),null===c&&(c=Zf,39===a.charCodeAt(Zf)?(d=Vd,Zf++):(d=null,0===dg&&e(Wd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Zf)?(g=Vd,Zf++):(g=null,0===dg&&e(Wd)),null!==g?(d=[d,f,g],c=d):(Zf=c,c=tc)):(Zf=c,c=tc)):(Zf=c,c=tc)),null!==c&&($f=b,c=Xd(c)),null===c?(Zf=b,b=c):b=c,b}function Jb(){var b,c,d,f;return b=Zf,c=_b(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Hb(),null!==f?($f=b,c=df(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Kb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(a.substr(Zf,4)===Jd?(f=Jd,Zf+=4):(f=null,0===dg&&e(Kd)),null===f&&(a.substr(Zf,5)===Ld?(f=Ld,Zf+=5):(f=null,0===dg&&e(Md))),null!==f?($f=b,c=ef(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Lb(){var b,c,d,f,g,h;if(b=Zf,123===a.charCodeAt(Zf)?(c=je,Zf++):(c=null,0===dg&&e(ke)),null!==c)if(d=hc(),null!==d){if(f=Zf,g=[],h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc))),null!==h)for(;null!==h;)g.push(h),h=Gb(),null===h&&(32===a.charCodeAt(Zf)?(h=Rc,Zf++):(h=null,0===dg&&e(Sc)));else g=tc;null!==g&&(g=a.substring(f,Zf)),f=g,null!==f?(g=hc(),null!==g?(125===a.charCodeAt(Zf)?(h=Ae,Zf++):(h=null,0===dg&&e(Be)),null!==h?($f=b,c=ff(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)}else Zf=b,b=tc;else Zf=b,b=tc;if(null===b){if(b=Zf,c=[],d=Gb(),null!==d)for(;null!==d;)c.push(d),d=Gb();else c=tc;null!==c&&(c=a.substring(b,Zf)),b=c}return b}function Mb(){var b,c,d,f,g,h;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=Lb(),null!==f?(g=Zf,dg++,33===a.charCodeAt(Zf)?(h=gf,Zf++):(h=null,0===dg&&e(hf)),dg--,null===h?g=uc:(Zf=g,g=tc),null!==g?($f=Zf,h=jf(c,f),h=h?uc:tc,null!==h?($f=b,c=kf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Nb(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=R(),null!==f?($f=b,c=lf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Ob(){var b,c,d,f;return b=Zf,c=M(),null!==c?(61===a.charCodeAt(Zf)?(d=xc,Zf++):(d=null,0===dg&&e(yc)),null!==d?(f=cb(),null!==f?($f=b,c=mf(c,f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Pb(){var b,c,d;return b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Qb(){var b,c,d;return b=Zf,35===a.charCodeAt(Zf)?(c=pf,Zf++):(c=null,0===dg&&e(qf)),null!==c?(d=Sb(),null!==d?($f=b,c=rf(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Rb(){var b,c,d;return b=Zf,46===a.charCodeAt(Zf)?(c=pd,Zf++):(c=null,0===dg&&e(qd)),null!==c?(d=Sb(),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function Sb(){var a,b;return dg++,a=Tb(),dg--,null===a&&(b=null,0===dg&&e(sf)),a}function Tb(){var b,c,d;for(b=Zf,c=[],d=Ub();null!==d;)c.push(d),d=Ub();return null!==c&&(c=a.substring(b,Zf)),b=c}function Ub(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=Vb()),b}function Vb(){var b;return vf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(wf)),b}function Wb(){var b,c,d;if(b=Zf,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c}function Xb(){var b,c,d,f;return dg++,b=Zf,37===a.charCodeAt(Zf)?(c=nf,Zf++):(c=null,0===dg&&e(of)),null!==c?(d=hc(),null!==d?(f=Wb(),null!==f?($f=b,c=td(f),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),null===b&&(b=Yb()),dg--,null===b&&(c=null,0===dg&&e(xf)),b}function Yb(){var a,b,c;return a=Zf,b=Wb(),null!==b?($f=Zf,c=yf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function Zb(){var b;return tf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(uf)),null===b&&(b=$b()),b}function $b(){var b,c,d,f;return b=Zf,58===a.charCodeAt(Zf)?(c=vd,Zf++):(c=null,0===dg&&e(wd)),null!==c?(d=Zf,dg++,32===a.charCodeAt(Zf)?(f=Rc,Zf++):(f=null,0===dg&&e(Sc)),dg--,null===f?d=uc:(Zf=d,d=tc),null!==d?($f=b,c=Uc(c),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function _b(){var a,b,c;return dg++,a=Zf,b=Wb(),null!==b?($f=Zf,c=Bf(b),c=c?uc:tc,null!==c?($f=a,b=zf(b),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),dg--,null===a&&(b=null,0===dg&&e(Af)),a}function ac(){var a,b,c;return a=Zf,b=bc(),null!==b?(c=gc(),null!==c?($f=a,b=td(c),null===b?(Zf=a,a=b):a=b):(Zf=a,a=tc)):(Zf=a,a=tc),a}function bc(){var b,c;return dg++,b=Zf,61423===a.charCodeAt(Zf)?(c=Df,Zf++):(c=null,0===dg&&e(Ef)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Cf)),b}function cc(){var b,c;return dg++,b=Zf,61438===a.charCodeAt(Zf)?(c=Hf,Zf++):(c=null,0===dg&&e(If)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Gf)),b}function dc(){var b,c;return dg++,b=Zf,61422===a.charCodeAt(Zf)?(c=Kf,Zf++):(c=null,0===dg&&e(Lf)),null!==c&&($f=b,c=Ff()),null===c?(Zf=b,b=c):b=c,dg--,null===b&&(c=null,0===dg&&e(Jf)),b}function ec(){var b,c,d,f;return dg++,b=Zf,13===a.charCodeAt(Zf)?(c=Nf,Zf++):(c=null,0===dg&&e(Of)),null===c&&(c=uc),null!==c?(61439===a.charCodeAt(Zf)?(d=Pf,Zf++):(d=null,0===dg&&e(Qf)),null!==d?(10===a.charCodeAt(Zf)?(f=Rf,Zf++):(f=null,0===dg&&e(Sf)),null!==f?($f=b,c=Ue(),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc)):(Zf=b,b=tc),dg--,null===b&&(c=null,0===dg&&e(Mf)),b}function fc(){var a,b;return dg++,a=cc(),null===a&&(a=dc()),dg--,null===a&&(b=null,0===dg&&e(Tf)),a}function gc(){var b,c,d;if(dg++,b=Zf,c=[],d=ic(),null!==d)for(;null!==d;)c.push(d),d=ic();else c=tc;return null!==c&&(c=a.substring(b,Zf)),b=c,dg--,null===b&&(c=null,0===dg&&e(Uf)),b}function hc(){var a,b;for(dg++,a=[],b=ic();null!==b;)a.push(b),b=ic();return dg--,null===a&&(b=null,0===dg&&e(Vf)),a}function ic(){var b,c;return dg++,Xf.test(a.charAt(Zf))?(b=a.charAt(Zf),Zf++):(b=null,0===dg&&e(Yf)),dg--,null===b&&(c=null,0===dg&&e(Wf)),b}function jc(){var b,c,d;return b=Zf,c=Zf,dg++,d=bc(),null===d&&(d=cc(),null===d&&(d=ec())),dg--,null===d?c=uc:(Zf=c,c=tc),null!==c?(a.length>Zf?(d=a.charAt(Zf),Zf++):(d=null,0===dg&&e(re)),null!==d?($f=b,c=Uc(d),null===c?(Zf=b,b=c):b=c):(Zf=b,b=tc)):(Zf=b,b=tc),b}function kc(){var b,c,d;for(b=Zf,c=[],d=jc();null!==d;)c.push(d),d=jc();return null!==c&&(c=a.substring(b,Zf)),b=c}function lc(a,b,c){if(ng){var d=c?lg:mg;return new gg.MustacheNode(a,b,d,{left:!1,right:!1})}return new gg.MustacheNode(a,b,!c)}function mc(a,b){return ng?new gg.ProgramNode(a,{left:!1,right:!1},b,null):new gg.ProgramNode(a,b)}function nc(a,b,c){var d=a.hash;if(c){d=d||new gg.HashNode([]);for(var e=0;e1?arguments[1]:{},rc={start:g},sc=g,tc=null,uc="",vc=function(a){return a},wc=function(a,b){return mc(a,b||[])},xc="=",yc='"="',zc="else",Ac='"else"',Bc=function(a){for(var b=[],c=[],d=0;d",Gc='">"',Hc=function(a,b){return[new gg.PartialNode(a,b[0])]},Ic=/^[a-zA-Z0-9_$-\/]/,Jc="[a-zA-Z0-9_$-\\/]",Kc=function(a){return new gg.PartialNameNode(new gg.StringNode(a))},Lc=function(a){return[a]},Mc="/",Nc='"/"',Oc=/^[A-Z]/,Pc="[A-Z]",Qc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?(a.mustache=nc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return fg&&c.match(/[A-Z]/)?nc(a,b):a},Rc=" ",Sc='" "',Tc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new gg.ContentNode(" ")),a=a.concat(b[c])}return a},Uc=function(a){return a},Vc=function(a){return[a]},Wc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Xc=function(a,b){if(!b)return a;var c=a.id;ng&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new gg.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Yc=": ",Zc='": "',$c=function(a){return mc(a,[])},_c=function(a){return a&&a[2]},ad=function(a,b){var c=b.mustache||b;return c.escaped=a,b},bd=function(a,b){if(a){var c=new gg.PartialNameNode(new gg.StringNode(b.id.string));return new gg.PartialNode(c,b.params[0])}var d;d=og?lc(b,null,!0):lc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?nc(d,"unbound"):"?"===e?nc(d,"if"):"^"===e?nc(d,"unless"):d},cd=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new gg.ContentNode(">")),[i,new gg.ContentNode("")])},Ye=function(a){return{shorthand:a,id:!0}},Ze=function(a){return{shorthand:a}},$e=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},_e=function(a){return a.length?[new gg.ContentNode(" ")].concat(a):[]},af=/^[A-Za-z.0-9_\-]/,bf="[A-Za-z.0-9_\\-]",cf=function(a){return lc([a],null,!0)},df=function(a,b){return b.id=new gg.StringNode(b.id.string),[nc(b,"action",[["on",new gg.StringNode(a)]])]},ef=function(a,b){return"true"===b?[new gg.ContentNode(a)]:[]},ff=function(a){return a.replace(/ *$/,"")},gf="!",hf='"!"',jf=function(){return fg},kf=function(a,b){var c=new gg.HashNode([[a,new gg.StringNode(b)]]),d=[new gg.IdNode([{part:"bind-attr"}])],e=lc(d,c);return[e]},lf=function(a,b){var c=lc([b],null,!0);return fg&&"!"===b._emblemSuffixModifier&&(c=nc(c,"unbound")),[new gg.ContentNode(a+'="'),c,new gg.ContentNode('"')]},mf=function(a,b){var c=[new gg.ContentNode(a+'="')].concat(b);return c.concat([new gg.ContentNode('"')])},nf="%",of='"%"',pf="#",qf='"#"',rf=function(a){return a},sf="CSSIdentifier",tf=/^[_a-zA-Z0-9\-]/,uf="[_a-zA-Z0-9\\-]",vf=/^[\x80-\xFF]/,wf="[\\x80-\\xFF]",xf="KnownHTMLTagName",yf=function(a){return!!ig[a]},zf=function(a){return a},Af="a JS event",Bf=function(a){return!!jg[a]},Cf="INDENT",Df="\uefef",Ef='"\\uEFEF"',Ff=function(){return""},Gf="DEDENT",Hf="\ueffe",If='"\\uEFFE"',Jf="Unmatched DEDENT",Kf="\uefee",Lf='"\\uEFEE"',Mf="LineEnd",Nf="\r",Of='"\\r"',Pf="\uefff",Qf='"\\uEFFF"',Rf="\n",Sf='"\\n"',Tf="ANYDEDENT",Uf="RequiredWhitespace",Vf="OptionalWhitespace",Wf="InlineWhitespace",Xf=/^[ \t]/,Yf="[ \\t]",Zf=0,$f=0,_f=0,ag={line:1,column:1,seenCR:!1},bg=0,cg=[],dg=0;if("startRule"in qc){if(!(qc.startRule in rc))throw new Error("Can't start parsing from rule \""+qc.startRule+'".');sc=rc[qc.startRule]}var eg=c.handlebarsVariant,fg="Ember.Handlebars"===eg.JavaScriptCompiler.prototype.namespace,gg=eg.AST,hg={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ig={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},jg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},kg=String.fromCharCode(125),lg=kg+kg,mg=lg+kg,ng=eg.VERSION.slice(0,3)>=1.1,og=eg.VERSION.slice(0,3)>=1.3;if(pc=sc(),null!==pc&&Zf===a.length)return pc;throw f(cg),$f=Math.max(Zf,bg),new b(cg,$fc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.15/emblem.js b/ajax/libs/emblem/0.3.15/emblem.js new file mode 100644 index 000000000..379b25d98 --- /dev/null +++ b/ajax/libs/emblem/0.3.15/emblem.js @@ -0,0 +1,6375 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^@]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^@]", + peg$c55 = function(s) { return s; }, + peg$c56 = "[", + peg$c57 = "\"[\"", + peg$c58 = /^[^\]]/, + peg$c59 = "[^\\]]", + peg$c60 = "]", + peg$c61 = "\"]\"", + peg$c62 = function(segmentLiteral) { return segmentLiteral; }, + peg$c63 = "Key", + peg$c64 = ":", + peg$c65 = "\":\"", + peg$c66 = function(h) { return [h[0], h[2]]; }, + peg$c67 = function(s) { s.isHelper = true; return s; }, + peg$c68 = function(s, p) { return { part: p, separator: s }; }, + peg$c69 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c70 = "PathSeparator", + peg$c71 = /^[\/.]/, + peg$c72 = "[\\/.]", + peg$c73 = function(v) { + var last = v[v.length - 1]; + + // Support for data keywords that are prefixed with @ in the each + // block helper such as @index, @key, @first, @last + if (last.part.charAt(0) === '@') { + last.part = last.part.slice(1); + var idNode = new AST.IdNode(v); + var dataNode = new AST.DataNode(idNode); + return dataNode; + } + + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c74 = function(v) { return new AST.StringNode(v); }, + peg$c75 = function(v) { return new AST.IntegerNode(v); }, + peg$c76 = function(v) { return new AST.BooleanNode(v); }, + peg$c77 = "Boolean", + peg$c78 = "true", + peg$c79 = "\"true\"", + peg$c80 = "false", + peg$c81 = "\"false\"", + peg$c82 = "Integer", + peg$c83 = "-", + peg$c84 = "\"-\"", + peg$c85 = /^[0-9]/, + peg$c86 = "[0-9]", + peg$c87 = function(s) { return parseInt(s); }, + peg$c88 = "\"", + peg$c89 = "\"\\\"\"", + peg$c90 = "'", + peg$c91 = "\"'\"", + peg$c92 = function(p) { return p[1]; }, + peg$c93 = /^[^"}]/, + peg$c94 = "[^\"}]", + peg$c95 = /^[^'}]/, + peg$c96 = "[^'}]", + peg$c97 = /^[A-Za-z]/, + peg$c98 = "[A-Za-z]", + peg$c99 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c100 = /^[|`']/, + peg$c101 = "[|`']", + peg$c102 = "<", + peg$c103 = "\"<\"", + peg$c104 = function() { return '<'; }, + peg$c105 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c106 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c107 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c108 = "{", + peg$c109 = "\"{\"", + peg$c110 = /^[^}]/, + peg$c111 = "[^}]", + peg$c112 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c113 = function(m) { m.escaped = true; return m; }, + peg$c114 = function(m) { m.escaped = false; return m; }, + peg$c115 = function(a) { return new AST.ContentNode(a); }, + peg$c116 = "any character", + peg$c117 = "SingleMustacheOpen", + peg$c118 = "DoubleMustacheOpen", + peg$c119 = "{{", + peg$c120 = "\"{{\"", + peg$c121 = "TripleMustacheOpen", + peg$c122 = "{{{", + peg$c123 = "\"{{{\"", + peg$c124 = "SingleMustacheClose", + peg$c125 = "}", + peg$c126 = "\"}\"", + peg$c127 = "DoubleMustacheClose", + peg$c128 = "}}", + peg$c129 = "\"}}\"", + peg$c130 = "TripleMustacheClose", + peg$c131 = "}}}", + peg$c132 = "\"}}}\"", + peg$c133 = "SubexpressionOpen", + peg$c134 = "(", + peg$c135 = "\"(\"", + peg$c136 = "SubexpressionClose", + peg$c137 = ")", + peg$c138 = "\")\"", + peg$c139 = "InterpolationOpen", + peg$c140 = "#{", + peg$c141 = "\"#{\"", + peg$c142 = "InterpolationClose", + peg$c143 = "==", + peg$c144 = "\"==\"", + peg$c145 = function() { return false; }, + peg$c146 = function() { return true; }, + peg$c147 = function(h, s) { return h || s; }, + peg$c148 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c149 = function(s) { return { shorthand: s, id: true}; }, + peg$c150 = function(s) { return { shorthand: s }; }, + peg$c151 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c152 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c153 = /^[A-Za-z.0-9_\-]/, + peg$c154 = "[A-Za-z.0-9_\\-]", + peg$c155 = function(id) { return createMustacheNode([id], null, true); }, + peg$c156 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c157 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c158 = function(value) { return value.replace(/ *$/, ''); }, + peg$c159 = "!", + peg$c160 = "\"!\"", + peg$c161 = function(key, value) { return IS_EMBER; }, + peg$c162 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c163 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c164 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c165 = "_", + peg$c166 = "\"_\"", + peg$c167 = "%", + peg$c168 = "\"%\"", + peg$c169 = "#", + peg$c170 = "\"#\"", + peg$c171 = function(c) { return c;}, + peg$c172 = "CSSIdentifier", + peg$c173 = /^[_a-zA-Z0-9\-]/, + peg$c174 = "[_a-zA-Z0-9\\-]", + peg$c175 = /^[_a-zA-Z]/, + peg$c176 = "[_a-zA-Z]", + peg$c177 = /^[\x80-\xFF]/, + peg$c178 = "[\\x80-\\xFF]", + peg$c179 = "KnownHTMLTagName", + peg$c180 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c181 = function(t) { return t; }, + peg$c182 = "a JS event", + peg$c183 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c184 = "INDENT", + peg$c185 = "\uEFEF", + peg$c186 = "\"\\uEFEF\"", + peg$c187 = function() { return ''; }, + peg$c188 = "DEDENT", + peg$c189 = "\uEFFE", + peg$c190 = "\"\\uEFFE\"", + peg$c191 = "Unmatched DEDENT", + peg$c192 = "\uEFEE", + peg$c193 = "\"\\uEFEE\"", + peg$c194 = "LineEnd", + peg$c195 = "\r", + peg$c196 = "\"\\r\"", + peg$c197 = "\uEFFF", + peg$c198 = "\"\\uEFFF\"", + peg$c199 = "\n", + peg$c200 = "\"\\n\"", + peg$c201 = "ANYDEDENT", + peg$c202 = "RequiredWhitespace", + peg$c203 = "OptionalWhitespace", + peg$c204 = "InlineWhitespace", + peg$c205 = /^[ \t]/, + peg$c206 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3, s4; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c56; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c58.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c58.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c60; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c64; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c64; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c68(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c68(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c71.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c75(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c76(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c78) { + s0 = peg$c78; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c80) { + s0 = peg$c80; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c85.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c85.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c88; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c90; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c93.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c93.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c97.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c100.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c102; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c88; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c88; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c90; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c90; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c108; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c110.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c110.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c114(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c108; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c125; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c128) { + s0 = peg$c128; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c131) { + s0 = peg$c131; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c134; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c136); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c140) { + s0 = peg$c140; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c125; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c143) { + s1 = peg$c143; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c146(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c147(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c149(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c150(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c149(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c150(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c152(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c155(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c88; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c90; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c78) { + s3 = peg$c78; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c80) { + s3 = peg$c80; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c108; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c125; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c159; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c161(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c162(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c85.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c165; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c83; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c171(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c173.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c175.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c177.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c180(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c181(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c173.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c64; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c183(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c181(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c189; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c190); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c192; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c195; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c197; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c199; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c200); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c201); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c202); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c205.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c206); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c204); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.15/emblem.min.js b/ajax/libs/emblem/0.3.15/emblem.min.js new file mode 100644 index 000000000..cf6245837 --- /dev/null +++ b/ajax/libs/emblem/0.3.15/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return gg!==b&&(gg>b&&(gg=0,hg={line:1,column:1,seenCR:!1}),c(hg,gg,b),gg=b),hg}function e(a){ig>eg||(eg>ig&&(ig=eg,jg=[]),jg.push(a))}function f(a){var b=0;for(a.sort();beg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function mb(){var b,c,d;return b=eg,c=eg,kg++,d=pb(),null===d&&(39===a.charCodeAt(eg)?(d=ae,eg++):(d=null,0===kg&&e(be))),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function nb(){var b,c,d,e;if(b=eg,c=eg,d=[],e=ob(),null!==e)for(;null!==e;)d.push(e),e=ob();else d=tc;return null!==d&&(d=a.substring(c,eg)),c=d,null!==c&&(fg=b,c=xe(c)),null===c?(eg=b,b=c):b=c,b}function ob(){var b,c,d;return b=eg,c=eg,kg++,d=pb(),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function pb(){var a;return a=ub(),null===a&&(a=tb(),null===a&&(a=Ab(),null===a&&(a=fc(),null===a&&(a=ec())))),a}function qb(){var a,b,c,d,e,f;return a=eg,b=sb(),null!==b?(c=hc(),null!==c?(d=gb(),null!==d?(e=hc(),null!==e?(f=vb(),null!==f?(fg=a,b=ve(d),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc),a}function rb(){var a;return a=qb(),null===a&&(a=ib(),null===a&&(a=hb())),a}function sb(){var b,c;return kg++,123===a.charCodeAt(eg)?(b=qe,eg++):(b=null,0===kg&&e(re)),kg--,null===b&&(c=null,0===kg&&e(ze)),b}function tb(){var b,c;return kg++,a.substr(eg,2)===Be?(b=Be,eg+=2):(b=null,0===kg&&e(Ce)),kg--,null===b&&(c=null,0===kg&&e(Ae)),b}function ub(){var b,c;return kg++,a.substr(eg,3)===Ee?(b=Ee,eg+=3):(b=null,0===kg&&e(Fe)),kg--,null===b&&(c=null,0===kg&&e(De)),b}function vb(){var b,c;return kg++,125===a.charCodeAt(eg)?(b=He,eg++):(b=null,0===kg&&e(Ie)),kg--,null===b&&(c=null,0===kg&&e(Ge)),b}function wb(){var b,c;return kg++,a.substr(eg,2)===Ke?(b=Ke,eg+=2):(b=null,0===kg&&e(Le)),kg--,null===b&&(c=null,0===kg&&e(Je)),b}function xb(){var b,c;return kg++,a.substr(eg,3)===Ne?(b=Ne,eg+=3):(b=null,0===kg&&e(Oe)),kg--,null===b&&(c=null,0===kg&&e(Me)),b}function yb(){var b,c;return kg++,40===a.charCodeAt(eg)?(b=Qe,eg++):(b=null,0===kg&&e(Re)),kg--,null===b&&(c=null,0===kg&&e(Pe)),b}function zb(){var b,c;return kg++,41===a.charCodeAt(eg)?(b=Te,eg++):(b=null,0===kg&&e(Ue)),kg--,null===b&&(c=null,0===kg&&e(Se)),b}function Ab(){var b,c;return kg++,a.substr(eg,2)===We?(b=We,eg+=2):(b=null,0===kg&&e(Xe)),kg--,null===b&&(c=null,0===kg&&e(Ve)),b}function Bb(){var b,c;return kg++,125===a.charCodeAt(eg)?(b=He,eg++):(b=null,0===kg&&e(Ie)),kg--,null===b&&(c=null,0===kg&&e(Ye)),b}function Cb(){var b,c,d;return b=eg,a.substr(eg,2)===Ze?(c=Ze,eg+=2):(c=null,0===kg&&e($e)),null!==c?(32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null===d&&(d=uc),null!==d?(fg=b,c=_e(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),null===b&&(b=eg,61===a.charCodeAt(eg)?(c=xc,eg++):(c=null,0===kg&&e(yc)),null!==c?(32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null===d&&(d=uc),null!==d?(fg=b,c=af(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)),b}function Db(){var b,c,d,f,g;return b=eg,c=Xb(),null===c&&(c=uc),null!==c?(d=G(),null===d&&(d=uc),null!==d?(47===a.charCodeAt(eg)?(f=Mc,eg++):(f=null,0===kg&&e(Nc)),null===f&&(f=uc),null!==f?(fg=eg,g=bf(c,d),g=g?uc:tc,null!==g?(c=[c,d,f,g],b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Eb(){var a,b,c,d,e;if(a=eg,b=Db(),null!==b){for(c=[],d=rb();null!==d;)c.push(d),d=rb();if(null!==c){for(d=[],e=Fb();null!==e;)d.push(e),e=Fb();null!==d?(fg=a,b=cf(b,c,d),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)}else eg=a,a=tc}else eg=a,a=tc;return a}function G(){var a,b,c,d;if(a=eg,b=[],c=eg,d=Qb(),null!==d&&(fg=c,d=df(d)),null===d?(eg=c,c=d):c=d,null===c&&(c=eg,d=Rb(),null!==d&&(fg=c,d=ef(d)),null===d?(eg=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=eg,d=Qb(),null!==d&&(fg=c,d=df(d)),null===d?(eg=c,c=d):c=d,null===c&&(c=eg,d=Rb(),null!==d&&(fg=c,d=ef(d)),null===d?(eg=c,c=d):c=d);else b=tc;return null!==b&&(fg=a,b=ff(b)),null===b?(eg=a,a=b):a=b,a}function Fb(){var b,c,d;if(b=eg,c=[],32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc));else c=tc;return null!==c?(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Mb(),null===d&&(d=Nb(),null===d&&(d=Ob())))),null!==d?(fg=b,c=gf(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Gb(){var b;return hf.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(jf)),null===b&&(b=$b()),b}function Hb(){var a,b;return a=Ib(),null===a&&(a=eg,b=R(),null!==b&&(fg=a,b=kf(b)),null===b?(eg=a,a=b):a=b),a}function Ib(){var b,c,d,f,g;return b=eg,c=eg,34===a.charCodeAt(eg)?(d=$d,eg++):(d=null,0===kg&&e(_d)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(eg)?(g=$d,eg++):(g=null,0===kg&&e(_d)),null!==g?(d=[d,f,g],c=d):(eg=c,c=tc)):(eg=c,c=tc)):(eg=c,c=tc),null===c&&(c=eg,39===a.charCodeAt(eg)?(d=ae,eg++):(d=null,0===kg&&e(be)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(eg)?(g=ae,eg++):(g=null,0===kg&&e(be)),null!==g?(d=[d,f,g],c=d):(eg=c,c=tc)):(eg=c,c=tc)):(eg=c,c=tc)),null!==c&&(fg=b,c=ce(c)),null===c?(eg=b,b=c):b=c,b}function Jb(){var b,c,d,f;return b=eg,c=_b(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=Hb(),null!==f?(fg=b,c=lf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Kb(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(a.substr(eg,4)===Qd?(f=Qd,eg+=4):(f=null,0===kg&&e(Rd)),null===f&&(a.substr(eg,5)===Sd?(f=Sd,eg+=5):(f=null,0===kg&&e(Td))),null!==f?(fg=b,c=mf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Lb(){var b,c,d,f,g,h;if(b=eg,123===a.charCodeAt(eg)?(c=qe,eg++):(c=null,0===kg&&e(re)),null!==c)if(d=hc(),null!==d){if(f=eg,g=[],h=Gb(),null===h&&(32===a.charCodeAt(eg)?(h=Rc,eg++):(h=null,0===kg&&e(Sc))),null!==h)for(;null!==h;)g.push(h),h=Gb(),null===h&&(32===a.charCodeAt(eg)?(h=Rc,eg++):(h=null,0===kg&&e(Sc)));else g=tc;null!==g&&(g=a.substring(f,eg)),f=g,null!==f?(g=hc(),null!==g?(125===a.charCodeAt(eg)?(h=He,eg++):(h=null,0===kg&&e(Ie)),null!==h?(fg=b,c=nf(f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)}else eg=b,b=tc;else eg=b,b=tc;if(null===b){if(b=eg,c=[],d=Gb(),null!==d)for(;null!==d;)c.push(d),d=Gb();else c=tc;null!==c&&(c=a.substring(b,eg)),b=c}return b}function Mb(){var b,c,d,f,g,h;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=Lb(),null!==f?(g=eg,kg++,33===a.charCodeAt(eg)?(h=of,eg++):(h=null,0===kg&&e(pf)),kg--,null===h?g=uc:(eg=g,g=tc),null!==g?(fg=eg,h=qf(c,f),h=h?uc:tc,null!==h?(fg=b,c=rf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Nb(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=R(),null!==f?(fg=b,c=sf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Ob(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=cb(),null!==f?(fg=b,c=tf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Pb(){var b,c,d;return b=eg,37===a.charCodeAt(eg)?(c=uf,eg++):(c=null,0===kg&&e(vf)),null!==c?(d=Sb(),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Qb(){var b,c,d;return b=eg,35===a.charCodeAt(eg)?(c=wf,eg++):(c=null,0===kg&&e(xf)),null!==c?(d=Sb(),null!==d?(fg=b,c=yf(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Rb(){var b,c,d;return b=eg,46===a.charCodeAt(eg)?(c=pd,eg++):(c=null,0===kg&&e(qd)),null!==c?(d=Sb(),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Sb(){var a,b;return kg++,a=Tb(),kg--,null===a&&(b=null,0===kg&&e(zf)),a}function Tb(){var b,c,d;for(b=eg,c=[],d=Ub();null!==d;)c.push(d),d=Ub();return null!==c&&(c=a.substring(b,eg)),b=c}function Ub(){var b;return Af.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Bf)),null===b&&(b=Vb()),b}function Vb(){var b;return Cf.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Df)),b}function Wb(){var b,c,d;if(b=eg,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=tc;return null!==c&&(c=a.substring(b,eg)),b=c}function Xb(){var b,c,d,f;return kg++,b=eg,37===a.charCodeAt(eg)?(c=uf,eg++):(c=null,0===kg&&e(vf)),null!==c?(d=hc(),null!==d?(f=Wb(),null!==f?(fg=b,c=td(f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),null===b&&(b=Yb()),kg--,null===b&&(c=null,0===kg&&e(Ef)),b}function Yb(){var a,b,c;return a=eg,b=Wb(),null!==b?(fg=eg,c=Ff(b),c=c?uc:tc,null!==c?(fg=a,b=Gf(b),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),a}function Zb(){var b;return Af.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Bf)),null===b&&(b=$b()),b}function $b(){var b,c,d,f;return b=eg,58===a.charCodeAt(eg)?(c=Cd,eg++):(c=null,0===kg&&e(Dd)),null!==c?(d=eg,kg++,32===a.charCodeAt(eg)?(f=Rc,eg++):(f=null,0===kg&&e(Sc)),kg--,null===f?d=uc:(eg=d,d=tc),null!==d?(fg=b,c=Uc(c),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function _b(){var a,b,c;return kg++,a=eg,b=Wb(),null!==b?(fg=eg,c=If(b),c=c?uc:tc,null!==c?(fg=a,b=Gf(b),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),kg--,null===a&&(b=null,0===kg&&e(Hf)),a}function ac(){var a,b,c;return a=eg,b=bc(),null!==b?(c=gc(),null!==c?(fg=a,b=td(c),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),a}function bc(){var b,c;return kg++,b=eg,61423===a.charCodeAt(eg)?(c=Kf,eg++):(c=null,0===kg&&e(Lf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Jf)),b}function cc(){var b,c;return kg++,b=eg,61438===a.charCodeAt(eg)?(c=Of,eg++):(c=null,0===kg&&e(Pf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Nf)),b}function dc(){var b,c;return kg++,b=eg,61422===a.charCodeAt(eg)?(c=Rf,eg++):(c=null,0===kg&&e(Sf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Qf)),b}function ec(){var b,c,d,f;return kg++,b=eg,13===a.charCodeAt(eg)?(c=Uf,eg++):(c=null,0===kg&&e(Vf)),null===c&&(c=uc),null!==c?(61439===a.charCodeAt(eg)?(d=Wf,eg++):(d=null,0===kg&&e(Xf)),null!==d?(10===a.charCodeAt(eg)?(f=Yf,eg++):(f=null,0===kg&&e(Zf)),null!==f?(fg=b,c=_e(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),kg--,null===b&&(c=null,0===kg&&e(Tf)),b}function fc(){var a,b;return kg++,a=cc(),null===a&&(a=dc()),kg--,null===a&&(b=null,0===kg&&e($f)),a}function gc(){var b,c,d;if(kg++,b=eg,c=[],d=ic(),null!==d)for(;null!==d;)c.push(d),d=ic();else c=tc;return null!==c&&(c=a.substring(b,eg)),b=c,kg--,null===b&&(c=null,0===kg&&e(_f)),b}function hc(){var a,b;for(kg++,a=[],b=ic();null!==b;)a.push(b),b=ic();return kg--,null===a&&(b=null,0===kg&&e(ag)),a}function ic(){var b,c;return kg++,cg.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(dg)),kg--,null===b&&(c=null,0===kg&&e(bg)),b}function jc(){var b,c,d;return b=eg,c=eg,kg++,d=bc(),null===d&&(d=cc(),null===d&&(d=ec())),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function kc(){var b,c,d;for(b=eg,c=[],d=jc();null!==d;)c.push(d),d=jc(); +return null!==c&&(c=a.substring(b,eg)),b=c}function lc(a,b,c){if(ug){var d=c?sg:tg;return new ng.MustacheNode(a,b,d,{left:!1,right:!1})}return new ng.MustacheNode(a,b,!c)}function mc(a,b){return ug?new ng.ProgramNode(a,{left:!1,right:!1},b,null):new ng.ProgramNode(a,b)}function nc(a,b,c){var d=a.hash;if(c){d=d||new ng.HashNode([]);for(var e=0;e1?arguments[1]:{},rc={start:g},sc=g,tc=null,uc="",vc=function(a){return a},wc=function(a,b){return mc(a,b||[])},xc="=",yc='"="',zc="else",Ac='"else"',Bc=function(a){for(var b=[],c=[],d=0;d",Gc='">"',Hc=function(a,b){return[new ng.PartialNode(a,b[0])]},Ic=/^[a-zA-Z0-9_$-\/]/,Jc="[a-zA-Z0-9_$-\\/]",Kc=function(a){return new ng.PartialNameNode(new ng.StringNode(a))},Lc=function(a){return[a]},Mc="/",Nc='"/"',Oc=/^[A-Z]/,Pc="[A-Z]",Qc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return mg&&c.match(/[A-Z]/)?(a.mustache=nc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return mg&&c.match(/[A-Z]/)?nc(a,b):a},Rc=" ",Sc='" "',Tc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new ng.ContentNode(" ")),a=a.concat(b[c])}return a},Uc=function(a){return a},Vc=function(a){return[a]},Wc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Xc=function(a,b){if(!b)return a;var c=a.id;ug&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new ng.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Yc=": ",Zc='": "',$c=function(a){return mc(a,[])},_c=function(a){return a&&a[2]},ad=function(a,b){var c=b.mustache||b;return c.escaped=a,b},bd=function(a,b){if(a){var c=new ng.PartialNameNode(new ng.StringNode(b.id.string));return new ng.PartialNode(c,b.params[0])}var d;d=vg?lc(b,null,!0):lc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?nc(d,"unbound"):"?"===e?nc(d,"if"):"^"===e?nc(d,"unless"):d},cd=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new ng.ContentNode(">")),[i,new ng.ContentNode("")])},df=function(a){return{shorthand:a,id:!0}},ef=function(a){return{shorthand:a}},ff=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},gf=function(a){return a.length?[new ng.ContentNode(" ")].concat(a):[]},hf=/^[A-Za-z.0-9_\-]/,jf="[A-Za-z.0-9_\\-]",kf=function(a){return lc([a],null,!0)},lf=function(a,b){return b.id=new ng.StringNode(b.id.string),[nc(b,"action",[["on",new ng.StringNode(a)]])]},mf=function(a,b){return"true"===b?[new ng.ContentNode(a)]:[]},nf=function(a){return a.replace(/ *$/,"")},of="!",pf='"!"',qf=function(){return mg},rf=function(a,b){var c=new ng.HashNode([[a,new ng.StringNode(b)]]),d=[new ng.IdNode([{part:"bind-attr"}])],e=lc(d,c);return[e]},sf=function(a,b){var c=lc([b],null,!0);return mg&&"!"===b._emblemSuffixModifier&&(c=nc(c,"unbound")),[new ng.ContentNode(a+'="'),c,new ng.ContentNode('"')]},tf=function(a,b){var c=[new ng.ContentNode(a+'="')].concat(b);return c.concat([new ng.ContentNode('"')])},uf="%",vf='"%"',wf="#",xf='"#"',yf=function(a){return a},zf="CSSIdentifier",Af=/^[_a-zA-Z0-9\-]/,Bf="[_a-zA-Z0-9\\-]",Cf=/^[\x80-\xFF]/,Df="[\\x80-\\xFF]",Ef="KnownHTMLTagName",Ff=function(a){return!!pg[a]},Gf=function(a){return a},Hf="a JS event",If=function(a){return!!qg[a]},Jf="INDENT",Kf="\uefef",Lf='"\\uEFEF"',Mf=function(){return""},Nf="DEDENT",Of="\ueffe",Pf='"\\uEFFE"',Qf="Unmatched DEDENT",Rf="\uefee",Sf='"\\uEFEE"',Tf="LineEnd",Uf="\r",Vf='"\\r"',Wf="\uefff",Xf='"\\uEFFF"',Yf="\n",Zf='"\\n"',$f="ANYDEDENT",_f="RequiredWhitespace",ag="OptionalWhitespace",bg="InlineWhitespace",cg=/^[ \t]/,dg="[ \\t]",eg=0,fg=0,gg=0,hg={line:1,column:1,seenCR:!1},ig=0,jg=[],kg=0;if("startRule"in qc){if(!(qc.startRule in rc))throw new Error("Can't start parsing from rule \""+qc.startRule+'".');sc=rc[qc.startRule]}var lg=c.handlebarsVariant,mg="Ember.Handlebars"===lg.JavaScriptCompiler.prototype.namespace,ng=lg.AST,og={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},pg={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},qg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},rg=String.fromCharCode(125),sg=rg+rg,tg=sg+rg,ug=lg.VERSION.slice(0,3)>=1.1,vg=lg.VERSION.slice(0,3)>=1.3;if(pc=sc(),null!==pc&&eg===a.length)return pc;throw f(jg),fg=Math.max(eg,ig),new b(jg,fgc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.16/emblem.js b/ajax/libs/emblem/0.3.16/emblem.js new file mode 100644 index 000000000..1844fab99 --- /dev/null +++ b/ajax/libs/emblem/0.3.16/emblem.js @@ -0,0 +1,6379 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode; + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(path, params, hash) { + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + }, + peg$c39 = function(t) { return ['tagName', t]; }, + peg$c40 = function(i) { return ['elementId', i]; }, + peg$c41 = function(c) { return ['class', c]; }, + peg$c42 = function(a) { + return a; + }, + peg$c43 = function(id, classes) { return [id, classes]; }, + peg$c44 = function(classes) { return [null, classes]; }, + peg$c45 = function(p) { return p; }, + peg$c46 = function(a) { return a; }, + peg$c47 = function(h) { return new AST.HashNode(h); }, + peg$c48 = "PathIdent", + peg$c49 = "..", + peg$c50 = "\"..\"", + peg$c51 = ".", + peg$c52 = "\".\"", + peg$c53 = /^[a-zA-Z0-9_$\-!?\^@]/, + peg$c54 = "[a-zA-Z0-9_$\\-!?\\^@]", + peg$c55 = function(s) { return s; }, + peg$c56 = "[", + peg$c57 = "\"[\"", + peg$c58 = /^[^\]]/, + peg$c59 = "[^\\]]", + peg$c60 = "]", + peg$c61 = "\"]\"", + peg$c62 = function(segmentLiteral) { return segmentLiteral; }, + peg$c63 = "Key", + peg$c64 = ":", + peg$c65 = "\":\"", + peg$c66 = function(h) { return [h[0], h[2]]; }, + peg$c67 = function(s) { s.isHelper = true; return s; }, + peg$c68 = function(s, p) { return { part: p, separator: s }; }, + peg$c69 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c70 = "PathSeparator", + peg$c71 = /^[\/.]/, + peg$c72 = "[\\/.]", + peg$c73 = function(v) { + var last = v[v.length - 1]; + + // Support for data keywords that are prefixed with @ in the each + // block helper such as @index, @key, @first, @last + if (last.part.charAt(0) === '@') { + last.part = last.part.slice(1); + var idNode = new AST.IdNode(v); + var dataNode = new AST.DataNode(idNode); + return dataNode; + } + + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c74 = function(v) { return new AST.StringNode(v); }, + peg$c75 = function(v) { return new AST.IntegerNode(v); }, + peg$c76 = function(v) { return new AST.BooleanNode(v); }, + peg$c77 = "Boolean", + peg$c78 = "true", + peg$c79 = "\"true\"", + peg$c80 = "false", + peg$c81 = "\"false\"", + peg$c82 = "Integer", + peg$c83 = "-", + peg$c84 = "\"-\"", + peg$c85 = /^[0-9]/, + peg$c86 = "[0-9]", + peg$c87 = function(s) { return parseInt(s); }, + peg$c88 = "\"", + peg$c89 = "\"\\\"\"", + peg$c90 = "'", + peg$c91 = "\"'\"", + peg$c92 = function(p) { return p[1]; }, + peg$c93 = /^[^"}]/, + peg$c94 = "[^\"}]", + peg$c95 = /^[^'}]/, + peg$c96 = "[^'}]", + peg$c97 = /^[A-Za-z]/, + peg$c98 = "[A-Za-z]", + peg$c99 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c100 = /^[|`']/, + peg$c101 = "[|`']", + peg$c102 = "<", + peg$c103 = "\"<\"", + peg$c104 = function() { return '<'; }, + peg$c105 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c106 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c107 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c108 = "{", + peg$c109 = "\"{\"", + peg$c110 = /^[^}]/, + peg$c111 = "[^}]", + peg$c112 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c113 = function(m) { m.escaped = true; return m; }, + peg$c114 = function(m) { m.escaped = false; return m; }, + peg$c115 = function(a) { return new AST.ContentNode(a); }, + peg$c116 = "any character", + peg$c117 = "SingleMustacheOpen", + peg$c118 = "DoubleMustacheOpen", + peg$c119 = "{{", + peg$c120 = "\"{{\"", + peg$c121 = "TripleMustacheOpen", + peg$c122 = "{{{", + peg$c123 = "\"{{{\"", + peg$c124 = "SingleMustacheClose", + peg$c125 = "}", + peg$c126 = "\"}\"", + peg$c127 = "DoubleMustacheClose", + peg$c128 = "}}", + peg$c129 = "\"}}\"", + peg$c130 = "TripleMustacheClose", + peg$c131 = "}}}", + peg$c132 = "\"}}}\"", + peg$c133 = "SubexpressionOpen", + peg$c134 = "(", + peg$c135 = "\"(\"", + peg$c136 = "SubexpressionClose", + peg$c137 = ")", + peg$c138 = "\")\"", + peg$c139 = "InterpolationOpen", + peg$c140 = "#{", + peg$c141 = "\"#{\"", + peg$c142 = "InterpolationClose", + peg$c143 = "==", + peg$c144 = "\"==\"", + peg$c145 = function() { return false; }, + peg$c146 = function() { return true; }, + peg$c147 = function(h, s) { return h || s; }, + peg$c148 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c149 = function(s) { return { shorthand: s, id: true}; }, + peg$c150 = function(s) { return { shorthand: s }; }, + peg$c151 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c152 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c153 = /^[A-Za-z.0-9_\-]/, + peg$c154 = "[A-Za-z.0-9_\\-]", + peg$c155 = function(id) { return createMustacheNode([id], null, true); }, + peg$c156 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c157 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c158 = function(value) { return value.replace(/ *$/, ''); }, + peg$c159 = "!", + peg$c160 = "\"!\"", + peg$c161 = function(key, value) { return IS_EMBER; }, + peg$c162 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c163 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c164 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c165 = "_", + peg$c166 = "\"_\"", + peg$c167 = "%", + peg$c168 = "\"%\"", + peg$c169 = "#", + peg$c170 = "\"#\"", + peg$c171 = function(c) { return c;}, + peg$c172 = "CSSIdentifier", + peg$c173 = /^[_a-zA-Z0-9\-]/, + peg$c174 = "[_a-zA-Z0-9\\-]", + peg$c175 = /^[_a-zA-Z]/, + peg$c176 = "[_a-zA-Z]", + peg$c177 = /^[\x80-\xFF]/, + peg$c178 = "[\\x80-\\xFF]", + peg$c179 = "KnownHTMLTagName", + peg$c180 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c181 = function(t) { return t; }, + peg$c182 = "a JS event", + peg$c183 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c184 = "INDENT", + peg$c185 = "\uEFEF", + peg$c186 = "\"\\uEFEF\"", + peg$c187 = function() { return ''; }, + peg$c188 = "DEDENT", + peg$c189 = "\uEFFE", + peg$c190 = "\"\\uEFFE\"", + peg$c191 = "Unmatched DEDENT", + peg$c192 = "\uEFEE", + peg$c193 = "\"\\uEFEE\"", + peg$c194 = "LineEnd", + peg$c195 = "\r", + peg$c196 = "\"\\r\"", + peg$c197 = "\uEFFF", + peg$c198 = "\"\\uEFFF\"", + peg$c199 = "\n", + peg$c200 = "\"\\n\"", + peg$c201 = "ANYDEDENT", + peg$c202 = "RequiredWhitespace", + peg$c203 = "OptionalWhitespace", + peg$c204 = "InlineWhitespace", + peg$c205 = /^[ \t]/, + peg$c206 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsesexpr(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinMustacheParam(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinMustacheParam(); + } + if (s2 !== null) { + s3 = peg$parsehash(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c41(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c45(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c47(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3, s4; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c49) { + s0 = peg$c49; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c51; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c53.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c56; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c58.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c58.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c60; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c64; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c64; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c68(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c68(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c69(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c71.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c75(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c76(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c78) { + s0 = peg$c78; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c80) { + s0 = peg$c80; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c83; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c85.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c85.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c88; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c90; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c93.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c93.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c95.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c97.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c100.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c102; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c88; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c88; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c90; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c90; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c107(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c108; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c110.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c110.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c114(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c115(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c108; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c125; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c128) { + s0 = peg$c128; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c131) { + s0 = peg$c131; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c130); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c134; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c137; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c136); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c140) { + s0 = peg$c140; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c125; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c142); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c143) { + s1 = peg$c143; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c146(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c147(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c149(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c150(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c149(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c150(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c152(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c153.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c155(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c88; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c88; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c90; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c90; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c78) { + s3 = peg$c78; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c79); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c80) { + s3 = peg$c80; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c108; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c125; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c158(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c159; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c161(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c162(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c164(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c85.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c165; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c83; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c169; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c171(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c51; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c173.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c175.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c177.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c180(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c181(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c173.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c64; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c183(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c181(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c185; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c189; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c190); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c192; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c187(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c195; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c197; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c199; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c200); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c145(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c194); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c201); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c202); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c205.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c206); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c204); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.16/emblem.min.js b/ajax/libs/emblem/0.3.16/emblem.min.js new file mode 100644 index 000000000..5cad9439c --- /dev/null +++ b/ajax/libs/emblem/0.3.16/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return gg!==b&&(gg>b&&(gg=0,hg={line:1,column:1,seenCR:!1}),c(hg,gg,b),gg=b),hg}function e(a){ig>eg||(eg>ig&&(ig=eg,jg=[]),jg.push(a))}function f(a){var b=0;for(a.sort();beg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function mb(){var b,c,d;return b=eg,c=eg,kg++,d=pb(),null===d&&(39===a.charCodeAt(eg)?(d=ae,eg++):(d=null,0===kg&&e(be))),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function nb(){var b,c,d,e;if(b=eg,c=eg,d=[],e=ob(),null!==e)for(;null!==e;)d.push(e),e=ob();else d=tc;return null!==d&&(d=a.substring(c,eg)),c=d,null!==c&&(fg=b,c=xe(c)),null===c?(eg=b,b=c):b=c,b}function ob(){var b,c,d;return b=eg,c=eg,kg++,d=pb(),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function pb(){var a;return a=ub(),null===a&&(a=tb(),null===a&&(a=Ab(),null===a&&(a=fc(),null===a&&(a=ec())))),a}function qb(){var a,b,c,d,e,f;return a=eg,b=sb(),null!==b?(c=hc(),null!==c?(d=gb(),null!==d?(e=hc(),null!==e?(f=vb(),null!==f?(fg=a,b=ve(d),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc)):(eg=a,a=tc),a}function rb(){var a;return a=qb(),null===a&&(a=ib(),null===a&&(a=hb())),a}function sb(){var b,c;return kg++,123===a.charCodeAt(eg)?(b=qe,eg++):(b=null,0===kg&&e(re)),kg--,null===b&&(c=null,0===kg&&e(ze)),b}function tb(){var b,c;return kg++,a.substr(eg,2)===Be?(b=Be,eg+=2):(b=null,0===kg&&e(Ce)),kg--,null===b&&(c=null,0===kg&&e(Ae)),b}function ub(){var b,c;return kg++,a.substr(eg,3)===Ee?(b=Ee,eg+=3):(b=null,0===kg&&e(Fe)),kg--,null===b&&(c=null,0===kg&&e(De)),b}function vb(){var b,c;return kg++,125===a.charCodeAt(eg)?(b=He,eg++):(b=null,0===kg&&e(Ie)),kg--,null===b&&(c=null,0===kg&&e(Ge)),b}function wb(){var b,c;return kg++,a.substr(eg,2)===Ke?(b=Ke,eg+=2):(b=null,0===kg&&e(Le)),kg--,null===b&&(c=null,0===kg&&e(Je)),b}function xb(){var b,c;return kg++,a.substr(eg,3)===Ne?(b=Ne,eg+=3):(b=null,0===kg&&e(Oe)),kg--,null===b&&(c=null,0===kg&&e(Me)),b}function yb(){var b,c;return kg++,40===a.charCodeAt(eg)?(b=Qe,eg++):(b=null,0===kg&&e(Re)),kg--,null===b&&(c=null,0===kg&&e(Pe)),b}function zb(){var b,c;return kg++,41===a.charCodeAt(eg)?(b=Te,eg++):(b=null,0===kg&&e(Ue)),kg--,null===b&&(c=null,0===kg&&e(Se)),b}function Ab(){var b,c;return kg++,a.substr(eg,2)===We?(b=We,eg+=2):(b=null,0===kg&&e(Xe)),kg--,null===b&&(c=null,0===kg&&e(Ve)),b}function Bb(){var b,c;return kg++,125===a.charCodeAt(eg)?(b=He,eg++):(b=null,0===kg&&e(Ie)),kg--,null===b&&(c=null,0===kg&&e(Ye)),b}function Cb(){var b,c,d;return b=eg,a.substr(eg,2)===Ze?(c=Ze,eg+=2):(c=null,0===kg&&e($e)),null!==c?(32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null===d&&(d=uc),null!==d?(fg=b,c=_e(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),null===b&&(b=eg,61===a.charCodeAt(eg)?(c=xc,eg++):(c=null,0===kg&&e(yc)),null!==c?(32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null===d&&(d=uc),null!==d?(fg=b,c=af(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)),b}function Db(){var b,c,d,f,g;return b=eg,c=Xb(),null===c&&(c=uc),null!==c?(d=G(),null===d&&(d=uc),null!==d?(47===a.charCodeAt(eg)?(f=Mc,eg++):(f=null,0===kg&&e(Nc)),null===f&&(f=uc),null!==f?(fg=eg,g=bf(c,d),g=g?uc:tc,null!==g?(c=[c,d,f,g],b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Eb(){var a,b,c,d,e;if(a=eg,b=Db(),null!==b){for(c=[],d=rb();null!==d;)c.push(d),d=rb();if(null!==c){for(d=[],e=Fb();null!==e;)d.push(e),e=Fb();null!==d?(fg=a,b=cf(b,c,d),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)}else eg=a,a=tc}else eg=a,a=tc;return a}function G(){var a,b,c,d;if(a=eg,b=[],c=eg,d=Qb(),null!==d&&(fg=c,d=df(d)),null===d?(eg=c,c=d):c=d,null===c&&(c=eg,d=Rb(),null!==d&&(fg=c,d=ef(d)),null===d?(eg=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=eg,d=Qb(),null!==d&&(fg=c,d=df(d)),null===d?(eg=c,c=d):c=d,null===c&&(c=eg,d=Rb(),null!==d&&(fg=c,d=ef(d)),null===d?(eg=c,c=d):c=d);else b=tc;return null!==b&&(fg=a,b=ff(b)),null===b?(eg=a,a=b):a=b,a}function Fb(){var b,c,d;if(b=eg,c=[],32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(eg)?(d=Rc,eg++):(d=null,0===kg&&e(Sc));else c=tc;return null!==c?(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Mb(),null===d&&(d=Nb(),null===d&&(d=Ob())))),null!==d?(fg=b,c=gf(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Gb(){var b;return hf.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(jf)),null===b&&(b=$b()),b}function Hb(){var a,b;return a=Ib(),null===a&&(a=eg,b=R(),null!==b&&(fg=a,b=kf(b)),null===b?(eg=a,a=b):a=b),a}function Ib(){var b,c,d,f,g;return b=eg,c=eg,34===a.charCodeAt(eg)?(d=$d,eg++):(d=null,0===kg&&e(_d)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(eg)?(g=$d,eg++):(g=null,0===kg&&e(_d)),null!==g?(d=[d,f,g],c=d):(eg=c,c=tc)):(eg=c,c=tc)):(eg=c,c=tc),null===c&&(c=eg,39===a.charCodeAt(eg)?(d=ae,eg++):(d=null,0===kg&&e(be)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(eg)?(g=ae,eg++):(g=null,0===kg&&e(be)),null!==g?(d=[d,f,g],c=d):(eg=c,c=tc)):(eg=c,c=tc)):(eg=c,c=tc)),null!==c&&(fg=b,c=ce(c)),null===c?(eg=b,b=c):b=c,b}function Jb(){var b,c,d,f;return b=eg,c=_b(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=Hb(),null!==f?(fg=b,c=lf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Kb(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(a.substr(eg,4)===Qd?(f=Qd,eg+=4):(f=null,0===kg&&e(Rd)),null===f&&(a.substr(eg,5)===Sd?(f=Sd,eg+=5):(f=null,0===kg&&e(Td))),null!==f?(fg=b,c=mf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Lb(){var b,c,d,f,g,h;if(b=eg,123===a.charCodeAt(eg)?(c=qe,eg++):(c=null,0===kg&&e(re)),null!==c)if(d=hc(),null!==d){if(f=eg,g=[],h=Gb(),null===h&&(32===a.charCodeAt(eg)?(h=Rc,eg++):(h=null,0===kg&&e(Sc))),null!==h)for(;null!==h;)g.push(h),h=Gb(),null===h&&(32===a.charCodeAt(eg)?(h=Rc,eg++):(h=null,0===kg&&e(Sc)));else g=tc;null!==g&&(g=a.substring(f,eg)),f=g,null!==f?(g=hc(),null!==g?(125===a.charCodeAt(eg)?(h=He,eg++):(h=null,0===kg&&e(Ie)),null!==h?(fg=b,c=nf(f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)}else eg=b,b=tc;else eg=b,b=tc;if(null===b){if(b=eg,c=[],d=Gb(),null!==d)for(;null!==d;)c.push(d),d=Gb();else c=tc;null!==c&&(c=a.substring(b,eg)),b=c}return b}function Mb(){var b,c,d,f,g,h;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=Lb(),null!==f?(g=eg,kg++,33===a.charCodeAt(eg)?(h=of,eg++):(h=null,0===kg&&e(pf)),kg--,null===h?g=uc:(eg=g,g=tc),null!==g?(fg=eg,h=qf(c,f),h=h?uc:tc,null!==h?(fg=b,c=rf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Nb(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=R(),null!==f?(fg=b,c=sf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Ob(){var b,c,d,f;return b=eg,c=M(),null!==c?(61===a.charCodeAt(eg)?(d=xc,eg++):(d=null,0===kg&&e(yc)),null!==d?(f=cb(),null!==f?(fg=b,c=tf(c,f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),b}function Pb(){var b,c,d;return b=eg,37===a.charCodeAt(eg)?(c=uf,eg++):(c=null,0===kg&&e(vf)),null!==c?(d=Sb(),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Qb(){var b,c,d;return b=eg,35===a.charCodeAt(eg)?(c=wf,eg++):(c=null,0===kg&&e(xf)),null!==c?(d=Sb(),null!==d?(fg=b,c=yf(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Rb(){var b,c,d;return b=eg,46===a.charCodeAt(eg)?(c=pd,eg++):(c=null,0===kg&&e(qd)),null!==c?(d=Sb(),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function Sb(){var a,b;return kg++,a=Tb(),kg--,null===a&&(b=null,0===kg&&e(zf)),a}function Tb(){var b,c,d;if(b=eg,c=[],d=Ub(),null!==d)for(;null!==d;)c.push(d),d=Ub();else c=tc;return null!==c&&(c=a.substring(b,eg)),b=c}function Ub(){var b;return Af.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Bf)),null===b&&(b=Vb()),b}function Vb(){var b;return Cf.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Df)),b}function Wb(){var b,c,d;if(b=eg,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=tc;return null!==c&&(c=a.substring(b,eg)),b=c}function Xb(){var b,c,d,f;return kg++,b=eg,37===a.charCodeAt(eg)?(c=uf,eg++):(c=null,0===kg&&e(vf)),null!==c?(d=hc(),null!==d?(f=Wb(),null!==f?(fg=b,c=td(f),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),null===b&&(b=Yb()),kg--,null===b&&(c=null,0===kg&&e(Ef)),b}function Yb(){var a,b,c;return a=eg,b=Wb(),null!==b?(fg=eg,c=Ff(b),c=c?uc:tc,null!==c?(fg=a,b=Gf(b),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),a}function Zb(){var b;return Af.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(Bf)),null===b&&(b=$b()),b}function $b(){var b,c,d,f;return b=eg,58===a.charCodeAt(eg)?(c=Cd,eg++):(c=null,0===kg&&e(Dd)),null!==c?(d=eg,kg++,32===a.charCodeAt(eg)?(f=Rc,eg++):(f=null,0===kg&&e(Sc)),kg--,null===f?d=uc:(eg=d,d=tc),null!==d?(fg=b,c=Uc(c),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function _b(){var a,b,c;return kg++,a=eg,b=Wb(),null!==b?(fg=eg,c=If(b),c=c?uc:tc,null!==c?(fg=a,b=Gf(b),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),kg--,null===a&&(b=null,0===kg&&e(Hf)),a}function ac(){var a,b,c;return a=eg,b=bc(),null!==b?(c=gc(),null!==c?(fg=a,b=td(c),null===b?(eg=a,a=b):a=b):(eg=a,a=tc)):(eg=a,a=tc),a}function bc(){var b,c;return kg++,b=eg,61423===a.charCodeAt(eg)?(c=Kf,eg++):(c=null,0===kg&&e(Lf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Jf)),b}function cc(){var b,c;return kg++,b=eg,61438===a.charCodeAt(eg)?(c=Of,eg++):(c=null,0===kg&&e(Pf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Nf)),b}function dc(){var b,c;return kg++,b=eg,61422===a.charCodeAt(eg)?(c=Rf,eg++):(c=null,0===kg&&e(Sf)),null!==c&&(fg=b,c=Mf()),null===c?(eg=b,b=c):b=c,kg--,null===b&&(c=null,0===kg&&e(Qf)),b}function ec(){var b,c,d,f;return kg++,b=eg,13===a.charCodeAt(eg)?(c=Uf,eg++):(c=null,0===kg&&e(Vf)),null===c&&(c=uc),null!==c?(61439===a.charCodeAt(eg)?(d=Wf,eg++):(d=null,0===kg&&e(Xf)),null!==d?(10===a.charCodeAt(eg)?(f=Yf,eg++):(f=null,0===kg&&e(Zf)),null!==f?(fg=b,c=_e(),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc)):(eg=b,b=tc),kg--,null===b&&(c=null,0===kg&&e(Tf)),b}function fc(){var a,b;return kg++,a=cc(),null===a&&(a=dc()),kg--,null===a&&(b=null,0===kg&&e($f)),a}function gc(){var b,c,d;if(kg++,b=eg,c=[],d=ic(),null!==d)for(;null!==d;)c.push(d),d=ic();else c=tc;return null!==c&&(c=a.substring(b,eg)),b=c,kg--,null===b&&(c=null,0===kg&&e(_f)),b}function hc(){var a,b;for(kg++,a=[],b=ic();null!==b;)a.push(b),b=ic();return kg--,null===a&&(b=null,0===kg&&e(ag)),a}function ic(){var b,c;return kg++,cg.test(a.charAt(eg))?(b=a.charAt(eg),eg++):(b=null,0===kg&&e(dg)),kg--,null===b&&(c=null,0===kg&&e(bg)),b}function jc(){var b,c,d;return b=eg,c=eg,kg++,d=bc(),null===d&&(d=cc(),null===d&&(d=ec())),kg--,null===d?c=uc:(eg=c,c=tc),null!==c?(a.length>eg?(d=a.charAt(eg),eg++):(d=null,0===kg&&e(ye)),null!==d?(fg=b,c=Uc(d),null===c?(eg=b,b=c):b=c):(eg=b,b=tc)):(eg=b,b=tc),b}function kc(){var b,c,d;for(b=eg,c=[],d=jc();null!==d;)c.push(d),d=jc(); +return null!==c&&(c=a.substring(b,eg)),b=c}function lc(a,b,c){if(ug){var d=c?sg:tg;return new ng.MustacheNode(a,b,d,{left:!1,right:!1})}return new ng.MustacheNode(a,b,!c)}function mc(a,b){return ug?new ng.ProgramNode(a,{left:!1,right:!1},b,null):new ng.ProgramNode(a,b)}function nc(a,b,c){var d=a.hash;if(c){d=d||new ng.HashNode([]);for(var e=0;e1?arguments[1]:{},rc={start:g},sc=g,tc=null,uc="",vc=function(a){return a},wc=function(a,b){return mc(a,b||[])},xc="=",yc='"="',zc="else",Ac='"else"',Bc=function(a){for(var b=[],c=[],d=0;d",Gc='">"',Hc=function(a,b){return[new ng.PartialNode(a,b[0])]},Ic=/^[a-zA-Z0-9_$-\/]/,Jc="[a-zA-Z0-9_$-\\/]",Kc=function(a){return new ng.PartialNameNode(new ng.StringNode(a))},Lc=function(a){return[a]},Mc="/",Nc='"/"',Oc=/^[A-Z]/,Pc="[A-Z]",Qc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return mg&&c.match(/[A-Z]/)?(a.mustache=nc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return mg&&c.match(/[A-Z]/)?nc(a,b):a},Rc=" ",Sc='" "',Tc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new ng.ContentNode(" ")),a=a.concat(b[c])}return a},Uc=function(a){return a},Vc=function(a){return[a]},Wc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Xc=function(a,b){if(!b)return a;var c=a.id;ug&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new ng.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Yc=": ",Zc='": "',$c=function(a){return mc(a,[])},_c=function(a){return a&&a[2]},ad=function(a,b){var c=b.mustache||b;return c.escaped=a,b},bd=function(a,b){if(a){var c=new ng.PartialNameNode(new ng.StringNode(b.id.string));return new ng.PartialNode(c,b.params[0])}var d;d=vg?lc(b,null,!0):lc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?nc(d,"unbound"):"?"===e?nc(d,"if"):"^"===e?nc(d,"unless"):d},cd=function(a,b,c){for(var d=[],e={},f=!1,g=0;g")),[i]):(i.push(new ng.ContentNode(">")),[i,new ng.ContentNode("")])},df=function(a){return{shorthand:a,id:!0}},ef=function(a){return{shorthand:a}},ff=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},gf=function(a){return a.length?[new ng.ContentNode(" ")].concat(a):[]},hf=/^[A-Za-z.0-9_\-]/,jf="[A-Za-z.0-9_\\-]",kf=function(a){return lc([a],null,!0)},lf=function(a,b){return b.id=new ng.StringNode(b.id.string),[nc(b,"action",[["on",new ng.StringNode(a)]])]},mf=function(a,b){return"true"===b?[new ng.ContentNode(a)]:[]},nf=function(a){return a.replace(/ *$/,"")},of="!",pf='"!"',qf=function(){return mg},rf=function(a,b){var c=new ng.HashNode([[a,new ng.StringNode(b)]]),d=[new ng.IdNode([{part:"bind-attr"}])],e=lc(d,c);return[e]},sf=function(a,b){var c=lc([b],null,!0);return mg&&"!"===b._emblemSuffixModifier&&(c=nc(c,"unbound")),[new ng.ContentNode(a+'="'),c,new ng.ContentNode('"')]},tf=function(a,b){var c=[new ng.ContentNode(a+'="')].concat(b);return c.concat([new ng.ContentNode('"')])},uf="%",vf='"%"',wf="#",xf='"#"',yf=function(a){return a},zf="CSSIdentifier",Af=/^[_a-zA-Z0-9\-]/,Bf="[_a-zA-Z0-9\\-]",Cf=/^[\x80-\xFF]/,Df="[\\x80-\\xFF]",Ef="KnownHTMLTagName",Ff=function(a){return!!pg[a]},Gf=function(a){return a},Hf="a JS event",If=function(a){return!!qg[a]},Jf="INDENT",Kf="\uefef",Lf='"\\uEFEF"',Mf=function(){return""},Nf="DEDENT",Of="\ueffe",Pf='"\\uEFFE"',Qf="Unmatched DEDENT",Rf="\uefee",Sf='"\\uEFEE"',Tf="LineEnd",Uf="\r",Vf='"\\r"',Wf="\uefff",Xf='"\\uEFFF"',Yf="\n",Zf='"\\n"',$f="ANYDEDENT",_f="RequiredWhitespace",ag="OptionalWhitespace",bg="InlineWhitespace",cg=/^[ \t]/,dg="[ \\t]",eg=0,fg=0,gg=0,hg={line:1,column:1,seenCR:!1},ig=0,jg=[],kg=0;if("startRule"in qc){if(!(qc.startRule in rc))throw new Error("Can't start parsing from rule \""+qc.startRule+'".');sc=rc[qc.startRule]}var lg=c.handlebarsVariant,mg="Ember.Handlebars"===lg.JavaScriptCompiler.prototype.namespace,ng=lg.AST,og={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},pg={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},qg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},rg=String.fromCharCode(125),sg=rg+rg,tg=sg+rg,ug=lg.VERSION.slice(0,3)>=1.1,vg=lg.VERSION.slice(0,3)>=1.3;if(pc=sc(),null!==pc&&eg===a.length)return pc;throw f(jg),fg=Math.max(eg,ig),new b(jg,fgc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.17/emblem.js b/ajax/libs/emblem/0.3.17/emblem.js new file mode 100644 index 000000000..921239af8 --- /dev/null +++ b/ajax/libs/emblem/0.3.17/emblem.js @@ -0,0 +1,7123 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = "]", + peg$c31 = "\"]\"", + peg$c32 = function(h) { return h;}, + peg$c33 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c34 = function(mustacheNode, nestedContentProgramNode) { + + if (!nestedContentProgramNode) { + return mustacheNode; + } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + + block.path = mustacheNode.id; + return block; + }, + peg$c35 = ": ", + peg$c36 = "\": \"", + peg$c37 = function(statements) { return createProgramNode(statements, []); }, + peg$c38 = function(block) {return block && block[2]; }, + peg$c39 = function(block) { + return block; + }, + peg$c40 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c41 = "[", + peg$c42 = "\"[\"", + peg$c43 = function(isPartial, sexpr) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(sexpr.id.string)); + return new AST.PartialNode(n, sexpr.params[0]); + } + + var mustacheNode; + if (useSexprNodes) { + mustacheNode = createMustacheNode(sexpr, null, true); + } else { + mustacheNode = createMustacheNode([sexpr.id].concat(sexpr.params), sexpr.hash, true); + } + + var tm = sexpr.id._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + return mustacheNode; + }, + peg$c44 = " [", + peg$c45 = "\" [\"", + peg$c46 = function(path, params, hash) { return parseSexpr(path, params, hash) }, + peg$c47 = function(t) { return ['tagName', t]; }, + peg$c48 = function(i) { return ['elementId', i]; }, + peg$c49 = function(c) { return ['class', c]; }, + peg$c50 = function(a) { + return a; + }, + peg$c51 = function(id, classes) { return [id, classes]; }, + peg$c52 = function(classes) { return [null, classes]; }, + peg$c53 = function(p) { return p; }, + peg$c54 = function(a) { return a; }, + peg$c55 = function(h) { return new AST.HashNode(h); }, + peg$c56 = "PathIdent", + peg$c57 = "..", + peg$c58 = "\"..\"", + peg$c59 = ".", + peg$c60 = "\".\"", + peg$c61 = /^[a-zA-Z0-9_$\-!?\^@]/, + peg$c62 = "[a-zA-Z0-9_$\\-!?\\^@]", + peg$c63 = function(s) { return s; }, + peg$c64 = /^[^\]]/, + peg$c65 = "[^\\]]", + peg$c66 = function(segmentLiteral) { return segmentLiteral; }, + peg$c67 = "Key", + peg$c68 = ":", + peg$c69 = "\":\"", + peg$c70 = function(h) { return [h[0], h[2]]; }, + peg$c71 = function(h) { return [h[0], h[2]];}, + peg$c72 = function(s) { s.isHelper = true; return s; }, + peg$c73 = function(s, p) { return { part: p, separator: s }; }, + peg$c74 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c75 = "PathSeparator", + peg$c76 = /^[\/.]/, + peg$c77 = "[\\/.]", + peg$c78 = function(v) { + var last = v[v.length - 1]; + + // Support for data keywords that are prefixed with @ in the each + // block helper such as @index, @key, @first, @last + if (last.part.charAt(0) === '@') { + last.part = last.part.slice(1); + var idNode = new AST.IdNode(v); + var dataNode = new AST.DataNode(idNode); + return dataNode; + } + + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c79 = function(v) { return new AST.StringNode(v); }, + peg$c80 = function(v) { return new AST.IntegerNode(v); }, + peg$c81 = function(v) { return new AST.BooleanNode(v); }, + peg$c82 = "Boolean", + peg$c83 = "true", + peg$c84 = "\"true\"", + peg$c85 = "false", + peg$c86 = "\"false\"", + peg$c87 = "Integer", + peg$c88 = "-", + peg$c89 = "\"-\"", + peg$c90 = /^[0-9]/, + peg$c91 = "[0-9]", + peg$c92 = function(s) { return parseInt(s); }, + peg$c93 = "\"", + peg$c94 = "\"\\\"\"", + peg$c95 = "'", + peg$c96 = "\"'\"", + peg$c97 = function(p) { return p[1]; }, + peg$c98 = /^[^"}]/, + peg$c99 = "[^\"}]", + peg$c100 = /^[^'}]/, + peg$c101 = "[^'}]", + peg$c102 = /^[A-Za-z]/, + peg$c103 = "[A-Za-z]", + peg$c104 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c105 = /^[|`']/, + peg$c106 = "[|`']", + peg$c107 = "<", + peg$c108 = "\"<\"", + peg$c109 = function() { return '<'; }, + peg$c110 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + return ret; + }, + peg$c111 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c112 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c113 = "{", + peg$c114 = "\"{\"", + peg$c115 = /^[^}]/, + peg$c116 = "[^}]", + peg$c117 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c118 = function(m) { m.escaped = true; return m; }, + peg$c119 = function(m) { m.escaped = false; return m; }, + peg$c120 = function(a) { return new AST.ContentNode(a); }, + peg$c121 = "any character", + peg$c122 = "SingleMustacheOpen", + peg$c123 = "DoubleMustacheOpen", + peg$c124 = "{{", + peg$c125 = "\"{{\"", + peg$c126 = "TripleMustacheOpen", + peg$c127 = "{{{", + peg$c128 = "\"{{{\"", + peg$c129 = "SingleMustacheClose", + peg$c130 = "}", + peg$c131 = "\"}\"", + peg$c132 = "DoubleMustacheClose", + peg$c133 = "}}", + peg$c134 = "\"}}\"", + peg$c135 = "TripleMustacheClose", + peg$c136 = "}}}", + peg$c137 = "\"}}}\"", + peg$c138 = "SubexpressionOpen", + peg$c139 = "(", + peg$c140 = "\"(\"", + peg$c141 = "SubexpressionClose", + peg$c142 = ")", + peg$c143 = "\")\"", + peg$c144 = "InterpolationOpen", + peg$c145 = "#{", + peg$c146 = "\"#{\"", + peg$c147 = "InterpolationClose", + peg$c148 = "==", + peg$c149 = "\"==\"", + peg$c150 = function() { return false; }, + peg$c151 = function() { return true; }, + peg$c152 = function(h, s) { return h || s; }, + peg$c153 = function(h, inTagMustaches, fullAttributes) { + return parseInHtml(h, inTagMustaches, fullAttributes) + }, + peg$c154 = function(s) { return { shorthand: s, id: true}; }, + peg$c155 = function(s) { return { shorthand: s }; }, + peg$c156 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c157 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c158 = /^[A-Za-z.0-9_\-]/, + peg$c159 = "[A-Za-z.0-9_\\-]", + peg$c160 = function(id) { return createMustacheNode([id], null, true); }, + peg$c161 = function(event, mustacheNode) { + // Replace the IdNode with a StringNode to prevent unquoted action deprecation warnings + mustacheNode.id = new AST.StringNode(mustacheNode.id.string); + + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c162 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c163 = function(value) { return value.replace(/ *$/, ''); }, + peg$c164 = "!", + peg$c165 = "\"!\"", + peg$c166 = function(key, value) { return IS_EMBER; }, + peg$c167 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c168 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c169 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c170 = "_", + peg$c171 = "\"_\"", + peg$c172 = "%", + peg$c173 = "\"%\"", + peg$c174 = "#", + peg$c175 = "\"#\"", + peg$c176 = function(c) { return c;}, + peg$c177 = "CSSIdentifier", + peg$c178 = /^[_a-zA-Z0-9\-]/, + peg$c179 = "[_a-zA-Z0-9\\-]", + peg$c180 = /^[_a-zA-Z]/, + peg$c181 = "[_a-zA-Z]", + peg$c182 = /^[\x80-\xFF]/, + peg$c183 = "[\\x80-\\xFF]", + peg$c184 = "KnownHTMLTagName", + peg$c185 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c186 = function(t) { return t; }, + peg$c187 = "a JS event", + peg$c188 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c189 = "INDENT", + peg$c190 = "\uEFEF", + peg$c191 = "\"\\uEFEF\"", + peg$c192 = function() { return ''; }, + peg$c193 = "DEDENT", + peg$c194 = "\uEFFE", + peg$c195 = "\"\\uEFFE\"", + peg$c196 = "Unmatched DEDENT", + peg$c197 = "\uEFEE", + peg$c198 = "\"\\uEFEE\"", + peg$c199 = "LineEnd", + peg$c200 = "\r", + peg$c201 = "\"\\r\"", + peg$c202 = "\uEFFF", + peg$c203 = "\"\\uEFFF\"", + peg$c204 = "\n", + peg$c205 = "\"\\n\"", + peg$c206 = "ANYDEDENT", + peg$c207 = "RequiredWhitespace", + peg$c208 = "OptionalWhitespace", + peg$c209 = "InlineWhitespace", + peg$c210 = /^[ \t]/, + peg$c211 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseunindentedContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parsecontent(); + if (s2 !== null) { + s3 = peg$parseDEDENT(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c30; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + if (s3 !== null) { + s4 = peg$parseTERM(); + if (s4 !== null) { + s5 = peg$parseunindentedContent(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehtmlNestedTextNodes(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c33(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c35) { + s1 = peg$c35; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s2 = peg$c30; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parsecolonContent(); + if (s4 === null) { + s4 = peg$parsetextLine(); + } + if (s4 !== null) { + s5 = peg$parseDEDENT(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s2 = peg$c30; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseinvertibleContent(); + if (s4 !== null) { + s5 = peg$parseDEDENT(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s4 = peg$c41; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c42); } + } + if (s4 !== null) { + s5 = peg$parseTERM(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parsesexpr(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsesexpr() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c44) { + s3 = peg$c44; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = []; + s4 = peg$parseinMustacheParam(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinMustacheParam(); + } + if (s3 !== null) { + s4 = peg$parsehash(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1, s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 91) { + s3 = peg$c41; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c42); } + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseTERM(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseTERM(); + } + if (s5 !== null) { + s6 = []; + s7 = peg$parseINDENT(); + while (s7 !== null) { + s6.push(s7); + s7 = peg$parseINDENT(); + } + if (s6 !== null) { + s7 = peg$parse_(); + if (s7 !== null) { + s8 = []; + s9 = peg$parseinMustacheBracketedParam(); + while (s9 !== null) { + s8.push(s9); + s9 = peg$parseinMustacheBracketedParam(); + } + if (s8 !== null) { + s9 = peg$parsebracketedHash(); + if (s9 === null) { + s9 = peg$c1; + } + if (s9 !== null) { + peg$reportedPos = s0; + s1 = peg$c46(s1, s8, s9); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c47(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c48(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c49(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c50(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c51(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parse__(); + if (s2 !== null) { + s3 = peg$parseparam(); + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c53(s3); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheBracketedParam() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$currPos; + s2 = peg$parseparam(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseTERM(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseTERM(); + } + if (s3 !== null) { + peg$reportedPos = s1; + s2 = peg$c53(s2); + if (s2 === null) { + peg$currPos = s1; + s1 = s2; + } else { + s1 = s2; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebracketedHash() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseINDENT(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseINDENT(); + } + if (s1 !== null) { + s2 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + while (s3 !== null) { + s2.push(s3); + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsebracketedHashSegment(); + if (s4 !== null) { + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsebracketedHashSegment(); + } + } else { + s3 = peg$c0; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c55(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3, s4; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c57) { + s0 = peg$c57; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c59; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c61.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c62); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c41; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c42); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c64.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c64.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c30; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c31); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c68; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c68; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseparam(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c70(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebracketedHashSegment() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseINDENT(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseINDENT(); + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parsekey(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s5 = peg$c4; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s5 !== null) { + s6 = peg$parseparam(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseTERM(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseTERM(); + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2, s3; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsesexprOpen(); + if (s1 !== null) { + s2 = peg$parsesexpr(); + if (s2 !== null) { + s3 = peg$parsesexprClose(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c73(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c73(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c80(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c81(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c83) { + s0 = peg$c83; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c85) { + s0 = peg$c85; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c88; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c90.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c90.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c93; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c95; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c98.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c98.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c100.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c100.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c101); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c102.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c105.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c106); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c107; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c109(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c110(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c111(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c93; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c93; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c95; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c113; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c115.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c115.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c117(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c119(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c120(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c120(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c120(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c118(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c113; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c124) { + s0 = peg$c124; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c127) { + s0 = peg$c127; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c128); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c133) { + s0 = peg$c133; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c134); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c132); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c136) { + s0 = peg$c136; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + + return s0; + } + + function peg$parsesexprOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s0 = peg$c139; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c138); } + } + + return s0; + } + + function peg$parsesexprClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s0 = peg$c142; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c145) { + s0 = peg$c145; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c144); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c130; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c148) { + s1 = peg$c148; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c151(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c152(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c44) { + s3 = peg$c44; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsefullAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsefullAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1, s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c44) { + s4 = peg$c44; + peg$currPos += 2; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s4 !== null) { + s5 = []; + s6 = peg$parseTERM(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseTERM(); + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c44) { + s4 = peg$c44; + peg$currPos += 2; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + if (s4 !== null) { + s5 = []; + s6 = peg$parseTERM(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseTERM(); + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = []; + s4 = peg$parseinTagMustache(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseinTagMustache(); + } + if (s3 !== null) { + s4 = []; + s5 = peg$parsebracketedAttribute(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parsebracketedAttribute(); + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s1, s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c154(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c155(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c154(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c155(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebracketedAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseINDENT(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseINDENT(); + } + if (s1 !== null) { + s2 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + while (s3 !== null) { + s2.push(s3); + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s2 !== null) { + s3 = peg$parseactionAttribute(); + if (s3 === null) { + s3 = peg$parsebooleanAttribute(); + if (s3 === null) { + s3 = peg$parseboundAttribute(); + if (s3 === null) { + s3 = peg$parserawMustacheAttribute(); + if (s3 === null) { + s3 = peg$parsenormalAttribute(); + } + } + } + } + if (s3 !== null) { + s4 = []; + s5 = peg$parseTERM(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseTERM(); + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c157(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c160(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c93; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c95; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c161(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c83) { + s3 = peg$c83; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c84); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c85) { + s3 = peg$c85; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c86); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c162(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c113; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c130; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c164; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c165); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c166(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c167(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c168(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c90.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c91); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c170; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c88; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c176(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c59; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c177); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c178.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c180.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c182.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c172; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c185(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c186(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c178.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c68; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c188(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c186(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c190; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c192(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c194; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c192(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c193); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c197; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c192(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c196); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c200; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c201); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c202; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c204; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c205); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c150(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c199); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c206); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c207); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c208); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c210.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c211); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c209); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + var useSexprNodes = handlebarsVariant.VERSION.slice(0, 3) >= 1.3; + + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + function parseSexpr(path, params, hash){ + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + if (useSexprNodes) { + return new AST.SexprNode(actualParams, hash); + } else { + // Stub a sexpr-like node for backwards compatibility with pre-1.3 AST. + return { + id: actualParams[0], + params: actualParams.slice(1), + hash: hash + }; + } + } + function parseInHtml(h, inTagMustaches, fullAttributes) { + + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair && pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + + tagOpenContent.push(new AST.ContentNode('>')); + + return [tagOpenContent, new AST.ContentNode('')]; + } + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.17/emblem.min.js b/ajax/libs/emblem/0.3.17/emblem.min.js new file mode 100644 index 000000000..f2269b794 --- /dev/null +++ b/ajax/libs/emblem/0.3.17/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return sg!==b&&(sg>b&&(sg=0,tg={line:1,column:1,seenCR:!1}),c(tg,sg,b),sg=b),tg}function e(a){ug>qg||(qg>ug&&(ug=qg,vg=[]),vg.push(a))}function f(a){var b=0;for(a.sort();bqg?(d=a.charAt(qg),qg++):(d=null,0===wg&&e(Ke)),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function qb(){var b,c,d;return b=qg,c=qg,wg++,d=tb(),null===d&&(39===a.charCodeAt(qg)?(d=me,qg++):(d=null,0===wg&&e(ne))),wg--,null===d?c=Bc:(qg=c,c=Ac),null!==c?(a.length>qg?(d=a.charAt(qg),qg++):(d=null,0===wg&&e(Ke)),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function rb(){var b,c,d,e;if(b=qg,c=qg,d=[],e=sb(),null!==e)for(;null!==e;)d.push(e),e=sb();else d=Ac;return null!==d&&(d=a.substring(c,qg)),c=d,null!==c&&(rg=b,c=Je(c)),null===c?(qg=b,b=c):b=c,b}function sb(){var b,c,d;return b=qg,c=qg,wg++,d=tb(),wg--,null===d?c=Bc:(qg=c,c=Ac),null!==c?(a.length>qg?(d=a.charAt(qg),qg++):(d=null,0===wg&&e(Ke)),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function tb(){var a;return a=yb(),null===a&&(a=xb(),null===a&&(a=Eb(),null===a&&(a=kc(),null===a&&(a=jc())))),a}function ub(){var a,b,c,d,e,f;return a=qg,b=wb(),null!==b?(c=mc(),null!==c?(d=kb(),null!==d?(e=mc(),null!==e?(f=zb(),null!==f?(rg=a,b=He(d),null===b?(qg=a,a=b):a=b):(qg=a,a=Ac)):(qg=a,a=Ac)):(qg=a,a=Ac)):(qg=a,a=Ac)):(qg=a,a=Ac),a}function vb(){var a;return a=ub(),null===a&&(a=mb(),null===a&&(a=lb())),a}function wb(){var b,c;return wg++,123===a.charCodeAt(qg)?(b=Ce,qg++):(b=null,0===wg&&e(De)),wg--,null===b&&(c=null,0===wg&&e(Le)),b}function xb(){var b,c;return wg++,a.substr(qg,2)===Ne?(b=Ne,qg+=2):(b=null,0===wg&&e(Oe)),wg--,null===b&&(c=null,0===wg&&e(Me)),b}function yb(){var b,c;return wg++,a.substr(qg,3)===Qe?(b=Qe,qg+=3):(b=null,0===wg&&e(Re)),wg--,null===b&&(c=null,0===wg&&e(Pe)),b}function zb(){var b,c;return wg++,125===a.charCodeAt(qg)?(b=Te,qg++):(b=null,0===wg&&e(Ue)),wg--,null===b&&(c=null,0===wg&&e(Se)),b}function Ab(){var b,c;return wg++,a.substr(qg,2)===We?(b=We,qg+=2):(b=null,0===wg&&e(Xe)),wg--,null===b&&(c=null,0===wg&&e(Ve)),b}function Bb(){var b,c;return wg++,a.substr(qg,3)===Ze?(b=Ze,qg+=3):(b=null,0===wg&&e($e)),wg--,null===b&&(c=null,0===wg&&e(Ye)),b}function Cb(){var b,c;return wg++,40===a.charCodeAt(qg)?(b=af,qg++):(b=null,0===wg&&e(bf)),wg--,null===b&&(c=null,0===wg&&e(_e)),b}function Db(){var b,c;return wg++,41===a.charCodeAt(qg)?(b=df,qg++):(b=null,0===wg&&e(ef)),wg--,null===b&&(c=null,0===wg&&e(cf)),b}function Eb(){var b,c;return wg++,a.substr(qg,2)===gf?(b=gf,qg+=2):(b=null,0===wg&&e(hf)),wg--,null===b&&(c=null,0===wg&&e(ff)),b}function Fb(){var b,c;return wg++,125===a.charCodeAt(qg)?(b=Te,qg++):(b=null,0===wg&&e(Ue)),wg--,null===b&&(c=null,0===wg&&e(jf)),b}function Gb(){var b,c,d;return b=qg,a.substr(qg,2)===kf?(c=kf,qg+=2):(c=null,0===wg&&e(lf)),null!==c?(32===a.charCodeAt(qg)?(d=Yc,qg++):(d=null,0===wg&&e(Zc)),null===d&&(d=Bc),null!==d?(rg=b,c=mf(),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),null===b&&(b=qg,61===a.charCodeAt(qg)?(c=Ec,qg++):(c=null,0===wg&&e(Fc)),null!==c?(32===a.charCodeAt(qg)?(d=Yc,qg++):(d=null,0===wg&&e(Zc)),null===d&&(d=Bc),null!==d?(rg=b,c=nf(),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)),b}function Hb(){var b,c,d,f,g;return b=qg,c=ac(),null===c&&(c=Bc),null!==c?(d=H(),null===d&&(d=Bc),null!==d?(47===a.charCodeAt(qg)?(f=Tc,qg++):(f=null,0===wg&&e(Uc)),null===f&&(f=Bc),null!==f?(rg=qg,g=of(c,d),g=g?Bc:Ac,null!==g?(c=[c,d,f,g],b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Ib(){var b,c,d,f,g,h,i;if(b=qg,c=Hb(),null!==c)if(d=qg,wg++,a.substr(qg,2)===pd?(f=pd,qg+=2):(f=null,0===wg&&e(qd)),wg--,null===f?d=Bc:(qg=d,d=Ac),null!==d){for(f=[],g=vb();null!==g;)f.push(g),g=vb();if(null!==f){for(g=[],h=Jb();null!==h;)g.push(h),h=Jb();null!==g?(rg=b,c=pf(c,f,g),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)}else qg=b,b=Ac}else qg=b,b=Ac;else qg=b,b=Ac;if(null===b)if(b=qg,c=Hb(),null!==c){if(d=[],f=qg,a.substr(qg,2)===pd?(g=pd,qg+=2):(g=null,0===wg&&e(qd)),null!==g){for(h=[],i=jc();null!==i;)h.push(i),i=jc();null!==h?(g=[g,h],f=g):(qg=f,f=Ac)}else qg=f,f=Ac;for(;null!==f;)if(d.push(f),f=qg,a.substr(qg,2)===pd?(g=pd,qg+=2):(g=null,0===wg&&e(qd)),null!==g){for(h=[],i=jc();null!==i;)h.push(i),i=jc();null!==h?(g=[g,h],f=g):(qg=f,f=Ac)}else qg=f,f=Ac;if(null!==d){for(f=[],g=vb();null!==g;)f.push(g),g=vb();if(null!==f){for(g=[],h=Kb();null!==h;)g.push(h),h=Kb();null!==g?(rg=b,c=pf(c,f,g),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)}else qg=b,b=Ac}else qg=b,b=Ac}else qg=b,b=Ac;return b}function H(){var a,b,c,d;if(a=qg,b=[],c=qg,d=Vb(),null!==d&&(rg=c,d=qf(d)),null===d?(qg=c,c=d):c=d,null===c&&(c=qg,d=Wb(),null!==d&&(rg=c,d=rf(d)),null===d?(qg=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=qg,d=Vb(),null!==d&&(rg=c,d=qf(d)),null===d?(qg=c,c=d):c=d,null===c&&(c=qg,d=Wb(),null!==d&&(rg=c,d=rf(d)),null===d?(qg=c,c=d):c=d);else b=Ac;return null!==b&&(rg=a,b=sf(b)),null===b?(qg=a,a=b):a=b,a}function Jb(){var b,c,d;if(b=qg,c=[],32===a.charCodeAt(qg)?(d=Yc,qg++):(d=null,0===wg&&e(Zc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(qg)?(d=Yc,qg++):(d=null,0===wg&&e(Zc));else c=Ac;return null!==c?(d=Ob(),null===d&&(d=Pb(),null===d&&(d=Rb(),null===d&&(d=Sb(),null===d&&(d=Tb())))),null!==d?(rg=b,c=tf(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Kb(){var b,c,d,f,g,h;for(b=qg,c=[],d=gc();null!==d;)c.push(d),d=gc();if(null!==c){for(d=[],32===a.charCodeAt(qg)?(f=Yc,qg++):(f=null,0===wg&&e(Zc));null!==f;)d.push(f),32===a.charCodeAt(qg)?(f=Yc,qg++):(f=null,0===wg&&e(Zc));if(null!==d)if(f=Ob(),null===f&&(f=Pb(),null===f&&(f=Rb(),null===f&&(f=Sb(),null===f&&(f=Tb())))),null!==f){for(g=[],h=jc();null!==h;)g.push(h),h=jc();null!==g?(rg=b,c=tf(f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)}else qg=b,b=Ac;else qg=b,b=Ac}else qg=b,b=Ac;return b}function Lb(){var b;return uf.test(a.charAt(qg))?(b=a.charAt(qg),qg++):(b=null,0===wg&&e(vf)),null===b&&(b=dc()),b}function Mb(){var a,b;return a=Nb(),null===a&&(a=qg,b=V(),null!==b&&(rg=a,b=wf(b)),null===b?(qg=a,a=b):a=b),a}function Nb(){var b,c,d,f,g;return b=qg,c=qg,34===a.charCodeAt(qg)?(d=ke,qg++):(d=null,0===wg&&e(le)),null!==d?(f=E(),null!==f?(34===a.charCodeAt(qg)?(g=ke,qg++):(g=null,0===wg&&e(le)),null!==g?(d=[d,f,g],c=d):(qg=c,c=Ac)):(qg=c,c=Ac)):(qg=c,c=Ac),null===c&&(c=qg,39===a.charCodeAt(qg)?(d=me,qg++):(d=null,0===wg&&e(ne)),null!==d?(f=E(),null!==f?(39===a.charCodeAt(qg)?(g=me,qg++):(g=null,0===wg&&e(ne)),null!==g?(d=[d,f,g],c=d):(qg=c,c=Ac)):(qg=c,c=Ac)):(qg=c,c=Ac)),null!==c&&(rg=b,c=oe(c)),null===c?(qg=b,b=c):b=c,b}function Ob(){var b,c,d,f;return b=qg,c=ec(),null!==c?(61===a.charCodeAt(qg)?(d=Ec,qg++):(d=null,0===wg&&e(Fc)),null!==d?(f=Mb(),null!==f?(rg=b,c=xf(c,f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Pb(){var b,c,d,f;return b=qg,c=P(),null!==c?(61===a.charCodeAt(qg)?(d=Ec,qg++):(d=null,0===wg&&e(Fc)),null!==d?(a.substr(qg,4)===ae?(f=ae,qg+=4):(f=null,0===wg&&e(be)),null===f&&(a.substr(qg,5)===ce?(f=ce,qg+=5):(f=null,0===wg&&e(de))),null!==f?(rg=b,c=yf(c,f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Qb(){var b,c,d,f,g,h;if(b=qg,123===a.charCodeAt(qg)?(c=Ce,qg++):(c=null,0===wg&&e(De)),null!==c)if(d=mc(),null!==d){if(f=qg,g=[],h=Lb(),null===h&&(32===a.charCodeAt(qg)?(h=Yc,qg++):(h=null,0===wg&&e(Zc))),null!==h)for(;null!==h;)g.push(h),h=Lb(),null===h&&(32===a.charCodeAt(qg)?(h=Yc,qg++):(h=null,0===wg&&e(Zc)));else g=Ac;null!==g&&(g=a.substring(f,qg)),f=g,null!==f?(g=mc(),null!==g?(125===a.charCodeAt(qg)?(h=Te,qg++):(h=null,0===wg&&e(Ue)),null!==h?(rg=b,c=zf(f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac)}else qg=b,b=Ac;else qg=b,b=Ac;if(null===b){if(b=qg,c=[],d=Lb(),null!==d)for(;null!==d;)c.push(d),d=Lb();else c=Ac;null!==c&&(c=a.substring(b,qg)),b=c}return b}function Rb(){var b,c,d,f,g,h;return b=qg,c=P(),null!==c?(61===a.charCodeAt(qg)?(d=Ec,qg++):(d=null,0===wg&&e(Fc)),null!==d?(f=Qb(),null!==f?(g=qg,wg++,33===a.charCodeAt(qg)?(h=Af,qg++):(h=null,0===wg&&e(Bf)),wg--,null===h?g=Bc:(qg=g,g=Ac),null!==g?(rg=qg,h=Cf(c,f),h=h?Bc:Ac,null!==h?(rg=b,c=Df(c,f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Sb(){var b,c,d,f;return b=qg,c=P(),null!==c?(61===a.charCodeAt(qg)?(d=Ec,qg++):(d=null,0===wg&&e(Fc)),null!==d?(f=V(),null!==f?(rg=b,c=Ef(c,f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b +}function Tb(){var b,c,d,f;return b=qg,c=P(),null!==c?(61===a.charCodeAt(qg)?(d=Ec,qg++):(d=null,0===wg&&e(Fc)),null!==d?(f=gb(),null!==f?(rg=b,c=Ff(c,f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Ub(){var b,c,d;return b=qg,37===a.charCodeAt(qg)?(c=Gf,qg++):(c=null,0===wg&&e(Hf)),null!==c?(d=Xb(),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Vb(){var b,c,d;return b=qg,35===a.charCodeAt(qg)?(c=If,qg++):(c=null,0===wg&&e(Jf)),null!==c?(d=Xb(),null!==d?(rg=b,c=Kf(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Wb(){var b,c,d;return b=qg,46===a.charCodeAt(qg)?(c=Ed,qg++):(c=null,0===wg&&e(Fd)),null!==c?(d=Xb(),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function Xb(){var a,b;return wg++,a=Yb(),wg--,null===a&&(b=null,0===wg&&e(Lf)),a}function Yb(){var b,c,d;if(b=qg,c=[],d=Zb(),null!==d)for(;null!==d;)c.push(d),d=Zb();else c=Ac;return null!==c&&(c=a.substring(b,qg)),b=c}function Zb(){var b;return Mf.test(a.charAt(qg))?(b=a.charAt(qg),qg++):(b=null,0===wg&&e(Nf)),null===b&&(b=$b()),b}function $b(){var b;return Of.test(a.charAt(qg))?(b=a.charAt(qg),qg++):(b=null,0===wg&&e(Pf)),b}function _b(){var b,c,d;if(b=qg,c=[],d=cc(),null!==d)for(;null!==d;)c.push(d),d=cc();else c=Ac;return null!==c&&(c=a.substring(b,qg)),b=c}function ac(){var b,c,d,f;return wg++,b=qg,37===a.charCodeAt(qg)?(c=Gf,qg++):(c=null,0===wg&&e(Hf)),null!==c?(d=mc(),null!==d?(f=_b(),null!==f?(rg=b,c=Id(f),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),null===b&&(b=bc()),wg--,null===b&&(c=null,0===wg&&e(Qf)),b}function bc(){var a,b,c;return a=qg,b=_b(),null!==b?(rg=qg,c=Rf(b),c=c?Bc:Ac,null!==c?(rg=a,b=Sf(b),null===b?(qg=a,a=b):a=b):(qg=a,a=Ac)):(qg=a,a=Ac),a}function cc(){var b;return Mf.test(a.charAt(qg))?(b=a.charAt(qg),qg++):(b=null,0===wg&&e(Nf)),null===b&&(b=dc()),b}function dc(){var b,c,d,f;return b=qg,58===a.charCodeAt(qg)?(c=Nd,qg++):(c=null,0===wg&&e(Od)),null!==c?(d=qg,wg++,32===a.charCodeAt(qg)?(f=Yc,qg++):(f=null,0===wg&&e(Zc)),wg--,null===f?d=Bc:(qg=d,d=Ac),null!==d?(rg=b,c=_c(c),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function ec(){var a,b,c;return wg++,a=qg,b=_b(),null!==b?(rg=qg,c=Uf(b),c=c?Bc:Ac,null!==c?(rg=a,b=Sf(b),null===b?(qg=a,a=b):a=b):(qg=a,a=Ac)):(qg=a,a=Ac),wg--,null===a&&(b=null,0===wg&&e(Tf)),a}function fc(){var a,b,c;return a=qg,b=gc(),null!==b?(c=lc(),null!==c?(rg=a,b=Id(c),null===b?(qg=a,a=b):a=b):(qg=a,a=Ac)):(qg=a,a=Ac),a}function gc(){var b,c;return wg++,b=qg,61423===a.charCodeAt(qg)?(c=Wf,qg++):(c=null,0===wg&&e(Xf)),null!==c&&(rg=b,c=Yf()),null===c?(qg=b,b=c):b=c,wg--,null===b&&(c=null,0===wg&&e(Vf)),b}function hc(){var b,c;return wg++,b=qg,61438===a.charCodeAt(qg)?(c=$f,qg++):(c=null,0===wg&&e(_f)),null!==c&&(rg=b,c=Yf()),null===c?(qg=b,b=c):b=c,wg--,null===b&&(c=null,0===wg&&e(Zf)),b}function ic(){var b,c;return wg++,b=qg,61422===a.charCodeAt(qg)?(c=bg,qg++):(c=null,0===wg&&e(cg)),null!==c&&(rg=b,c=Yf()),null===c?(qg=b,b=c):b=c,wg--,null===b&&(c=null,0===wg&&e(ag)),b}function jc(){var b,c,d,f;return wg++,b=qg,13===a.charCodeAt(qg)?(c=eg,qg++):(c=null,0===wg&&e(fg)),null===c&&(c=Bc),null!==c?(61439===a.charCodeAt(qg)?(d=gg,qg++):(d=null,0===wg&&e(hg)),null!==d?(10===a.charCodeAt(qg)?(f=ig,qg++):(f=null,0===wg&&e(jg)),null!==f?(rg=b,c=mf(),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac)):(qg=b,b=Ac),wg--,null===b&&(c=null,0===wg&&e(dg)),b}function kc(){var a,b;return wg++,a=hc(),null===a&&(a=ic()),wg--,null===a&&(b=null,0===wg&&e(kg)),a}function lc(){var b,c,d;if(wg++,b=qg,c=[],d=nc(),null!==d)for(;null!==d;)c.push(d),d=nc();else c=Ac;return null!==c&&(c=a.substring(b,qg)),b=c,wg--,null===b&&(c=null,0===wg&&e(lg)),b}function mc(){var a,b;for(wg++,a=[],b=nc();null!==b;)a.push(b),b=nc();return wg--,null===a&&(b=null,0===wg&&e(mg)),a}function nc(){var b,c;return wg++,og.test(a.charAt(qg))?(b=a.charAt(qg),qg++):(b=null,0===wg&&e(pg)),wg--,null===b&&(c=null,0===wg&&e(ng)),b}function oc(){var b,c,d;return b=qg,c=qg,wg++,d=gc(),null===d&&(d=hc(),null===d&&(d=jc())),wg--,null===d?c=Bc:(qg=c,c=Ac),null!==c?(a.length>qg?(d=a.charAt(qg),qg++):(d=null,0===wg&&e(Ke)),null!==d?(rg=b,c=_c(d),null===c?(qg=b,b=c):b=c):(qg=b,b=Ac)):(qg=b,b=Ac),b}function pc(){var b,c,d;for(b=qg,c=[],d=oc();null!==d;)c.push(d),d=oc();return null!==c&&(c=a.substring(b,qg)),b=c}function qc(a,b,c){if(Gg){var d=c?Eg:Fg;return new zg.MustacheNode(a,b,d,{left:!1,right:!1})}return new zg.MustacheNode(a,b,!c)}function rc(a,b){return Gg?new zg.ProgramNode(a,{left:!1,right:!1},b,null):new zg.ProgramNode(a,b)}function sc(a,b,c){var d=a.hash;if(c){d=d||new zg.HashNode([]);for(var e=0;e")),[i]):(i.push(new zg.ContentNode(">")),[i,new zg.ContentNode("")])}var wc,xc=arguments.length>1?arguments[1]:{},yc={start:g},zc=g,Ac=null,Bc="",Cc=function(a){return a},Dc=function(a,b){return rc(a,b||[])},Ec="=",Fc='"="',Gc="else",Hc='"else"',Ic=function(a){for(var b=[],c=[],d=0;d",Nc='">"',Oc=function(a,b){return[new zg.PartialNode(a,b[0])]},Pc=/^[a-zA-Z0-9_$-\/]/,Qc="[a-zA-Z0-9_$-\\/]",Rc=function(a){return new zg.PartialNameNode(new zg.StringNode(a))},Sc=function(a){return[a]},Tc="/",Uc='"/"',Vc=/^[A-Z]/,Wc="[A-Z]",Xc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return yg&&c.match(/[A-Z]/)?(a.mustache=sc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return yg&&c.match(/[A-Z]/)?sc(a,b):a},Yc=" ",Zc='" "',$c=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new zg.ContentNode(" ")),a=a.concat(b[c])}return a},_c=function(a){return a},ad=function(a){return[a]},bd="]",cd='"]"',dd=function(a){return a},ed=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},fd=function(a,b){if(!b)return a;var c=a.id;Gg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new zg.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},gd=": ",hd='": "',id=function(a){return rc(a,[])},jd=function(a){return a&&a[2]},kd=function(a){return a},ld=function(a,b){var c=b.mustache||b;return c.escaped=a,b},md="[",nd='"["',od=function(a,b){if(a){var c=new zg.PartialNameNode(new zg.StringNode(b.id.string));return new zg.PartialNode(c,b.params[0])}var d;d=Hg?qc(b,null,!0):qc([b.id].concat(b.params),b.hash,!0);var e=b.id._emblemSuffixModifier;return"!"===e?sc(d,"unbound"):"?"===e?sc(d,"if"):"^"===e?sc(d,"unless"):d},pd=" [",qd='" ["',rd=function(a,b,c){return uc(a,b,c)},sd=function(a){return["tagName",a]},td=function(a){return["elementId",a]},ud=function(a){return["class",a]},vd=function(a){return a},wd=function(a,b){return[a,b]},xd=function(a){return[null,a]},yd=function(a){return a},zd=function(a){return a},Ad=function(a){return new zg.HashNode(a)},Bd="PathIdent",Cd="..",Dd='".."',Ed=".",Fd='"."',Gd=/^[a-zA-Z0-9_$\-!?\^@]/,Hd="[a-zA-Z0-9_$\\-!?\\^@]",Id=function(a){return a},Jd=/^[^\]]/,Kd="[^\\]]",Ld=function(a){return a},Md="Key",Nd=":",Od='":"',Pd=function(a){return[a[0],a[2]]},Qd=function(a){return[a[0],a[2]]},Rd=function(a){return a.isHelper=!0,a},Sd=function(a,b){return{part:b,separator:a}},Td=function(a,b){for(var c=[{part:a}],d=0;dd;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},tf=function(a){return a.length?[new zg.ContentNode(" ")].concat(a):[]},uf=/^[A-Za-z.0-9_\-]/,vf="[A-Za-z.0-9_\\-]",wf=function(a){return qc([a],null,!0)},xf=function(a,b){return b.id=new zg.StringNode(b.id.string),[sc(b,"action",[["on",new zg.StringNode(a)]])]},yf=function(a,b){return"true"===b?[new zg.ContentNode(a)]:[]},zf=function(a){return a.replace(/ *$/,"")},Af="!",Bf='"!"',Cf=function(){return yg},Df=function(a,b){var c=new zg.HashNode([[a,new zg.StringNode(b)]]),d=[new zg.IdNode([{part:"bind-attr"}])],e=qc(d,c);return[e]},Ef=function(a,b){var c=qc([b],null,!0);return yg&&"!"===b._emblemSuffixModifier&&(c=sc(c,"unbound")),[new zg.ContentNode(a+'="'),c,new zg.ContentNode('"')]},Ff=function(a,b){var c=[new zg.ContentNode(a+'="')].concat(b);return c.concat([new zg.ContentNode('"')])},Gf="%",Hf='"%"',If="#",Jf='"#"',Kf=function(a){return a},Lf="CSSIdentifier",Mf=/^[_a-zA-Z0-9\-]/,Nf="[_a-zA-Z0-9\\-]",Of=/^[\x80-\xFF]/,Pf="[\\x80-\\xFF]",Qf="KnownHTMLTagName",Rf=function(a){return!!Bg[a]},Sf=function(a){return a},Tf="a JS event",Uf=function(a){return!!Cg[a]},Vf="INDENT",Wf="\uefef",Xf='"\\uEFEF"',Yf=function(){return""},Zf="DEDENT",$f="\ueffe",_f='"\\uEFFE"',ag="Unmatched DEDENT",bg="\uefee",cg='"\\uEFEE"',dg="LineEnd",eg="\r",fg='"\\r"',gg="\uefff",hg='"\\uEFFF"',ig="\n",jg='"\\n"',kg="ANYDEDENT",lg="RequiredWhitespace",mg="OptionalWhitespace",ng="InlineWhitespace",og=/^[ \t]/,pg="[ \\t]",qg=0,rg=0,sg=0,tg={line:1,column:1,seenCR:!1},ug=0,vg=[],wg=0;if("startRule"in xc){if(!(xc.startRule in yc))throw new Error("Can't start parsing from rule \""+xc.startRule+'".');zc=yc[xc.startRule]}var xg=c.handlebarsVariant,yg="Ember.Handlebars"===xg.JavaScriptCompiler.prototype.namespace,zg=xg.AST,Ag={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Bg={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},Cg={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},Dg=String.fromCharCode(125),Eg=Dg+Dg,Fg=Eg+Dg,Gg=xg.VERSION.slice(0,3)>=1.1,Hg=xg.VERSION.slice(0,3)>=1.3;if(wc=zc(),null!==wc&&qg===a.length)return wc;throw f(vg),rg=Math.max(qg,ug),new b(vg,rgc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}).call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.2/emblem.js b/ajax/libs/emblem/0.3.2/emblem.js new file mode 100644 index 000000000..253fd05c7 --- /dev/null +++ b/ajax/libs/emblem/0.3.2/emblem.js @@ -0,0 +1,6058 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(id, classes) { return [id, classes]; }, + peg$c42 = function(classes) { return [null, classes]; }, + peg$c43 = function(a) { return a; }, + peg$c44 = function(h) { return new AST.HashNode(h); }, + peg$c45 = "PathIdent", + peg$c46 = "..", + peg$c47 = "\"..\"", + peg$c48 = ".", + peg$c49 = "\".\"", + peg$c50 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c51 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c52 = function(s) { return s; }, + peg$c53 = "Key", + peg$c54 = ":", + peg$c55 = "\":\"", + peg$c56 = function(h) { return [h[0], h[2]]; }, + peg$c57 = function(s, p) { return { part: p, separator: s }; }, + peg$c58 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c59 = "PathSeparator", + peg$c60 = /^[\/.]/, + peg$c61 = "[\\/.]", + peg$c62 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c63 = function(v) { return new AST.StringNode(v); }, + peg$c64 = function(v) { return new AST.IntegerNode(v); }, + peg$c65 = function(v) { return new AST.BooleanNode(v); }, + peg$c66 = "Boolean", + peg$c67 = "true", + peg$c68 = "\"true\"", + peg$c69 = "false", + peg$c70 = "\"false\"", + peg$c71 = "Integer", + peg$c72 = /^[0-9]/, + peg$c73 = "[0-9]", + peg$c74 = function(s) { return parseInt(s); }, + peg$c75 = "\"", + peg$c76 = "\"\\\"\"", + peg$c77 = "'", + peg$c78 = "\"'\"", + peg$c79 = function(p) { return p[1]; }, + peg$c80 = /^[^"}]/, + peg$c81 = "[^\"}]", + peg$c82 = /^[^'}]/, + peg$c83 = "[^'}]", + peg$c84 = /^[A-Za-z]/, + peg$c85 = "[A-Za-z]", + peg$c86 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c87 = /^[|`']/, + peg$c88 = "[|`']", + peg$c89 = "<", + peg$c90 = "\"<\"", + peg$c91 = function() { return '<'; }, + peg$c92 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c93 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c94 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c95 = "{", + peg$c96 = "\"{\"", + peg$c97 = /^[^}]/, + peg$c98 = "[^}]", + peg$c99 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c100 = function(m) { m.escaped = true; return m; }, + peg$c101 = function(m) { m.escaped = false; return m; }, + peg$c102 = function(a) { return new AST.ContentNode(a); }, + peg$c103 = "any character", + peg$c104 = "SingleMustacheOpen", + peg$c105 = "DoubleMustacheOpen", + peg$c106 = "{{", + peg$c107 = "\"{{\"", + peg$c108 = "TripleMustacheOpen", + peg$c109 = "{{{", + peg$c110 = "\"{{{\"", + peg$c111 = "SingleMustacheClose", + peg$c112 = "}", + peg$c113 = "\"}\"", + peg$c114 = "DoubleMustacheClose", + peg$c115 = "}}", + peg$c116 = "\"}}\"", + peg$c117 = "TripleMustacheClose", + peg$c118 = "}}}", + peg$c119 = "\"}}}\"", + peg$c120 = "InterpolationOpen", + peg$c121 = "#{", + peg$c122 = "\"#{\"", + peg$c123 = "InterpolationClose", + peg$c124 = "==", + peg$c125 = "\"==\"", + peg$c126 = function() { return false; }, + peg$c127 = function() { return true; }, + peg$c128 = function(h, s) { return h || s; }, + peg$c129 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c130 = function(s) { return { shorthand: s, id: true}; }, + peg$c131 = function(s) { return { shorthand: s }; }, + peg$c132 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c133 = function(a) { + return [new AST.ContentNode(' ')].concat(a); + }, + peg$c134 = /^[A-Za-z.0-9_\-]/, + peg$c135 = "[A-Za-z.0-9_\\-]", + peg$c136 = function(id) { return new AST.MustacheNode([id]); }, + peg$c137 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c138 = function(value) { return value.replace(/ *$/, ''); }, + peg$c139 = "!", + peg$c140 = "\"!\"", + peg$c141 = function(key, value) { return IS_EMBER; }, + peg$c142 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bindAttr'}])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c143 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c144 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c145 = "_", + peg$c146 = "\"_\"", + peg$c147 = "-", + peg$c148 = "\"-\"", + peg$c149 = "%", + peg$c150 = "\"%\"", + peg$c151 = "#", + peg$c152 = "\"#\"", + peg$c153 = function(c) { return c;}, + peg$c154 = "CSSIdentifier", + peg$c155 = /^[_a-zA-Z0-9\-]/, + peg$c156 = "[_a-zA-Z0-9\\-]", + peg$c157 = /^[_a-zA-Z]/, + peg$c158 = "[_a-zA-Z]", + peg$c159 = /^[\x80-\xFF]/, + peg$c160 = "[\\x80-\\xFF]", + peg$c161 = "KnownHTMLTagName", + peg$c162 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c163 = function(t) { return t; }, + peg$c164 = "a JS event", + peg$c165 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c166 = "INDENT", + peg$c167 = "\uEFEF", + peg$c168 = "\"\\uEFEF\"", + peg$c169 = function() { return ''; }, + peg$c170 = "DEDENT", + peg$c171 = "\uEFFE", + peg$c172 = "\"\\uEFFE\"", + peg$c173 = "Unmatched DEDENT", + peg$c174 = "\uEFEE", + peg$c175 = "\"\\uEFEE\"", + peg$c176 = "LineEnd", + peg$c177 = "\r", + peg$c178 = "\"\\r\"", + peg$c179 = "\uEFFF", + peg$c180 = "\"\\uEFFF\"", + peg$c181 = "\n", + peg$c182 = "\"\\n\"", + peg$c183 = "ANYDEDENT", + peg$c184 = "RequiredWhitespace", + peg$c185 = "OptionalWhitespace", + peg$c186 = "InlineWhitespace", + peg$c187 = /^[ \t]/, + peg$c188 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = []; + s6 = peg$parseinMustacheParam(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parseinMustacheParam(); + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTERM(); + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsetagNameShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c38(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseclassShorthand(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c40(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parsehtmlMustacheAttribute(); + if (s2 === null) { + s2 = peg$parseparam(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c46) { + s0 = peg$c46; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c47); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c48; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c50.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c45); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c54; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c53); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c56(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0; + + s0 = peg$parsebooleanNode(); + if (s0 === null) { + s0 = peg$parseintegerNode(); + if (s0 === null) { + s0 = peg$parsepathIdNode(); + if (s0 === null) { + s0 = peg$parsestringNode(); + } + } + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c57(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c60.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c67) { + s0 = peg$c67; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c69) { + s0 = peg$c69; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c66); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c72.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c71); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c80.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c82.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c84.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c87.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c88); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c89; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c90); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c75; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c75; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c77; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c77; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c94(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c95; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c97.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c98); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c99(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c102(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c95; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c104); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c106) { + s0 = peg$c106; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c109) { + s0 = peg$c109; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c110); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c115) { + s0 = peg$c115; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c116); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c118) { + s0 = peg$c118; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c121) { + s0 = peg$c121; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c122); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c112; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c124) { + s1 = peg$c124; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c127(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c128(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c129(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c130(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c131(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c132(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c134.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c75; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c76); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c95; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c96); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c112; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c113); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c138(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c139; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c140); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c141(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c144(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeValue() { + var s0; + + s0 = peg$parsestring(); + if (s0 === null) { + s0 = peg$parseparam(); + } + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c72.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c145; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c146); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c147; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c148); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c151; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c152); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c153(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c48; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c154); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c157.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c158); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c159.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c160); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c149; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c150); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c162(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c155.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c156); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c54; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c163(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c167; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c171; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c169(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c179; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c181; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c126(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c187.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.2/emblem.min.js b/ajax/libs/emblem/0.3.2/emblem.min.js new file mode 100644 index 000000000..32892d7a0 --- /dev/null +++ b/ajax/libs/emblem/0.3.2/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return If!==b&&(If>b&&(If=0,Jf={line:1,column:1,seenCR:!1}),c(Jf,If,b),If=b),Jf}function e(a){Kf>Gf||(Gf>Kf&&(Kf=Gf,Lf=[]),Lf.push(a))}function f(a){var b=0;for(a.sort();bGf?(d=a.charAt(Gf),Gf++):(d=null,0===Mf&&e(fe)),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function lb(){var b,c,d;return b=Gf,c=Gf,Mf++,d=ob(),null===d&&(39===a.charCodeAt(Gf)?(d=Jd,Gf++):(d=null,0===Mf&&e(Kd))),Mf--,null===d?c=oc:(Gf=c,c=nc),null!==c?(a.length>Gf?(d=a.charAt(Gf),Gf++):(d=null,0===Mf&&e(fe)),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function mb(){var b,c,d,e;if(b=Gf,c=Gf,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=nc;return null!==d&&(d=a.substring(c,Gf)),c=d,null!==c&&(Hf=b,c=ee(c)),null===c?(Gf=b,b=c):b=c,b}function nb(){var b,c,d;return b=Gf,c=Gf,Mf++,d=ob(),Mf--,null===d?c=oc:(Gf=c,c=nc),null!==c?(a.length>Gf?(d=a.charAt(Gf),Gf++):(d=null,0===Mf&&e(fe)),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=bc(),null===a&&(a=ac())))),a}function pb(){var a,b,c,d,e,f;return a=Gf,b=rb(),null!==b?(c=dc(),null!==c?(d=fb(),null!==d?(e=dc(),null!==e?(f=ub(),null!==f?(Hf=a,b=ce(d),null===b?(Gf=a,a=b):a=b):(Gf=a,a=nc)):(Gf=a,a=nc)):(Gf=a,a=nc)):(Gf=a,a=nc)):(Gf=a,a=nc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Mf++,123===a.charCodeAt(Gf)?(b=Zd,Gf++):(b=null,0===Mf&&e($d)),Mf--,null===b&&(c=null,0===Mf&&e(ge)),b}function sb(){var b,c;return Mf++,a.substr(Gf,2)===ie?(b=ie,Gf+=2):(b=null,0===Mf&&e(je)),Mf--,null===b&&(c=null,0===Mf&&e(he)),b}function tb(){var b,c;return Mf++,a.substr(Gf,3)===le?(b=le,Gf+=3):(b=null,0===Mf&&e(me)),Mf--,null===b&&(c=null,0===Mf&&e(ke)),b}function ub(){var b,c;return Mf++,125===a.charCodeAt(Gf)?(b=oe,Gf++):(b=null,0===Mf&&e(pe)),Mf--,null===b&&(c=null,0===Mf&&e(ne)),b}function vb(){var b,c;return Mf++,a.substr(Gf,2)===re?(b=re,Gf+=2):(b=null,0===Mf&&e(se)),Mf--,null===b&&(c=null,0===Mf&&e(qe)),b}function wb(){var b,c;return Mf++,a.substr(Gf,3)===ue?(b=ue,Gf+=3):(b=null,0===Mf&&e(ve)),Mf--,null===b&&(c=null,0===Mf&&e(te)),b}function xb(){var b,c;return Mf++,a.substr(Gf,2)===xe?(b=xe,Gf+=2):(b=null,0===Mf&&e(ye)),Mf--,null===b&&(c=null,0===Mf&&e(we)),b}function yb(){var b,c;return Mf++,125===a.charCodeAt(Gf)?(b=oe,Gf++):(b=null,0===Mf&&e(pe)),Mf--,null===b&&(c=null,0===Mf&&e(ze)),b}function zb(){var b,c,d;return b=Gf,a.substr(Gf,2)===Ae?(c=Ae,Gf+=2):(c=null,0===Mf&&e(Be)),null!==c?(32===a.charCodeAt(Gf)?(d=Lc,Gf++):(d=null,0===Mf&&e(Mc)),null===d&&(d=oc),null!==d?(Hf=b,c=Ce(),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),null===b&&(b=Gf,61===a.charCodeAt(Gf)?(c=rc,Gf++):(c=null,0===Mf&&e(sc)),null!==c?(32===a.charCodeAt(Gf)?(d=Lc,Gf++):(d=null,0===Mf&&e(Mc)),null===d&&(d=oc),null!==d?(Hf=b,c=De(),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)),b}function Ab(){var b,c,d,f,g;return b=Gf,c=Tb(),null===c&&(c=oc),null!==c?(d=F(),null===d&&(d=oc),null!==d?(47===a.charCodeAt(Gf)?(f=Gc,Gf++):(f=null,0===Mf&&e(Hc)),null===f&&(f=oc),null!==f?(Hf=Gf,g=Ee(c,d),g=g?oc:nc,null!==g?(c=[c,d,f,g],b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Bb(){var a,b,c,d,e;if(a=Gf,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Hf=a,b=Fe(b,c,d),null===b?(Gf=a,a=b):a=b):(Gf=a,a=nc)}else Gf=a,a=nc}else Gf=a,a=nc;return a}function F(){var a,b,c,d;if(a=Gf,b=[],c=Gf,d=Mb(),null!==d&&(Hf=c,d=Ge(d)),null===d?(Gf=c,c=d):c=d,null===c&&(c=Gf,d=Nb(),null!==d&&(Hf=c,d=He(d)),null===d?(Gf=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Gf,d=Mb(),null!==d&&(Hf=c,d=Ge(d)),null===d?(Gf=c,c=d):c=d,null===c&&(c=Gf,d=Nb(),null!==d&&(Hf=c,d=He(d)),null===d?(Gf=c,c=d):c=d);else b=nc;return null!==b&&(Hf=a,b=Ie(b)),null===b?(Gf=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Gf,c=[],32===a.charCodeAt(Gf)?(d=Lc,Gf++):(d=null,0===Mf&&e(Mc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Gf)?(d=Lc,Gf++):(d=null,0===Mf&&e(Mc));else c=nc;return null!==c?(d=Gb(),null===d&&(d=Ib(),null===d&&(d=Jb(),null===d&&(d=Kb()))),null!==d?(Hf=b,c=Je(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Db(){var b;return Ke.test(a.charAt(Gf))?(b=a.charAt(Gf),Gf++):(b=null,0===Mf&&e(Le)),null===b&&(b=Wb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Gf,b=Q(),null!==b&&(Hf=a,b=Me(b)),null===b?(Gf=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Gf,c=Gf,34===a.charCodeAt(Gf)?(d=Hd,Gf++):(d=null,0===Mf&&e(Id)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Gf)?(g=Hd,Gf++):(g=null,0===Mf&&e(Id)),null!==g?(d=[d,f,g],c=d):(Gf=c,c=nc)):(Gf=c,c=nc)):(Gf=c,c=nc),null===c&&(c=Gf,39===a.charCodeAt(Gf)?(d=Jd,Gf++):(d=null,0===Mf&&e(Kd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Gf)?(g=Jd,Gf++):(g=null,0===Mf&&e(Kd)),null!==g?(d=[d,f,g],c=d):(Gf=c,c=nc)):(Gf=c,c=nc)):(Gf=c,c=nc)),null!==c&&(Hf=b,c=Ld(c)),null===c?(Gf=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Gf,c=Xb(),null!==c?(61===a.charCodeAt(Gf)?(d=rc,Gf++):(d=null,0===Mf&&e(sc)),null!==d?(f=Eb(),null!==f?(Hf=b,c=Ne(c,f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Hb(){var b,c,d,f,g,h;if(b=Gf,123===a.charCodeAt(Gf)?(c=Zd,Gf++):(c=null,0===Mf&&e($d)),null!==c)if(d=dc(),null!==d){if(f=Gf,g=[],h=Db(),null===h&&(32===a.charCodeAt(Gf)?(h=Lc,Gf++):(h=null,0===Mf&&e(Mc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Gf)?(h=Lc,Gf++):(h=null,0===Mf&&e(Mc)));else g=nc;null!==g&&(g=a.substring(f,Gf)),f=g,null!==f?(g=dc(),null!==g?(125===a.charCodeAt(Gf)?(h=oe,Gf++):(h=null,0===Mf&&e(pe)),null!==h?(Hf=b,c=Oe(f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc)}else Gf=b,b=nc;else Gf=b,b=nc;if(null===b){if(b=Gf,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=nc;null!==c&&(c=a.substring(b,Gf)),b=c}return b}function Ib(){var b,c,d,f,g,h;return b=Gf,c=L(),null!==c?(61===a.charCodeAt(Gf)?(d=rc,Gf++):(d=null,0===Mf&&e(sc)),null!==d?(f=Hb(),null!==f?(g=Gf,Mf++,33===a.charCodeAt(Gf)?(h=Pe,Gf++):(h=null,0===Mf&&e(Qe)),Mf--,null===h?g=oc:(Gf=g,g=nc),null!==g?(Hf=Gf,h=Re(c,f),h=h?oc:nc,null!==h?(Hf=b,c=Se(c,f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Jb(){var b,c,d,f;return b=Gf,c=L(),null!==c?(61===a.charCodeAt(Gf)?(d=rc,Gf++):(d=null,0===Mf&&e(sc)),null!==d?(f=Q(),null!==f?(Hf=b,c=Te(c,f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Kb(){var b,c,d,f;return b=Gf,c=L(),null!==c?(61===a.charCodeAt(Gf)?(d=rc,Gf++):(d=null,0===Mf&&e(sc)),null!==d?(f=bb(),null!==f?(Hf=b,c=Ue(c,f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Lb(){var b,c,d;return b=Gf,37===a.charCodeAt(Gf)?(c=Ve,Gf++):(c=null,0===Mf&&e(We)),null!==c?(d=Ob(),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Mb(){var b,c,d;return b=Gf,35===a.charCodeAt(Gf)?(c=Xe,Gf++):(c=null,0===Mf&&e(Ye)),null!==c?(d=Ob(),null!==d?(Hf=b,c=Ze(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Nb(){var b,c,d;return b=Gf,46===a.charCodeAt(Gf)?(c=gd,Gf++):(c=null,0===Mf&&e(hd)),null!==c?(d=Ob(),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Ob(){var a,b;return Mf++,a=Pb(),Mf--,null===a&&(b=null,0===Mf&&e($e)),a}function Pb(){var b,c,d;for(b=Gf,c=[],d=Qb();null!==d;)c.push(d),d=Qb();return null!==c&&(c=a.substring(b,Gf)),b=c}function Qb(){var b;return _e.test(a.charAt(Gf))?(b=a.charAt(Gf),Gf++):(b=null,0===Mf&&e(af)),null===b&&(b=Rb()),b}function Rb(){var b;return bf.test(a.charAt(Gf))?(b=a.charAt(Gf),Gf++):(b=null,0===Mf&&e(cf)),b}function Sb(){var b,c,d;if(b=Gf,c=[],d=Vb(),null!==d)for(;null!==d;)c.push(d),d=Vb();else c=nc;return null!==c&&(c=a.substring(b,Gf)),b=c}function Tb(){var b,c,d,f;return Mf++,b=Gf,37===a.charCodeAt(Gf)?(c=Ve,Gf++):(c=null,0===Mf&&e(We)),null!==c?(d=dc(),null!==d?(f=Sb(),null!==f?(Hf=b,c=kd(f),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),null===b&&(b=Ub()),Mf--,null===b&&(c=null,0===Mf&&e(df)),b}function Ub(){var a,b,c;return a=Gf,b=Sb(),null!==b?(Hf=Gf,c=ef(b),c=c?oc:nc,null!==c?(Hf=a,b=ff(b),null===b?(Gf=a,a=b):a=b):(Gf=a,a=nc)):(Gf=a,a=nc),a}function Vb(){var b;return _e.test(a.charAt(Gf))?(b=a.charAt(Gf),Gf++):(b=null,0===Mf&&e(af)),null===b&&(b=Wb()),b}function Wb(){var b,c,d,f;return b=Gf,58===a.charCodeAt(Gf)?(c=md,Gf++):(c=null,0===Mf&&e(nd)),null!==c?(d=Gf,Mf++,32===a.charCodeAt(Gf)?(f=Lc,Gf++):(f=null,0===Mf&&e(Mc)),Mf--,null===f?d=oc:(Gf=d,d=nc),null!==d?(Hf=b,c=Oc(c),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function Xb(){var a,b,c;return Mf++,a=Gf,b=Sb(),null!==b?(Hf=Gf,c=hf(b),c=c?oc:nc,null!==c?(Hf=a,b=ff(b),null===b?(Gf=a,a=b):a=b):(Gf=a,a=nc)):(Gf=a,a=nc),Mf--,null===a&&(b=null,0===Mf&&e(gf)),a}function Yb(){var a,b,c;return a=Gf,b=Zb(),null!==b?(c=cc(),null!==c?(Hf=a,b=kd(c),null===b?(Gf=a,a=b):a=b):(Gf=a,a=nc)):(Gf=a,a=nc),a}function Zb(){var b,c;return Mf++,b=Gf,61423===a.charCodeAt(Gf)?(c=kf,Gf++):(c=null,0===Mf&&e(lf)),null!==c&&(Hf=b,c=mf()),null===c?(Gf=b,b=c):b=c,Mf--,null===b&&(c=null,0===Mf&&e(jf)),b}function $b(){var b,c;return Mf++,b=Gf,61438===a.charCodeAt(Gf)?(c=of,Gf++):(c=null,0===Mf&&e(pf)),null!==c&&(Hf=b,c=mf()),null===c?(Gf=b,b=c):b=c,Mf--,null===b&&(c=null,0===Mf&&e(nf)),b}function _b(){var b,c;return Mf++,b=Gf,61422===a.charCodeAt(Gf)?(c=rf,Gf++):(c=null,0===Mf&&e(sf)),null!==c&&(Hf=b,c=mf()),null===c?(Gf=b,b=c):b=c,Mf--,null===b&&(c=null,0===Mf&&e(qf)),b}function ac(){var b,c,d,f;return Mf++,b=Gf,13===a.charCodeAt(Gf)?(c=uf,Gf++):(c=null,0===Mf&&e(vf)),null===c&&(c=oc),null!==c?(61439===a.charCodeAt(Gf)?(d=wf,Gf++):(d=null,0===Mf&&e(xf)),null!==d?(10===a.charCodeAt(Gf)?(f=yf,Gf++):(f=null,0===Mf&&e(zf)),null!==f?(Hf=b,c=Ce(),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc)):(Gf=b,b=nc),Mf--,null===b&&(c=null,0===Mf&&e(tf)),b}function bc(){var a,b;return Mf++,a=$b(),null===a&&(a=_b()),Mf--,null===a&&(b=null,0===Mf&&e(Af)),a}function cc(){var b,c,d;if(Mf++,b=Gf,c=[],d=ec(),null!==d)for(;null!==d;)c.push(d),d=ec();else c=nc;return null!==c&&(c=a.substring(b,Gf)),b=c,Mf--,null===b&&(c=null,0===Mf&&e(Bf)),b}function dc(){var a,b;for(Mf++,a=[],b=ec();null!==b;)a.push(b),b=ec();return Mf--,null===a&&(b=null,0===Mf&&e(Cf)),a}function ec(){var b,c;return Mf++,Ef.test(a.charAt(Gf))?(b=a.charAt(Gf),Gf++):(b=null,0===Mf&&e(Ff)),Mf--,null===b&&(c=null,0===Mf&&e(Df)),b}function fc(){var b,c,d;return b=Gf,c=Gf,Mf++,d=Zb(),null===d&&(d=$b(),null===d&&(d=ac())),Mf--,null===d?c=oc:(Gf=c,c=nc),null!==c?(a.length>Gf?(d=a.charAt(Gf),Gf++):(d=null,0===Mf&&e(fe)),null!==d?(Hf=b,c=Oc(d),null===c?(Gf=b,b=c):b=c):(Gf=b,b=nc)):(Gf=b,b=nc),b}function gc(){var b,c,d;for(b=Gf,c=[],d=fc();null!==d;)c.push(d),d=fc();return null!==c&&(c=a.substring(b,Gf)),b=c}function hc(a,b,c){var d=a.hash;if(c){d=d||new Pf.HashNode([]);for(var e=0;e1?arguments[1]:{},lc={start:g},mc=g,nc=null,oc="",pc=function(a){return a},qc=function(a,b){return new Pf.ProgramNode(a,b||[])},rc="=",sc='"="',tc="else",uc='"else"',vc=function(a){for(var b=[],c=[],d=0;d",Ac='">"',Bc=function(a,b){return[new Pf.PartialNode(a,b[0])]},Cc=/^[a-zA-Z0-9_$-\/]/,Dc="[a-zA-Z0-9_$-\\/]",Ec=function(a){return new Pf.PartialNameNode(new Pf.StringNode(a))},Fc=function(a){return[a]},Gc="/",Hc='"/"',Ic=/^[A-Z]/,Jc="[A-Z]",Kc=function(a){var b="view"; +if(a.mustache){var c=a.mustache.id.string.charAt(0);return Of&&c.match(/[A-Z]/)?(a.mustache=hc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Of&&c.match(/[A-Z]/)?hc(a,b):a},Lc=" ",Mc='" "',Nc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Pf.ContentNode(" ")),a=a.concat(b[c])}return a},Oc=function(a){return a},Pc=function(a){return[a]},Qc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Rc=function(a,b){return b?new Pf.BlockNode(a,b,b.inverse,a.id):a},Sc=": ",Tc='": "',Uc=function(a){return new Pf.ProgramNode(a,[])},Vc=function(a){return a&&a[2]},Wc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},Xc=function(a,b,c,d){if(a){var e=new Pf.PartialNameNode(new Pf.StringNode(b.string));return new Pf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[h]):(h.push(new Pf.ContentNode(">")),[h,new Pf.ContentNode("")])},Ge=function(a){return{shorthand:a,id:!0}},He=function(a){return{shorthand:a}},Ie=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Je=function(a){return[new Pf.ContentNode(" ")].concat(a)},Ke=/^[A-Za-z.0-9_\-]/,Le="[A-Za-z.0-9_\\-]",Me=function(a){return new Pf.MustacheNode([a])},Ne=function(a,b){return[hc(b,"action",[["on",new Pf.StringNode(a)]])]},Oe=function(a){return a.replace(/ *$/,"")},Pe="!",Qe='"!"',Re=function(){return Of},Se=function(a,b){var c=new Pf.HashNode([[a,new Pf.StringNode(b)]]),d=[new Pf.IdNode([{part:"bindAttr"}])],e=new Pf.MustacheNode(d,c);return[e]},Te=function(a,b){var c=new Pf.MustacheNode([b]);return Of&&"!"===b._emblemSuffixModifier&&(c=hc(c,"unbound")),[new Pf.ContentNode(a+"="+'"'),c,new Pf.ContentNode('"')]},Ue=function(a,b){var c=[new Pf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Pf.ContentNode('"')])},Ve="%",We='"%"',Xe="#",Ye='"#"',Ze=function(a){return a},$e="CSSIdentifier",_e=/^[_a-zA-Z0-9\-]/,af="[_a-zA-Z0-9\\-]",bf=/^[\x80-\xFF]/,cf="[\\x80-\\xFF]",df="KnownHTMLTagName",ef=function(a){return!!Rf[a]},ff=function(a){return a},gf="a JS event",hf=function(a){return!!Sf[a]},jf="INDENT",kf="\uefef",lf='"\\uEFEF"',mf=function(){return""},nf="DEDENT",of="\ueffe",pf='"\\uEFFE"',qf="Unmatched DEDENT",rf="\uefee",sf='"\\uEFEE"',tf="LineEnd",uf="\r",vf='"\\r"',wf="\uefff",xf='"\\uEFFF"',yf="\n",zf='"\\n"',Af="ANYDEDENT",Bf="RequiredWhitespace",Cf="OptionalWhitespace",Df="InlineWhitespace",Ef=/^[ \t]/,Ff="[ \\t]",Gf=0,Hf=0,If=0,Jf={line:1,column:1,seenCR:!1},Kf=0,Lf=[],Mf=0;if("startRule"in kc){if(!(kc.startRule in lc))throw new Error("Can't start parsing from rule \""+kc.startRule+'".');mc=lc[kc.startRule]}var Nf=c.handlebarsVariant,Of="Ember.Handlebars"===Nf.JavaScriptCompiler.prototype.namespace,Pf=Nf.AST,Qf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Rf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},Sf={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0};if(jc=mc(),null!==jc&&Gf===a.length)return jc;throw f(Lf),Hf=Math.max(Gf,Kf),new b(Lf,Hfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.4/emblem.js b/ajax/libs/emblem/0.3.4/emblem.js new file mode 100644 index 000000000..452699635 --- /dev/null +++ b/ajax/libs/emblem/0.3.4/emblem.js @@ -0,0 +1,6168 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return new AST.ProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + return new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, mustacheNode.id); + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return new AST.ProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = new AST.MustacheNode(actualParams, hash); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(a) { + return a; + }, + peg$c42 = function(id, classes) { return [id, classes]; }, + peg$c43 = function(classes) { return [null, classes]; }, + peg$c44 = function(a) { return a; }, + peg$c45 = function(h) { return new AST.HashNode(h); }, + peg$c46 = "PathIdent", + peg$c47 = "..", + peg$c48 = "\"..\"", + peg$c49 = ".", + peg$c50 = "\".\"", + peg$c51 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c52 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c53 = function(s) { return s; }, + peg$c54 = "Key", + peg$c55 = ":", + peg$c56 = "\":\"", + peg$c57 = function(h) { return [h[0], h[2]]; }, + peg$c58 = function(n) { return n; }, + peg$c59 = function(s, p) { return { part: p, separator: s }; }, + peg$c60 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c61 = "PathSeparator", + peg$c62 = /^[\/.]/, + peg$c63 = "[\\/.]", + peg$c64 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c65 = function(v) { return new AST.StringNode(v); }, + peg$c66 = function(v) { return new AST.IntegerNode(v); }, + peg$c67 = function(v) { return new AST.BooleanNode(v); }, + peg$c68 = "Boolean", + peg$c69 = "true", + peg$c70 = "\"true\"", + peg$c71 = "false", + peg$c72 = "\"false\"", + peg$c73 = "Integer", + peg$c74 = "-", + peg$c75 = "\"-\"", + peg$c76 = /^[0-9]/, + peg$c77 = "[0-9]", + peg$c78 = function(s) { return parseInt(s); }, + peg$c79 = "\"", + peg$c80 = "\"\\\"\"", + peg$c81 = "'", + peg$c82 = "\"'\"", + peg$c83 = function(p) { return p[1]; }, + peg$c84 = /^[^"}]/, + peg$c85 = "[^\"}]", + peg$c86 = /^[^'}]/, + peg$c87 = "[^'}]", + peg$c88 = /^[A-Za-z]/, + peg$c89 = "[A-Za-z]", + peg$c90 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c91 = /^[|`']/, + peg$c92 = "[|`']", + peg$c93 = "<", + peg$c94 = "\"<\"", + peg$c95 = function() { return '<'; }, + peg$c96 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c97 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c98 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c99 = "{", + peg$c100 = "\"{\"", + peg$c101 = /^[^}]/, + peg$c102 = "[^}]", + peg$c103 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c104 = function(m) { m.escaped = true; return m; }, + peg$c105 = function(m) { m.escaped = false; return m; }, + peg$c106 = function(a) { return new AST.ContentNode(a); }, + peg$c107 = "any character", + peg$c108 = "SingleMustacheOpen", + peg$c109 = "DoubleMustacheOpen", + peg$c110 = "{{", + peg$c111 = "\"{{\"", + peg$c112 = "TripleMustacheOpen", + peg$c113 = "{{{", + peg$c114 = "\"{{{\"", + peg$c115 = "SingleMustacheClose", + peg$c116 = "}", + peg$c117 = "\"}\"", + peg$c118 = "DoubleMustacheClose", + peg$c119 = "}}", + peg$c120 = "\"}}\"", + peg$c121 = "TripleMustacheClose", + peg$c122 = "}}}", + peg$c123 = "\"}}}\"", + peg$c124 = "InterpolationOpen", + peg$c125 = "#{", + peg$c126 = "\"#{\"", + peg$c127 = "InterpolationClose", + peg$c128 = "==", + peg$c129 = "\"==\"", + peg$c130 = function() { return false; }, + peg$c131 = function() { return true; }, + peg$c132 = function(h, s) { return h || s; }, + peg$c133 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c134 = function(s) { return { shorthand: s, id: true}; }, + peg$c135 = function(s) { return { shorthand: s }; }, + peg$c136 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c137 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c138 = /^[A-Za-z.0-9_\-]/, + peg$c139 = "[A-Za-z.0-9_\\-]", + peg$c140 = function(id) { return new AST.MustacheNode([id]); }, + peg$c141 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c142 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c143 = function(value) { return value.replace(/ *$/, ''); }, + peg$c144 = "!", + peg$c145 = "\"!\"", + peg$c146 = function(key, value) { return IS_EMBER; }, + peg$c147 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bindAttr'}])]; + var mustacheNode = new AST.MustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c148 = function(key, id) { + var mustacheNode = new AST.MustacheNode([id]); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c149 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c150 = "_", + peg$c151 = "\"_\"", + peg$c152 = "%", + peg$c153 = "\"%\"", + peg$c154 = "#", + peg$c155 = "\"#\"", + peg$c156 = function(c) { return c;}, + peg$c157 = "CSSIdentifier", + peg$c158 = /^[_a-zA-Z0-9\-]/, + peg$c159 = "[_a-zA-Z0-9\\-]", + peg$c160 = /^[_a-zA-Z]/, + peg$c161 = "[_a-zA-Z]", + peg$c162 = /^[\x80-\xFF]/, + peg$c163 = "[\\x80-\\xFF]", + peg$c164 = "KnownHTMLTagName", + peg$c165 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c166 = function(t) { return t; }, + peg$c167 = "a JS event", + peg$c168 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c169 = "INDENT", + peg$c170 = "\uEFEF", + peg$c171 = "\"\\uEFEF\"", + peg$c172 = function() { return ''; }, + peg$c173 = "DEDENT", + peg$c174 = "\uEFFE", + peg$c175 = "\"\\uEFFE\"", + peg$c176 = "Unmatched DEDENT", + peg$c177 = "\uEFEE", + peg$c178 = "\"\\uEFEE\"", + peg$c179 = "LineEnd", + peg$c180 = "\r", + peg$c181 = "\"\\r\"", + peg$c182 = "\uEFFF", + peg$c183 = "\"\\uEFFF\"", + peg$c184 = "\n", + peg$c185 = "\"\\n\"", + peg$c186 = "ANYDEDENT", + peg$c187 = "RequiredWhitespace", + peg$c188 = "OptionalWhitespace", + peg$c189 = "InlineWhitespace", + peg$c190 = /^[ \t]/, + peg$c191 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c38(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$parseparam(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c45(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c47) { + s0 = peg$c47; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c49; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$parsebooleanNode(); + if (s2 === null) { + s2 = peg$parseintegerNode(); + if (s2 === null) { + s2 = peg$parsepathIdNode(); + if (s2 === null) { + s2 = peg$parsestringNode(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c62.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c69) { + s0 = peg$c69; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s0 = peg$c71; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c88.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c91.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c96(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c79; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c79; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c99; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c103(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c99; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c125) { + s0 = peg$c125; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c128) { + s1 = peg$c128; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c132(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c138.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c69) { + s3 = peg$c69; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s3 = peg$c71; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c99; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c116; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c144; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c146(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c150; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c74; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c154; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c160.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c162.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c55; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c168(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c180; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c182; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c184; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c190.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return new AST.MustacheNode(params, hash, !mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.4/emblem.min.js b/ajax/libs/emblem/0.3.4/emblem.min.js new file mode 100644 index 000000000..8c0069ac3 --- /dev/null +++ b/ajax/libs/emblem/0.3.4/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Of!==b&&(Of>b&&(Of=0,Pf={line:1,column:1,seenCR:!1}),c(Pf,Of,b),Of=b),Pf}function e(a){Qf>Mf||(Mf>Qf&&(Qf=Mf,Rf=[]),Rf.push(a))}function f(a){var b=0;for(a.sort();bMf?(d=a.charAt(Mf),Mf++):(d=null,0===Sf&&e(ke)),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function lb(){var b,c,d;return b=Mf,c=Mf,Sf++,d=ob(),null===d&&(39===a.charCodeAt(Mf)?(d=Od,Mf++):(d=null,0===Sf&&e(Pd))),Sf--,null===d?c=pc:(Mf=c,c=oc),null!==c?(a.length>Mf?(d=a.charAt(Mf),Mf++):(d=null,0===Sf&&e(ke)),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function mb(){var b,c,d,e;if(b=Mf,c=Mf,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=oc;return null!==d&&(d=a.substring(c,Mf)),c=d,null!==c&&(Nf=b,c=je(c)),null===c?(Mf=b,b=c):b=c,b}function nb(){var b,c,d;return b=Mf,c=Mf,Sf++,d=ob(),Sf--,null===d?c=pc:(Mf=c,c=oc),null!==c?(a.length>Mf?(d=a.charAt(Mf),Mf++):(d=null,0===Sf&&e(ke)),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=cc(),null===a&&(a=bc())))),a}function pb(){var a,b,c,d,e,f;return a=Mf,b=rb(),null!==b?(c=ec(),null!==c?(d=fb(),null!==d?(e=ec(),null!==e?(f=ub(),null!==f?(Nf=a,b=he(d),null===b?(Mf=a,a=b):a=b):(Mf=a,a=oc)):(Mf=a,a=oc)):(Mf=a,a=oc)):(Mf=a,a=oc)):(Mf=a,a=oc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Sf++,123===a.charCodeAt(Mf)?(b=ce,Mf++):(b=null,0===Sf&&e(de)),Sf--,null===b&&(c=null,0===Sf&&e(le)),b}function sb(){var b,c;return Sf++,a.substr(Mf,2)===ne?(b=ne,Mf+=2):(b=null,0===Sf&&e(oe)),Sf--,null===b&&(c=null,0===Sf&&e(me)),b}function tb(){var b,c;return Sf++,a.substr(Mf,3)===qe?(b=qe,Mf+=3):(b=null,0===Sf&&e(re)),Sf--,null===b&&(c=null,0===Sf&&e(pe)),b}function ub(){var b,c;return Sf++,125===a.charCodeAt(Mf)?(b=te,Mf++):(b=null,0===Sf&&e(ue)),Sf--,null===b&&(c=null,0===Sf&&e(se)),b}function vb(){var b,c;return Sf++,a.substr(Mf,2)===we?(b=we,Mf+=2):(b=null,0===Sf&&e(xe)),Sf--,null===b&&(c=null,0===Sf&&e(ve)),b}function wb(){var b,c;return Sf++,a.substr(Mf,3)===ze?(b=ze,Mf+=3):(b=null,0===Sf&&e(Ae)),Sf--,null===b&&(c=null,0===Sf&&e(ye)),b}function xb(){var b,c;return Sf++,a.substr(Mf,2)===Ce?(b=Ce,Mf+=2):(b=null,0===Sf&&e(De)),Sf--,null===b&&(c=null,0===Sf&&e(Be)),b}function yb(){var b,c;return Sf++,125===a.charCodeAt(Mf)?(b=te,Mf++):(b=null,0===Sf&&e(ue)),Sf--,null===b&&(c=null,0===Sf&&e(Ee)),b}function zb(){var b,c,d;return b=Mf,a.substr(Mf,2)===Fe?(c=Fe,Mf+=2):(c=null,0===Sf&&e(Ge)),null!==c?(32===a.charCodeAt(Mf)?(d=Mc,Mf++):(d=null,0===Sf&&e(Nc)),null===d&&(d=pc),null!==d?(Nf=b,c=He(),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),null===b&&(b=Mf,61===a.charCodeAt(Mf)?(c=sc,Mf++):(c=null,0===Sf&&e(tc)),null!==c?(32===a.charCodeAt(Mf)?(d=Mc,Mf++):(d=null,0===Sf&&e(Nc)),null===d&&(d=pc),null!==d?(Nf=b,c=Ie(),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)),b}function Ab(){var b,c,d,f,g;return b=Mf,c=Ub(),null===c&&(c=pc),null!==c?(d=F(),null===d&&(d=pc),null!==d?(47===a.charCodeAt(Mf)?(f=Hc,Mf++):(f=null,0===Sf&&e(Ic)),null===f&&(f=pc),null!==f?(Nf=Mf,g=Je(c,d),g=g?pc:oc,null!==g?(c=[c,d,f,g],b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Bb(){var a,b,c,d,e;if(a=Mf,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Nf=a,b=Ke(b,c,d),null===b?(Mf=a,a=b):a=b):(Mf=a,a=oc)}else Mf=a,a=oc}else Mf=a,a=oc;return a}function F(){var a,b,c,d;if(a=Mf,b=[],c=Mf,d=Nb(),null!==d&&(Nf=c,d=Le(d)),null===d?(Mf=c,c=d):c=d,null===c&&(c=Mf,d=Ob(),null!==d&&(Nf=c,d=Me(d)),null===d?(Mf=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Mf,d=Nb(),null!==d&&(Nf=c,d=Le(d)),null===d?(Mf=c,c=d):c=d,null===c&&(c=Mf,d=Ob(),null!==d&&(Nf=c,d=Me(d)),null===d?(Mf=c,c=d):c=d);else b=oc;return null!==b&&(Nf=a,b=Ne(b)),null===b?(Mf=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Mf,c=[],32===a.charCodeAt(Mf)?(d=Mc,Mf++):(d=null,0===Sf&&e(Nc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Mf)?(d=Mc,Mf++):(d=null,0===Sf&&e(Nc));else c=oc;return null!==c?(d=Gb(),null===d&&(d=Hb(),null===d&&(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Lb())))),null!==d?(Nf=b,c=Oe(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Db(){var b;return Pe.test(a.charAt(Mf))?(b=a.charAt(Mf),Mf++):(b=null,0===Sf&&e(Qe)),null===b&&(b=Xb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Mf,b=Q(),null!==b&&(Nf=a,b=Re(b)),null===b?(Mf=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Mf,c=Mf,34===a.charCodeAt(Mf)?(d=Md,Mf++):(d=null,0===Sf&&e(Nd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Mf)?(g=Md,Mf++):(g=null,0===Sf&&e(Nd)),null!==g?(d=[d,f,g],c=d):(Mf=c,c=oc)):(Mf=c,c=oc)):(Mf=c,c=oc),null===c&&(c=Mf,39===a.charCodeAt(Mf)?(d=Od,Mf++):(d=null,0===Sf&&e(Pd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Mf)?(g=Od,Mf++):(g=null,0===Sf&&e(Pd)),null!==g?(d=[d,f,g],c=d):(Mf=c,c=oc)):(Mf=c,c=oc)):(Mf=c,c=oc)),null!==c&&(Nf=b,c=Qd(c)),null===c?(Mf=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Mf,c=Yb(),null!==c?(61===a.charCodeAt(Mf)?(d=sc,Mf++):(d=null,0===Sf&&e(tc)),null!==d?(f=Eb(),null!==f?(Nf=b,c=Se(c,f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Hb(){var b,c,d,f;return b=Mf,c=L(),null!==c?(61===a.charCodeAt(Mf)?(d=sc,Mf++):(d=null,0===Sf&&e(tc)),null!==d?(a.substr(Mf,4)===Cd?(f=Cd,Mf+=4):(f=null,0===Sf&&e(Dd)),null===f&&(a.substr(Mf,5)===Ed?(f=Ed,Mf+=5):(f=null,0===Sf&&e(Fd))),null!==f?(Nf=b,c=Te(c,f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Ib(){var b,c,d,f,g,h;if(b=Mf,123===a.charCodeAt(Mf)?(c=ce,Mf++):(c=null,0===Sf&&e(de)),null!==c)if(d=ec(),null!==d){if(f=Mf,g=[],h=Db(),null===h&&(32===a.charCodeAt(Mf)?(h=Mc,Mf++):(h=null,0===Sf&&e(Nc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Mf)?(h=Mc,Mf++):(h=null,0===Sf&&e(Nc)));else g=oc;null!==g&&(g=a.substring(f,Mf)),f=g,null!==f?(g=ec(),null!==g?(125===a.charCodeAt(Mf)?(h=te,Mf++):(h=null,0===Sf&&e(ue)),null!==h?(Nf=b,c=Ue(f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc)}else Mf=b,b=oc;else Mf=b,b=oc;if(null===b){if(b=Mf,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=oc;null!==c&&(c=a.substring(b,Mf)),b=c}return b}function Jb(){var b,c,d,f,g,h;return b=Mf,c=L(),null!==c?(61===a.charCodeAt(Mf)?(d=sc,Mf++):(d=null,0===Sf&&e(tc)),null!==d?(f=Ib(),null!==f?(g=Mf,Sf++,33===a.charCodeAt(Mf)?(h=Ve,Mf++):(h=null,0===Sf&&e(We)),Sf--,null===h?g=pc:(Mf=g,g=oc),null!==g?(Nf=Mf,h=Xe(c,f),h=h?pc:oc,null!==h?(Nf=b,c=Ye(c,f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Kb(){var b,c,d,f;return b=Mf,c=L(),null!==c?(61===a.charCodeAt(Mf)?(d=sc,Mf++):(d=null,0===Sf&&e(tc)),null!==d?(f=Q(),null!==f?(Nf=b,c=Ze(c,f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Lb(){var b,c,d,f;return b=Mf,c=L(),null!==c?(61===a.charCodeAt(Mf)?(d=sc,Mf++):(d=null,0===Sf&&e(tc)),null!==d?(f=bb(),null!==f?(Nf=b,c=$e(c,f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Mb(){var b,c,d;return b=Mf,37===a.charCodeAt(Mf)?(c=_e,Mf++):(c=null,0===Sf&&e(af)),null!==c?(d=Pb(),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Nb(){var b,c,d;return b=Mf,35===a.charCodeAt(Mf)?(c=bf,Mf++):(c=null,0===Sf&&e(cf)),null!==c?(d=Pb(),null!==d?(Nf=b,c=df(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Ob(){var b,c,d;return b=Mf,46===a.charCodeAt(Mf)?(c=id,Mf++):(c=null,0===Sf&&e(jd)),null!==c?(d=Pb(),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Pb(){var a,b;return Sf++,a=Qb(),Sf--,null===a&&(b=null,0===Sf&&e(ef)),a}function Qb(){var b,c,d;for(b=Mf,c=[],d=Rb();null!==d;)c.push(d),d=Rb();return null!==c&&(c=a.substring(b,Mf)),b=c}function Rb(){var b;return ff.test(a.charAt(Mf))?(b=a.charAt(Mf),Mf++):(b=null,0===Sf&&e(gf)),null===b&&(b=Sb()),b}function Sb(){var b;return hf.test(a.charAt(Mf))?(b=a.charAt(Mf),Mf++):(b=null,0===Sf&&e(jf)),b}function Tb(){var b,c,d;if(b=Mf,c=[],d=Wb(),null!==d)for(;null!==d;)c.push(d),d=Wb();else c=oc;return null!==c&&(c=a.substring(b,Mf)),b=c}function Ub(){var b,c,d,f;return Sf++,b=Mf,37===a.charCodeAt(Mf)?(c=_e,Mf++):(c=null,0===Sf&&e(af)),null!==c?(d=ec(),null!==d?(f=Tb(),null!==f?(Nf=b,c=md(f),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),null===b&&(b=Vb()),Sf--,null===b&&(c=null,0===Sf&&e(kf)),b}function Vb(){var a,b,c;return a=Mf,b=Tb(),null!==b?(Nf=Mf,c=lf(b),c=c?pc:oc,null!==c?(Nf=a,b=mf(b),null===b?(Mf=a,a=b):a=b):(Mf=a,a=oc)):(Mf=a,a=oc),a}function Wb(){var b;return ff.test(a.charAt(Mf))?(b=a.charAt(Mf),Mf++):(b=null,0===Sf&&e(gf)),null===b&&(b=Xb()),b}function Xb(){var b,c,d,f;return b=Mf,58===a.charCodeAt(Mf)?(c=od,Mf++):(c=null,0===Sf&&e(pd)),null!==c?(d=Mf,Sf++,32===a.charCodeAt(Mf)?(f=Mc,Mf++):(f=null,0===Sf&&e(Nc)),Sf--,null===f?d=pc:(Mf=d,d=oc),null!==d?(Nf=b,c=Pc(c),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function Yb(){var a,b,c;return Sf++,a=Mf,b=Tb(),null!==b?(Nf=Mf,c=of(b),c=c?pc:oc,null!==c?(Nf=a,b=mf(b),null===b?(Mf=a,a=b):a=b):(Mf=a,a=oc)):(Mf=a,a=oc),Sf--,null===a&&(b=null,0===Sf&&e(nf)),a}function Zb(){var a,b,c;return a=Mf,b=$b(),null!==b?(c=dc(),null!==c?(Nf=a,b=md(c),null===b?(Mf=a,a=b):a=b):(Mf=a,a=oc)):(Mf=a,a=oc),a}function $b(){var b,c;return Sf++,b=Mf,61423===a.charCodeAt(Mf)?(c=qf,Mf++):(c=null,0===Sf&&e(rf)),null!==c&&(Nf=b,c=sf()),null===c?(Mf=b,b=c):b=c,Sf--,null===b&&(c=null,0===Sf&&e(pf)),b}function _b(){var b,c;return Sf++,b=Mf,61438===a.charCodeAt(Mf)?(c=uf,Mf++):(c=null,0===Sf&&e(vf)),null!==c&&(Nf=b,c=sf()),null===c?(Mf=b,b=c):b=c,Sf--,null===b&&(c=null,0===Sf&&e(tf)),b}function ac(){var b,c;return Sf++,b=Mf,61422===a.charCodeAt(Mf)?(c=xf,Mf++):(c=null,0===Sf&&e(yf)),null!==c&&(Nf=b,c=sf()),null===c?(Mf=b,b=c):b=c,Sf--,null===b&&(c=null,0===Sf&&e(wf)),b}function bc(){var b,c,d,f;return Sf++,b=Mf,13===a.charCodeAt(Mf)?(c=Af,Mf++):(c=null,0===Sf&&e(Bf)),null===c&&(c=pc),null!==c?(61439===a.charCodeAt(Mf)?(d=Cf,Mf++):(d=null,0===Sf&&e(Df)),null!==d?(10===a.charCodeAt(Mf)?(f=Ef,Mf++):(f=null,0===Sf&&e(Ff)),null!==f?(Nf=b,c=He(),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc)):(Mf=b,b=oc),Sf--,null===b&&(c=null,0===Sf&&e(zf)),b}function cc(){var a,b;return Sf++,a=_b(),null===a&&(a=ac()),Sf--,null===a&&(b=null,0===Sf&&e(Gf)),a}function dc(){var b,c,d;if(Sf++,b=Mf,c=[],d=fc(),null!==d)for(;null!==d;)c.push(d),d=fc();else c=oc;return null!==c&&(c=a.substring(b,Mf)),b=c,Sf--,null===b&&(c=null,0===Sf&&e(Hf)),b}function ec(){var a,b;for(Sf++,a=[],b=fc();null!==b;)a.push(b),b=fc();return Sf--,null===a&&(b=null,0===Sf&&e(If)),a}function fc(){var b,c;return Sf++,Kf.test(a.charAt(Mf))?(b=a.charAt(Mf),Mf++):(b=null,0===Sf&&e(Lf)),Sf--,null===b&&(c=null,0===Sf&&e(Jf)),b}function gc(){var b,c,d;return b=Mf,c=Mf,Sf++,d=$b(),null===d&&(d=_b(),null===d&&(d=bc())),Sf--,null===d?c=pc:(Mf=c,c=oc),null!==c?(a.length>Mf?(d=a.charAt(Mf),Mf++):(d=null,0===Sf&&e(ke)),null!==d?(Nf=b,c=Pc(d),null===c?(Mf=b,b=c):b=c):(Mf=b,b=oc)):(Mf=b,b=oc),b}function hc(){var b,c,d;for(b=Mf,c=[],d=gc();null!==d;)c.push(d),d=gc();return null!==c&&(c=a.substring(b,Mf)),b=c}function ic(a,b,c){var d=a.hash;if(c){d=d||new Vf.HashNode([]);for(var e=0;e1?arguments[1]:{},mc={start:g},nc=g,oc=null,pc="",qc=function(a){return a},rc=function(a,b){return new Vf.ProgramNode(a,b||[]) +},sc="=",tc='"="',uc="else",vc='"else"',wc=function(a){for(var b=[],c=[],d=0;d",Bc='">"',Cc=function(a,b){return[new Vf.PartialNode(a,b[0])]},Dc=/^[a-zA-Z0-9_$-\/]/,Ec="[a-zA-Z0-9_$-\\/]",Fc=function(a){return new Vf.PartialNameNode(new Vf.StringNode(a))},Gc=function(a){return[a]},Hc="/",Ic='"/"',Jc=/^[A-Z]/,Kc="[A-Z]",Lc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return Uf&&c.match(/[A-Z]/)?(a.mustache=ic(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Uf&&c.match(/[A-Z]/)?ic(a,b):a},Mc=" ",Nc='" "',Oc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Vf.ContentNode(" ")),a=a.concat(b[c])}return a},Pc=function(a){return a},Qc=function(a){return[a]},Rc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Sc=function(a,b){return b?new Vf.BlockNode(a,b,b.inverse,a.id):a},Tc=": ",Uc='": "',Vc=function(a){return new Vf.ProgramNode(a,[])},Wc=function(a){return a&&a[2]},Xc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},Yc=function(a,b,c,d){if(a){var e=new Vf.PartialNameNode(new Vf.StringNode(b.string));return new Vf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[h]):(h.push(new Vf.ContentNode(">")),[h,new Vf.ContentNode("")])},Le=function(a){return{shorthand:a,id:!0}},Me=function(a){return{shorthand:a}},Ne=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Oe=function(a){return a.length?[new Vf.ContentNode(" ")].concat(a):[]},Pe=/^[A-Za-z.0-9_\-]/,Qe="[A-Za-z.0-9_\\-]",Re=function(a){return new Vf.MustacheNode([a])},Se=function(a,b){return[ic(b,"action",[["on",new Vf.StringNode(a)]])]},Te=function(a,b){return"true"===b?[new Vf.ContentNode(a)]:[]},Ue=function(a){return a.replace(/ *$/,"")},Ve="!",We='"!"',Xe=function(){return Uf},Ye=function(a,b){var c=new Vf.HashNode([[a,new Vf.StringNode(b)]]),d=[new Vf.IdNode([{part:"bindAttr"}])],e=new Vf.MustacheNode(d,c);return[e]},Ze=function(a,b){var c=new Vf.MustacheNode([b]);return Uf&&"!"===b._emblemSuffixModifier&&(c=ic(c,"unbound")),[new Vf.ContentNode(a+"="+'"'),c,new Vf.ContentNode('"')]},$e=function(a,b){var c=[new Vf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Vf.ContentNode('"')])},_e="%",af='"%"',bf="#",cf='"#"',df=function(a){return a},ef="CSSIdentifier",ff=/^[_a-zA-Z0-9\-]/,gf="[_a-zA-Z0-9\\-]",hf=/^[\x80-\xFF]/,jf="[\\x80-\\xFF]",kf="KnownHTMLTagName",lf=function(a){return!!Xf[a]},mf=function(a){return a},nf="a JS event",of=function(a){return!!Yf[a]},pf="INDENT",qf="\uefef",rf='"\\uEFEF"',sf=function(){return""},tf="DEDENT",uf="\ueffe",vf='"\\uEFFE"',wf="Unmatched DEDENT",xf="\uefee",yf='"\\uEFEE"',zf="LineEnd",Af="\r",Bf='"\\r"',Cf="\uefff",Df='"\\uEFFF"',Ef="\n",Ff='"\\n"',Gf="ANYDEDENT",Hf="RequiredWhitespace",If="OptionalWhitespace",Jf="InlineWhitespace",Kf=/^[ \t]/,Lf="[ \\t]",Mf=0,Nf=0,Of=0,Pf={line:1,column:1,seenCR:!1},Qf=0,Rf=[],Sf=0;if("startRule"in lc){if(!(lc.startRule in mc))throw new Error("Can't start parsing from rule \""+lc.startRule+'".');nc=mc[lc.startRule]}var Tf=c.handlebarsVariant,Uf="Ember.Handlebars"===Tf.JavaScriptCompiler.prototype.namespace,Vf=Tf.AST,Wf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Xf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},Yf={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0};if(kc=nc(),null!==kc&&Mf===a.length)return kc;throw f(Rf),Nf=Math.max(Mf,Qf),new b(Rf,Nfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.5/emblem.js b/ajax/libs/emblem/0.3.5/emblem.js new file mode 100644 index 000000000..bb878777f --- /dev/null +++ b/ajax/libs/emblem/0.3.5/emblem.js @@ -0,0 +1,6206 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = createMustacheNode(actualParams, hash, true); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(a) { + return a; + }, + peg$c42 = function(id, classes) { return [id, classes]; }, + peg$c43 = function(classes) { return [null, classes]; }, + peg$c44 = function(a) { return a; }, + peg$c45 = function(h) { return new AST.HashNode(h); }, + peg$c46 = "PathIdent", + peg$c47 = "..", + peg$c48 = "\"..\"", + peg$c49 = ".", + peg$c50 = "\".\"", + peg$c51 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c52 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c53 = function(s) { return s; }, + peg$c54 = "Key", + peg$c55 = ":", + peg$c56 = "\":\"", + peg$c57 = function(h) { return [h[0], h[2]]; }, + peg$c58 = function(n) { return n; }, + peg$c59 = function(s, p) { return { part: p, separator: s }; }, + peg$c60 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c61 = "PathSeparator", + peg$c62 = /^[\/.]/, + peg$c63 = "[\\/.]", + peg$c64 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c65 = function(v) { return new AST.StringNode(v); }, + peg$c66 = function(v) { return new AST.IntegerNode(v); }, + peg$c67 = function(v) { return new AST.BooleanNode(v); }, + peg$c68 = "Boolean", + peg$c69 = "true", + peg$c70 = "\"true\"", + peg$c71 = "false", + peg$c72 = "\"false\"", + peg$c73 = "Integer", + peg$c74 = "-", + peg$c75 = "\"-\"", + peg$c76 = /^[0-9]/, + peg$c77 = "[0-9]", + peg$c78 = function(s) { return parseInt(s); }, + peg$c79 = "\"", + peg$c80 = "\"\\\"\"", + peg$c81 = "'", + peg$c82 = "\"'\"", + peg$c83 = function(p) { return p[1]; }, + peg$c84 = /^[^"}]/, + peg$c85 = "[^\"}]", + peg$c86 = /^[^'}]/, + peg$c87 = "[^'}]", + peg$c88 = /^[A-Za-z]/, + peg$c89 = "[A-Za-z]", + peg$c90 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c91 = /^[|`']/, + peg$c92 = "[|`']", + peg$c93 = "<", + peg$c94 = "\"<\"", + peg$c95 = function() { return '<'; }, + peg$c96 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c97 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c98 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c99 = "{", + peg$c100 = "\"{\"", + peg$c101 = /^[^}]/, + peg$c102 = "[^}]", + peg$c103 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c104 = function(m) { m.escaped = true; return m; }, + peg$c105 = function(m) { m.escaped = false; return m; }, + peg$c106 = function(a) { return new AST.ContentNode(a); }, + peg$c107 = "any character", + peg$c108 = "SingleMustacheOpen", + peg$c109 = "DoubleMustacheOpen", + peg$c110 = "{{", + peg$c111 = "\"{{\"", + peg$c112 = "TripleMustacheOpen", + peg$c113 = "{{{", + peg$c114 = "\"{{{\"", + peg$c115 = "SingleMustacheClose", + peg$c116 = "}", + peg$c117 = "\"}\"", + peg$c118 = "DoubleMustacheClose", + peg$c119 = "}}", + peg$c120 = "\"}}\"", + peg$c121 = "TripleMustacheClose", + peg$c122 = "}}}", + peg$c123 = "\"}}}\"", + peg$c124 = "InterpolationOpen", + peg$c125 = "#{", + peg$c126 = "\"#{\"", + peg$c127 = "InterpolationClose", + peg$c128 = "==", + peg$c129 = "\"==\"", + peg$c130 = function() { return false; }, + peg$c131 = function() { return true; }, + peg$c132 = function(h, s) { return h || s; }, + peg$c133 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c134 = function(s) { return { shorthand: s, id: true}; }, + peg$c135 = function(s) { return { shorthand: s }; }, + peg$c136 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c137 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c138 = /^[A-Za-z.0-9_\-]/, + peg$c139 = "[A-Za-z.0-9_\\-]", + peg$c140 = function(id) { return createMustacheNode([id], null, true); }, + peg$c141 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c142 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c143 = function(value) { return value.replace(/ *$/, ''); }, + peg$c144 = "!", + peg$c145 = "\"!\"", + peg$c146 = function(key, value) { return IS_EMBER; }, + peg$c147 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bindAttr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c148 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c149 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c150 = "_", + peg$c151 = "\"_\"", + peg$c152 = "%", + peg$c153 = "\"%\"", + peg$c154 = "#", + peg$c155 = "\"#\"", + peg$c156 = function(c) { return c;}, + peg$c157 = "CSSIdentifier", + peg$c158 = /^[_a-zA-Z0-9\-]/, + peg$c159 = "[_a-zA-Z0-9\\-]", + peg$c160 = /^[_a-zA-Z]/, + peg$c161 = "[_a-zA-Z]", + peg$c162 = /^[\x80-\xFF]/, + peg$c163 = "[\\x80-\\xFF]", + peg$c164 = "KnownHTMLTagName", + peg$c165 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c166 = function(t) { return t; }, + peg$c167 = "a JS event", + peg$c168 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c169 = "INDENT", + peg$c170 = "\uEFEF", + peg$c171 = "\"\\uEFEF\"", + peg$c172 = function() { return ''; }, + peg$c173 = "DEDENT", + peg$c174 = "\uEFFE", + peg$c175 = "\"\\uEFFE\"", + peg$c176 = "Unmatched DEDENT", + peg$c177 = "\uEFEE", + peg$c178 = "\"\\uEFEE\"", + peg$c179 = "LineEnd", + peg$c180 = "\r", + peg$c181 = "\"\\r\"", + peg$c182 = "\uEFFF", + peg$c183 = "\"\\uEFFF\"", + peg$c184 = "\n", + peg$c185 = "\"\\n\"", + peg$c186 = "ANYDEDENT", + peg$c187 = "RequiredWhitespace", + peg$c188 = "OptionalWhitespace", + peg$c189 = "InlineWhitespace", + peg$c190 = /^[ \t]/, + peg$c191 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c38(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$parseparam(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c45(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c47) { + s0 = peg$c47; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c49; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$parsebooleanNode(); + if (s2 === null) { + s2 = peg$parseintegerNode(); + if (s2 === null) { + s2 = peg$parsepathIdNode(); + if (s2 === null) { + s2 = peg$parsestringNode(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c62.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c69) { + s0 = peg$c69; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s0 = peg$c71; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c88.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c91.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c96(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c79; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c79; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c99; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c103(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c99; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c125) { + s0 = peg$c125; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c128) { + s1 = peg$c128; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c132(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c138.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c69) { + s3 = peg$c69; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s3 = peg$c71; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c99; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c116; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c144; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c146(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c150; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c74; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c154; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c160.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c162.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c55; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c168(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c180; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c182; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c184; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c190.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.indexOf('1.1') === 0; + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.5/emblem.min.js b/ajax/libs/emblem/0.3.5/emblem.min.js new file mode 100644 index 000000000..37446c346 --- /dev/null +++ b/ajax/libs/emblem/0.3.5/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Qf!==b&&(Qf>b&&(Qf=0,Rf={line:1,column:1,seenCR:!1}),c(Rf,Qf,b),Qf=b),Rf}function e(a){Sf>Of||(Of>Sf&&(Sf=Of,Tf=[]),Tf.push(a))}function f(a){var b=0;for(a.sort();bOf?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function lb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),null===d&&(39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd))),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function mb(){var b,c,d,e;if(b=Of,c=Of,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=qc;return null!==d&&(d=a.substring(c,Of)),c=d,null!==c&&(Pf=b,c=le(c)),null===c?(Of=b,b=c):b=c,b}function nb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=cc(),null===a&&(a=bc())))),a}function pb(){var a,b,c,d,e,f;return a=Of,b=rb(),null!==b?(c=ec(),null!==c?(d=fb(),null!==d?(e=ec(),null!==e?(f=ub(),null!==f?(Pf=a,b=je(d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Uf++,123===a.charCodeAt(Of)?(b=ee,Of++):(b=null,0===Uf&&e(fe)),Uf--,null===b&&(c=null,0===Uf&&e(ne)),b}function sb(){var b,c;return Uf++,a.substr(Of,2)===pe?(b=pe,Of+=2):(b=null,0===Uf&&e(qe)),Uf--,null===b&&(c=null,0===Uf&&e(oe)),b}function tb(){var b,c;return Uf++,a.substr(Of,3)===se?(b=se,Of+=3):(b=null,0===Uf&&e(te)),Uf--,null===b&&(c=null,0===Uf&&e(re)),b}function ub(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(ue)),b}function vb(){var b,c;return Uf++,a.substr(Of,2)===ye?(b=ye,Of+=2):(b=null,0===Uf&&e(ze)),Uf--,null===b&&(c=null,0===Uf&&e(xe)),b}function wb(){var b,c;return Uf++,a.substr(Of,3)===Be?(b=Be,Of+=3):(b=null,0===Uf&&e(Ce)),Uf--,null===b&&(c=null,0===Uf&&e(Ae)),b}function xb(){var b,c;return Uf++,a.substr(Of,2)===Ee?(b=Ee,Of+=2):(b=null,0===Uf&&e(Fe)),Uf--,null===b&&(c=null,0===Uf&&e(De)),b}function yb(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(Ge)),b}function zb(){var b,c,d;return b=Of,a.substr(Of,2)===He?(c=He,Of+=2):(c=null,0===Uf&&e(Ie)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Of,61===a.charCodeAt(Of)?(c=uc,Of++):(c=null,0===Uf&&e(vc)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Ke(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)),b}function Ab(){var b,c,d,f,g;return b=Of,c=Ub(),null===c&&(c=rc),null!==c?(d=F(),null===d&&(d=rc),null!==d?(47===a.charCodeAt(Of)?(f=Jc,Of++):(f=null,0===Uf&&e(Kc)),null===f&&(f=rc),null!==f?(Pf=Of,g=Le(c,d),g=g?rc:qc,null!==g?(c=[c,d,f,g],b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Bb(){var a,b,c,d,e;if(a=Of,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Pf=a,b=Me(b,c,d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)}else Of=a,a=qc}else Of=a,a=qc;return a}function F(){var a,b,c,d;if(a=Of,b=[],c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d);else b=qc;return null!==b&&(Pf=a,b=Pe(b)),null===b?(Of=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Of,c=[],32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc));else c=qc;return null!==c?(d=Gb(),null===d&&(d=Hb(),null===d&&(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Lb())))),null!==d?(Pf=b,c=Qe(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Db(){var b;return Re.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Se)),null===b&&(b=Xb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Of,b=Q(),null!==b&&(Pf=a,b=Te(b)),null===b?(Of=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Of,c=Of,34===a.charCodeAt(Of)?(d=Od,Of++):(d=null,0===Uf&&e(Pd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Of)?(g=Od,Of++):(g=null,0===Uf&&e(Pd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc),null===c&&(c=Of,39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Of)?(g=Qd,Of++):(g=null,0===Uf&&e(Rd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc)),null!==c&&(Pf=b,c=Sd(c)),null===c?(Of=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Of,c=Yb(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Eb(),null!==f?(Pf=b,c=Ue(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Hb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(a.substr(Of,4)===Ed?(f=Ed,Of+=4):(f=null,0===Uf&&e(Fd)),null===f&&(a.substr(Of,5)===Gd?(f=Gd,Of+=5):(f=null,0===Uf&&e(Hd))),null!==f?(Pf=b,c=Ve(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Ib(){var b,c,d,f,g,h;if(b=Of,123===a.charCodeAt(Of)?(c=ee,Of++):(c=null,0===Uf&&e(fe)),null!==c)if(d=ec(),null!==d){if(f=Of,g=[],h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc)));else g=qc;null!==g&&(g=a.substring(f,Of)),f=g,null!==f?(g=ec(),null!==g?(125===a.charCodeAt(Of)?(h=ve,Of++):(h=null,0===Uf&&e(we)),null!==h?(Pf=b,c=We(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)}else Of=b,b=qc;else Of=b,b=qc;if(null===b){if(b=Of,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=qc;null!==c&&(c=a.substring(b,Of)),b=c}return b}function Jb(){var b,c,d,f,g,h;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Ib(),null!==f?(g=Of,Uf++,33===a.charCodeAt(Of)?(h=Xe,Of++):(h=null,0===Uf&&e(Ye)),Uf--,null===h?g=rc:(Of=g,g=qc),null!==g?(Pf=Of,h=Ze(c,f),h=h?rc:qc,null!==h?(Pf=b,c=$e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Kb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Q(),null!==f?(Pf=b,c=_e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Lb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=bb(),null!==f?(Pf=b,c=af(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Mb(){var b,c,d;return b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Nb(){var b,c,d;return b=Of,35===a.charCodeAt(Of)?(c=df,Of++):(c=null,0===Uf&&e(ef)),null!==c?(d=Pb(),null!==d?(Pf=b,c=ff(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Ob(){var b,c,d;return b=Of,46===a.charCodeAt(Of)?(c=kd,Of++):(c=null,0===Uf&&e(ld)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Pb(){var a,b;return Uf++,a=Qb(),Uf--,null===a&&(b=null,0===Uf&&e(gf)),a}function Qb(){var b,c,d;for(b=Of,c=[],d=Rb();null!==d;)c.push(d),d=Rb();return null!==c&&(c=a.substring(b,Of)),b=c}function Rb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Sb()),b}function Sb(){var b;return kf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(lf)),b}function Tb(){var b,c,d;if(b=Of,c=[],d=Wb(),null!==d)for(;null!==d;)c.push(d),d=Wb();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c}function Ub(){var b,c,d,f;return Uf++,b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=ec(),null!==d?(f=Tb(),null!==f?(Pf=b,c=od(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Vb()),Uf--,null===b&&(c=null,0===Uf&&e(mf)),b}function Vb(){var a,b,c;return a=Of,b=Tb(),null!==b?(Pf=Of,c=nf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function Wb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Xb()),b}function Xb(){var b,c,d,f;return b=Of,58===a.charCodeAt(Of)?(c=qd,Of++):(c=null,0===Uf&&e(rd)),null!==c?(d=Of,Uf++,32===a.charCodeAt(Of)?(f=Oc,Of++):(f=null,0===Uf&&e(Pc)),Uf--,null===f?d=rc:(Of=d,d=qc),null!==d?(Pf=b,c=Rc(c),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Yb(){var a,b,c;return Uf++,a=Of,b=Tb(),null!==b?(Pf=Of,c=qf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),Uf--,null===a&&(b=null,0===Uf&&e(pf)),a}function Zb(){var a,b,c;return a=Of,b=$b(),null!==b?(c=dc(),null!==c?(Pf=a,b=od(c),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function $b(){var b,c;return Uf++,b=Of,61423===a.charCodeAt(Of)?(c=sf,Of++):(c=null,0===Uf&&e(tf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(rf)),b}function _b(){var b,c;return Uf++,b=Of,61438===a.charCodeAt(Of)?(c=wf,Of++):(c=null,0===Uf&&e(xf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(vf)),b}function ac(){var b,c;return Uf++,b=Of,61422===a.charCodeAt(Of)?(c=zf,Of++):(c=null,0===Uf&&e(Af)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(yf)),b}function bc(){var b,c,d,f;return Uf++,b=Of,13===a.charCodeAt(Of)?(c=Cf,Of++):(c=null,0===Uf&&e(Df)),null===c&&(c=rc),null!==c?(61439===a.charCodeAt(Of)?(d=Ef,Of++):(d=null,0===Uf&&e(Ff)),null!==d?(10===a.charCodeAt(Of)?(f=Gf,Of++):(f=null,0===Uf&&e(Hf)),null!==f?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),Uf--,null===b&&(c=null,0===Uf&&e(Bf)),b}function cc(){var a,b;return Uf++,a=_b(),null===a&&(a=ac()),Uf--,null===a&&(b=null,0===Uf&&e(If)),a}function dc(){var b,c,d;if(Uf++,b=Of,c=[],d=fc(),null!==d)for(;null!==d;)c.push(d),d=fc();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c,Uf--,null===b&&(c=null,0===Uf&&e(Jf)),b}function ec(){var a,b;for(Uf++,a=[],b=fc();null!==b;)a.push(b),b=fc();return Uf--,null===a&&(b=null,0===Uf&&e(Kf)),a}function fc(){var b,c;return Uf++,Mf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Nf)),Uf--,null===b&&(c=null,0===Uf&&e(Lf)),b}function gc(){var b,c,d;return b=Of,c=Of,Uf++,d=$b(),null===d&&(d=_b(),null===d&&(d=bc())),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function hc(){var b,c,d;for(b=Of,c=[],d=gc();null!==d;)c.push(d),d=gc();return null!==c&&(c=a.substring(b,Of)),b=c}function ic(a,b,c){if(cg){var d=c?ag:bg;return new Xf.MustacheNode(a,b,d,{left:!1,right:!1})}return new Xf.MustacheNode(a,b,!c)}function jc(a,b){return cg?new Xf.ProgramNode(a,{left:!1,right:!1},b):new Xf.ProgramNode(a,b)}function kc(a,b,c){var d=a.hash;if(c){d=d||new Xf.HashNode([]);for(var e=0;e1?arguments[1]:{},oc={start:g},pc=g,qc=null,rc="",sc=function(a){return a},tc=function(a,b){return jc(a,b||[])},uc="=",vc='"="',wc="else",xc='"else"',yc=function(a){for(var b=[],c=[],d=0;d",Dc='">"',Ec=function(a,b){return[new Xf.PartialNode(a,b[0])]},Fc=/^[a-zA-Z0-9_$-\/]/,Gc="[a-zA-Z0-9_$-\\/]",Hc=function(a){return new Xf.PartialNameNode(new Xf.StringNode(a))},Ic=function(a){return[a]},Jc="/",Kc='"/"',Lc=/^[A-Z]/,Mc="[A-Z]",Nc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?(a.mustache=kc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?kc(a,b):a},Oc=" ",Pc='" "',Qc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Xf.ContentNode(" ")),a=a.concat(b[c])}return a},Rc=function(a){return a},Sc=function(a){return[a]},Tc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Uc=function(a,b){if(!b)return a;var c=a.id;cg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new Xf.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Vc=": ",Wc='": "',Xc=function(a){return jc(a,[])},Yc=function(a){return a&&a[2]},Zc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},$c=function(a,b,c,d){if(a){var e=new Xf.PartialNameNode(new Xf.StringNode(b.string));return new Xf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[h]):(h.push(new Xf.ContentNode(">")),[h,new Xf.ContentNode("")])},Ne=function(a){return{shorthand:a,id:!0}},Oe=function(a){return{shorthand:a}},Pe=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Qe=function(a){return a.length?[new Xf.ContentNode(" ")].concat(a):[]},Re=/^[A-Za-z.0-9_\-]/,Se="[A-Za-z.0-9_\\-]",Te=function(a){return ic([a],null,!0)},Ue=function(a,b){return[kc(b,"action",[["on",new Xf.StringNode(a)]])]},Ve=function(a,b){return"true"===b?[new Xf.ContentNode(a)]:[]},We=function(a){return a.replace(/ *$/,"")},Xe="!",Ye='"!"',Ze=function(){return Wf},$e=function(a,b){var c=new Xf.HashNode([[a,new Xf.StringNode(b)]]),d=[new Xf.IdNode([{part:"bindAttr"}])],e=ic(d,c);return[e]},_e=function(a,b){var c=ic([b],null,!0);return Wf&&"!"===b._emblemSuffixModifier&&(c=kc(c,"unbound")),[new Xf.ContentNode(a+"="+'"'),c,new Xf.ContentNode('"')]},af=function(a,b){var c=[new Xf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Xf.ContentNode('"')])},bf="%",cf='"%"',df="#",ef='"#"',ff=function(a){return a},gf="CSSIdentifier",hf=/^[_a-zA-Z0-9\-]/,jf="[_a-zA-Z0-9\\-]",kf=/^[\x80-\xFF]/,lf="[\\x80-\\xFF]",mf="KnownHTMLTagName",nf=function(a){return!!Zf[a]},of=function(a){return a},pf="a JS event",qf=function(a){return!!$f[a]},rf="INDENT",sf="\uefef",tf='"\\uEFEF"',uf=function(){return""},vf="DEDENT",wf="\ueffe",xf='"\\uEFFE"',yf="Unmatched DEDENT",zf="\uefee",Af='"\\uEFEE"',Bf="LineEnd",Cf="\r",Df='"\\r"',Ef="\uefff",Ff='"\\uEFFF"',Gf="\n",Hf='"\\n"',If="ANYDEDENT",Jf="RequiredWhitespace",Kf="OptionalWhitespace",Lf="InlineWhitespace",Mf=/^[ \t]/,Nf="[ \\t]",Of=0,Pf=0,Qf=0,Rf={line:1,column:1,seenCR:!1},Sf=0,Tf=[],Uf=0;if("startRule"in nc){if(!(nc.startRule in oc))throw new Error("Can't start parsing from rule \""+nc.startRule+'".');pc=oc[nc.startRule]}var Vf=c.handlebarsVariant,Wf="Ember.Handlebars"===Vf.JavaScriptCompiler.prototype.namespace,Xf=Vf.AST,Yf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Zf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},$f={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},_f=String.fromCharCode(125),ag=_f+_f,bg=ag+_f,cg=0===Vf.VERSION.indexOf("1.1");if(mc=pc(),null!==mc&&Of===a.length)return mc;throw f(Tf),Pf=Math.max(Of,Sf),new b(Tf,Pfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.6/emblem.js b/ajax/libs/emblem/0.3.6/emblem.js new file mode 100644 index 000000000..048c3bfab --- /dev/null +++ b/ajax/libs/emblem/0.3.6/emblem.js @@ -0,0 +1,6206 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = createMustacheNode(actualParams, hash, true); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(a) { + return a; + }, + peg$c42 = function(id, classes) { return [id, classes]; }, + peg$c43 = function(classes) { return [null, classes]; }, + peg$c44 = function(a) { return a; }, + peg$c45 = function(h) { return new AST.HashNode(h); }, + peg$c46 = "PathIdent", + peg$c47 = "..", + peg$c48 = "\"..\"", + peg$c49 = ".", + peg$c50 = "\".\"", + peg$c51 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c52 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c53 = function(s) { return s; }, + peg$c54 = "Key", + peg$c55 = ":", + peg$c56 = "\":\"", + peg$c57 = function(h) { return [h[0], h[2]]; }, + peg$c58 = function(n) { return n; }, + peg$c59 = function(s, p) { return { part: p, separator: s }; }, + peg$c60 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c61 = "PathSeparator", + peg$c62 = /^[\/.]/, + peg$c63 = "[\\/.]", + peg$c64 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c65 = function(v) { return new AST.StringNode(v); }, + peg$c66 = function(v) { return new AST.IntegerNode(v); }, + peg$c67 = function(v) { return new AST.BooleanNode(v); }, + peg$c68 = "Boolean", + peg$c69 = "true", + peg$c70 = "\"true\"", + peg$c71 = "false", + peg$c72 = "\"false\"", + peg$c73 = "Integer", + peg$c74 = "-", + peg$c75 = "\"-\"", + peg$c76 = /^[0-9]/, + peg$c77 = "[0-9]", + peg$c78 = function(s) { return parseInt(s); }, + peg$c79 = "\"", + peg$c80 = "\"\\\"\"", + peg$c81 = "'", + peg$c82 = "\"'\"", + peg$c83 = function(p) { return p[1]; }, + peg$c84 = /^[^"}]/, + peg$c85 = "[^\"}]", + peg$c86 = /^[^'}]/, + peg$c87 = "[^'}]", + peg$c88 = /^[A-Za-z]/, + peg$c89 = "[A-Za-z]", + peg$c90 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c91 = /^[|`']/, + peg$c92 = "[|`']", + peg$c93 = "<", + peg$c94 = "\"<\"", + peg$c95 = function() { return '<'; }, + peg$c96 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c97 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c98 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c99 = "{", + peg$c100 = "\"{\"", + peg$c101 = /^[^}]/, + peg$c102 = "[^}]", + peg$c103 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c104 = function(m) { m.escaped = true; return m; }, + peg$c105 = function(m) { m.escaped = false; return m; }, + peg$c106 = function(a) { return new AST.ContentNode(a); }, + peg$c107 = "any character", + peg$c108 = "SingleMustacheOpen", + peg$c109 = "DoubleMustacheOpen", + peg$c110 = "{{", + peg$c111 = "\"{{\"", + peg$c112 = "TripleMustacheOpen", + peg$c113 = "{{{", + peg$c114 = "\"{{{\"", + peg$c115 = "SingleMustacheClose", + peg$c116 = "}", + peg$c117 = "\"}\"", + peg$c118 = "DoubleMustacheClose", + peg$c119 = "}}", + peg$c120 = "\"}}\"", + peg$c121 = "TripleMustacheClose", + peg$c122 = "}}}", + peg$c123 = "\"}}}\"", + peg$c124 = "InterpolationOpen", + peg$c125 = "#{", + peg$c126 = "\"#{\"", + peg$c127 = "InterpolationClose", + peg$c128 = "==", + peg$c129 = "\"==\"", + peg$c130 = function() { return false; }, + peg$c131 = function() { return true; }, + peg$c132 = function(h, s) { return h || s; }, + peg$c133 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1]; + + var tagOpenContent = []; + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + if(classes && classes.length) { + tagOpenContent.push(new AST.ContentNode(' class="' + classes.join(' ') + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + tagOpenContent = tagOpenContent.concat(fullAttributes[i]); + } + + var closingTagSlashPresent = !!h[2]; + if(SELF_CLOSING_TAG[tagName] || closingTagSlashPresent) { + tagOpenContent.push(new AST.ContentNode(' />')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c134 = function(s) { return { shorthand: s, id: true}; }, + peg$c135 = function(s) { return { shorthand: s }; }, + peg$c136 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c137 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c138 = /^[A-Za-z.0-9_\-]/, + peg$c139 = "[A-Za-z.0-9_\\-]", + peg$c140 = function(id) { return createMustacheNode([id], null, true); }, + peg$c141 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c142 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c143 = function(value) { return value.replace(/ *$/, ''); }, + peg$c144 = "!", + peg$c145 = "\"!\"", + peg$c146 = function(key, value) { return IS_EMBER; }, + peg$c147 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c148 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c149 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c150 = "_", + peg$c151 = "\"_\"", + peg$c152 = "%", + peg$c153 = "\"%\"", + peg$c154 = "#", + peg$c155 = "\"#\"", + peg$c156 = function(c) { return c;}, + peg$c157 = "CSSIdentifier", + peg$c158 = /^[_a-zA-Z0-9\-]/, + peg$c159 = "[_a-zA-Z0-9\\-]", + peg$c160 = /^[_a-zA-Z]/, + peg$c161 = "[_a-zA-Z]", + peg$c162 = /^[\x80-\xFF]/, + peg$c163 = "[\\x80-\\xFF]", + peg$c164 = "KnownHTMLTagName", + peg$c165 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c166 = function(t) { return t; }, + peg$c167 = "a JS event", + peg$c168 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c169 = "INDENT", + peg$c170 = "\uEFEF", + peg$c171 = "\"\\uEFEF\"", + peg$c172 = function() { return ''; }, + peg$c173 = "DEDENT", + peg$c174 = "\uEFFE", + peg$c175 = "\"\\uEFFE\"", + peg$c176 = "Unmatched DEDENT", + peg$c177 = "\uEFEE", + peg$c178 = "\"\\uEFEE\"", + peg$c179 = "LineEnd", + peg$c180 = "\r", + peg$c181 = "\"\\r\"", + peg$c182 = "\uEFFF", + peg$c183 = "\"\\uEFFF\"", + peg$c184 = "\n", + peg$c185 = "\"\\n\"", + peg$c186 = "ANYDEDENT", + peg$c187 = "RequiredWhitespace", + peg$c188 = "OptionalWhitespace", + peg$c189 = "InlineWhitespace", + peg$c190 = /^[ \t]/, + peg$c191 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c38(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$parseparam(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c45(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c47) { + s0 = peg$c47; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c49; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$parsebooleanNode(); + if (s2 === null) { + s2 = peg$parseintegerNode(); + if (s2 === null) { + s2 = peg$parsepathIdNode(); + if (s2 === null) { + s2 = peg$parsestringNode(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c62.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c69) { + s0 = peg$c69; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s0 = peg$c71; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c88.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c91.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c96(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c79; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c79; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c99; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c103(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c99; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c125) { + s0 = peg$c125; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c128) { + s1 = peg$c128; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c132(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c138.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c69) { + s3 = peg$c69; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s3 = peg$c71; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c99; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c116; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c144; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c146(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c150; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c74; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c154; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c160.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c162.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c55; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c168(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c180; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c182; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c184; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c190.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.6/emblem.min.js b/ajax/libs/emblem/0.3.6/emblem.min.js new file mode 100644 index 000000000..374dec372 --- /dev/null +++ b/ajax/libs/emblem/0.3.6/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Qf!==b&&(Qf>b&&(Qf=0,Rf={line:1,column:1,seenCR:!1}),c(Rf,Qf,b),Qf=b),Rf}function e(a){Sf>Of||(Of>Sf&&(Sf=Of,Tf=[]),Tf.push(a))}function f(a){var b=0;for(a.sort();bOf?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function lb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),null===d&&(39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd))),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function mb(){var b,c,d,e;if(b=Of,c=Of,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=qc;return null!==d&&(d=a.substring(c,Of)),c=d,null!==c&&(Pf=b,c=le(c)),null===c?(Of=b,b=c):b=c,b}function nb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=cc(),null===a&&(a=bc())))),a}function pb(){var a,b,c,d,e,f;return a=Of,b=rb(),null!==b?(c=ec(),null!==c?(d=fb(),null!==d?(e=ec(),null!==e?(f=ub(),null!==f?(Pf=a,b=je(d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Uf++,123===a.charCodeAt(Of)?(b=ee,Of++):(b=null,0===Uf&&e(fe)),Uf--,null===b&&(c=null,0===Uf&&e(ne)),b}function sb(){var b,c;return Uf++,a.substr(Of,2)===pe?(b=pe,Of+=2):(b=null,0===Uf&&e(qe)),Uf--,null===b&&(c=null,0===Uf&&e(oe)),b}function tb(){var b,c;return Uf++,a.substr(Of,3)===se?(b=se,Of+=3):(b=null,0===Uf&&e(te)),Uf--,null===b&&(c=null,0===Uf&&e(re)),b}function ub(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(ue)),b}function vb(){var b,c;return Uf++,a.substr(Of,2)===ye?(b=ye,Of+=2):(b=null,0===Uf&&e(ze)),Uf--,null===b&&(c=null,0===Uf&&e(xe)),b}function wb(){var b,c;return Uf++,a.substr(Of,3)===Be?(b=Be,Of+=3):(b=null,0===Uf&&e(Ce)),Uf--,null===b&&(c=null,0===Uf&&e(Ae)),b}function xb(){var b,c;return Uf++,a.substr(Of,2)===Ee?(b=Ee,Of+=2):(b=null,0===Uf&&e(Fe)),Uf--,null===b&&(c=null,0===Uf&&e(De)),b}function yb(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(Ge)),b}function zb(){var b,c,d;return b=Of,a.substr(Of,2)===He?(c=He,Of+=2):(c=null,0===Uf&&e(Ie)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Of,61===a.charCodeAt(Of)?(c=uc,Of++):(c=null,0===Uf&&e(vc)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Ke(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)),b}function Ab(){var b,c,d,f,g;return b=Of,c=Ub(),null===c&&(c=rc),null!==c?(d=F(),null===d&&(d=rc),null!==d?(47===a.charCodeAt(Of)?(f=Jc,Of++):(f=null,0===Uf&&e(Kc)),null===f&&(f=rc),null!==f?(Pf=Of,g=Le(c,d),g=g?rc:qc,null!==g?(c=[c,d,f,g],b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Bb(){var a,b,c,d,e;if(a=Of,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Pf=a,b=Me(b,c,d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)}else Of=a,a=qc}else Of=a,a=qc;return a}function F(){var a,b,c,d;if(a=Of,b=[],c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d);else b=qc;return null!==b&&(Pf=a,b=Pe(b)),null===b?(Of=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Of,c=[],32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc));else c=qc;return null!==c?(d=Gb(),null===d&&(d=Hb(),null===d&&(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Lb())))),null!==d?(Pf=b,c=Qe(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Db(){var b;return Re.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Se)),null===b&&(b=Xb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Of,b=Q(),null!==b&&(Pf=a,b=Te(b)),null===b?(Of=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Of,c=Of,34===a.charCodeAt(Of)?(d=Od,Of++):(d=null,0===Uf&&e(Pd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Of)?(g=Od,Of++):(g=null,0===Uf&&e(Pd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc),null===c&&(c=Of,39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Of)?(g=Qd,Of++):(g=null,0===Uf&&e(Rd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc)),null!==c&&(Pf=b,c=Sd(c)),null===c?(Of=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Of,c=Yb(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Eb(),null!==f?(Pf=b,c=Ue(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Hb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(a.substr(Of,4)===Ed?(f=Ed,Of+=4):(f=null,0===Uf&&e(Fd)),null===f&&(a.substr(Of,5)===Gd?(f=Gd,Of+=5):(f=null,0===Uf&&e(Hd))),null!==f?(Pf=b,c=Ve(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Ib(){var b,c,d,f,g,h;if(b=Of,123===a.charCodeAt(Of)?(c=ee,Of++):(c=null,0===Uf&&e(fe)),null!==c)if(d=ec(),null!==d){if(f=Of,g=[],h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc)));else g=qc;null!==g&&(g=a.substring(f,Of)),f=g,null!==f?(g=ec(),null!==g?(125===a.charCodeAt(Of)?(h=ve,Of++):(h=null,0===Uf&&e(we)),null!==h?(Pf=b,c=We(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)}else Of=b,b=qc;else Of=b,b=qc;if(null===b){if(b=Of,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=qc;null!==c&&(c=a.substring(b,Of)),b=c}return b}function Jb(){var b,c,d,f,g,h;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Ib(),null!==f?(g=Of,Uf++,33===a.charCodeAt(Of)?(h=Xe,Of++):(h=null,0===Uf&&e(Ye)),Uf--,null===h?g=rc:(Of=g,g=qc),null!==g?(Pf=Of,h=Ze(c,f),h=h?rc:qc,null!==h?(Pf=b,c=$e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Kb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Q(),null!==f?(Pf=b,c=_e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Lb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=bb(),null!==f?(Pf=b,c=af(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Mb(){var b,c,d;return b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Nb(){var b,c,d;return b=Of,35===a.charCodeAt(Of)?(c=df,Of++):(c=null,0===Uf&&e(ef)),null!==c?(d=Pb(),null!==d?(Pf=b,c=ff(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Ob(){var b,c,d;return b=Of,46===a.charCodeAt(Of)?(c=kd,Of++):(c=null,0===Uf&&e(ld)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Pb(){var a,b;return Uf++,a=Qb(),Uf--,null===a&&(b=null,0===Uf&&e(gf)),a}function Qb(){var b,c,d;for(b=Of,c=[],d=Rb();null!==d;)c.push(d),d=Rb();return null!==c&&(c=a.substring(b,Of)),b=c}function Rb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Sb()),b}function Sb(){var b;return kf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(lf)),b}function Tb(){var b,c,d;if(b=Of,c=[],d=Wb(),null!==d)for(;null!==d;)c.push(d),d=Wb();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c}function Ub(){var b,c,d,f;return Uf++,b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=ec(),null!==d?(f=Tb(),null!==f?(Pf=b,c=od(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Vb()),Uf--,null===b&&(c=null,0===Uf&&e(mf)),b}function Vb(){var a,b,c;return a=Of,b=Tb(),null!==b?(Pf=Of,c=nf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function Wb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Xb()),b}function Xb(){var b,c,d,f;return b=Of,58===a.charCodeAt(Of)?(c=qd,Of++):(c=null,0===Uf&&e(rd)),null!==c?(d=Of,Uf++,32===a.charCodeAt(Of)?(f=Oc,Of++):(f=null,0===Uf&&e(Pc)),Uf--,null===f?d=rc:(Of=d,d=qc),null!==d?(Pf=b,c=Rc(c),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Yb(){var a,b,c;return Uf++,a=Of,b=Tb(),null!==b?(Pf=Of,c=qf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),Uf--,null===a&&(b=null,0===Uf&&e(pf)),a}function Zb(){var a,b,c;return a=Of,b=$b(),null!==b?(c=dc(),null!==c?(Pf=a,b=od(c),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function $b(){var b,c;return Uf++,b=Of,61423===a.charCodeAt(Of)?(c=sf,Of++):(c=null,0===Uf&&e(tf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(rf)),b}function _b(){var b,c;return Uf++,b=Of,61438===a.charCodeAt(Of)?(c=wf,Of++):(c=null,0===Uf&&e(xf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(vf)),b}function ac(){var b,c;return Uf++,b=Of,61422===a.charCodeAt(Of)?(c=zf,Of++):(c=null,0===Uf&&e(Af)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(yf)),b}function bc(){var b,c,d,f;return Uf++,b=Of,13===a.charCodeAt(Of)?(c=Cf,Of++):(c=null,0===Uf&&e(Df)),null===c&&(c=rc),null!==c?(61439===a.charCodeAt(Of)?(d=Ef,Of++):(d=null,0===Uf&&e(Ff)),null!==d?(10===a.charCodeAt(Of)?(f=Gf,Of++):(f=null,0===Uf&&e(Hf)),null!==f?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),Uf--,null===b&&(c=null,0===Uf&&e(Bf)),b}function cc(){var a,b;return Uf++,a=_b(),null===a&&(a=ac()),Uf--,null===a&&(b=null,0===Uf&&e(If)),a}function dc(){var b,c,d;if(Uf++,b=Of,c=[],d=fc(),null!==d)for(;null!==d;)c.push(d),d=fc();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c,Uf--,null===b&&(c=null,0===Uf&&e(Jf)),b}function ec(){var a,b;for(Uf++,a=[],b=fc();null!==b;)a.push(b),b=fc();return Uf--,null===a&&(b=null,0===Uf&&e(Kf)),a}function fc(){var b,c;return Uf++,Mf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Nf)),Uf--,null===b&&(c=null,0===Uf&&e(Lf)),b}function gc(){var b,c,d;return b=Of,c=Of,Uf++,d=$b(),null===d&&(d=_b(),null===d&&(d=bc())),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function hc(){var b,c,d;for(b=Of,c=[],d=gc();null!==d;)c.push(d),d=gc();return null!==c&&(c=a.substring(b,Of)),b=c}function ic(a,b,c){if(cg){var d=c?ag:bg;return new Xf.MustacheNode(a,b,d,{left:!1,right:!1})}return new Xf.MustacheNode(a,b,!c)}function jc(a,b){return cg?new Xf.ProgramNode(a,{left:!1,right:!1},b):new Xf.ProgramNode(a,b)}function kc(a,b,c){var d=a.hash;if(c){d=d||new Xf.HashNode([]);for(var e=0;e1?arguments[1]:{},oc={start:g},pc=g,qc=null,rc="",sc=function(a){return a},tc=function(a,b){return jc(a,b||[])},uc="=",vc='"="',wc="else",xc='"else"',yc=function(a){for(var b=[],c=[],d=0;d",Dc='">"',Ec=function(a,b){return[new Xf.PartialNode(a,b[0])]},Fc=/^[a-zA-Z0-9_$-\/]/,Gc="[a-zA-Z0-9_$-\\/]",Hc=function(a){return new Xf.PartialNameNode(new Xf.StringNode(a))},Ic=function(a){return[a]},Jc="/",Kc='"/"',Lc=/^[A-Z]/,Mc="[A-Z]",Nc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?(a.mustache=kc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?kc(a,b):a},Oc=" ",Pc='" "',Qc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Xf.ContentNode(" ")),a=a.concat(b[c])}return a},Rc=function(a){return a},Sc=function(a){return[a]},Tc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Uc=function(a,b){if(!b)return a;var c=a.id;cg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new Xf.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Vc=": ",Wc='": "',Xc=function(a){return jc(a,[])},Yc=function(a){return a&&a[2]},Zc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},$c=function(a,b,c,d){if(a){var e=new Xf.PartialNameNode(new Xf.StringNode(b.string));return new Xf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[h]):(h.push(new Xf.ContentNode(">")),[h,new Xf.ContentNode("")])},Ne=function(a){return{shorthand:a,id:!0}},Oe=function(a){return{shorthand:a}},Pe=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Qe=function(a){return a.length?[new Xf.ContentNode(" ")].concat(a):[]},Re=/^[A-Za-z.0-9_\-]/,Se="[A-Za-z.0-9_\\-]",Te=function(a){return ic([a],null,!0)},Ue=function(a,b){return[kc(b,"action",[["on",new Xf.StringNode(a)]])]},Ve=function(a,b){return"true"===b?[new Xf.ContentNode(a)]:[]},We=function(a){return a.replace(/ *$/,"")},Xe="!",Ye='"!"',Ze=function(){return Wf},$e=function(a,b){var c=new Xf.HashNode([[a,new Xf.StringNode(b)]]),d=[new Xf.IdNode([{part:"bind-attr"}])],e=ic(d,c);return[e]},_e=function(a,b){var c=ic([b],null,!0);return Wf&&"!"===b._emblemSuffixModifier&&(c=kc(c,"unbound")),[new Xf.ContentNode(a+"="+'"'),c,new Xf.ContentNode('"')]},af=function(a,b){var c=[new Xf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Xf.ContentNode('"')])},bf="%",cf='"%"',df="#",ef='"#"',ff=function(a){return a},gf="CSSIdentifier",hf=/^[_a-zA-Z0-9\-]/,jf="[_a-zA-Z0-9\\-]",kf=/^[\x80-\xFF]/,lf="[\\x80-\\xFF]",mf="KnownHTMLTagName",nf=function(a){return!!Zf[a]},of=function(a){return a},pf="a JS event",qf=function(a){return!!$f[a]},rf="INDENT",sf="\uefef",tf='"\\uEFEF"',uf=function(){return""},vf="DEDENT",wf="\ueffe",xf='"\\uEFFE"',yf="Unmatched DEDENT",zf="\uefee",Af='"\\uEFEE"',Bf="LineEnd",Cf="\r",Df='"\\r"',Ef="\uefff",Ff='"\\uEFFF"',Gf="\n",Hf='"\\n"',If="ANYDEDENT",Jf="RequiredWhitespace",Kf="OptionalWhitespace",Lf="InlineWhitespace",Mf=/^[ \t]/,Nf="[ \\t]",Of=0,Pf=0,Qf=0,Rf={line:1,column:1,seenCR:!1},Sf=0,Tf=[],Uf=0;if("startRule"in nc){if(!(nc.startRule in oc))throw new Error("Can't start parsing from rule \""+nc.startRule+'".');pc=oc[nc.startRule]}var Vf=c.handlebarsVariant,Wf="Ember.Handlebars"===Vf.JavaScriptCompiler.prototype.namespace,Xf=Vf.AST,Yf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Zf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},$f={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},_f=String.fromCharCode(125),ag=_f+_f,bg=ag+_f,cg=Vf.VERSION.slice(0,3)>=1.1;if(mc=pc(),null!==mc&&Of===a.length)return mc;throw f(Tf),Pf=Math.max(Of,Sf),new b(Tf,Pfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.8/emblem.js b/ajax/libs/emblem/0.3.8/emblem.js new file mode 100644 index 000000000..56fbd0f27 --- /dev/null +++ b/ajax/libs/emblem/0.3.8/emblem.js @@ -0,0 +1,6262 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = createMustacheNode(actualParams, hash, true); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(a) { + return a; + }, + peg$c42 = function(id, classes) { return [id, classes]; }, + peg$c43 = function(classes) { return [null, classes]; }, + peg$c44 = function(a) { return a; }, + peg$c45 = function(h) { return new AST.HashNode(h); }, + peg$c46 = "PathIdent", + peg$c47 = "..", + peg$c48 = "\"..\"", + peg$c49 = ".", + peg$c50 = "\".\"", + peg$c51 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c52 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c53 = function(s) { return s; }, + peg$c54 = "Key", + peg$c55 = ":", + peg$c56 = "\":\"", + peg$c57 = function(h) { return [h[0], h[2]]; }, + peg$c58 = function(n) { return n; }, + peg$c59 = function(s, p) { return { part: p, separator: s }; }, + peg$c60 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c61 = "PathSeparator", + peg$c62 = /^[\/.]/, + peg$c63 = "[\\/.]", + peg$c64 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c65 = function(v) { return new AST.StringNode(v); }, + peg$c66 = function(v) { return new AST.IntegerNode(v); }, + peg$c67 = function(v) { return new AST.BooleanNode(v); }, + peg$c68 = "Boolean", + peg$c69 = "true", + peg$c70 = "\"true\"", + peg$c71 = "false", + peg$c72 = "\"false\"", + peg$c73 = "Integer", + peg$c74 = "-", + peg$c75 = "\"-\"", + peg$c76 = /^[0-9]/, + peg$c77 = "[0-9]", + peg$c78 = function(s) { return parseInt(s); }, + peg$c79 = "\"", + peg$c80 = "\"\\\"\"", + peg$c81 = "'", + peg$c82 = "\"'\"", + peg$c83 = function(p) { return p[1]; }, + peg$c84 = /^[^"}]/, + peg$c85 = "[^\"}]", + peg$c86 = /^[^'}]/, + peg$c87 = "[^'}]", + peg$c88 = /^[A-Za-z]/, + peg$c89 = "[A-Za-z]", + peg$c90 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c91 = /^[|`']/, + peg$c92 = "[|`']", + peg$c93 = "<", + peg$c94 = "\"<\"", + peg$c95 = function() { return '<'; }, + peg$c96 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c97 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c98 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c99 = "{", + peg$c100 = "\"{\"", + peg$c101 = /^[^}]/, + peg$c102 = "[^}]", + peg$c103 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c104 = function(m) { m.escaped = true; return m; }, + peg$c105 = function(m) { m.escaped = false; return m; }, + peg$c106 = function(a) { return new AST.ContentNode(a); }, + peg$c107 = "any character", + peg$c108 = "SingleMustacheOpen", + peg$c109 = "DoubleMustacheOpen", + peg$c110 = "{{", + peg$c111 = "\"{{\"", + peg$c112 = "TripleMustacheOpen", + peg$c113 = "{{{", + peg$c114 = "\"{{{\"", + peg$c115 = "SingleMustacheClose", + peg$c116 = "}", + peg$c117 = "\"}\"", + peg$c118 = "DoubleMustacheClose", + peg$c119 = "}}", + peg$c120 = "\"}}\"", + peg$c121 = "TripleMustacheClose", + peg$c122 = "}}}", + peg$c123 = "\"}}}\"", + peg$c124 = "InterpolationOpen", + peg$c125 = "#{", + peg$c126 = "\"#{\"", + peg$c127 = "InterpolationClose", + peg$c128 = "==", + peg$c129 = "\"==\"", + peg$c130 = function() { return false; }, + peg$c131 = function() { return true; }, + peg$c132 = function(h, s) { return h || s; }, + peg$c133 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + pair = pairs[i2]; + if (pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c134 = function(s) { return { shorthand: s, id: true}; }, + peg$c135 = function(s) { return { shorthand: s }; }, + peg$c136 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c137 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c138 = /^[A-Za-z.0-9_\-]/, + peg$c139 = "[A-Za-z.0-9_\\-]", + peg$c140 = function(id) { return createMustacheNode([id], null, true); }, + peg$c141 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c142 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c143 = function(value) { return value.replace(/ *$/, ''); }, + peg$c144 = "!", + peg$c145 = "\"!\"", + peg$c146 = function(key, value) { return IS_EMBER; }, + peg$c147 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c148 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c149 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c150 = "_", + peg$c151 = "\"_\"", + peg$c152 = "%", + peg$c153 = "\"%\"", + peg$c154 = "#", + peg$c155 = "\"#\"", + peg$c156 = function(c) { return c;}, + peg$c157 = "CSSIdentifier", + peg$c158 = /^[_a-zA-Z0-9\-]/, + peg$c159 = "[_a-zA-Z0-9\\-]", + peg$c160 = /^[_a-zA-Z]/, + peg$c161 = "[_a-zA-Z]", + peg$c162 = /^[\x80-\xFF]/, + peg$c163 = "[\\x80-\\xFF]", + peg$c164 = "KnownHTMLTagName", + peg$c165 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c166 = function(t) { return t; }, + peg$c167 = "a JS event", + peg$c168 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c169 = "INDENT", + peg$c170 = "\uEFEF", + peg$c171 = "\"\\uEFEF\"", + peg$c172 = function() { return ''; }, + peg$c173 = "DEDENT", + peg$c174 = "\uEFFE", + peg$c175 = "\"\\uEFFE\"", + peg$c176 = "Unmatched DEDENT", + peg$c177 = "\uEFEE", + peg$c178 = "\"\\uEFEE\"", + peg$c179 = "LineEnd", + peg$c180 = "\r", + peg$c181 = "\"\\r\"", + peg$c182 = "\uEFFF", + peg$c183 = "\"\\uEFFF\"", + peg$c184 = "\n", + peg$c185 = "\"\\n\"", + peg$c186 = "ANYDEDENT", + peg$c187 = "RequiredWhitespace", + peg$c188 = "OptionalWhitespace", + peg$c189 = "InlineWhitespace", + peg$c190 = /^[ \t]/, + peg$c191 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c38(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$parseparam(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c45(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c47) { + s0 = peg$c47; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c49; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$parsebooleanNode(); + if (s2 === null) { + s2 = peg$parseintegerNode(); + if (s2 === null) { + s2 = peg$parsepathIdNode(); + if (s2 === null) { + s2 = peg$parsestringNode(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c62.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c69) { + s0 = peg$c69; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s0 = peg$c71; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c88.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c91.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c96(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c79; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c79; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c99; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c103(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c99; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c125) { + s0 = peg$c125; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c128) { + s1 = peg$c128; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c132(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c138.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c69) { + s3 = peg$c69; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s3 = peg$c71; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c99; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c116; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c144; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c146(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c150; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c74; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c154; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c160.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c162.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c55; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c168(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c180; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c182; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c184; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c190.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.8/emblem.min.js b/ajax/libs/emblem/0.3.8/emblem.min.js new file mode 100644 index 000000000..f22c8784c --- /dev/null +++ b/ajax/libs/emblem/0.3.8/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Qf!==b&&(Qf>b&&(Qf=0,Rf={line:1,column:1,seenCR:!1}),c(Rf,Qf,b),Qf=b),Rf}function e(a){Sf>Of||(Of>Sf&&(Sf=Of,Tf=[]),Tf.push(a))}function f(a){var b=0;for(a.sort();bOf?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function lb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),null===d&&(39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd))),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function mb(){var b,c,d,e;if(b=Of,c=Of,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=qc;return null!==d&&(d=a.substring(c,Of)),c=d,null!==c&&(Pf=b,c=le(c)),null===c?(Of=b,b=c):b=c,b}function nb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=cc(),null===a&&(a=bc())))),a}function pb(){var a,b,c,d,e,f;return a=Of,b=rb(),null!==b?(c=ec(),null!==c?(d=fb(),null!==d?(e=ec(),null!==e?(f=ub(),null!==f?(Pf=a,b=je(d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Uf++,123===a.charCodeAt(Of)?(b=ee,Of++):(b=null,0===Uf&&e(fe)),Uf--,null===b&&(c=null,0===Uf&&e(ne)),b}function sb(){var b,c;return Uf++,a.substr(Of,2)===pe?(b=pe,Of+=2):(b=null,0===Uf&&e(qe)),Uf--,null===b&&(c=null,0===Uf&&e(oe)),b}function tb(){var b,c;return Uf++,a.substr(Of,3)===se?(b=se,Of+=3):(b=null,0===Uf&&e(te)),Uf--,null===b&&(c=null,0===Uf&&e(re)),b}function ub(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(ue)),b}function vb(){var b,c;return Uf++,a.substr(Of,2)===ye?(b=ye,Of+=2):(b=null,0===Uf&&e(ze)),Uf--,null===b&&(c=null,0===Uf&&e(xe)),b}function wb(){var b,c;return Uf++,a.substr(Of,3)===Be?(b=Be,Of+=3):(b=null,0===Uf&&e(Ce)),Uf--,null===b&&(c=null,0===Uf&&e(Ae)),b}function xb(){var b,c;return Uf++,a.substr(Of,2)===Ee?(b=Ee,Of+=2):(b=null,0===Uf&&e(Fe)),Uf--,null===b&&(c=null,0===Uf&&e(De)),b}function yb(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(Ge)),b}function zb(){var b,c,d;return b=Of,a.substr(Of,2)===He?(c=He,Of+=2):(c=null,0===Uf&&e(Ie)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Of,61===a.charCodeAt(Of)?(c=uc,Of++):(c=null,0===Uf&&e(vc)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Ke(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)),b}function Ab(){var b,c,d,f,g;return b=Of,c=Ub(),null===c&&(c=rc),null!==c?(d=F(),null===d&&(d=rc),null!==d?(47===a.charCodeAt(Of)?(f=Jc,Of++):(f=null,0===Uf&&e(Kc)),null===f&&(f=rc),null!==f?(Pf=Of,g=Le(c,d),g=g?rc:qc,null!==g?(c=[c,d,f,g],b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Bb(){var a,b,c,d,e;if(a=Of,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Pf=a,b=Me(b,c,d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)}else Of=a,a=qc}else Of=a,a=qc;return a}function F(){var a,b,c,d;if(a=Of,b=[],c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d);else b=qc;return null!==b&&(Pf=a,b=Pe(b)),null===b?(Of=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Of,c=[],32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc));else c=qc;return null!==c?(d=Gb(),null===d&&(d=Hb(),null===d&&(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Lb())))),null!==d?(Pf=b,c=Qe(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Db(){var b;return Re.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Se)),null===b&&(b=Xb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Of,b=Q(),null!==b&&(Pf=a,b=Te(b)),null===b?(Of=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Of,c=Of,34===a.charCodeAt(Of)?(d=Od,Of++):(d=null,0===Uf&&e(Pd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Of)?(g=Od,Of++):(g=null,0===Uf&&e(Pd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc),null===c&&(c=Of,39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Of)?(g=Qd,Of++):(g=null,0===Uf&&e(Rd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc)),null!==c&&(Pf=b,c=Sd(c)),null===c?(Of=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Of,c=Yb(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Eb(),null!==f?(Pf=b,c=Ue(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Hb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(a.substr(Of,4)===Ed?(f=Ed,Of+=4):(f=null,0===Uf&&e(Fd)),null===f&&(a.substr(Of,5)===Gd?(f=Gd,Of+=5):(f=null,0===Uf&&e(Hd))),null!==f?(Pf=b,c=Ve(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Ib(){var b,c,d,f,g,h;if(b=Of,123===a.charCodeAt(Of)?(c=ee,Of++):(c=null,0===Uf&&e(fe)),null!==c)if(d=ec(),null!==d){if(f=Of,g=[],h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc)));else g=qc;null!==g&&(g=a.substring(f,Of)),f=g,null!==f?(g=ec(),null!==g?(125===a.charCodeAt(Of)?(h=ve,Of++):(h=null,0===Uf&&e(we)),null!==h?(Pf=b,c=We(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)}else Of=b,b=qc;else Of=b,b=qc;if(null===b){if(b=Of,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=qc;null!==c&&(c=a.substring(b,Of)),b=c}return b}function Jb(){var b,c,d,f,g,h;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Ib(),null!==f?(g=Of,Uf++,33===a.charCodeAt(Of)?(h=Xe,Of++):(h=null,0===Uf&&e(Ye)),Uf--,null===h?g=rc:(Of=g,g=qc),null!==g?(Pf=Of,h=Ze(c,f),h=h?rc:qc,null!==h?(Pf=b,c=$e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Kb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Q(),null!==f?(Pf=b,c=_e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Lb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=bb(),null!==f?(Pf=b,c=af(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Mb(){var b,c,d;return b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Nb(){var b,c,d;return b=Of,35===a.charCodeAt(Of)?(c=df,Of++):(c=null,0===Uf&&e(ef)),null!==c?(d=Pb(),null!==d?(Pf=b,c=ff(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Ob(){var b,c,d;return b=Of,46===a.charCodeAt(Of)?(c=kd,Of++):(c=null,0===Uf&&e(ld)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Pb(){var a,b;return Uf++,a=Qb(),Uf--,null===a&&(b=null,0===Uf&&e(gf)),a}function Qb(){var b,c,d;for(b=Of,c=[],d=Rb();null!==d;)c.push(d),d=Rb();return null!==c&&(c=a.substring(b,Of)),b=c}function Rb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Sb()),b}function Sb(){var b;return kf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(lf)),b}function Tb(){var b,c,d;if(b=Of,c=[],d=Wb(),null!==d)for(;null!==d;)c.push(d),d=Wb();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c}function Ub(){var b,c,d,f;return Uf++,b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=ec(),null!==d?(f=Tb(),null!==f?(Pf=b,c=od(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Vb()),Uf--,null===b&&(c=null,0===Uf&&e(mf)),b}function Vb(){var a,b,c;return a=Of,b=Tb(),null!==b?(Pf=Of,c=nf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function Wb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Xb()),b}function Xb(){var b,c,d,f;return b=Of,58===a.charCodeAt(Of)?(c=qd,Of++):(c=null,0===Uf&&e(rd)),null!==c?(d=Of,Uf++,32===a.charCodeAt(Of)?(f=Oc,Of++):(f=null,0===Uf&&e(Pc)),Uf--,null===f?d=rc:(Of=d,d=qc),null!==d?(Pf=b,c=Rc(c),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Yb(){var a,b,c;return Uf++,a=Of,b=Tb(),null!==b?(Pf=Of,c=qf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),Uf--,null===a&&(b=null,0===Uf&&e(pf)),a}function Zb(){var a,b,c;return a=Of,b=$b(),null!==b?(c=dc(),null!==c?(Pf=a,b=od(c),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function $b(){var b,c;return Uf++,b=Of,61423===a.charCodeAt(Of)?(c=sf,Of++):(c=null,0===Uf&&e(tf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(rf)),b}function _b(){var b,c;return Uf++,b=Of,61438===a.charCodeAt(Of)?(c=wf,Of++):(c=null,0===Uf&&e(xf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(vf)),b}function ac(){var b,c;return Uf++,b=Of,61422===a.charCodeAt(Of)?(c=zf,Of++):(c=null,0===Uf&&e(Af)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(yf)),b}function bc(){var b,c,d,f;return Uf++,b=Of,13===a.charCodeAt(Of)?(c=Cf,Of++):(c=null,0===Uf&&e(Df)),null===c&&(c=rc),null!==c?(61439===a.charCodeAt(Of)?(d=Ef,Of++):(d=null,0===Uf&&e(Ff)),null!==d?(10===a.charCodeAt(Of)?(f=Gf,Of++):(f=null,0===Uf&&e(Hf)),null!==f?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),Uf--,null===b&&(c=null,0===Uf&&e(Bf)),b}function cc(){var a,b;return Uf++,a=_b(),null===a&&(a=ac()),Uf--,null===a&&(b=null,0===Uf&&e(If)),a}function dc(){var b,c,d;if(Uf++,b=Of,c=[],d=fc(),null!==d)for(;null!==d;)c.push(d),d=fc();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c,Uf--,null===b&&(c=null,0===Uf&&e(Jf)),b}function ec(){var a,b;for(Uf++,a=[],b=fc();null!==b;)a.push(b),b=fc();return Uf--,null===a&&(b=null,0===Uf&&e(Kf)),a}function fc(){var b,c;return Uf++,Mf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Nf)),Uf--,null===b&&(c=null,0===Uf&&e(Lf)),b}function gc(){var b,c,d;return b=Of,c=Of,Uf++,d=$b(),null===d&&(d=_b(),null===d&&(d=bc())),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function hc(){var b,c,d;for(b=Of,c=[],d=gc();null!==d;)c.push(d),d=gc();return null!==c&&(c=a.substring(b,Of)),b=c}function ic(a,b,c){if(cg){var d=c?ag:bg;return new Xf.MustacheNode(a,b,d,{left:!1,right:!1})}return new Xf.MustacheNode(a,b,!c)}function jc(a,b){return cg?new Xf.ProgramNode(a,{left:!1,right:!1},b,null):new Xf.ProgramNode(a,b)}function kc(a,b,c){var d=a.hash;if(c){d=d||new Xf.HashNode([]);for(var e=0;e1?arguments[1]:{},oc={start:g},pc=g,qc=null,rc="",sc=function(a){return a},tc=function(a,b){return jc(a,b||[])},uc="=",vc='"="',wc="else",xc='"else"',yc=function(a){for(var b=[],c=[],d=0;d",Dc='">"',Ec=function(a,b){return[new Xf.PartialNode(a,b[0])]},Fc=/^[a-zA-Z0-9_$-\/]/,Gc="[a-zA-Z0-9_$-\\/]",Hc=function(a){return new Xf.PartialNameNode(new Xf.StringNode(a))},Ic=function(a){return[a]},Jc="/",Kc='"/"',Lc=/^[A-Z]/,Mc="[A-Z]",Nc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?(a.mustache=kc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?kc(a,b):a},Oc=" ",Pc='" "',Qc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Xf.ContentNode(" ")),a=a.concat(b[c])}return a},Rc=function(a){return a},Sc=function(a){return[a]},Tc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Uc=function(a,b){if(!b)return a;var c=a.id;cg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new Xf.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Vc=": ",Wc='": "',Xc=function(a){return jc(a,[])},Yc=function(a){return a&&a[2]},Zc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},$c=function(a,b,c,d){if(a){var e=new Xf.PartialNameNode(new Xf.StringNode(b.string));return new Xf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[i]):(i.push(new Xf.ContentNode(">")),[i,new Xf.ContentNode("")])},Ne=function(a){return{shorthand:a,id:!0}},Oe=function(a){return{shorthand:a}},Pe=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Qe=function(a){return a.length?[new Xf.ContentNode(" ")].concat(a):[]},Re=/^[A-Za-z.0-9_\-]/,Se="[A-Za-z.0-9_\\-]",Te=function(a){return ic([a],null,!0)},Ue=function(a,b){return[kc(b,"action",[["on",new Xf.StringNode(a)]])]},Ve=function(a,b){return"true"===b?[new Xf.ContentNode(a)]:[]},We=function(a){return a.replace(/ *$/,"")},Xe="!",Ye='"!"',Ze=function(){return Wf},$e=function(a,b){var c=new Xf.HashNode([[a,new Xf.StringNode(b)]]),d=[new Xf.IdNode([{part:"bind-attr"}])],e=ic(d,c);return[e]},_e=function(a,b){var c=ic([b],null,!0);return Wf&&"!"===b._emblemSuffixModifier&&(c=kc(c,"unbound")),[new Xf.ContentNode(a+"="+'"'),c,new Xf.ContentNode('"')]},af=function(a,b){var c=[new Xf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Xf.ContentNode('"')])},bf="%",cf='"%"',df="#",ef='"#"',ff=function(a){return a},gf="CSSIdentifier",hf=/^[_a-zA-Z0-9\-]/,jf="[_a-zA-Z0-9\\-]",kf=/^[\x80-\xFF]/,lf="[\\x80-\\xFF]",mf="KnownHTMLTagName",nf=function(a){return!!Zf[a]},of=function(a){return a},pf="a JS event",qf=function(a){return!!$f[a]},rf="INDENT",sf="\uefef",tf='"\\uEFEF"',uf=function(){return""},vf="DEDENT",wf="\ueffe",xf='"\\uEFFE"',yf="Unmatched DEDENT",zf="\uefee",Af='"\\uEFEE"',Bf="LineEnd",Cf="\r",Df='"\\r"',Ef="\uefff",Ff='"\\uEFFF"',Gf="\n",Hf='"\\n"',If="ANYDEDENT",Jf="RequiredWhitespace",Kf="OptionalWhitespace",Lf="InlineWhitespace",Mf=/^[ \t]/,Nf="[ \\t]",Of=0,Pf=0,Qf=0,Rf={line:1,column:1,seenCR:!1},Sf=0,Tf=[],Uf=0;if("startRule"in nc){if(!(nc.startRule in oc))throw new Error("Can't start parsing from rule \""+nc.startRule+'".');pc=oc[nc.startRule]}var Vf=c.handlebarsVariant,Wf="Ember.Handlebars"===Vf.JavaScriptCompiler.prototype.namespace,Xf=Vf.AST,Yf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Zf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},$f={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},_f=String.fromCharCode(125),ag=_f+_f,bg=ag+_f,cg=Vf.VERSION.slice(0,3)>=1.1;if(mc=pc(),null!==mc&&Of===a.length)return mc;throw f(Tf),Pf=Math.max(Of,Sf),new b(Tf,Pfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.9/emblem.js b/ajax/libs/emblem/0.3.9/emblem.js new file mode 100644 index 000000000..aebaa4917 --- /dev/null +++ b/ajax/libs/emblem/0.3.9/emblem.js @@ -0,0 +1,6263 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(c) {return c;}, + peg$c3 = function(c, i) { + return createProgramNode(c, i || []); + }, + peg$c4 = "=", + peg$c5 = "\"=\"", + peg$c6 = "else", + peg$c7 = "\"else\"", + peg$c8 = [], + peg$c9 = function(statements) { + // Coalesce all adjacent ContentNodes into one. + + var compressedStatements = []; + var buffer = []; + + for(var i = 0; i < statements.length; ++i) { + var nodes = statements[i]; + + for(var j = 0; j < nodes.length; ++j) { + var node = nodes[j] + if(node.type === "content") { + if(node.string) { + // Ignore empty strings (comments). + buffer.push(node.string); + } + continue; + } + + // Flush content if present. + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + buffer = []; + } + compressedStatements.push(node); + } + } + + if(buffer.length) { + compressedStatements.push(new AST.ContentNode(buffer.join(''))); + } + + return compressedStatements; + }, + peg$c10 = "BeginStatement", + peg$c11 = "ContentStatement", + peg$c12 = function() { return []; }, + peg$c13 = ">", + peg$c14 = "\">\"", + peg$c15 = function(n, params) { + return [new AST.PartialNode(n, params[0])]; + }, + peg$c16 = /^[a-zA-Z0-9_$-\/]/, + peg$c17 = "[a-zA-Z0-9_$-\\/]", + peg$c18 = function(s) { return new AST.PartialNameNode(new AST.StringNode(s)); }, + peg$c19 = function(m) { + return [m]; + }, + peg$c20 = "/", + peg$c21 = "\"/\"", + peg$c22 = /^[A-Z]/, + peg$c23 = "[A-Z]", + peg$c24 = function(ret) { + // TODO make this configurable + var defaultCapitalizedHelper = 'view'; + + if(ret.mustache) { + // Block. Modify inner MustacheNode and return. + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.mustache.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + ret.mustache = unshiftParam(ret.mustache, defaultCapitalizedHelper); + return ret; + } else { + + // Make sure a suffix modifier hasn't already been applied. + var ch = ret.id.string.charAt(0); + if(!IS_EMBER || !ch.match(/[A-Z]/)) return ret; + + return unshiftParam(ret, defaultCapitalizedHelper); + } + }, + peg$c25 = " ", + peg$c26 = "\" \"", + peg$c27 = function(ret, multilineContent) { + if(multilineContent) { + multilineContent = multilineContent[1]; + for(var i = 0, len = multilineContent.length; i < len; ++i) { + ret.push(new AST.ContentNode(' ')); + ret = ret.concat(multilineContent[i]); + } + } + return ret; + }, + peg$c28 = function(c) { return c; }, + peg$c29 = function(m) { return [m]; }, + peg$c30 = function(h, nested) { + // h is [[open tag content], closing tag ContentNode] + var ret = h[0]; + if(nested) { ret = ret.concat(nested); } + + // Push the closing tag ContentNode if it exists (self-closing if not) + if(h[1]) { ret.push(h[1]); } + + return ret; + }, + peg$c31 = function(mustacheNode, nestedContentProgramNode) { + if (!nestedContentProgramNode) { return mustacheNode; } + + var close = mustacheNode.id; + if (use11AST) { + close.path = mustacheNode.id; + close.strip = { + left: false, + right: false + }; + } + + var block = new AST.BlockNode(mustacheNode, nestedContentProgramNode, nestedContentProgramNode.inverse, close); + block.path = mustacheNode.id; + return block; + }, + peg$c32 = ": ", + peg$c33 = "\": \"", + peg$c34 = function(statements) { return createProgramNode(statements, []); }, + peg$c35 = function(block) { return block && block[2]; }, + peg$c36 = function(e, ret) { + var mustache = ret.mustache || ret; + mustache.escaped = e; + return ret; + }, + peg$c37 = function(isPartial, path, params, hash) { + if(isPartial) { + var n = new AST.PartialNameNode(new AST.StringNode(path.string)); + return new AST.PartialNode(n, params[0]); + } + + var actualParams = []; + var attrs = {}; + var hasAttrs = false; + + // Convert shorthand html attributes (e.g. % = tagName, . = class, etc) + for(var i = 0; i < params.length; ++i) { + var p = params[i]; + var attrKey = p[0]; + if(attrKey == 'tagName' || attrKey == 'elementId' || attrKey == 'class') { + hasAttrs = true; + attrs[attrKey] = attrs[attrKey] || []; + attrs[attrKey].push(p[1]); + } else { + actualParams.push(p); + } + } + + if(hasAttrs) { + hash = hash || new AST.HashNode([]); + for(var k in attrs) { + if(!attrs.hasOwnProperty(k)) continue; + hash.pairs.push([k, new AST.StringNode(attrs[k].join(' '))]); + } + } + + actualParams.unshift(path); + + var mustacheNode = createMustacheNode(actualParams, hash, true); + + var tm = path._emblemSuffixModifier; + if(tm === '!') { + return unshiftParam(mustacheNode, 'unbound'); + } else if(tm === '?') { + return unshiftParam(mustacheNode, 'if'); + } else if(tm === '^') { + return unshiftParam(mustacheNode, 'unless'); + } + + return mustacheNode; + }, + peg$c38 = function(t) { return ['tagName', t]; }, + peg$c39 = function(i) { return ['elementId', i]; }, + peg$c40 = function(c) { return ['class', c]; }, + peg$c41 = function(a) { + return a; + }, + peg$c42 = function(id, classes) { return [id, classes]; }, + peg$c43 = function(classes) { return [null, classes]; }, + peg$c44 = function(a) { return a; }, + peg$c45 = function(h) { return new AST.HashNode(h); }, + peg$c46 = "PathIdent", + peg$c47 = "..", + peg$c48 = "\"..\"", + peg$c49 = ".", + peg$c50 = "\".\"", + peg$c51 = /^[a-zA-Z0-9_$\-!?\^]/, + peg$c52 = "[a-zA-Z0-9_$\\-!?\\^]", + peg$c53 = function(s) { return s; }, + peg$c54 = "Key", + peg$c55 = ":", + peg$c56 = "\":\"", + peg$c57 = function(h) { return [h[0], h[2]]; }, + peg$c58 = function(n) { return n; }, + peg$c59 = function(s, p) { return { part: p, separator: s }; }, + peg$c60 = function(first, tail) { + var ret = [{ part: first }]; + for(var i = 0; i < tail.length; ++i) { + ret.push(tail[i]); + } + return ret; + }, + peg$c61 = "PathSeparator", + peg$c62 = /^[\/.]/, + peg$c63 = "[\\/.]", + peg$c64 = function(v) { + var last = v[v.length - 1]; + var match; + var suffixModifier; + if(match = last.part.match(/[!\?\^]$/)) { + suffixModifier = match[0]; + last.part = last.part.slice(0, -1); + } + + var idNode = new AST.IdNode(v); + idNode._emblemSuffixModifier = suffixModifier; + + return idNode; + }, + peg$c65 = function(v) { return new AST.StringNode(v); }, + peg$c66 = function(v) { return new AST.IntegerNode(v); }, + peg$c67 = function(v) { return new AST.BooleanNode(v); }, + peg$c68 = "Boolean", + peg$c69 = "true", + peg$c70 = "\"true\"", + peg$c71 = "false", + peg$c72 = "\"false\"", + peg$c73 = "Integer", + peg$c74 = "-", + peg$c75 = "\"-\"", + peg$c76 = /^[0-9]/, + peg$c77 = "[0-9]", + peg$c78 = function(s) { return parseInt(s); }, + peg$c79 = "\"", + peg$c80 = "\"\\\"\"", + peg$c81 = "'", + peg$c82 = "\"'\"", + peg$c83 = function(p) { return p[1]; }, + peg$c84 = /^[^"}]/, + peg$c85 = "[^\"}]", + peg$c86 = /^[^'}]/, + peg$c87 = "[^'}]", + peg$c88 = /^[A-Za-z]/, + peg$c89 = "[A-Za-z]", + peg$c90 = function(ind, nodes, w) { + nodes.unshift(new AST.ContentNode(ind)); + + for(var i = 0; i < w.length; ++i) { + nodes.push(new AST.ContentNode(ind)); + nodes = nodes.concat(w[i]); + nodes.push("\n"); + } + return nodes; + }, + peg$c91 = /^[|`']/, + peg$c92 = "[|`']", + peg$c93 = "<", + peg$c94 = "\"<\"", + peg$c95 = function() { return '<'; }, + peg$c96 = function(s, nodes, indentedNodes) { + if(nodes.length || !indentedNodes) { + nodes.push("\n"); + } + + if(indentedNodes) { + indentedNodes = indentedNodes[1]; + for(var i = 0; i < indentedNodes.length; ++i) { + /*nodes.push(new AST.ContentNode("#"));*/ + nodes = nodes.concat(indentedNodes[i]); + nodes.push("\n"); + } + } + + var ret = []; + var strip = s !== '`'; + for(var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + if(node == "\n") { + if(!strip) { + ret.push(new AST.ContentNode("\n")); + } + } else { + ret.push(node); + } + } + + if(s === "'") { + ret.push(new AST.ContentNode(" ")); + } + + return ret; + }, + peg$c97 = function(first, tail) { + return textNodesResult(first, tail); + }, + peg$c98 = function(first, tail) { return textNodesResult(first, tail); }, + peg$c99 = "{", + peg$c100 = "\"{\"", + peg$c101 = /^[^}]/, + peg$c102 = "[^}]", + peg$c103 = function(text) { + // Force interpretation as mustache. + // TODO: change to just parse with a specific rule? + text = "=" + text; + return Emblem.parse(text).statements[0]; + }, + peg$c104 = function(m) { m.escaped = true; return m; }, + peg$c105 = function(m) { m.escaped = false; return m; }, + peg$c106 = function(a) { return new AST.ContentNode(a); }, + peg$c107 = "any character", + peg$c108 = "SingleMustacheOpen", + peg$c109 = "DoubleMustacheOpen", + peg$c110 = "{{", + peg$c111 = "\"{{\"", + peg$c112 = "TripleMustacheOpen", + peg$c113 = "{{{", + peg$c114 = "\"{{{\"", + peg$c115 = "SingleMustacheClose", + peg$c116 = "}", + peg$c117 = "\"}\"", + peg$c118 = "DoubleMustacheClose", + peg$c119 = "}}", + peg$c120 = "\"}}\"", + peg$c121 = "TripleMustacheClose", + peg$c122 = "}}}", + peg$c123 = "\"}}}\"", + peg$c124 = "InterpolationOpen", + peg$c125 = "#{", + peg$c126 = "\"#{\"", + peg$c127 = "InterpolationClose", + peg$c128 = "==", + peg$c129 = "\"==\"", + peg$c130 = function() { return false; }, + peg$c131 = function() { return true; }, + peg$c132 = function(h, s) { return h || s; }, + peg$c133 = function(h, inTagMustaches, fullAttributes) { + var tagName = h[0] || 'div', + shorthandAttributes = h[1] || [], + id = shorthandAttributes[0], + classes = shorthandAttributes[1] || [], + tagOpenContent = [], + updateMustacheNode; + + updateMustacheNode = function (node) { + var pairs, pair, stringNode, original; + if (!classes.length) { + return; + } + if (!node.id || node.id.string !== 'bind-attr') { + return; + } + if (node.hash && node.hash.pairs && (pairs = node.hash.pairs)) { + for (var i2 in pairs) { + if (!pairs.hasOwnProperty(i2)) { continue; } + pair = pairs[i2]; + if (pair[0] === 'class' && pair[1] instanceof AST.StringNode) { + stringNode = pair[1]; + original = stringNode.original; + stringNode.original = stringNode.string = stringNode.stringModeValue = ':' + classes.join(' :') + ' ' + original; + classes = []; + } + } + } + }; + + tagOpenContent.push(new AST.ContentNode('<' + tagName)); + + if(id) { + tagOpenContent.push(new AST.ContentNode(' id="' + id + '"')); + } + + // Pad in tag mustaches with spaces. + for(var i = 0; i < inTagMustaches.length; ++i) { + // Check if given mustache node has class bindings and prepend shorthand classes + updateMustacheNode(inTagMustaches[i]); + tagOpenContent.push(new AST.ContentNode(' ')); + tagOpenContent.push(inTagMustaches[i]); + } + + for(var i = 0; i < fullAttributes.length; ++i) { + for (var i2 in fullAttributes[i]) { + if (fullAttributes[i][i2] instanceof AST.MustacheNode) { + updateMustacheNode(fullAttributes[i][i2]); + } + } + + if (classes.length) { + var isClassAttr = fullAttributes[i][1] && fullAttributes[i][1].string === 'class="'; + + // Check if attribute is class attribute and has content + if (isClassAttr && fullAttributes[i].length === 4) { + if (fullAttributes[i][2].type == 'mustache') { + var mustacheNode, classesContent, hash, params; + // If class was mustache binding, transform attribute into bind-attr MustacheNode + // In case of 'div.shorthand class=varBinding' will transform into '
')); + return [tagOpenContent]; + } else { + tagOpenContent.push(new AST.ContentNode('>')); + return [tagOpenContent, new AST.ContentNode('')]; + } + }, + peg$c134 = function(s) { return { shorthand: s, id: true}; }, + peg$c135 = function(s) { return { shorthand: s }; }, + peg$c136 = function(shorthands) { + var id, classes = []; + for(var i = 0, len = shorthands.length; i < len; ++i) { + var shorthand = shorthands[i]; + if(shorthand.id) { + id = shorthand.shorthand; + } else { + classes.push(shorthand.shorthand); + } + } + + return [id, classes]; + }, + peg$c137 = function(a) { + if (a.length) { + return [new AST.ContentNode(' ')].concat(a); + } else { + return []; + } + }, + peg$c138 = /^[A-Za-z.0-9_\-]/, + peg$c139 = "[A-Za-z.0-9_\\-]", + peg$c140 = function(id) { return createMustacheNode([id], null, true); }, + peg$c141 = function(event, mustacheNode) { + // Unshift the action helper and augment the hash + return [unshiftParam(mustacheNode, 'action', [['on', new AST.StringNode(event)]])]; + }, + peg$c142 = function(key, boolValue) { + if (boolValue === 'true') { + return [ new AST.ContentNode(key) ]; + } else { + return []; + } + }, + peg$c143 = function(value) { return value.replace(/ *$/, ''); }, + peg$c144 = "!", + peg$c145 = "\"!\"", + peg$c146 = function(key, value) { return IS_EMBER; }, + peg$c147 = function(key, value) { + var hashNode = new AST.HashNode([[key, new AST.StringNode(value)]]); + var params = [new AST.IdNode([{part: 'bind-attr'}])]; + var mustacheNode = createMustacheNode(params, hashNode); + + return [mustacheNode]; + }, + peg$c148 = function(key, id) { + var mustacheNode = createMustacheNode([id], null, true); + + if(IS_EMBER && id._emblemSuffixModifier === '!') { + mustacheNode = unshiftParam(mustacheNode, 'unbound'); + } + + return [ + new AST.ContentNode(key + '=' + '"'), + mustacheNode, + new AST.ContentNode('"'), + ]; + }, + peg$c149 = function(key, nodes) { + var result = [ new AST.ContentNode(key + '=' + '"') ].concat(nodes); + return result.concat([new AST.ContentNode('"')]); + }, + peg$c150 = "_", + peg$c151 = "\"_\"", + peg$c152 = "%", + peg$c153 = "\"%\"", + peg$c154 = "#", + peg$c155 = "\"#\"", + peg$c156 = function(c) { return c;}, + peg$c157 = "CSSIdentifier", + peg$c158 = /^[_a-zA-Z0-9\-]/, + peg$c159 = "[_a-zA-Z0-9\\-]", + peg$c160 = /^[_a-zA-Z]/, + peg$c161 = "[_a-zA-Z]", + peg$c162 = /^[\x80-\xFF]/, + peg$c163 = "[\\x80-\\xFF]", + peg$c164 = "KnownHTMLTagName", + peg$c165 = function(t) { return !!KNOWN_TAGS[t]; }, + peg$c166 = function(t) { return t; }, + peg$c167 = "a JS event", + peg$c168 = function(t) { return !!KNOWN_EVENTS[t]; }, + peg$c169 = "INDENT", + peg$c170 = "\uEFEF", + peg$c171 = "\"\\uEFEF\"", + peg$c172 = function() { return ''; }, + peg$c173 = "DEDENT", + peg$c174 = "\uEFFE", + peg$c175 = "\"\\uEFFE\"", + peg$c176 = "Unmatched DEDENT", + peg$c177 = "\uEFEE", + peg$c178 = "\"\\uEFEE\"", + peg$c179 = "LineEnd", + peg$c180 = "\r", + peg$c181 = "\"\\r\"", + peg$c182 = "\uEFFF", + peg$c183 = "\"\\uEFFF\"", + peg$c184 = "\n", + peg$c185 = "\"\\n\"", + peg$c186 = "ANYDEDENT", + peg$c187 = "RequiredWhitespace", + peg$c188 = "OptionalWhitespace", + peg$c189 = "InlineWhitespace", + peg$c190 = /^[ \t]/, + peg$c191 = "[ \\t]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parsestart() { + var s0; + + s0 = peg$parseinvertibleContent(); + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = peg$parseindentation(); + if (s7 !== null) { + s8 = peg$parsecontent(); + if (s8 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s8); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseelse() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.substr(peg$currPos, 4) === peg$c6) { + s2 = peg$c6; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecontent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsestatement(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsestatement(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseblankLine(); + if (s0 === null) { + s0 = peg$parsecomment(); + if (s0 === null) { + s0 = peg$parsecontentStatement(); + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + + return s0; + } + + function peg$parsecontentStatement() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parselegacyPartialInvocation(); + if (s0 === null) { + s0 = peg$parsehtmlElement(); + if (s0 === null) { + s0 = peg$parsetextLine(); + if (s0 === null) { + s0 = peg$parsemustache(); + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c11); } + } + + return s0; + } + + function peg$parseblankLine() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialInvocation() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parselegacyPartialName(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c15(s3, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselegacyPartialName() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c16.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsemustache() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseexplicitMustache(); + if (s1 === null) { + s1 = peg$parselineStartingMustache(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c19(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsecommentContent() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parselineContent(); + if (s1 !== null) { + s2 = peg$parseTERM(); + if (s2 !== null) { + s3 = []; + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + while (s4 !== null) { + s3.push(s4); + s4 = peg$currPos; + s5 = peg$parseindentation(); + if (s5 !== null) { + s6 = []; + s7 = peg$parsecommentContent(); + if (s7 !== null) { + while (s7 !== null) { + s6.push(s7); + s7 = peg$parsecommentContent(); + } + } else { + s6 = peg$c0; + } + if (s6 !== null) { + s7 = peg$parseanyDedent(); + if (s7 !== null) { + s5 = [s5, s6, s7]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } else { + peg$currPos = s4; + s4 = peg$c0; + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecomment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parsecommentContent(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinlineComment() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c20; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s1 !== null) { + s2 = peg$parselineContent(); + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineStartingMustache() { + var s0; + + s0 = peg$parsecapitalizedLineStarterMustache(); + if (s0 === null) { + s0 = peg$parsemustacheOrBlock(); + } + + return s0; + } + + function peg$parsecapitalizedLineStarterMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$c22.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlNestedTextNodes() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 32) { + s1 = peg$c25; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + if (s6 !== null) { + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + } else { + s5 = peg$c0; + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c27(s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseindentedContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseblankLine(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseblankLine(); + } + if (s1 !== null) { + s2 = peg$parseindentation(); + if (s2 !== null) { + s3 = peg$parsecontent(); + if (s3 !== null) { + s4 = peg$parseDEDENT(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlTerminator() { + var s0, s1, s2, s3, s4; + + s0 = peg$parsecolonContent(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseexplicitMustache(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$parseinlineComment(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + s4 = peg$parseindentedContent(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsehtmlNestedTextNodes(); + } + } + } + + return s0; + } + + function peg$parsehtmlElement() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseinHtmlTag(); + if (s1 !== null) { + s2 = peg$parsehtmlTerminator(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheOrBlock() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseinMustache(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseinlineComment(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parsemustacheNestedContent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s1, s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinvertibleContent() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + s0 = peg$currPos; + s1 = peg$parsecontent(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parseDEDENT(); + if (s3 !== null) { + s4 = peg$parseelse(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTERM(); + if (s6 !== null) { + s7 = []; + s8 = peg$parseblankLine(); + while (s8 !== null) { + s7.push(s8); + s8 = peg$parseblankLine(); + } + if (s7 !== null) { + s8 = peg$parseindentation(); + if (s8 !== null) { + s9 = peg$parsecontent(); + if (s9 !== null) { + peg$reportedPos = s2; + s3 = peg$c2(s9); + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c3(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecolonContent() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c32) { + s1 = peg$c32; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c33); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsecontentStatement(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsemustacheNestedContent() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsecolonContent(); + if (s1 === null) { + s1 = peg$parsetextLine(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTERM(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + s4 = peg$parseblankLine(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseblankLine(); + } + if (s3 !== null) { + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = peg$parseinvertibleContent(); + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c35(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseexplicitMustache() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseequalSign(); + if (s1 !== null) { + s2 = peg$parsemustacheOrBlock(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c36(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinMustache() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 62) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c14); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + s4 = []; + s5 = peg$parseinMustacheParam(); + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseinMustacheParam(); + } + if (s4 !== null) { + s5 = peg$parsehash(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c37(s1, s3, s4, s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsehtmlMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsetagNameShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c38(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c39(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c40(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c41(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0; + + s0 = peg$parseattributesAtLeastID(); + if (s0 === null) { + s0 = peg$parseattributesAtLeastClass(); + } + + return s0; + } + + function peg$parseattributesAtLeastID() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseidShorthand(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseclassShorthand(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseclassShorthand(); + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributesAtLeastClass() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseclassShorthand(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseclassShorthand(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseinMustacheParam() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsehtmlMustacheAttribute(); + if (s1 === null) { + s1 = peg$parseparam(); + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehash() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsehashSegment(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsehashSegment(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c45(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepathIdent() { + var s0, s1, s2, s3; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c47) { + s0 = peg$c47; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 46) { + s0 = peg$c49; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (peg$c51.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + + return s0; + } + + function peg$parsekey() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s2 = peg$c55; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + + return s0; + } + + function peg$parsehashSegment() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsebooleanNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parseintegerNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsepathIdNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parsekey(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c4; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s4 !== null) { + s5 = peg$parsestringNode(); + if (s5 !== null) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseparam() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parse__(); + if (s1 !== null) { + s2 = peg$parsebooleanNode(); + if (s2 === null) { + s2 = peg$parseintegerNode(); + if (s2 === null) { + s2 = peg$parsepathIdNode(); + if (s2 === null) { + s2 = peg$parsestringNode(); + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepathIdent(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseseperator(); + if (s4 !== null) { + s5 = peg$parsepathIdent(); + if (s5 !== null) { + peg$reportedPos = s3; + s4 = peg$c59(s4, s5); + if (s4 === null) { + peg$currPos = s3; + s3 = s4; + } else { + s3 = s4; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseseperator() { + var s0, s1; + + peg$silentFails++; + if (peg$c62.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + + return s0; + } + + function peg$parsepathIdNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsepath(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsestringNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsestring(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseintegerNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseinteger(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsebooleanNode() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseboolean(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c67(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseboolean() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 4) === peg$c69) { + s0 = peg$c69; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s0 = peg$c71; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + function peg$parseinteger() { + var s0, s1, s2, s3, s4, s5; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s3 = peg$c74; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = []; + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + if (peg$c76.test(input.charAt(peg$currPos))) { + s5 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c78(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c73); } + } + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parsehashDoubleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parsehashSingleQuoteStringValue(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsehashDoubleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c84.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c85); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehashSingleQuoteStringValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseTERM(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + if (peg$c86.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c87); } + } + if (s4 !== null) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsealpha() { + var s0; + + if (peg$c88.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c89); } + } + + return s0; + } + + function peg$parsewhitespaceableTextNodes() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseindentation(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = []; + s4 = peg$parsewhitespaceableTextNodes(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsewhitespaceableTextNodes(); + } + if (s3 !== null) { + s4 = peg$parseanyDedent(); + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parsetextNodes(); + } + + return s0; + } + + function peg$parsetextLineStart() { + var s0, s1, s2; + + s0 = peg$currPos; + if (peg$c91.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c92); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c93; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c94); } + } + peg$silentFails--; + if (s2 !== null) { + peg$currPos = s1; + s1 = peg$c1; + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c95(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsetextLine() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parsetextLineStart(); + if (s1 !== null) { + s2 = peg$parsetextNodes(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parseindentation(); + if (s4 !== null) { + s5 = []; + s6 = peg$parsewhitespaceableTextNodes(); + while (s6 !== null) { + s5.push(s6); + s6 = peg$parsewhitespaceableTextNodes(); + } + if (s5 !== null) { + s6 = peg$parseDEDENT(); + if (s6 !== null) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c96(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetextNodes() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + s3 = peg$parseTERM(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c97(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c79; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInner(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c79; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c81; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s1 !== null) { + s2 = peg$parseattributeTextNodesInnerSingle(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c81; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseattributeTextNodesInner() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheText(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheText(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeTextNodesInnerSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsepreAttrMustacheTextSingle(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parserawMustache(); + if (s4 !== null) { + s5 = peg$parsepreAttrMustacheTextSingle(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c98(s1, s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustache() { + var s0; + + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + + return s0; + } + + function peg$parserecursivelyParsedMustacheContent() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c99; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = []; + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + while (s4 !== null) { + s3.push(s4); + if (peg$c101.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c102); } + } + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c103(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheEscaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsedoubleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsedoubleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsehashStacheOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsehashStacheClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parserawMustacheUnescaped() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsetripleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsetripleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c105(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheTextSingle() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreAttrMustacheUnitSingle(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreAttrMustacheUnitSingle(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreAttrMustacheUnitSingle() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsepreMustacheText() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = []; + s3 = peg$parsepreMustacheUnit(); + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$parsepreMustacheUnit(); + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c106(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsepreMustacheUnit() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parsenonMustacheUnit(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenonMustacheUnit() { + var s0; + + s0 = peg$parsetripleOpen(); + if (s0 === null) { + s0 = peg$parsedoubleOpen(); + if (s0 === null) { + s0 = peg$parsehashStacheOpen(); + if (s0 === null) { + s0 = peg$parseanyDedent(); + if (s0 === null) { + s0 = peg$parseTERM(); + } + } + } + } + + return s0; + } + + function peg$parserawMustacheSingle() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsesingleOpen(); + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parserecursivelyParsedMustacheContent(); + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parsesingleClose(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c104(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinTagMustache() { + var s0; + + s0 = peg$parserawMustacheSingle(); + if (s0 === null) { + s0 = peg$parserawMustacheUnescaped(); + if (s0 === null) { + s0 = peg$parserawMustacheEscaped(); + } + } + + return s0; + } + + function peg$parsesingleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 123) { + s0 = peg$c99; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c108); } + } + + return s0; + } + + function peg$parsedoubleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c110) { + s0 = peg$c110; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + + return s0; + } + + function peg$parsetripleOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c113) { + s0 = peg$c113; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c114); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c112); } + } + + return s0; + } + + function peg$parsesingleClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + + return s0; + } + + function peg$parsedoubleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c119) { + s0 = peg$c119; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c120); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c118); } + } + + return s0; + } + + function peg$parsetripleClose() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c122) { + s0 = peg$c122; + peg$currPos += 3; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + + return s0; + } + + function peg$parsehashStacheOpen() { + var s0, s1; + + peg$silentFails++; + if (input.substr(peg$currPos, 2) === peg$c125) { + s0 = peg$c125; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c126); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c124); } + } + + return s0; + } + + function peg$parsehashStacheClose() { + var s0, s1; + + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 125) { + s0 = peg$c116; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + + return s0; + } + + function peg$parseequalSign() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c128) { + s1 = peg$c128; + peg$currPos += 2; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c4; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c131(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parsehtmlStart() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlTagName(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseshorthandAttributes(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 47) { + s3 = peg$c20; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = peg$currPos; + s4 = peg$c132(s1, s2); + if (s4) { + s4 = peg$c1; + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s1 = [s1, s2, s3, s4]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseinHtmlTag() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parsehtmlStart(); + if (s1 !== null) { + s2 = []; + s3 = peg$parseinTagMustache(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseinTagMustache(); + } + if (s2 !== null) { + s3 = []; + s4 = peg$parsefullAttribute(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parsefullAttribute(); + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c133(s1, s2, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseshorthandAttributes() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parseidShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c134(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + if (s2 === null) { + s2 = peg$currPos; + s3 = peg$parseclassShorthand(); + if (s3 !== null) { + peg$reportedPos = s2; + s3 = peg$c135(s3); + } + if (s3 === null) { + peg$currPos = s2; + s2 = s3; + } else { + s2 = s3; + } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c136(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsefullAttribute() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + if (input.charCodeAt(peg$currPos) === 32) { + s2 = peg$c25; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseactionAttribute(); + if (s2 === null) { + s2 = peg$parsebooleanAttribute(); + if (s2 === null) { + s2 = peg$parseboundAttribute(); + if (s2 === null) { + s2 = peg$parserawMustacheAttribute(); + if (s2 === null) { + s2 = peg$parsenormalAttribute(); + } + } + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c137(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValueChar() { + var s0; + + if (peg$c138.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parseactionValue() { + var s0, s1; + + s0 = peg$parsequotedActionValue(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parsepathIdNode(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c140(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsequotedActionValue() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c79; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s4 = peg$c79; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c80); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 === null) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c81; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s2 !== null) { + s3 = peg$parseinMustache(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s4 = peg$c81; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c82); } + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c83(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseactionAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseknownEvent(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseactionValue(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c141(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsebooleanAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + if (input.substr(peg$currPos, 4) === peg$c69) { + s3 = peg$c69; + peg$currPos += 4; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c70); } + } + if (s3 === null) { + if (input.substr(peg$currPos, 5) === peg$c71) { + s3 = peg$c71; + peg$currPos += 5; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c72); } + } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c142(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseboundAttributeValue() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c99; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c100); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseboundAttributeValueChar(); + if (s5 === null) { + if (input.charCodeAt(peg$currPos) === 32) { + s5 = peg$c25; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + } + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c116; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c143(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseboundAttributeValueChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseboundAttributeValueChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseboundAttribute() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseboundAttributeValue(); + if (s3 !== null) { + s4 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 33) { + s5 = peg$c144; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + peg$silentFails--; + if (s5 === null) { + s4 = peg$c1; + } else { + peg$currPos = s4; + s4 = peg$c0; + } + if (s4 !== null) { + peg$reportedPos = peg$currPos; + s5 = peg$c146(s1, s3); + if (s5) { + s5 = peg$c1; + } else { + s5 = peg$c0; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c147(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parserawMustacheAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parsepathIdNode(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c148(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsenormalAttribute() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c4; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c5); } + } + if (s2 !== null) { + s3 = peg$parseattributeTextNodes(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c149(s1, s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseattributeName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseattributeChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseattributeChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseattributeChar() { + var s0; + + s0 = peg$parsealpha(); + if (s0 === null) { + if (peg$c76.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c77); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c150; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c74; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c75); } + } + } + } + } + + return s0; + } + + function peg$parsetagNameShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseidShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c154; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c156(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseclassShorthand() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 !== null) { + s2 = peg$parsecssIdentifier(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsecssIdentifier() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseident(); + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + + return s0; + } + + function peg$parseident() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsenmchar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsenmchar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsenmchar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenmstart() { + var s0; + + if (peg$c160.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c161); } + } + if (s0 === null) { + s0 = peg$parsenonascii(); + } + + return s0; + } + + function peg$parsenonascii() { + var s0; + + if (peg$c162.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c163); } + } + + return s0; + } + + function peg$parsetagString() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsetagChar(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsetagChar(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsehtmlTagName() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 37) { + s1 = peg$c152; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parsetagString(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseknownTagName(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + + return s0; + } + + function peg$parseknownTagName() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c165(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parsetagChar() { + var s0; + + if (peg$c158.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + if (s0 === null) { + s0 = peg$parsenonSeparatorColon(); + } + + return s0; + } + + function peg$parsenonSeparatorColon() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c55; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 32) { + s3 = peg$c25; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseknownEvent() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsetagString(); + if (s1 !== null) { + peg$reportedPos = peg$currPos; + s2 = peg$c168(s1); + if (s2) { + s2 = peg$c1; + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c166(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c167); } + } + + return s0; + } + + function peg$parseindentation() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseINDENT(); + if (s1 !== null) { + s2 = peg$parse__(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseINDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61423) { + s1 = peg$c170; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c171); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c169); } + } + + return s0; + } + + function peg$parseDEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61438) { + s1 = peg$c174; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c175); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c173); } + } + + return s0; + } + + function peg$parseUNMATCHED_DEDENT() { + var s0, s1; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61422) { + s1 = peg$c177; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c172(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + + return s0; + } + + function peg$parseTERM() { + var s0, s1, s2, s3; + + peg$silentFails++; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c180; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c181); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 61439) { + s2 = peg$c182; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c183); } + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c184; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c185); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c130(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c179); } + } + + return s0; + } + + function peg$parseanyDedent() { + var s0, s1; + + peg$silentFails++; + s0 = peg$parseDEDENT(); + if (s0 === null) { + s0 = peg$parseUNMATCHED_DEDENT(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c187); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parsewhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parsewhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0, s1; + + peg$silentFails++; + if (peg$c190.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c191); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c189); } + } + + return s0; + } + + function peg$parselineChar() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseINDENT(); + if (s2 === null) { + s2 = peg$parseDEDENT(); + if (s2 === null) { + s2 = peg$parseTERM(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + if (input.length > peg$currPos) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parselineContent() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parselineChar(); + while (s2 !== null) { + s1.push(s2); + s2 = peg$parselineChar(); + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + + var handlebarsVariant = Emblem.handlebarsVariant; + var IS_EMBER = handlebarsVariant.JavaScriptCompiler.prototype.namespace === "Ember.Handlebars"; + var AST = handlebarsVariant.AST; + + var SELF_CLOSING_TAG = { + area: true, + base: true, + br: true, + col: true, + command: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true + }; + + var KNOWN_TAGS = { + figcaption: true, blockquote: true, plaintext: true, textarea: true, progress: true, + optgroup: true, noscript: true, noframes: true, frameset: true, fieldset: true, + datalist: true, colgroup: true, basefont: true, summary: true, section: true, + marquee: true, listing: true, isindex: true, details: true, command: true, + caption: true, bgsound: true, article: true, address: true, acronym: true, + strong: true, strike: true, spacer: true, source: true, select: true, + script: true, output: true, option: true, object: true, legend: true, + keygen: true, iframe: true, hgroup: true, header: true, footer: true, + figure: true, center: true, canvas: true, button: true, applet: true, video: true, + track: true, title: true, thead: true, tfoot: true, tbody: true, table: true, + style: true, small: true, param: true, meter: true, label: true, input: true, + frame: true, embed: true, blink: true, audio: true, aside: true, time: true, + span: true, samp: true, ruby: true, nobr: true, meta: true, menu: true, + mark: true, main: true, link: true, html: true, head: true, form: true, + font: true, data: true, code: true, cite: true, body: true, base: true, + area: true, abbr: true, xmp: true, wbr: true, 'var': true, sup: true, + sub: true, pre: true, nav: true, map: true, kbd: true, ins: true, + img: true, div: true, dir: true, dfn: true, del: true, col: true, + big: true, bdo: true, bdi: true, ul: true, tt: true, tr: true, th: true, td: true, + rt: true, rp: true, ol: true, li: true, hr: true, h6: true, h5: true, h4: true, + h3: true, h2: true, h1: true, em: true, dt: true, dl: true, dd: true, br: true, + u: true, s: true, q: true, p: true, i: true, b: true, a: true + }; + + var KNOWN_EVENTS = { + "touchStart": true, "touchMove": true, "touchEnd": true, "touchCancel": true, + "keyDown": true, "keyUp": true, "keyPress": true, "mouseDown": true, "mouseUp": true, + "contextMenu": true, "click": true, "doubleClick": true, "mouseMove": true, + "focusIn": true, "focusOut": true, "mouseEnter": true, "mouseLeave": true, + "submit": true, "input": true, "change": true, "dragStart": true, + "drag": true, "dragEnter": true, "dragLeave": true, + "dragOver": true, "drop": true, "dragEnd": true + }; + + // Ridiculous that we have to do this, but PEG doesn't + // support unmatched closing braces in JS code, + // so we have to construct. + var closeBrace = String.fromCharCode(125); + var twoBrace = closeBrace + closeBrace; + var threeBrace = twoBrace + closeBrace; + + var use11AST = handlebarsVariant.VERSION.slice(0, 3) >= 1.1; + function createMustacheNode(params, hash, escaped) { + if (use11AST) { + var open = escaped ? twoBrace : threeBrace; + return new AST.MustacheNode(params, hash, open, { left: false, right: false }); + } else { + // old style + return new AST.MustacheNode(params, hash, !escaped); + } + } + + function createProgramNode(statements, inverse) { + if (use11AST) { + return new AST.ProgramNode(statements, { left: false, right: false}, inverse, null); + } else { + return new AST.ProgramNode(statements, inverse); + } + } + + // Returns a new MustacheNode with a new preceding param (id). + function unshiftParam(mustacheNode, helperName, newHashPairs) { + + var hash = mustacheNode.hash; + + // Merge hash. + if(newHashPairs) { + hash = hash || new AST.HashNode([]); + + for(var i = 0; i < newHashPairs.length; ++i) { + hash.pairs.push(newHashPairs[i]); + } + } + + var params = [mustacheNode.id].concat(mustacheNode.params); + params.unshift(new AST.IdNode([{ part: helperName}])); + return createMustacheNode(params, hash, mustacheNode.escaped); + } + + function textNodesResult(first, tail) { + var ret = []; + if(first) { ret.push(first); } + for(var i = 0; i < tail.length; ++i) { + var t = tail[i]; + ret.push(t[0]); + if(t[1]) { ret.push(t[1]); } + } + return ret; + } + + // Only for debugging use. + function log(msg) { + handlebarsVariant.log(9, msg); + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); + +module.exports = Emblem.Parser; + +},{"./emblem":3}],5:[function(require,module,exports){ +var Emblem, Preprocessor, StringScanner; + +StringScanner = require('StringScanner'); + +Emblem = require('./emblem'); + +Emblem.Preprocessor = Preprocessor = (function() { + var DEDENT, INDENT, TERM, UNMATCHED_DEDENT, anyWhitespaceAndNewlinesTouchingEOF, any_whitespaceFollowedByNewlines_, processInput, ws; + + ws = '\\t\\x0B\\f \\xA0\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000\\uFEFF'; + + INDENT = '\uEFEF'; + + DEDENT = '\uEFFE'; + + UNMATCHED_DEDENT = '\uEFEE'; + + TERM = '\uEFFF'; + + anyWhitespaceAndNewlinesTouchingEOF = RegExp("[" + ws + "\\r?\\n]*$"); + + any_whitespaceFollowedByNewlines_ = RegExp("(?:[" + ws + "]*\\r?\\n)+"); + + function Preprocessor() { + this.base = null; + this.indents = []; + this.context = []; + this.context.peek = function() { + if (this.length) { + return this[this.length - 1]; + } else { + return null; + } + }; + this.context.err = function(c) { + throw new Error("Unexpected " + c); + }; + this.output = ''; + this.context.observe = function(c) { + var top; + top = this.peek(); + switch (c) { + case INDENT: + this.push(c); + break; + case DEDENT: + if (top !== INDENT) { + this.err(c); + } + this.pop(); + break; + case '\r': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '\n': + if (top !== '/') { + this.err(c); + } + this.pop(); + break; + case '/': + this.push(c); + break; + case 'end-\\': + if (top !== '\\') { + this.err(c); + } + this.pop(); + break; + default: + throw new Error("undefined token observed: " + c); + } + return this; + }; + if (this.StringScanner) { + this.ss = new this.StringScanner(''); + } else if (Emblem.StringScanner) { + this.ss = new Emblem.StringScanner(''); + } else { + this.ss = new StringScanner(''); + } + } + + Preprocessor.prototype.p = function(s) { + if (s) { + this.output += s; + } + return s; + }; + + Preprocessor.prototype.scan = function(r) { + return this.p(this.ss.scan(r)); + }; + + Preprocessor.prototype.discard = function(r) { + return this.ss.scan(r); + }; + + processInput = function(isEnd) { + return function(data) { + var b, d, indent, s; + if (!isEnd) { + this.ss.concat(data); + this.discard(any_whitespaceFollowedByNewlines_); + } + while (!this.ss.eos()) { + switch (this.context.peek()) { + case null: + case INDENT: + if (this.ss.bol() || this.discard(any_whitespaceFollowedByNewlines_)) { + if (this.discard(RegExp("[" + ws + "]*\\r?\\n"))) { + this.p("" + TERM + "\n"); + continue; + } + if (this.base != null) { + if ((this.discard(this.base)) == null) { + throw new Error("inconsistent base indentation"); + } + } else { + b = this.discard(RegExp("[" + ws + "]*")); + this.base = RegExp("" + b); + } + if (this.indents.length === 0) { + if (this.ss.check(RegExp("[" + ws + "]+"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + indent = this.indents[this.indents.length - 1]; + if (d = this.ss.check(RegExp("(" + indent + ")"))) { + this.discard(d); + if (this.ss.check(RegExp("([" + ws + "]+)"))) { + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(d + this.scan(RegExp("([" + ws + "]+)"))); + } + } else { + while (this.indents.length) { + indent = this.indents[this.indents.length - 1]; + if (this.discard(RegExp("(?:" + indent + ")"))) { + break; + } + this.context.observe(DEDENT); + this.p(DEDENT); + this.indents.pop(); + } + if (s = this.discard(RegExp("[" + ws + "]+"))) { + this.output = this.output.slice(0, -1); + this.output += UNMATCHED_DEDENT; + this.p(INDENT); + this.context.observe(INDENT); + this.indents.push(s); + } + } + } + } + this.scan(/[^\r\n]+/); + if (this.discard(/\r?\n/)) { + this.p("" + TERM + "\n"); + } + } + } + if (isEnd) { + this.scan(anyWhitespaceAndNewlinesTouchingEOF); + while (this.context.length && INDENT === this.context.peek()) { + this.context.observe(DEDENT); + this.p(DEDENT); + } + if (this.context.length) { + throw new Error('Unclosed ' + (this.context.peek()) + ' at EOF'); + } + } + }; + }; + + Preprocessor.prototype.processData = processInput(false); + + Preprocessor.prototype.processEnd = processInput(true); + + Preprocessor.processSync = function(input) { + var pre; + input += "\n"; + pre = new Preprocessor; + pre.processData(input); + pre.processEnd(); + return pre.output; + }; + + return Preprocessor; + +})(); + +},{"./emblem":3,"StringScanner":6}],6:[function(require,module,exports){ +(function() { + var StringScanner; + StringScanner = (function() { + function StringScanner(str) { + this.str = str != null ? str : ''; + this.str = '' + this.str; + this.pos = 0; + this.lastMatch = { + reset: function() { + this.str = null; + this.captures = []; + return this; + } + }.reset(); + this; + } + StringScanner.prototype.bol = function() { + return this.pos <= 0 || (this.str[this.pos - 1] === "\n"); + }; + StringScanner.prototype.captures = function() { + return this.lastMatch.captures; + }; + StringScanner.prototype.check = function(pattern) { + var matches; + if (this.str.substr(this.pos).search(pattern) !== 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str; + }; + StringScanner.prototype.checkUntil = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.captures = matches.slice(1); + return this.lastMatch.str = this.str.substr(this.pos, patternPos) + matches[0]; + }; + StringScanner.prototype.clone = function() { + var clone, prop, value, _ref; + clone = new this.constructor(this.str); + clone.pos = this.pos; + clone.lastMatch = {}; + _ref = this.lastMatch; + for (prop in _ref) { + value = _ref[prop]; + clone.lastMatch[prop] = value; + } + return clone; + }; + StringScanner.prototype.concat = function(str) { + this.str += str; + return this; + }; + StringScanner.prototype.eos = function() { + return this.pos === this.str.length; + }; + StringScanner.prototype.exists = function(pattern) { + var matches, patternPos; + patternPos = this.str.substr(this.pos).search(pattern); + if (patternPos < 0) { + this.lastMatch.reset(); + return null; + } + matches = this.str.substr(this.pos + patternPos).match(pattern); + this.lastMatch.str = matches[0]; + this.lastMatch.captures = matches.slice(1); + return patternPos; + }; + StringScanner.prototype.getch = function() { + return this.scan(/./); + }; + StringScanner.prototype.match = function() { + return this.lastMatch.str; + }; + StringScanner.prototype.matches = function(pattern) { + this.check(pattern); + return this.matchSize(); + }; + StringScanner.prototype.matched = function() { + return this.lastMatch.str != null; + }; + StringScanner.prototype.matchSize = function() { + if (this.matched()) { + return this.match().length; + } else { + return null; + } + }; + StringScanner.prototype.peek = function(len) { + return this.str.substr(this.pos, len); + }; + StringScanner.prototype.pointer = function() { + return this.pos; + }; + StringScanner.prototype.setPointer = function(pos) { + pos = +pos; + if (pos < 0) { + pos = 0; + } + if (pos > this.str.length) { + pos = this.str.length; + } + return this.pos = pos; + }; + StringScanner.prototype.reset = function() { + this.lastMatch.reset(); + this.pos = 0; + return this; + }; + StringScanner.prototype.rest = function() { + return this.str.substr(this.pos); + }; + StringScanner.prototype.scan = function(pattern) { + var chk; + chk = this.check(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.scanUntil = function(pattern) { + var chk; + chk = this.checkUntil(pattern); + if (chk != null) { + this.pos += chk.length; + } + return chk; + }; + StringScanner.prototype.skip = function(pattern) { + this.scan(pattern); + return this.matchSize(); + }; + StringScanner.prototype.skipUntil = function(pattern) { + this.scanUntil(pattern); + return this.matchSize(); + }; + StringScanner.prototype.string = function() { + return this.str; + }; + StringScanner.prototype.terminate = function() { + this.pos = this.str.length; + this.lastMatch.reset(); + return this; + }; + StringScanner.prototype.toString = function() { + return "# 8 ? "" + (this.str.substr(0, 5)) + "..." : this.str)) + ">"; + }; + return StringScanner; + })(); + StringScanner.prototype.beginningOfLine = StringScanner.prototype.bol; + StringScanner.prototype.clear = StringScanner.prototype.terminate; + StringScanner.prototype.dup = StringScanner.prototype.clone; + StringScanner.prototype.endOfString = StringScanner.prototype.eos; + StringScanner.prototype.exist = StringScanner.prototype.exists; + StringScanner.prototype.getChar = StringScanner.prototype.getch; + StringScanner.prototype.position = StringScanner.prototype.pointer; + StringScanner.StringScanner = StringScanner; + module.exports = StringScanner; +}).call(this); + +},{}]},{},[3]) +; \ No newline at end of file diff --git a/ajax/libs/emblem/0.3.9/emblem.min.js b/ajax/libs/emblem/0.3.9/emblem.min.js new file mode 100644 index 000000000..ec789712b --- /dev/null +++ b/ajax/libs/emblem/0.3.9/emblem.min.js @@ -0,0 +1,2 @@ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ge;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return Qf!==b&&(Qf>b&&(Qf=0,Rf={line:1,column:1,seenCR:!1}),c(Rf,Qf,b),Qf=b),Rf}function e(a){Sf>Of||(Of>Sf&&(Sf=Of,Tf=[]),Tf.push(a))}function f(a){var b=0;for(a.sort();bOf?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function lb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),null===d&&(39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd))),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function mb(){var b,c,d,e;if(b=Of,c=Of,d=[],e=nb(),null!==e)for(;null!==e;)d.push(e),e=nb();else d=qc;return null!==d&&(d=a.substring(c,Of)),c=d,null!==c&&(Pf=b,c=le(c)),null===c?(Of=b,b=c):b=c,b}function nb(){var b,c,d;return b=Of,c=Of,Uf++,d=ob(),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function ob(){var a;return a=tb(),null===a&&(a=sb(),null===a&&(a=xb(),null===a&&(a=cc(),null===a&&(a=bc())))),a}function pb(){var a,b,c,d,e,f;return a=Of,b=rb(),null!==b?(c=ec(),null!==c?(d=fb(),null!==d?(e=ec(),null!==e?(f=ub(),null!==f?(Pf=a,b=je(d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc)):(Of=a,a=qc),a}function qb(){var a;return a=pb(),null===a&&(a=hb(),null===a&&(a=gb())),a}function rb(){var b,c;return Uf++,123===a.charCodeAt(Of)?(b=ee,Of++):(b=null,0===Uf&&e(fe)),Uf--,null===b&&(c=null,0===Uf&&e(ne)),b}function sb(){var b,c;return Uf++,a.substr(Of,2)===pe?(b=pe,Of+=2):(b=null,0===Uf&&e(qe)),Uf--,null===b&&(c=null,0===Uf&&e(oe)),b}function tb(){var b,c;return Uf++,a.substr(Of,3)===se?(b=se,Of+=3):(b=null,0===Uf&&e(te)),Uf--,null===b&&(c=null,0===Uf&&e(re)),b}function ub(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(ue)),b}function vb(){var b,c;return Uf++,a.substr(Of,2)===ye?(b=ye,Of+=2):(b=null,0===Uf&&e(ze)),Uf--,null===b&&(c=null,0===Uf&&e(xe)),b}function wb(){var b,c;return Uf++,a.substr(Of,3)===Be?(b=Be,Of+=3):(b=null,0===Uf&&e(Ce)),Uf--,null===b&&(c=null,0===Uf&&e(Ae)),b}function xb(){var b,c;return Uf++,a.substr(Of,2)===Ee?(b=Ee,Of+=2):(b=null,0===Uf&&e(Fe)),Uf--,null===b&&(c=null,0===Uf&&e(De)),b}function yb(){var b,c;return Uf++,125===a.charCodeAt(Of)?(b=ve,Of++):(b=null,0===Uf&&e(we)),Uf--,null===b&&(c=null,0===Uf&&e(Ge)),b}function zb(){var b,c,d;return b=Of,a.substr(Of,2)===He?(c=He,Of+=2):(c=null,0===Uf&&e(Ie)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Of,61===a.charCodeAt(Of)?(c=uc,Of++):(c=null,0===Uf&&e(vc)),null!==c?(32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null===d&&(d=rc),null!==d?(Pf=b,c=Ke(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)),b}function Ab(){var b,c,d,f,g;return b=Of,c=Ub(),null===c&&(c=rc),null!==c?(d=F(),null===d&&(d=rc),null!==d?(47===a.charCodeAt(Of)?(f=Jc,Of++):(f=null,0===Uf&&e(Kc)),null===f&&(f=rc),null!==f?(Pf=Of,g=Le(c,d),g=g?rc:qc,null!==g?(c=[c,d,f,g],b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Bb(){var a,b,c,d,e;if(a=Of,b=Ab(),null!==b){for(c=[],d=qb();null!==d;)c.push(d),d=qb();if(null!==c){for(d=[],e=Cb();null!==e;)d.push(e),e=Cb();null!==d?(Pf=a,b=Me(b,c,d),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)}else Of=a,a=qc}else Of=a,a=qc;return a}function F(){var a,b,c,d;if(a=Of,b=[],c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d),null!==c)for(;null!==c;)b.push(c),c=Of,d=Nb(),null!==d&&(Pf=c,d=Ne(d)),null===d?(Of=c,c=d):c=d,null===c&&(c=Of,d=Ob(),null!==d&&(Pf=c,d=Oe(d)),null===d?(Of=c,c=d):c=d);else b=qc;return null!==b&&(Pf=a,b=Pe(b)),null===b?(Of=a,a=b):a=b,a}function Cb(){var b,c,d;if(b=Of,c=[],32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc)),null!==d)for(;null!==d;)c.push(d),32===a.charCodeAt(Of)?(d=Oc,Of++):(d=null,0===Uf&&e(Pc));else c=qc;return null!==c?(d=Gb(),null===d&&(d=Hb(),null===d&&(d=Jb(),null===d&&(d=Kb(),null===d&&(d=Lb())))),null!==d?(Pf=b,c=Qe(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Db(){var b;return Re.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Se)),null===b&&(b=Xb()),b}function Eb(){var a,b;return a=Fb(),null===a&&(a=Of,b=Q(),null!==b&&(Pf=a,b=Te(b)),null===b?(Of=a,a=b):a=b),a}function Fb(){var b,c,d,f,g;return b=Of,c=Of,34===a.charCodeAt(Of)?(d=Od,Of++):(d=null,0===Uf&&e(Pd)),null!==d?(f=D(),null!==f?(34===a.charCodeAt(Of)?(g=Od,Of++):(g=null,0===Uf&&e(Pd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc),null===c&&(c=Of,39===a.charCodeAt(Of)?(d=Qd,Of++):(d=null,0===Uf&&e(Rd)),null!==d?(f=D(),null!==f?(39===a.charCodeAt(Of)?(g=Qd,Of++):(g=null,0===Uf&&e(Rd)),null!==g?(d=[d,f,g],c=d):(Of=c,c=qc)):(Of=c,c=qc)):(Of=c,c=qc)),null!==c&&(Pf=b,c=Sd(c)),null===c?(Of=b,b=c):b=c,b}function Gb(){var b,c,d,f;return b=Of,c=Yb(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Eb(),null!==f?(Pf=b,c=Ue(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Hb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(a.substr(Of,4)===Ed?(f=Ed,Of+=4):(f=null,0===Uf&&e(Fd)),null===f&&(a.substr(Of,5)===Gd?(f=Gd,Of+=5):(f=null,0===Uf&&e(Hd))),null!==f?(Pf=b,c=Ve(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Ib(){var b,c,d,f,g,h;if(b=Of,123===a.charCodeAt(Of)?(c=ee,Of++):(c=null,0===Uf&&e(fe)),null!==c)if(d=ec(),null!==d){if(f=Of,g=[],h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc))),null!==h)for(;null!==h;)g.push(h),h=Db(),null===h&&(32===a.charCodeAt(Of)?(h=Oc,Of++):(h=null,0===Uf&&e(Pc)));else g=qc;null!==g&&(g=a.substring(f,Of)),f=g,null!==f?(g=ec(),null!==g?(125===a.charCodeAt(Of)?(h=ve,Of++):(h=null,0===Uf&&e(we)),null!==h?(Pf=b,c=We(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)}else Of=b,b=qc;else Of=b,b=qc;if(null===b){if(b=Of,c=[],d=Db(),null!==d)for(;null!==d;)c.push(d),d=Db();else c=qc;null!==c&&(c=a.substring(b,Of)),b=c}return b}function Jb(){var b,c,d,f,g,h;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Ib(),null!==f?(g=Of,Uf++,33===a.charCodeAt(Of)?(h=Xe,Of++):(h=null,0===Uf&&e(Ye)),Uf--,null===h?g=rc:(Of=g,g=qc),null!==g?(Pf=Of,h=Ze(c,f),h=h?rc:qc,null!==h?(Pf=b,c=$e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Kb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=Q(),null!==f?(Pf=b,c=_e(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Lb(){var b,c,d,f;return b=Of,c=L(),null!==c?(61===a.charCodeAt(Of)?(d=uc,Of++):(d=null,0===Uf&&e(vc)),null!==d?(f=bb(),null!==f?(Pf=b,c=af(c,f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),b}function Mb(){var b,c,d;return b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Nb(){var b,c,d;return b=Of,35===a.charCodeAt(Of)?(c=df,Of++):(c=null,0===Uf&&e(ef)),null!==c?(d=Pb(),null!==d?(Pf=b,c=ff(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Ob(){var b,c,d;return b=Of,46===a.charCodeAt(Of)?(c=kd,Of++):(c=null,0===Uf&&e(ld)),null!==c?(d=Pb(),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Pb(){var a,b;return Uf++,a=Qb(),Uf--,null===a&&(b=null,0===Uf&&e(gf)),a}function Qb(){var b,c,d;for(b=Of,c=[],d=Rb();null!==d;)c.push(d),d=Rb();return null!==c&&(c=a.substring(b,Of)),b=c}function Rb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Sb()),b}function Sb(){var b;return kf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(lf)),b}function Tb(){var b,c,d;if(b=Of,c=[],d=Wb(),null!==d)for(;null!==d;)c.push(d),d=Wb();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c}function Ub(){var b,c,d,f;return Uf++,b=Of,37===a.charCodeAt(Of)?(c=bf,Of++):(c=null,0===Uf&&e(cf)),null!==c?(d=ec(),null!==d?(f=Tb(),null!==f?(Pf=b,c=od(f),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),null===b&&(b=Vb()),Uf--,null===b&&(c=null,0===Uf&&e(mf)),b}function Vb(){var a,b,c;return a=Of,b=Tb(),null!==b?(Pf=Of,c=nf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function Wb(){var b;return hf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(jf)),null===b&&(b=Xb()),b}function Xb(){var b,c,d,f;return b=Of,58===a.charCodeAt(Of)?(c=qd,Of++):(c=null,0===Uf&&e(rd)),null!==c?(d=Of,Uf++,32===a.charCodeAt(Of)?(f=Oc,Of++):(f=null,0===Uf&&e(Pc)),Uf--,null===f?d=rc:(Of=d,d=qc),null!==d?(Pf=b,c=Rc(c),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function Yb(){var a,b,c;return Uf++,a=Of,b=Tb(),null!==b?(Pf=Of,c=qf(b),c=c?rc:qc,null!==c?(Pf=a,b=of(b),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),Uf--,null===a&&(b=null,0===Uf&&e(pf)),a}function Zb(){var a,b,c;return a=Of,b=$b(),null!==b?(c=dc(),null!==c?(Pf=a,b=od(c),null===b?(Of=a,a=b):a=b):(Of=a,a=qc)):(Of=a,a=qc),a}function $b(){var b,c;return Uf++,b=Of,61423===a.charCodeAt(Of)?(c=sf,Of++):(c=null,0===Uf&&e(tf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(rf)),b}function _b(){var b,c;return Uf++,b=Of,61438===a.charCodeAt(Of)?(c=wf,Of++):(c=null,0===Uf&&e(xf)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(vf)),b}function ac(){var b,c;return Uf++,b=Of,61422===a.charCodeAt(Of)?(c=zf,Of++):(c=null,0===Uf&&e(Af)),null!==c&&(Pf=b,c=uf()),null===c?(Of=b,b=c):b=c,Uf--,null===b&&(c=null,0===Uf&&e(yf)),b}function bc(){var b,c,d,f;return Uf++,b=Of,13===a.charCodeAt(Of)?(c=Cf,Of++):(c=null,0===Uf&&e(Df)),null===c&&(c=rc),null!==c?(61439===a.charCodeAt(Of)?(d=Ef,Of++):(d=null,0===Uf&&e(Ff)),null!==d?(10===a.charCodeAt(Of)?(f=Gf,Of++):(f=null,0===Uf&&e(Hf)),null!==f?(Pf=b,c=Je(),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc)):(Of=b,b=qc),Uf--,null===b&&(c=null,0===Uf&&e(Bf)),b}function cc(){var a,b;return Uf++,a=_b(),null===a&&(a=ac()),Uf--,null===a&&(b=null,0===Uf&&e(If)),a}function dc(){var b,c,d;if(Uf++,b=Of,c=[],d=fc(),null!==d)for(;null!==d;)c.push(d),d=fc();else c=qc;return null!==c&&(c=a.substring(b,Of)),b=c,Uf--,null===b&&(c=null,0===Uf&&e(Jf)),b}function ec(){var a,b;for(Uf++,a=[],b=fc();null!==b;)a.push(b),b=fc();return Uf--,null===a&&(b=null,0===Uf&&e(Kf)),a}function fc(){var b,c;return Uf++,Mf.test(a.charAt(Of))?(b=a.charAt(Of),Of++):(b=null,0===Uf&&e(Nf)),Uf--,null===b&&(c=null,0===Uf&&e(Lf)),b}function gc(){var b,c,d;return b=Of,c=Of,Uf++,d=$b(),null===d&&(d=_b(),null===d&&(d=bc())),Uf--,null===d?c=rc:(Of=c,c=qc),null!==c?(a.length>Of?(d=a.charAt(Of),Of++):(d=null,0===Uf&&e(me)),null!==d?(Pf=b,c=Rc(d),null===c?(Of=b,b=c):b=c):(Of=b,b=qc)):(Of=b,b=qc),b}function hc(){var b,c,d;for(b=Of,c=[],d=gc();null!==d;)c.push(d),d=gc();return null!==c&&(c=a.substring(b,Of)),b=c}function ic(a,b,c){if(cg){var d=c?ag:bg;return new Xf.MustacheNode(a,b,d,{left:!1,right:!1})}return new Xf.MustacheNode(a,b,!c)}function jc(a,b){return cg?new Xf.ProgramNode(a,{left:!1,right:!1},b,null):new Xf.ProgramNode(a,b)}function kc(a,b,c){var d=a.hash;if(c){d=d||new Xf.HashNode([]);for(var e=0;e1?arguments[1]:{},oc={start:g},pc=g,qc=null,rc="",sc=function(a){return a},tc=function(a,b){return jc(a,b||[])},uc="=",vc='"="',wc="else",xc='"else"',yc=function(a){for(var b=[],c=[],d=0;d",Dc='">"',Ec=function(a,b){return[new Xf.PartialNode(a,b[0])]},Fc=/^[a-zA-Z0-9_$-\/]/,Gc="[a-zA-Z0-9_$-\\/]",Hc=function(a){return new Xf.PartialNameNode(new Xf.StringNode(a))},Ic=function(a){return[a]},Jc="/",Kc='"/"',Lc=/^[A-Z]/,Mc="[A-Z]",Nc=function(a){var b="view";if(a.mustache){var c=a.mustache.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?(a.mustache=kc(a.mustache,b),a):a}var c=a.id.string.charAt(0);return Wf&&c.match(/[A-Z]/)?kc(a,b):a},Oc=" ",Pc='" "',Qc=function(a,b){if(b){b=b[1];for(var c=0,d=b.length;d>c;++c)a.push(new Xf.ContentNode(" ")),a=a.concat(b[c])}return a},Rc=function(a){return a},Sc=function(a){return[a]},Tc=function(a,b){var c=a[0];return b&&(c=c.concat(b)),a[1]&&c.push(a[1]),c},Uc=function(a,b){if(!b)return a;var c=a.id;cg&&(c.path=a.id,c.strip={left:!1,right:!1});var d=new Xf.BlockNode(a,b,b.inverse,c);return d.path=a.id,d},Vc=": ",Wc='": "',Xc=function(a){return jc(a,[])},Yc=function(a){return a&&a[2]},Zc=function(a,b){var c=b.mustache||b;return c.escaped=a,b},$c=function(a,b,c,d){if(a){var e=new Xf.PartialNameNode(new Xf.StringNode(b.string));return new Xf.PartialNode(e,c[0])}for(var f=[],g={},h=!1,i=0;i")),[i]):(i.push(new Xf.ContentNode(">")),[i,new Xf.ContentNode("")])},Ne=function(a){return{shorthand:a,id:!0}},Oe=function(a){return{shorthand:a}},Pe=function(a){for(var b,c=[],d=0,e=a.length;e>d;++d){var f=a[d];f.id?b=f.shorthand:c.push(f.shorthand)}return[b,c]},Qe=function(a){return a.length?[new Xf.ContentNode(" ")].concat(a):[]},Re=/^[A-Za-z.0-9_\-]/,Se="[A-Za-z.0-9_\\-]",Te=function(a){return ic([a],null,!0)},Ue=function(a,b){return[kc(b,"action",[["on",new Xf.StringNode(a)]])]},Ve=function(a,b){return"true"===b?[new Xf.ContentNode(a)]:[]},We=function(a){return a.replace(/ *$/,"")},Xe="!",Ye='"!"',Ze=function(){return Wf},$e=function(a,b){var c=new Xf.HashNode([[a,new Xf.StringNode(b)]]),d=[new Xf.IdNode([{part:"bind-attr"}])],e=ic(d,c);return[e]},_e=function(a,b){var c=ic([b],null,!0);return Wf&&"!"===b._emblemSuffixModifier&&(c=kc(c,"unbound")),[new Xf.ContentNode(a+"="+'"'),c,new Xf.ContentNode('"')]},af=function(a,b){var c=[new Xf.ContentNode(a+"="+'"')].concat(b);return c.concat([new Xf.ContentNode('"')])},bf="%",cf='"%"',df="#",ef='"#"',ff=function(a){return a},gf="CSSIdentifier",hf=/^[_a-zA-Z0-9\-]/,jf="[_a-zA-Z0-9\\-]",kf=/^[\x80-\xFF]/,lf="[\\x80-\\xFF]",mf="KnownHTMLTagName",nf=function(a){return!!Zf[a]},of=function(a){return a},pf="a JS event",qf=function(a){return!!$f[a]},rf="INDENT",sf="\uefef",tf='"\\uEFEF"',uf=function(){return""},vf="DEDENT",wf="\ueffe",xf='"\\uEFFE"',yf="Unmatched DEDENT",zf="\uefee",Af='"\\uEFEE"',Bf="LineEnd",Cf="\r",Df='"\\r"',Ef="\uefff",Ff='"\\uEFFF"',Gf="\n",Hf='"\\n"',If="ANYDEDENT",Jf="RequiredWhitespace",Kf="OptionalWhitespace",Lf="InlineWhitespace",Mf=/^[ \t]/,Nf="[ \\t]",Of=0,Pf=0,Qf=0,Rf={line:1,column:1,seenCR:!1},Sf=0,Tf=[],Uf=0;if("startRule"in nc){if(!(nc.startRule in oc))throw new Error("Can't start parsing from rule \""+nc.startRule+'".');pc=oc[nc.startRule]}var Vf=c.handlebarsVariant,Wf="Ember.Handlebars"===Vf.JavaScriptCompiler.prototype.namespace,Xf=Vf.AST,Yf={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Zf={figcaption:!0,blockquote:!0,plaintext:!0,textarea:!0,progress:!0,optgroup:!0,noscript:!0,noframes:!0,frameset:!0,fieldset:!0,datalist:!0,colgroup:!0,basefont:!0,summary:!0,section:!0,marquee:!0,listing:!0,isindex:!0,details:!0,command:!0,caption:!0,bgsound:!0,article:!0,address:!0,acronym:!0,strong:!0,strike:!0,spacer:!0,source:!0,select:!0,script:!0,output:!0,option:!0,object:!0,legend:!0,keygen:!0,iframe:!0,hgroup:!0,header:!0,footer:!0,figure:!0,center:!0,canvas:!0,button:!0,applet:!0,video:!0,track:!0,title:!0,thead:!0,tfoot:!0,tbody:!0,table:!0,style:!0,small:!0,param:!0,meter:!0,label:!0,input:!0,frame:!0,embed:!0,blink:!0,audio:!0,aside:!0,time:!0,span:!0,samp:!0,ruby:!0,nobr:!0,meta:!0,menu:!0,mark:!0,main:!0,link:!0,html:!0,head:!0,form:!0,font:!0,data:!0,code:!0,cite:!0,body:!0,base:!0,area:!0,abbr:!0,xmp:!0,wbr:!0,"var":!0,sup:!0,sub:!0,pre:!0,nav:!0,map:!0,kbd:!0,ins:!0,img:!0,div:!0,dir:!0,dfn:!0,del:!0,col:!0,big:!0,bdo:!0,bdi:!0,ul:!0,tt:!0,tr:!0,th:!0,td:!0,rt:!0,rp:!0,ol:!0,li:!0,hr:!0,h6:!0,h5:!0,h4:!0,h3:!0,h2:!0,h1:!0,em:!0,dt:!0,dl:!0,dd:!0,br:!0,u:!0,s:!0,q:!0,p:!0,i:!0,b:!0,a:!0},$f={touchStart:!0,touchMove:!0,touchEnd:!0,touchCancel:!0,keyDown:!0,keyUp:!0,keyPress:!0,mouseDown:!0,mouseUp:!0,contextMenu:!0,click:!0,doubleClick:!0,mouseMove:!0,focusIn:!0,focusOut:!0,mouseEnter:!0,mouseLeave:!0,submit:!0,input:!0,change:!0,dragStart:!0,drag:!0,dragEnter:!0,dragLeave:!0,dragOver:!0,drop:!0,dragEnd:!0},_f=String.fromCharCode(125),ag=_f+_f,bg=ag+_f,cg=Vf.VERSION.slice(0,3)>=1.1;if(mc=pc(),null!==mc&&Of===a.length)return mc;throw f(Tf),Pf=Math.max(Of,Sf),new b(Tf,Pfc?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.captures=b.slice(1),this.lastMatch.str=this.str.substr(this.pos,c)+b[0])},a.prototype.clone=function(){var a,b,c,d;a=new this.constructor(this.str),a.pos=this.pos,a.lastMatch={},d=this.lastMatch;for(b in d)c=d[b],a.lastMatch[b]=c;return a},a.prototype.concat=function(a){return this.str+=a,this},a.prototype.eos=function(){return this.pos===this.str.length},a.prototype.exists=function(a){var b,c;return c=this.str.substr(this.pos).search(a),0>c?(this.lastMatch.reset(),null):(b=this.str.substr(this.pos+c).match(a),this.lastMatch.str=b[0],this.lastMatch.captures=b.slice(1),c)},a.prototype.getch=function(){return this.scan(/./)},a.prototype.match=function(){return this.lastMatch.str},a.prototype.matches=function(a){return this.check(a),this.matchSize()},a.prototype.matched=function(){return null!=this.lastMatch.str},a.prototype.matchSize=function(){return this.matched()?this.match().length:null},a.prototype.peek=function(a){return this.str.substr(this.pos,a)},a.prototype.pointer=function(){return this.pos},a.prototype.setPointer=function(a){return a=+a,0>a&&(a=0),a>this.str.length&&(a=this.str.length),this.pos=a},a.prototype.reset=function(){return this.lastMatch.reset(),this.pos=0,this},a.prototype.rest=function(){return this.str.substr(this.pos)},a.prototype.scan=function(a){var b;return b=this.check(a),null!=b&&(this.pos+=b.length),b},a.prototype.scanUntil=function(a){var b;return b=this.checkUntil(a),null!=b&&(this.pos+=b.length),b},a.prototype.skip=function(a){return this.scan(a),this.matchSize()},a.prototype.skipUntil=function(a){return this.scanUntil(a),this.matchSize()},a.prototype.string=function(){return this.str},a.prototype.terminate=function(){return this.pos=this.str.length,this.lastMatch.reset(),this},a.prototype.toString=function(){return"#8?""+this.str.substr(0,5)+"...":this.str))+">"},a}(),a.prototype.beginningOfLine=a.prototype.bol,a.prototype.clear=a.prototype.terminate,a.prototype.dup=a.prototype.clone,a.prototype.endOfString=a.prototype.eos,a.prototype.exist=a.prototype.exists,a.prototype.getChar=a.prototype.getch,a.prototype.position=a.prototype.pointer,a.StringScanner=a,b.exports=a}.call(this)},{}]},{},[3]); \ No newline at end of file diff --git a/ajax/libs/emblem/package.json b/ajax/libs/emblem/package.json index 566e075df..45889241e 100644 --- a/ajax/libs/emblem/package.json +++ b/ajax/libs/emblem/package.json @@ -1,7 +1,7 @@ { "name": "emblem", "filename": "emblem.min.js", - "version": "0.3.18", + "version": "0.3.16", "description": "Ember-friendly, indented syntax alternative for Handlebars.js", "homepage": "http://emblemjs.com/", "keywords": [