diff --git a/lib/compiler.js b/lib/compiler.js index 26cf7127..b131e58f 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -25,13 +25,11 @@ try { var ast = filterAST(parse(source)); return compile(ast, name); - } - catch (err) - { - if (!err.line || !err.column) { + } catch (err) { + if (!err.location) { throw err; } - throw new SyntaxError(err.message + ' At line : ' + err.line + ', column : ' + err.column); + throw new SyntaxError(err.message + ' [' + name + ':' + err.location.start.line + ':' + err.location.start.column + ']'); } }; diff --git a/lib/parser.js b/lib/parser.js index b468bd7e..eaf418e1 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -14,10 +14,12 @@ } }(this, function(dust) { var parser = (function() { + "use strict"; + /* - * Generated by PEG.js 0.8.0. + * Generated by PEG.js 0.9.0. * - * http://pegjs.majda.cz/ + * http://pegjs.org/ */ function peg$subclass(child, parent) { @@ -26,117 +28,115 @@ child.prototype = new ctor(); } - function SyntaxError(message, expected, found, offset, line, column) { + function peg$SyntaxError(message, expected, found, location) { this.message = message; this.expected = expected; this.found = found; - this.offset = offset; - this.line = line; - this.column = column; - + this.location = location; this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } } - peg$subclass(SyntaxError, Error); + peg$subclass(peg$SyntaxError, Error); - function parse(input) { + function peg$parse(input) { var options = arguments.length > 1 ? arguments[1] : {}, + parser = this, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, - peg$c0 = [], - peg$c1 = function(p) { + peg$c0 = function(p) { var body = ["body"].concat(p); return withPosition(body); }, - peg$c2 = { type: "other", description: "section" }, - peg$c3 = peg$FAILED, - peg$c4 = null, - peg$c5 = function(t, b, e, n) { + peg$c1 = { type: "other", description: "section" }, + peg$c2 = function(t, b, e, n) { if( (!n) || (t[1].text !== n.text) ) { error("Expected end tag for "+t[1].text+" but it was not found."); } return true; }, - peg$c6 = void 0, - peg$c7 = function(t, b, e, n) { + peg$c3 = function(t, b, e, n) { e.push(["param", ["literal", "block"], b]); t.push(e, ["filters"]); return withPosition(t) }, - peg$c8 = "/", - peg$c9 = { type: "literal", value: "/", description: "\"/\"" }, - peg$c10 = function(t) { + peg$c4 = "/", + peg$c5 = { type: "literal", value: "/", description: "\"/\"" }, + peg$c6 = function(t) { t.push(["bodies"], ["filters"]); return withPosition(t) }, - peg$c11 = /^[#?\^<+@%]/, - peg$c12 = { type: "class", value: "[#?\\^<+@%]", description: "[#?\\^<+@%]" }, - peg$c13 = function(t, n, c, p) { return [t, n, c, p] }, - peg$c14 = { type: "other", description: "end tag" }, - peg$c15 = function(n) { return n }, - peg$c16 = ":", - peg$c17 = { type: "literal", value: ":", description: "\":\"" }, - peg$c18 = function(n) {return n}, - peg$c19 = function(n) { return n ? ["context", n] : ["context"] }, - peg$c20 = { type: "other", description: "params" }, - peg$c21 = "=", - peg$c22 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c23 = function(k, v) {return ["param", ["literal", k], v]}, - peg$c24 = function(p) { return ["params"].concat(p) }, - peg$c25 = { type: "other", description: "bodies" }, - peg$c26 = function(p) { return ["bodies"].concat(p) }, - peg$c27 = { type: "other", description: "reference" }, - peg$c28 = function(n, f) { return withPosition(["reference", n, f]) }, - peg$c29 = { type: "other", description: "partial" }, - peg$c30 = ">", - peg$c31 = { type: "literal", value: ">", description: "\">\"" }, - peg$c32 = "+", - peg$c33 = { type: "literal", value: "+", description: "\"+\"" }, - peg$c34 = function(k) {return ["literal", k]}, - peg$c35 = function(s, n, c, p) { + peg$c7 = /^[#?\^<+@%]/, + peg$c8 = { type: "class", value: "[#?^<+@%]", description: "[#?^<+@%]" }, + peg$c9 = function(t, n, c, p) { return [t, n, c, p] }, + peg$c10 = { type: "other", description: "end tag" }, + peg$c11 = function(n) { return n }, + peg$c12 = ":", + peg$c13 = { type: "literal", value: ":", description: "\":\"" }, + peg$c14 = function(n) {return n}, + peg$c15 = function(n) { return n ? ["context", n] : ["context"] }, + peg$c16 = { type: "other", description: "params" }, + peg$c17 = "=", + peg$c18 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c19 = function(k, v) {return ["param", ["literal", k], v]}, + peg$c20 = function(p) { return ["params"].concat(p) }, + peg$c21 = { type: "other", description: "bodies" }, + peg$c22 = function(p) { return ["bodies"].concat(p) }, + peg$c23 = { type: "other", description: "reference" }, + peg$c24 = function(n, f) { return withPosition(["reference", n, f]) }, + peg$c25 = { type: "other", description: "partial" }, + peg$c26 = ">", + peg$c27 = { type: "literal", value: ">", description: "\">\"" }, + peg$c28 = "+", + peg$c29 = { type: "literal", value: "+", description: "\"+\"" }, + peg$c30 = function(s, k) {return ["literal", k]}, + peg$c31 = function(s, n, c, p) { var key = (s === ">") ? "partial" : s; return withPosition([key, n, c, p]) }, - peg$c36 = { type: "other", description: "filters" }, - peg$c37 = "|", - peg$c38 = { type: "literal", value: "|", description: "\"|\"" }, - peg$c39 = function(f) { return ["filters"].concat(f) }, - peg$c40 = { type: "other", description: "special" }, - peg$c41 = "~", - peg$c42 = { type: "literal", value: "~", description: "\"~\"" }, - peg$c43 = function(k) { return withPosition(["special", k]) }, - peg$c44 = { type: "other", description: "identifier" }, - peg$c45 = function(p) { + peg$c32 = { type: "other", description: "filters" }, + peg$c33 = "|", + peg$c34 = { type: "literal", value: "|", description: "\"|\"" }, + peg$c35 = function(f) { return ["filters"].concat(f) }, + peg$c36 = { type: "other", description: "special" }, + peg$c37 = "~", + peg$c38 = { type: "literal", value: "~", description: "\"~\"" }, + peg$c39 = function(k) { return withPosition(["special", k]) }, + peg$c40 = { type: "other", description: "identifier" }, + peg$c41 = function(p) { var arr = ["path"].concat(p); arr.text = p[1].join('.').replace(/,line,\d+,col,\d+/g,''); return arr; }, - peg$c46 = function(k) { + peg$c42 = function(k) { var arr = ["key", k]; arr.text = k; return arr; }, - peg$c47 = { type: "other", description: "number" }, - peg$c48 = function(n) { return ['literal', n]; }, - peg$c49 = { type: "other", description: "float" }, - peg$c50 = ".", - peg$c51 = { type: "literal", value: ".", description: "\".\"" }, - peg$c52 = function(l, r) { return parseFloat(l + "." + r); }, - peg$c53 = { type: "other", description: "unsigned_integer" }, - peg$c54 = /^[0-9]/, - peg$c55 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c56 = function(digits) { return makeInteger(digits); }, - peg$c57 = { type: "other", description: "signed_integer" }, - peg$c58 = "-", - peg$c59 = { type: "literal", value: "-", description: "\"-\"" }, - peg$c60 = function(sign, n) { return n * -1; }, - peg$c61 = { type: "other", description: "integer" }, - peg$c62 = { type: "other", description: "path" }, - peg$c63 = function(k, d) { + peg$c43 = { type: "other", description: "number" }, + peg$c44 = function(n) { return ['literal', n]; }, + peg$c45 = { type: "other", description: "float" }, + peg$c46 = ".", + peg$c47 = { type: "literal", value: ".", description: "\".\"" }, + peg$c48 = function(l, r) { return parseFloat(l + "." + r); }, + peg$c49 = { type: "other", description: "unsigned_integer" }, + peg$c50 = /^[0-9]/, + peg$c51 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c52 = function(digits) { return makeInteger(digits); }, + peg$c53 = { type: "other", description: "signed_integer" }, + peg$c54 = "-", + peg$c55 = { type: "literal", value: "-", description: "\"-\"" }, + peg$c56 = function(sign, n) { return n * -1; }, + peg$c57 = { type: "other", description: "integer" }, + peg$c58 = { type: "other", description: "path" }, + peg$c59 = function(k, d) { d = d[0]; if (k && d) { d.unshift(k); @@ -144,84 +144,83 @@ } return withPosition([true, d]) }, - peg$c64 = function(d) { + peg$c60 = function(d) { if (d.length > 0) { return withPosition([true, d[0]]) } return withPosition([true, []]) }, - peg$c65 = { type: "other", description: "key" }, - peg$c66 = /^[a-zA-Z_$]/, - peg$c67 = { type: "class", value: "[a-zA-Z_$]", description: "[a-zA-Z_$]" }, - peg$c68 = /^[0-9a-zA-Z_$\-]/, - peg$c69 = { type: "class", value: "[0-9a-zA-Z_$\\-]", description: "[0-9a-zA-Z_$\\-]" }, - peg$c70 = function(h, t) { return h + t.join('') }, - peg$c71 = { type: "other", description: "array" }, - peg$c72 = function(n) {return n.join('')}, - peg$c73 = function(a) {return a; }, - peg$c74 = function(i, nk) { if(nk) { nk.unshift(i); } else {nk = [i] } return nk; }, - peg$c75 = { type: "other", description: "array_part" }, - peg$c76 = function(k) {return k}, - peg$c77 = function(d, a) { if (a) { return d.concat(a); } else { return d; } }, - peg$c78 = { type: "other", description: "inline" }, - peg$c79 = "\"", - peg$c80 = { type: "literal", value: "\"", description: "\"\\\"\"" }, - peg$c81 = function() { return withPosition(["literal", ""]) }, - peg$c82 = function(l) { return withPosition(["literal", l]) }, - peg$c83 = function(p) { return withPosition(["body"].concat(p)) }, - peg$c84 = function(l) { return ["buffer", l] }, - peg$c85 = { type: "other", description: "buffer" }, - peg$c86 = function(e, w) { return withPosition(["format", e, w.join('')]) }, - peg$c87 = { type: "any", description: "any character" }, - peg$c88 = function(c) {return c}, - peg$c89 = function(b) { return withPosition(["buffer", b.join('')]) }, - peg$c90 = { type: "other", description: "literal" }, - peg$c91 = /^[^"]/, - peg$c92 = { type: "class", value: "[^\"]", description: "[^\"]" }, - peg$c93 = function(b) { return b.join('') }, - peg$c94 = "\\\"", - peg$c95 = { type: "literal", value: "\\\"", description: "\"\\\\\\\"\"" }, - peg$c96 = function() { return '"' }, - peg$c97 = { type: "other", description: "raw" }, - peg$c98 = "{`", - peg$c99 = { type: "literal", value: "{`", description: "\"{`\"" }, - peg$c100 = "`}", - peg$c101 = { type: "literal", value: "`}", description: "\"`}\"" }, - peg$c102 = function(character) {return character}, - peg$c103 = function(rawText) { return withPosition(["raw", rawText.join('')]) }, - peg$c104 = { type: "other", description: "comment" }, - peg$c105 = "{!", - peg$c106 = { type: "literal", value: "{!", description: "\"{!\"" }, - peg$c107 = "!}", - peg$c108 = { type: "literal", value: "!}", description: "\"!}\"" }, - peg$c109 = function(c) { return withPosition(["comment", c.join('')]) }, - peg$c110 = /^[#?\^><+%:@\/~%]/, - peg$c111 = { type: "class", value: "[#?\\^><+%:@\\/~%]", description: "[#?\\^><+%:@\\/~%]" }, - peg$c112 = "{", - peg$c113 = { type: "literal", value: "{", description: "\"{\"" }, - peg$c114 = "}", - peg$c115 = { type: "literal", value: "}", description: "\"}\"" }, - peg$c116 = "[", - peg$c117 = { type: "literal", value: "[", description: "\"[\"" }, - peg$c118 = "]", - peg$c119 = { type: "literal", value: "]", description: "\"]\"" }, - peg$c120 = "\n", - peg$c121 = { type: "literal", value: "\n", description: "\"\\n\"" }, - peg$c122 = "\r\n", - peg$c123 = { type: "literal", value: "\r\n", description: "\"\\r\\n\"" }, - peg$c124 = "\r", - peg$c125 = { type: "literal", value: "\r", description: "\"\\r\"" }, - peg$c126 = "\u2028", - peg$c127 = { type: "literal", value: "\u2028", description: "\"\\u2028\"" }, - peg$c128 = "\u2029", - peg$c129 = { type: "literal", value: "\u2029", description: "\"\\u2029\"" }, - peg$c130 = /^[\t\x0B\f \xA0\uFEFF]/, - peg$c131 = { type: "class", value: "[\\t\\x0B\\f \\xA0\\uFEFF]", description: "[\\t\\x0B\\f \\xA0\\uFEFF]" }, + peg$c61 = { type: "other", description: "key" }, + peg$c62 = /^[a-zA-Z_$]/, + peg$c63 = { type: "class", value: "[a-zA-Z_$]", description: "[a-zA-Z_$]" }, + peg$c64 = /^[0-9a-zA-Z_$\-]/, + peg$c65 = { type: "class", value: "[0-9a-zA-Z_$-]", description: "[0-9a-zA-Z_$-]" }, + peg$c66 = function(h, t) { return h + t.join('') }, + peg$c67 = { type: "other", description: "array" }, + peg$c68 = function(n) {return n.join('')}, + peg$c69 = function(a) {return a; }, + peg$c70 = function(i, nk) { if(nk) { nk.unshift(i); } else {nk = [i] } return nk; }, + peg$c71 = { type: "other", description: "array_part" }, + peg$c72 = function(k) {return k}, + peg$c73 = function(d, a) { if (a) { return d.concat(a); } else { return d; } }, + peg$c74 = { type: "other", description: "inline" }, + peg$c75 = "\"", + peg$c76 = { type: "literal", value: "\"", description: "\"\\\"\"" }, + peg$c77 = function() { return withPosition(["literal", ""]) }, + peg$c78 = function(l) { return withPosition(["literal", l]) }, + peg$c79 = function(p) { return withPosition(["body"].concat(p)) }, + peg$c80 = function(l) { return ["buffer", l] }, + peg$c81 = { type: "other", description: "buffer" }, + peg$c82 = function(e, w) { return withPosition(["format", e, w.join('')]) }, + peg$c83 = { type: "any", description: "any character" }, + peg$c84 = function(c) {return c}, + peg$c85 = function(b) { return withPosition(["buffer", b.join('')]) }, + peg$c86 = { type: "other", description: "literal" }, + peg$c87 = /^[^"]/, + peg$c88 = { type: "class", value: "[^\"]", description: "[^\"]" }, + peg$c89 = function(b) { return b.join('') }, + peg$c90 = "\\\"", + peg$c91 = { type: "literal", value: "\\\"", description: "\"\\\\\\\"\"" }, + peg$c92 = function() { return '"' }, + peg$c93 = { type: "other", description: "raw" }, + peg$c94 = "{`", + peg$c95 = { type: "literal", value: "{`", description: "\"{`\"" }, + peg$c96 = "`}", + peg$c97 = { type: "literal", value: "`}", description: "\"`}\"" }, + peg$c98 = function(character) {return character}, + peg$c99 = function(rawText) { return withPosition(["raw", rawText.join('')]) }, + peg$c100 = { type: "other", description: "comment" }, + peg$c101 = "{!", + peg$c102 = { type: "literal", value: "{!", description: "\"{!\"" }, + peg$c103 = "!}", + peg$c104 = { type: "literal", value: "!}", description: "\"!}\"" }, + peg$c105 = function(c) { return withPosition(["comment", c.join('')]) }, + peg$c106 = /^[#?\^><+%:@\/~%]/, + peg$c107 = { type: "class", value: "[#?^><+%:@/~%]", description: "[#?^><+%:@/~%]" }, + peg$c108 = "{", + peg$c109 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c110 = "}", + peg$c111 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c112 = "[", + peg$c113 = { type: "literal", value: "[", description: "\"[\"" }, + peg$c114 = "]", + peg$c115 = { type: "literal", value: "]", description: "\"]\"" }, + peg$c116 = "\n", + peg$c117 = { type: "literal", value: "\n", description: "\"\\n\"" }, + peg$c118 = "\r\n", + peg$c119 = { type: "literal", value: "\r\n", description: "\"\\r\\n\"" }, + peg$c120 = "\r", + peg$c121 = { type: "literal", value: "\r", description: "\"\\r\"" }, + peg$c122 = "\u2028", + peg$c123 = { type: "literal", value: "\u2028", description: "\"\\u2028\"" }, + peg$c124 = "\u2029", + peg$c125 = { type: "literal", value: "\u2029", description: "\"\\u2029\"" }, + peg$c126 = /^[\t\x0B\f \xA0\uFEFF]/, + peg$c127 = { type: "class", value: "[\\t\\v\\f \\u00A0\\uFEFF]", description: "[\\t\\v\\f \\u00A0\\uFEFF]" }, peg$currPos = 0, - peg$reportedPos = 0, - peg$cachedPos = 0, - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, @@ -237,38 +236,51 @@ } function text() { - return input.substring(peg$reportedPos, peg$currPos); + return input.substring(peg$savedPos, peg$currPos); } - function offset() { - return peg$reportedPos; - } - - function line() { - return peg$computePosDetails(peg$reportedPos).line; - } - - function column() { - return peg$computePosDetails(peg$reportedPos).column; + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); } function expected(description) { throw peg$buildException( null, [{ type: "other", description: description }], - peg$reportedPos + input.substring(peg$savedPos, peg$currPos), + peg$computeLocation(peg$savedPos, peg$currPos) ); } function error(message) { - throw peg$buildException(message, null, peg$reportedPos); + throw peg$buildException( + message, + null, + input.substring(peg$savedPos, peg$currPos), + peg$computeLocation(peg$savedPos, peg$currPos) + ); } function peg$computePosDetails(pos) { - function advance(details, startPos, endPos) { - var p, ch; + var details = peg$posDetailsCache[pos], + p, ch; - for (p = startPos; p < endPos; p++) { + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column, + seenCR: details.seenCR + }; + + while (p < pos) { ch = input.charAt(p); if (ch === "\n") { if (!details.seenCR) { details.line++; } @@ -282,19 +294,31 @@ details.column++; details.seenCR = false; } - } - } - if (peg$cachedPos !== pos) { - if (peg$cachedPos > pos) { - peg$cachedPos = 0; - peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + p++; } - advance(peg$cachedPosDetails, peg$cachedPos, pos); - peg$cachedPos = pos; + + peg$posDetailsCache[pos] = details; + return details; } + } - return peg$cachedPosDetails; + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; } function peg$fail(expected) { @@ -308,7 +332,7 @@ peg$maxFailExpected.push(expected); } - function peg$buildException(message, expected, pos) { + function peg$buildException(message, expected, found, location) { function cleanupExpected(expected) { var i = 1; @@ -345,8 +369,8 @@ .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); }); + .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); } var expectedDescs = new Array(expected.length), @@ -367,20 +391,15 @@ return "Expected " + expectedDesc + " but " + foundDesc + " found."; } - var posDetails = peg$computePosDetails(pos), - found = pos < input.length ? input.charAt(pos) : null; - if (expected !== null) { cleanupExpected(expected); } - return new SyntaxError( + return new peg$SyntaxError( message !== null ? message : buildMessage(expected, found), expected, found, - pos, - posDetails.line, - posDetails.column + location ); } @@ -403,8 +422,8 @@ s2 = peg$parsepart(); } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c1(s1); + peg$savedPos = s0; + s1 = peg$c0(s1); } s0 = s1; @@ -459,47 +478,47 @@ if (s5 !== peg$FAILED) { s6 = peg$parseend_tag(); if (s6 === peg$FAILED) { - s6 = peg$c4; + s6 = null; } if (s6 !== peg$FAILED) { - peg$reportedPos = peg$currPos; - s7 = peg$c5(s1, s4, s5, s6); + peg$savedPos = peg$currPos; + s7 = peg$c2(s1, s4, s5, s6); if (s7) { - s7 = peg$c6; + s7 = void 0; } else { - s7 = peg$c3; + s7 = peg$FAILED; } if (s7 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c7(s1, s4, s5, s6); + peg$savedPos = s0; + s1 = peg$c3(s1, s4, s5, s6); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; @@ -513,39 +532,39 @@ } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s3 = peg$c8; + s3 = peg$c4; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } + if (peg$silentFails === 0) { peg$fail(peg$c5); } } if (s3 !== peg$FAILED) { s4 = peg$parserd(); if (s4 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c10(s1); + peg$savedPos = s0; + s1 = peg$c6(s1); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c2); } + if (peg$silentFails === 0) { peg$fail(peg$c1); } } return s0; @@ -557,12 +576,12 @@ s0 = peg$currPos; s1 = peg$parseld(); if (s1 !== peg$FAILED) { - if (peg$c11.test(input.charAt(peg$currPos))) { + if (peg$c7.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c12); } + if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s2 !== peg$FAILED) { s3 = []; @@ -578,32 +597,32 @@ if (s5 !== peg$FAILED) { s6 = peg$parseparams(); if (s6 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c13(s2, s4, s5, s6); + peg$savedPos = s0; + s1 = peg$c9(s2, s4, s5, s6); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } return s0; @@ -617,11 +636,11 @@ s1 = peg$parseld(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s2 = peg$c8; + s2 = peg$c4; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } + if (peg$silentFails === 0) { peg$fail(peg$c5); } } if (s2 !== peg$FAILED) { s3 = []; @@ -642,37 +661,37 @@ if (s5 !== peg$FAILED) { s6 = peg$parserd(); if (s6 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c15(s4); + peg$savedPos = s0; + s1 = peg$c11(s4); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c14); } + if (peg$silentFails === 0) { peg$fail(peg$c10); } } return s0; @@ -684,32 +703,32 @@ s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { - s2 = peg$c16; + s2 = peg$c12; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s2 !== peg$FAILED) { s3 = peg$parseidentifier(); if (s3 !== peg$FAILED) { - peg$reportedPos = s1; - s2 = peg$c18(s3); + peg$savedPos = s1; + s2 = peg$c14(s3); s1 = s2; } else { peg$currPos = s1; - s1 = peg$c3; + s1 = peg$FAILED; } } else { peg$currPos = s1; - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 === peg$FAILED) { - s1 = peg$c4; + s1 = null; } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c19(s1); + peg$savedPos = s0; + s1 = peg$c15(s1); } s0 = s1; @@ -731,17 +750,17 @@ s4 = peg$parsews(); } } else { - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s5 = peg$c21; + s5 = peg$c17; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c22); } + if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s5 !== peg$FAILED) { s6 = peg$parsenumber(); @@ -752,24 +771,24 @@ } } if (s6 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c23(s4, s6); + peg$savedPos = s2; + s3 = peg$c19(s4, s6); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } while (s2 !== peg$FAILED) { s1.push(s2); @@ -782,17 +801,17 @@ s4 = peg$parsews(); } } else { - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s5 = peg$c21; + s5 = peg$c17; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c22); } + if (peg$silentFails === 0) { peg$fail(peg$c18); } } if (s5 !== peg$FAILED) { s6 = peg$parsenumber(); @@ -803,35 +822,35 @@ } } if (s6 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c23(s4, s6); + peg$savedPos = s2; + s3 = peg$c19(s4, s6); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c24(s1); + peg$savedPos = s0; + s1 = peg$c20(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c20); } + if (peg$silentFails === 0) { peg$fail(peg$c16); } } return s0; @@ -847,11 +866,11 @@ s3 = peg$parseld(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s4 = peg$c16; + s4 = peg$c12; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s4 !== peg$FAILED) { s5 = peg$parsekey(); @@ -860,28 +879,28 @@ if (s6 !== peg$FAILED) { s7 = peg$parsebody(); if (s7 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c23(s5, s7); + peg$savedPos = s2; + s3 = peg$c19(s5, s7); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } while (s2 !== peg$FAILED) { s1.push(s2); @@ -889,11 +908,11 @@ s3 = peg$parseld(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s4 = peg$c16; + s4 = peg$c12; peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s4 !== peg$FAILED) { s5 = peg$parsekey(); @@ -902,39 +921,39 @@ if (s6 !== peg$FAILED) { s7 = peg$parsebody(); if (s7 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c23(s5, s7); + peg$savedPos = s2; + s3 = peg$c19(s5, s7); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c26(s1); + peg$savedPos = s0; + s1 = peg$c22(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$c21); } } return s0; @@ -953,29 +972,29 @@ if (s3 !== peg$FAILED) { s4 = peg$parserd(); if (s4 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c28(s2, s3); + peg$savedPos = s0; + s1 = peg$c24(s2, s3); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c27); } + if (peg$silentFails === 0) { peg$fail(peg$c23); } } return s0; @@ -989,19 +1008,19 @@ s1 = peg$parseld(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { - s2 = peg$c30; + s2 = peg$c26; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c31); } + if (peg$silentFails === 0) { peg$fail(peg$c27); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { - s2 = peg$c32; + s2 = peg$c28; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } + if (peg$silentFails === 0) { peg$fail(peg$c29); } } } if (s2 !== peg$FAILED) { @@ -1015,8 +1034,8 @@ s4 = peg$currPos; s5 = peg$parsekey(); if (s5 !== peg$FAILED) { - peg$reportedPos = s4; - s5 = peg$c34(s5); + peg$savedPos = s4; + s5 = peg$c30(s2, s5); } s4 = s5; if (s4 === peg$FAILED) { @@ -1035,58 +1054,58 @@ } if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s8 = peg$c8; + s8 = peg$c4; peg$currPos++; } else { s8 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c9); } + if (peg$silentFails === 0) { peg$fail(peg$c5); } } if (s8 !== peg$FAILED) { s9 = peg$parserd(); if (s9 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c35(s2, s4, s5, s6); + peg$savedPos = s0; + s1 = peg$c31(s2, s4, s5, s6); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c29); } + if (peg$silentFails === 0) { peg$fail(peg$c25); } } return s0; @@ -1100,60 +1119,60 @@ s1 = []; s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 124) { - s3 = peg$c37; + s3 = peg$c33; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c38); } + if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c18(s4); + peg$savedPos = s2; + s3 = peg$c14(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 124) { - s3 = peg$c37; + s3 = peg$c33; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c38); } + if (peg$silentFails === 0) { peg$fail(peg$c34); } } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c18(s4); + peg$savedPos = s2; + s3 = peg$c14(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c39(s1); + peg$savedPos = s0; + s1 = peg$c35(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$c32); } } return s0; @@ -1167,40 +1186,40 @@ s1 = peg$parseld(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c41; + s2 = peg$c37; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c42); } + if (peg$silentFails === 0) { peg$fail(peg$c38); } } if (s2 !== peg$FAILED) { s3 = peg$parsekey(); if (s3 !== peg$FAILED) { s4 = peg$parserd(); if (s4 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c43(s3); + peg$savedPos = s0; + s1 = peg$c39(s3); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c40); } + if (peg$silentFails === 0) { peg$fail(peg$c36); } } return s0; @@ -1213,23 +1232,23 @@ s0 = peg$currPos; s1 = peg$parsepath(); if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c45(s1); + peg$savedPos = s0; + s1 = peg$c41(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsekey(); if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c46(s1); + peg$savedPos = s0; + s1 = peg$c42(s1); } s0 = s1; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c44); } + if (peg$silentFails === 0) { peg$fail(peg$c40); } } return s0; @@ -1245,14 +1264,14 @@ s1 = peg$parseinteger(); } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c48(s1); + peg$savedPos = s0; + s1 = peg$c44(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c47); } + if (peg$silentFails === 0) { peg$fail(peg$c43); } } return s0; @@ -1266,34 +1285,34 @@ s1 = peg$parseinteger(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { - s2 = peg$c50; + s2 = peg$c46; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s2 !== peg$FAILED) { s3 = peg$parseunsigned_integer(); if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c52(s1, s3); + peg$savedPos = s0; + s1 = peg$c48(s1, s3); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c49); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } return s0; @@ -1305,36 +1324,36 @@ peg$silentFails++; s0 = peg$currPos; s1 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c50.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c51); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c50.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c51); } } } } else { - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c56(s1); + peg$savedPos = s0; + s1 = peg$c52(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c53); } + if (peg$silentFails === 0) { peg$fail(peg$c49); } } return s0; @@ -1346,30 +1365,30 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c58; + s1 = peg$c54; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c59); } + if (peg$silentFails === 0) { peg$fail(peg$c55); } } if (s1 !== peg$FAILED) { s2 = peg$parseunsigned_integer(); if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c60(s1, s2); + peg$savedPos = s0; + s1 = peg$c56(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c57); } + if (peg$silentFails === 0) { peg$fail(peg$c53); } } return s0; @@ -1386,7 +1405,7 @@ peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c57); } } return s0; @@ -1399,7 +1418,7 @@ s0 = peg$currPos; s1 = peg$parsekey(); if (s1 === peg$FAILED) { - s1 = peg$c4; + s1 = null; } if (s1 !== peg$FAILED) { s2 = []; @@ -1416,28 +1435,28 @@ } } } else { - s2 = peg$c3; + s2 = peg$FAILED; } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c63(s1, s2); + peg$savedPos = s0; + s1 = peg$c59(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s1 = peg$c50; + s1 = peg$c46; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1453,22 +1472,22 @@ } } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c64(s2); + peg$savedPos = s0; + s1 = peg$c60(s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c62); } + if (peg$silentFails === 0) { peg$fail(peg$c58); } } return s0; @@ -1479,48 +1498,48 @@ peg$silentFails++; s0 = peg$currPos; - if (peg$c66.test(input.charAt(peg$currPos))) { + if (peg$c62.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c67); } + if (peg$silentFails === 0) { peg$fail(peg$c63); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c68.test(input.charAt(peg$currPos))) { + if (peg$c64.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c68.test(input.charAt(peg$currPos))) { + if (peg$c64.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c69); } + if (peg$silentFails === 0) { peg$fail(peg$c65); } } } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c70(s1, s2); + peg$savedPos = s0; + s1 = peg$c66(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$c61); } } return s0; @@ -1536,30 +1555,30 @@ if (s2 !== peg$FAILED) { s3 = peg$currPos; s4 = []; - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c50.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c51); } } if (s5 !== peg$FAILED) { while (s5 !== peg$FAILED) { s4.push(s5); - if (peg$c54.test(input.charAt(peg$currPos))) { + if (peg$c50.test(input.charAt(peg$currPos))) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c51); } } } } else { - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { - peg$reportedPos = s3; - s4 = peg$c72(s4); + peg$savedPos = s3; + s4 = peg$c68(s4); } s3 = s4; if (s3 === peg$FAILED) { @@ -1568,42 +1587,42 @@ if (s3 !== peg$FAILED) { s4 = peg$parserb(); if (s4 !== peg$FAILED) { - peg$reportedPos = s1; - s2 = peg$c73(s3); + peg$savedPos = s1; + s2 = peg$c69(s3); s1 = s2; } else { peg$currPos = s1; - s1 = peg$c3; + s1 = peg$FAILED; } } else { peg$currPos = s1; - s1 = peg$c3; + s1 = peg$FAILED; } } else { peg$currPos = s1; - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s2 = peg$parsearray_part(); if (s2 === peg$FAILED) { - s2 = peg$c4; + s2 = null; } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c74(s1, s2); + peg$savedPos = s0; + s1 = peg$c70(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c71); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } return s0; @@ -1617,76 +1636,76 @@ s1 = []; s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c50; + s3 = peg$c46; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c76(s4); + peg$savedPos = s2; + s3 = peg$c72(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c50; + s3 = peg$c46; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c51); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s3 !== peg$FAILED) { s4 = peg$parsekey(); if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c76(s4); + peg$savedPos = s2; + s3 = peg$c72(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } } else { - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s2 = peg$parsearray(); if (s2 === peg$FAILED) { - s2 = peg$c4; + s2 = null; } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c77(s1, s2); + peg$savedPos = s0; + s1 = peg$c73(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c75); } + if (peg$silentFails === 0) { peg$fail(peg$c71); } } return s0; @@ -1698,75 +1717,75 @@ peg$silentFails++; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c79; + s1 = peg$c75; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c79; + s2 = peg$c75; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c81(); + peg$savedPos = s0; + s1 = peg$c77(); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c79; + s1 = peg$c75; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s1 !== peg$FAILED) { s2 = peg$parseliteral(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c79; + s3 = peg$c75; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c82(s2); + peg$savedPos = s0; + s1 = peg$c78(s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c79; + s1 = peg$c75; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1777,38 +1796,38 @@ s3 = peg$parseinline_part(); } } else { - s2 = peg$c3; + s2 = peg$FAILED; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c79; + s3 = peg$c75; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c83(s2); + peg$savedPos = s0; + s1 = peg$c79(s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } + if (peg$silentFails === 0) { peg$fail(peg$c74); } } return s0; @@ -1824,8 +1843,8 @@ s0 = peg$currPos; s1 = peg$parseliteral(); if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c84(s1); + peg$savedPos = s0; + s1 = peg$c80(s1); } s0 = s1; } @@ -1848,16 +1867,16 @@ s3 = peg$parsews(); } if (s2 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c86(s1, s2); + peg$savedPos = s0; + s1 = peg$c82(s1, s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$currPos; @@ -1868,10 +1887,10 @@ s4 = peg$parsetag(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = peg$c6; + s3 = void 0; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$currPos; @@ -1879,10 +1898,10 @@ s5 = peg$parseraw(); peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s5 = peg$currPos; @@ -1890,10 +1909,10 @@ s6 = peg$parsecomment(); peg$silentFails--; if (s6 === peg$FAILED) { - s5 = peg$c6; + s5 = void 0; } else { peg$currPos = s5; - s5 = peg$c3; + s5 = peg$FAILED; } if (s5 !== peg$FAILED) { s6 = peg$currPos; @@ -1901,10 +1920,10 @@ s7 = peg$parseeol(); peg$silentFails--; if (s7 === peg$FAILED) { - s6 = peg$c6; + s6 = void 0; } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } if (s6 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1912,31 +1931,31 @@ peg$currPos++; } else { s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s7 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c88(s7); + peg$savedPos = s2; + s3 = peg$c84(s7); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -1947,10 +1966,10 @@ s4 = peg$parsetag(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = peg$c6; + s3 = void 0; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$currPos; @@ -1958,10 +1977,10 @@ s5 = peg$parseraw(); peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { s5 = peg$currPos; @@ -1969,10 +1988,10 @@ s6 = peg$parsecomment(); peg$silentFails--; if (s6 === peg$FAILED) { - s5 = peg$c6; + s5 = void 0; } else { peg$currPos = s5; - s5 = peg$c3; + s5 = peg$FAILED; } if (s5 !== peg$FAILED) { s6 = peg$currPos; @@ -1980,10 +1999,10 @@ s7 = peg$parseeol(); peg$silentFails--; if (s7 === peg$FAILED) { - s6 = peg$c6; + s6 = void 0; } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } if (s6 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -1991,46 +2010,46 @@ peg$currPos++; } else { s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s7 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c88(s7); + peg$savedPos = s2; + s3 = peg$c84(s7); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } } else { - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c89(s1); + peg$savedPos = s0; + s1 = peg$c85(s1); } s0 = s1; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c85); } + if (peg$silentFails === 0) { peg$fail(peg$c81); } } return s0; @@ -2048,33 +2067,33 @@ s4 = peg$parsetag(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = peg$c6; + s3 = void 0; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parseesc(); if (s4 === peg$FAILED) { - if (peg$c91.test(input.charAt(peg$currPos))) { + if (peg$c87.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c92); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } } if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c88(s4); + peg$savedPos = s2; + s3 = peg$c84(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -2085,47 +2104,47 @@ s4 = peg$parsetag(); peg$silentFails--; if (s4 === peg$FAILED) { - s3 = peg$c6; + s3 = void 0; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s4 = peg$parseesc(); if (s4 === peg$FAILED) { - if (peg$c91.test(input.charAt(peg$currPos))) { + if (peg$c87.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c92); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } } if (s4 !== peg$FAILED) { - peg$reportedPos = s2; - s3 = peg$c88(s4); + peg$savedPos = s2; + s3 = peg$c84(s4); s2 = s3; } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } else { peg$currPos = s2; - s2 = peg$c3; + s2 = peg$FAILED; } } } else { - s1 = peg$c3; + s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c93(s1); + peg$savedPos = s0; + s1 = peg$c89(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c90); } + if (peg$silentFails === 0) { peg$fail(peg$c86); } } return s0; @@ -2135,16 +2154,16 @@ var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c94) { - s1 = peg$c94; + if (input.substr(peg$currPos, 2) === peg$c90) { + s1 = peg$c90; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c95); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s1 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c96(); + peg$savedPos = s0; + s1 = peg$c92(); } s0 = s1; @@ -2156,31 +2175,31 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c98) { - s1 = peg$c98; + if (input.substr(peg$currPos, 2) === peg$c94) { + s1 = peg$c94; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } + if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c100) { - s5 = peg$c100; + if (input.substr(peg$currPos, 2) === peg$c96) { + s5 = peg$c96; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c97); } } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2188,38 +2207,38 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { - peg$reportedPos = s3; - s4 = peg$c102(s5); + peg$savedPos = s3; + s4 = peg$c98(s5); s3 = s4; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c100) { - s5 = peg$c100; + if (input.substr(peg$currPos, 2) === peg$c96) { + s5 = peg$c96; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c97); } } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2227,49 +2246,49 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { - peg$reportedPos = s3; - s4 = peg$c102(s5); + peg$savedPos = s3; + s4 = peg$c98(s5); s3 = s4; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c100) { - s3 = peg$c100; + if (input.substr(peg$currPos, 2) === peg$c96) { + s3 = peg$c96; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c101); } + if (peg$silentFails === 0) { peg$fail(peg$c97); } } if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c103(s2); + peg$savedPos = s0; + s1 = peg$c99(s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } + if (peg$silentFails === 0) { peg$fail(peg$c93); } } return s0; @@ -2280,31 +2299,31 @@ peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c105) { - s1 = peg$c105; + if (input.substr(peg$currPos, 2) === peg$c101) { + s1 = peg$c101; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } + if (peg$silentFails === 0) { peg$fail(peg$c102); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c107) { - s5 = peg$c107; + if (input.substr(peg$currPos, 2) === peg$c103) { + s5 = peg$c103; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2312,38 +2331,38 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { - peg$reportedPos = s3; - s4 = peg$c88(s5); + peg$savedPos = s3; + s4 = peg$c84(s5); s3 = s4; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c107) { - s5 = peg$c107; + if (input.substr(peg$currPos, 2) === peg$c103) { + s5 = peg$c103; peg$currPos += 2; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } peg$silentFails--; if (s5 === peg$FAILED) { - s4 = peg$c6; + s4 = void 0; } else { peg$currPos = s4; - s4 = peg$c3; + s4 = peg$FAILED; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2351,49 +2370,49 @@ peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s5 !== peg$FAILED) { - peg$reportedPos = s3; - s4 = peg$c88(s5); + peg$savedPos = s3; + s4 = peg$c84(s5); s3 = s4; } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } else { peg$currPos = s3; - s3 = peg$c3; + s3 = peg$FAILED; } } if (s2 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c107) { - s3 = peg$c107; + if (input.substr(peg$currPos, 2) === peg$c103) { + s3 = peg$c103; peg$currPos += 2; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s3 !== peg$FAILED) { - peg$reportedPos = s0; - s1 = peg$c109(s2); + peg$savedPos = s0; + s1 = peg$c105(s2); s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c104); } + if (peg$silentFails === 0) { peg$fail(peg$c100); } } return s0; @@ -2412,12 +2431,12 @@ s3 = peg$parsews(); } if (s2 !== peg$FAILED) { - if (peg$c110.test(input.charAt(peg$currPos))) { + if (peg$c106.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c107); } } if (s3 !== peg$FAILED) { s4 = []; @@ -2434,10 +2453,10 @@ s8 = peg$parserd(); peg$silentFails--; if (s8 === peg$FAILED) { - s7 = peg$c6; + s7 = void 0; } else { peg$currPos = s7; - s7 = peg$c3; + s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s8 = peg$currPos; @@ -2445,10 +2464,10 @@ s9 = peg$parseeol(); peg$silentFails--; if (s9 === peg$FAILED) { - s8 = peg$c6; + s8 = void 0; } else { peg$currPos = s8; - s8 = peg$c3; + s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2456,22 +2475,22 @@ peg$currPos++; } else { s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s9 !== peg$FAILED) { s7 = [s7, s8, s9]; s6 = s7; } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { @@ -2482,10 +2501,10 @@ s8 = peg$parserd(); peg$silentFails--; if (s8 === peg$FAILED) { - s7 = peg$c6; + s7 = void 0; } else { peg$currPos = s7; - s7 = peg$c3; + s7 = peg$FAILED; } if (s7 !== peg$FAILED) { s8 = peg$currPos; @@ -2493,10 +2512,10 @@ s9 = peg$parseeol(); peg$silentFails--; if (s9 === peg$FAILED) { - s8 = peg$c6; + s8 = void 0; } else { peg$currPos = s8; - s8 = peg$c3; + s8 = peg$FAILED; } if (s8 !== peg$FAILED) { if (input.length > peg$currPos) { @@ -2504,26 +2523,26 @@ peg$currPos++; } else { s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c87); } + if (peg$silentFails === 0) { peg$fail(peg$c83); } } if (s9 !== peg$FAILED) { s7 = [s7, s8, s9]; s6 = s7; } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } } else { peg$currPos = s6; - s6 = peg$c3; + s6 = peg$FAILED; } } } else { - s5 = peg$c3; + s5 = peg$FAILED; } if (s5 !== peg$FAILED) { s6 = []; @@ -2539,31 +2558,31 @@ s0 = s1; } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } } else { peg$currPos = s0; - s0 = peg$c3; + s0 = peg$FAILED; } if (s0 === peg$FAILED) { s0 = peg$parsereference(); @@ -2576,11 +2595,11 @@ var s0; if (input.charCodeAt(peg$currPos) === 123) { - s0 = peg$c112; + s0 = peg$c108; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c109); } } return s0; @@ -2590,11 +2609,11 @@ var s0; if (input.charCodeAt(peg$currPos) === 125) { - s0 = peg$c114; + s0 = peg$c110; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c115); } + if (peg$silentFails === 0) { peg$fail(peg$c111); } } return s0; @@ -2604,11 +2623,11 @@ var s0; if (input.charCodeAt(peg$currPos) === 91) { - s0 = peg$c116; + s0 = peg$c112; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } return s0; @@ -2618,11 +2637,11 @@ var s0; if (input.charCodeAt(peg$currPos) === 93) { - s0 = peg$c118; + s0 = peg$c114; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c119); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } return s0; @@ -2632,43 +2651,43 @@ var s0; if (input.charCodeAt(peg$currPos) === 10) { - s0 = peg$c120; + s0 = peg$c116; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } + if (peg$silentFails === 0) { peg$fail(peg$c117); } } if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c122) { - s0 = peg$c122; + if (input.substr(peg$currPos, 2) === peg$c118) { + s0 = peg$c118; peg$currPos += 2; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 13) { - s0 = peg$c124; + s0 = peg$c120; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c121); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8232) { - s0 = peg$c126; + s0 = peg$c122; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c123); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8233) { - s0 = peg$c128; + s0 = peg$c124; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c129); } + if (peg$silentFails === 0) { peg$fail(peg$c125); } } } } @@ -2681,12 +2700,12 @@ function peg$parsews() { var s0; - if (peg$c130.test(input.charAt(peg$currPos))) { + if (peg$c126.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c131); } + if (peg$silentFails === 0) { peg$fail(peg$c127); } } if (s0 === peg$FAILED) { s0 = peg$parseeol(); @@ -2700,7 +2719,7 @@ return parseInt(arr.join(''), 10); } function withPosition(arr) { - return arr.concat([['line', line()], ['col', column()]]); + return arr.concat([['line', location().start.line], ['col', location().start.column]]); } @@ -2713,13 +2732,20 @@ peg$fail({ type: "end", description: "end of input" }); } - throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + throw peg$buildException( + null, + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); } } return { - SyntaxError: SyntaxError, - parse: parse + SyntaxError: peg$SyntaxError, + parse: peg$parse }; })(); diff --git a/package.json b/package.json index 36fcdf2a..d3388512 100644 --- a/package.json +++ b/package.json @@ -58,12 +58,12 @@ "grunt-execute": "~0.2.2", "grunt-github-changes": "~0.0.6", "grunt-jasmine-nodejs": "~1.4.0", - "grunt-peg": "~1.5.0", + "grunt-peg": "~2.0.0", "grunt-saucelabs": "~8.6.1", "grunt-shell": "~1.1.2", "grunt-template-jasmine-istanbul": "~0.3.3", "highland": "2.4.0", - "pegjs": "0.8.0", + "pegjs": "0.9.0", "rhino-1_7r3-bin": "~1.0.1", "rhino-1_7r5-bin": "~1.0.1", "tmp": "~0.0.25" diff --git a/src/dust.pegjs b/src/dust.pegjs index 96366ba2..1f877b7c 100644 --- a/src/dust.pegjs +++ b/src/dust.pegjs @@ -3,7 +3,7 @@ return parseInt(arr.join(''), 10); } function withPosition(arr) { - return arr.concat([['line', line()], ['col', column()]]); + return arr.concat([['line', location().start.line], ['col', location().start.column]]); } } diff --git a/test/templates/all.js b/test/templates/all.js index 941e40ae..36536104 100755 --- a/test/templates/all.js +++ b/test/templates/all.js @@ -1782,7 +1782,7 @@ return [ name: "error: whitespaces between the opening brace and any of (#,?,@,^,+,%) is not allowed", source: '{ # helper foo="bar" boo="boo" } {/helper}', context: { "helper": function(chunk, context, bodies, params) { return chunk.write(params.boo + " " + params.foo); } }, - error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found. At line : 1, column : 1', + error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found.', message: "should show an error for whitespces between the opening brace and any of (#,?,@,^,+,%)" }, { @@ -1793,10 +1793,10 @@ return [ message: "should ignore extra whitespaces between the closing brace plus slash and the tag identifier" }, { - name: "error: whitespaces between the openning curly brace and forward slash in the closing tags not supported", + name: "error: whitespaces between the opening curly brace and forward slash in the closing tags not supported", source: '{# helper foo="bar" boo="boo"} { / helper }', context: { "helper": function(chunk, context, bodies, params) { return chunk.write(params.boo + " " + params.foo); } }, - error: 'Expected end tag for helper but it was not found. At line : 1, column : 32', + error: 'Expected end tag for helper but it was not found.', message: "should show an error because whitespaces between the '{' and the forward slash are not allowed in the closing tags" }, { @@ -1810,7 +1810,7 @@ return [ name: "error: whitespaces between the forward slash and the closing brace in self closing tags", source: '{#helper foo="bar" boo="boo" / }', context: { "helper": function(chunk, context, bodies, params) { return chunk.write(params.boo + " " + params.foo); } }, - error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found. At line : 1, column : 1', + error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found.', message: "should show an error for whitespaces etween the forward slash and the closing brace in self closing tags" }, { @@ -1824,7 +1824,7 @@ return [ name: "error : whitespaces between the '{' plus '>' and partial identifier is not supported", source: '{ > partial/} {> "hello_world"/} {> "{ref}"/}', context: { "name": "Jim", "count": 42, "ref": "hello_world" }, - error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found. At line : 1, column : 1', + error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found.', message: "should show an error for whitespaces between the '{' plus '>' and partial identifier" }, { @@ -1924,7 +1924,7 @@ return [ name: "Dust syntax error", source: "RRR {##}", context: { name: "Mick", count: 30 }, - error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found. At line : 1, column : 5', + error: 'Expected buffer, comment, end of input, partial, raw, reference, section or special but "{" found.', message: "should test that the error message shows line and column." }, { @@ -1933,7 +1933,7 @@ return [ "{#&2}", "{/s}"].join("\n"), context: {}, - error: 'Expected end tag for s but it was not found. At line : 2, column : 1', + error: 'Expected end tag for s but it was not found.', message: "should test the errors message for section with error." }, { @@ -1946,7 +1946,7 @@ return [ "buffer", "{/s}"].join("\n"), context: {}, - error: 'Expected end tag for s but it was not found. At line : 4, column : 1', + error: 'Expected end tag for s but it was not found.', message: "should test the errors message for section with a buffer and error inside." }, { @@ -1957,7 +1957,7 @@ return [ "a second", "buffer"].join("\n"), context: {}, - error: 'Expected end tag for s but it was not found. At line : 5, column : 7', + error: 'Expected end tag for s but it was not found.', message: "should test the errors message for section without end tag shows." }, { @@ -1969,7 +1969,7 @@ return [ "default header ", "{/header}"].join("\n"), context: {}, - error: 'Expected end tag for header but it was not found. At line : 4, column : 5', + error: 'Expected end tag for header but it was not found.', message: "should test the errors message for partials with a buffer inside." }, { @@ -1980,7 +1980,7 @@ return [ "a second", "buffer"].join("\n"), context: {}, - error: 'Expected end tag for header but it was not found. At line : 5, column : 7', + error: 'Expected end tag for header but it was not found.', message: "should test the errors message for partial without end tag." }, { @@ -1992,7 +1992,7 @@ return [ "false", "{/scalar}"].join("\n"), context: {}, - error: 'Expected end tag for scalar but it was not found. At line : 3, column : 2', + error: 'Expected end tag for scalar but it was not found.', message: "should test the errors message for Scalar." }, { @@ -2004,7 +2004,7 @@ return [ " {#@#fger}", "{/scalar}"].join("\n"), context: {}, - error: 'Expected end tag for scalar but it was not found. At line : 5, column : 2', + error: 'Expected end tag for scalar but it was not found.', message: "should test the errors message for Scalar." }, { @@ -2019,7 +2019,7 @@ return [ "No Tags!", "{/tags}"].join("\n"), context: {}, - error: 'Expected end tag for tags but it was not found. At line : 4, column : 5', + error: 'Expected end tag for tags but it was not found.', message: "should test the errors message for Conditionals." }, { @@ -2035,7 +2035,7 @@ return [ "No Tags!", "{/tags}"].join("\n"), context: {}, - error: 'Expected end tag for tags but it was not found. At line : 8, column : 1', + error: 'Expected end tag for tags but it was not found.', message: "should test the errors message for Conditional's else." }, { @@ -2049,7 +2049,7 @@ return [ "{:else}", "No Tags!"].join("\n"), context: {}, - error: 'Expected end tag for tags but it was not found. At line : 8, column : 9', + error: 'Expected end tag for tags but it was not found.', message: "should test the errors message for Conditional without end tag." }, {