diff --git a/lib/compiler.js b/lib/compiler.js index 87ba39b..752d647 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -372,6 +372,82 @@ PEG.Compiler = { } ], + /* + * Optimalization passes made on the grammar AST before compilation. Each pass + * is a function that is passed the AST and start rule and returns a new AST + * and start rule. The AST can be modified in-place by the pass. The passes + * are run in sequence in order of their definition. + */ + _passes: [ + /* + * Removes proxy rules -- that is, rules that only delegate to other rule. + */ + function(ast, startRule) { + function isProxyRule(node) { + return node.type === "rule" && node.expression.type === "rule_ref"; + } + + function replaceRuleRefs(ast, from, to) { + function nop() {} + + function replaceInExpression(node, from, to) { + replace(node.expression, from, to); + } + + function replaceInSubnodes(propertyName) { + return function(node, from, to) { + PEG.ArrayUtils.each(node[propertyName], function(node) { + replace(node, from, to); + }); + }; + } + + var replaceFunctions = { + rule: replaceInExpression, + choice: replaceInSubnodes("alternatives"), + sequence: replaceInSubnodes("elements"), + and_predicate: replaceInExpression, + not_predicate: replaceInExpression, + optional: replaceInExpression, + zero_or_more: replaceInExpression, + one_or_more: replaceInExpression, + action: replaceInExpression, + + rule_ref: + function(node, from, to) { + if (node.name === from) { + node.name = to; + } + }, + + literal: nop, + any: nop, + "class": nop + }; + + function replace(node, from, to) { + replaceFunctions[node.type](node, from, to); + } + + for (var rule in ast) { + replace(ast[rule], from, to); + } + } + + for (var rule in ast) { + if (isProxyRule(ast[rule])) { + replaceRuleRefs(ast, ast[rule].name, ast[rule].expression.name); + if (rule === startRule) { + startRule = ast[rule].expression.name; + } + delete ast[rule]; + } + } + + return [ast, startRule]; + } + ], + _compileFunctions: { rule: function(node) { var resultVar = PEG.Compiler.generateUniqueIdentifier("result"); @@ -787,6 +863,12 @@ PEG.Compiler = { this._checks[i](ast, startRule); } + for (var i = 0; i < this._passes.length; i++) { + var newAstNadStartRule = this._passes[i](ast, startRule); + ast = newAstNadStartRule[0]; + startRule = newAstNadStartRule[1]; + } + var parseFunctionDefinitions = []; for (var rule in ast) { parseFunctionDefinitions.push(this.compileNode(ast[rule])); diff --git a/lib/metagrammar.js b/lib/metagrammar.js index 3e2725e..ea0b4d6 100644 --- a/lib/metagrammar.js +++ b/lib/metagrammar.js @@ -133,7 +133,7 @@ PEG.grammarParser = (function(){ if (result8 !== null) { var result9 = this._parse_colon(context); if (result9 !== null) { - var result10 = this._parse_expression(context); + var result10 = this._parse_choice(context); if (result10 !== null) { var result6 = [result7, result8, result9, result10]; } else { @@ -172,28 +172,6 @@ PEG.grammarParser = (function(){ return result5; }, - _parse_expression: function(context) { - var cacheKey = "expression" + '@' + this._pos; - var cachedResult = this._cache[cacheKey]; - if (cachedResult) { - this._pos = cachedResult.nextPos; - return cachedResult.result; - } - - var pos = this._pos; - - - var result13 = this._parse_choice(context); - - - - this._cache[cacheKey] = { - nextPos: this._pos, - result: result13 - }; - return result13; - }, - _parse_choice: function(context) { var cacheKey = "choice" + '@' + this._pos; var cachedResult = this._cache[cacheKey]; @@ -206,51 +184,51 @@ PEG.grammarParser = (function(){ var savedPos2 = this._pos; - var result16 = this._parse_sequence(context); - if (result16 !== null) { - var result17 = []; + var result15 = this._parse_sequence(context); + if (result15 !== null) { + var result16 = []; var savedPos3 = this._pos; - var result19 = this._parse_slash(context); - if (result19 !== null) { - var result20 = this._parse_sequence(context); - if (result20 !== null) { - var result18 = [result19, result20]; + var result18 = this._parse_slash(context); + if (result18 !== null) { + var result19 = this._parse_sequence(context); + if (result19 !== null) { + var result17 = [result18, result19]; } else { - var result18 = null; + var result17 = null; this._pos = savedPos3; } } else { - var result18 = null; + var result17 = null; this._pos = savedPos3; } - while (result18 !== null) { - result17.push(result18); + while (result17 !== null) { + result16.push(result17); var savedPos3 = this._pos; - var result19 = this._parse_slash(context); - if (result19 !== null) { - var result20 = this._parse_sequence(context); - if (result20 !== null) { - var result18 = [result19, result20]; + var result18 = this._parse_slash(context); + if (result18 !== null) { + var result19 = this._parse_sequence(context); + if (result19 !== null) { + var result17 = [result18, result19]; } else { - var result18 = null; + var result17 = null; this._pos = savedPos3; } } else { - var result18 = null; + var result17 = null; this._pos = savedPos3; } } - if (result17 !== null) { - var result15 = [result16, result17]; + if (result16 !== null) { + var result14 = [result15, result16]; } else { - var result15 = null; + var result14 = null; this._pos = savedPos2; } } else { - var result15 = null; + var result14 = null; this._pos = savedPos2; } - var result14 = result15 !== null + var result13 = result14 !== null ? (function($1, $2) { if ($2.length > 0) { var alternatives = [$1].concat(PEG.ArrayUtils.map( @@ -264,16 +242,16 @@ PEG.grammarParser = (function(){ } else { return $1; } - }).apply(null, result15) + }).apply(null, result14) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result14 + result: result13 }; - return result14; + return result13; }, _parse_sequence: function(context) { @@ -288,25 +266,25 @@ PEG.grammarParser = (function(){ var savedPos4 = this._pos; - var result27 = []; - var result29 = this._parse_prefixed(context); - while (result29 !== null) { - result27.push(result29); - var result29 = this._parse_prefixed(context); - } - if (result27 !== null) { - var result28 = this._parse_action(context); - if (result28 !== null) { - var result26 = [result27, result28]; - } else { - var result26 = null; + var result26 = []; + var result28 = this._parse_prefixed(context); + while (result28 !== null) { + result26.push(result28); + var result28 = this._parse_prefixed(context); + } + if (result26 !== null) { + var result27 = this._parse_action(context); + if (result27 !== null) { + var result25 = [result26, result27]; + } else { + var result25 = null; this._pos = savedPos4; } } else { - var result26 = null; + var result25 = null; this._pos = savedPos4; } - var result25 = result26 !== null + var result24 = result25 !== null ? (function($1, $2) { var expression = $1.length != 1 ? { @@ -319,18 +297,18 @@ PEG.grammarParser = (function(){ expression: expression, action: $2 }; - }).apply(null, result26) + }).apply(null, result25) : null; - if (result25 !== null) { - var result21 = result25; + if (result24 !== null) { + var result20 = result24; } else { - var result23 = []; - var result24 = this._parse_prefixed(context); - while (result24 !== null) { - result23.push(result24); - var result24 = this._parse_prefixed(context); + var result22 = []; + var result23 = this._parse_prefixed(context); + while (result23 !== null) { + result22.push(result23); + var result23 = this._parse_prefixed(context); } - var result22 = result23 !== null + var result21 = result22 !== null ? (function($1) { return $1.length != 1 ? { @@ -338,12 +316,12 @@ PEG.grammarParser = (function(){ elements: $1 } : $1[0]; - })(result23) + })(result22) : null; - if (result22 !== null) { - var result21 = result22; + if (result21 !== null) { + var result20 = result21; } else { - var result21 = null;; + var result20 = null;; }; } @@ -351,9 +329,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result21 + result: result20 }; - return result21; + return result20; }, _parse_prefixed: function(context) { @@ -368,50 +346,50 @@ PEG.grammarParser = (function(){ var savedPos6 = this._pos; - var result38 = this._parse_and(context); - if (result38 !== null) { - var result39 = this._parse_suffixed(context); - if (result39 !== null) { - var result37 = [result38, result39]; + var result37 = this._parse_and(context); + if (result37 !== null) { + var result38 = this._parse_suffixed(context); + if (result38 !== null) { + var result36 = [result37, result38]; } else { - var result37 = null; + var result36 = null; this._pos = savedPos6; } } else { - var result37 = null; + var result36 = null; this._pos = savedPos6; } - var result36 = result37 !== null - ? (function($1, $2) { return { type: "and_predicate", expression: $2 }; }).apply(null, result37) + var result35 = result36 !== null + ? (function($1, $2) { return { type: "and_predicate", expression: $2 }; }).apply(null, result36) : null; - if (result36 !== null) { - var result30 = result36; + if (result35 !== null) { + var result29 = result35; } else { var savedPos5 = this._pos; - var result34 = this._parse_not(context); - if (result34 !== null) { - var result35 = this._parse_suffixed(context); - if (result35 !== null) { - var result33 = [result34, result35]; + var result33 = this._parse_not(context); + if (result33 !== null) { + var result34 = this._parse_suffixed(context); + if (result34 !== null) { + var result32 = [result33, result34]; } else { - var result33 = null; + var result32 = null; this._pos = savedPos5; } } else { - var result33 = null; + var result32 = null; this._pos = savedPos5; } - var result32 = result33 !== null - ? (function($1, $2) { return { type: "not_predicate", expression: $2 }; }).apply(null, result33) + var result31 = result32 !== null + ? (function($1, $2) { return { type: "not_predicate", expression: $2 }; }).apply(null, result32) : null; - if (result32 !== null) { - var result30 = result32; + if (result31 !== null) { + var result29 = result31; } else { - var result31 = this._parse_suffixed(context); - if (result31 !== null) { - var result30 = result31; + var result30 = this._parse_suffixed(context); + if (result30 !== null) { + var result29 = result30; } else { - var result30 = null;; + var result29 = null;; }; }; } @@ -420,9 +398,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result30 + result: result29 }; - return result30; + return result29; }, _parse_suffixed: function(context) { @@ -437,70 +415,70 @@ PEG.grammarParser = (function(){ var savedPos9 = this._pos; - var result52 = this._parse_primary(context); - if (result52 !== null) { - var result53 = this._parse_question(context); - if (result53 !== null) { - var result51 = [result52, result53]; + var result51 = this._parse_primary(context); + if (result51 !== null) { + var result52 = this._parse_question(context); + if (result52 !== null) { + var result50 = [result51, result52]; } else { - var result51 = null; + var result50 = null; this._pos = savedPos9; } } else { - var result51 = null; + var result50 = null; this._pos = savedPos9; } - var result50 = result51 !== null - ? (function($1, $2) { return { type: "optional", expression: $1}; }).apply(null, result51) + var result49 = result50 !== null + ? (function($1, $2) { return { type: "optional", expression: $1}; }).apply(null, result50) : null; - if (result50 !== null) { - var result40 = result50; + if (result49 !== null) { + var result39 = result49; } else { var savedPos8 = this._pos; - var result48 = this._parse_primary(context); - if (result48 !== null) { - var result49 = this._parse_star(context); - if (result49 !== null) { - var result47 = [result48, result49]; + var result47 = this._parse_primary(context); + if (result47 !== null) { + var result48 = this._parse_star(context); + if (result48 !== null) { + var result46 = [result47, result48]; } else { - var result47 = null; + var result46 = null; this._pos = savedPos8; } } else { - var result47 = null; + var result46 = null; this._pos = savedPos8; } - var result46 = result47 !== null - ? (function($1, $2) { return { type: "zero_or_more", expression: $1}; }).apply(null, result47) + var result45 = result46 !== null + ? (function($1, $2) { return { type: "zero_or_more", expression: $1}; }).apply(null, result46) : null; - if (result46 !== null) { - var result40 = result46; + if (result45 !== null) { + var result39 = result45; } else { var savedPos7 = this._pos; - var result44 = this._parse_primary(context); - if (result44 !== null) { - var result45 = this._parse_plus(context); - if (result45 !== null) { - var result43 = [result44, result45]; + var result43 = this._parse_primary(context); + if (result43 !== null) { + var result44 = this._parse_plus(context); + if (result44 !== null) { + var result42 = [result43, result44]; } else { - var result43 = null; + var result42 = null; this._pos = savedPos7; } } else { - var result43 = null; + var result42 = null; this._pos = savedPos7; } - var result42 = result43 !== null - ? (function($1, $2) { return { type: "one_or_more", expression: $1}; }).apply(null, result43) + var result41 = result42 !== null + ? (function($1, $2) { return { type: "one_or_more", expression: $1}; }).apply(null, result42) : null; - if (result42 !== null) { - var result40 = result42; + if (result41 !== null) { + var result39 = result41; } else { - var result41 = this._parse_primary(context); - if (result41 !== null) { - var result40 = result41; + var result40 = this._parse_primary(context); + if (result40 !== null) { + var result39 = result40; } else { - var result40 = null;; + var result39 = null;; }; }; }; @@ -510,9 +488,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result40 + result: result39 }; - return result40; + return result39; }, _parse_primary: function(context) { @@ -527,111 +505,111 @@ PEG.grammarParser = (function(){ var savedPos11 = this._pos; - var result67 = this._parse_identifier(context); - if (result67 !== null) { + var result66 = this._parse_identifier(context); + if (result66 !== null) { var savedPos12 = this._pos; var savedReportMatchFailuresVar0 = context.reportMatchFailures; context.reportMatchFailures = false; var savedPos13 = this._pos; - var result73 = this._parse_literal(context); - if (result73 !== null) { - var result70 = result73; + var result72 = this._parse_literal(context); + if (result72 !== null) { + var result69 = result72; } else { if (this._input.substr(this._pos, 0) === "") { - var result72 = ""; + var result71 = ""; this._pos += 0; } else { - var result72 = null; + var result71 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("")); } } - if (result72 !== null) { - var result70 = result72; + if (result71 !== null) { + var result69 = result71; } else { - var result70 = null;; + var result69 = null;; }; } - if (result70 !== null) { - var result71 = this._parse_colon(context); - if (result71 !== null) { - var result69 = [result70, result71]; + if (result69 !== null) { + var result70 = this._parse_colon(context); + if (result70 !== null) { + var result68 = [result69, result70]; } else { - var result69 = null; + var result68 = null; this._pos = savedPos13; } } else { - var result69 = null; + var result68 = null; this._pos = savedPos13; } context.reportMatchFailures = savedReportMatchFailuresVar0; - if (result69 === null) { - var result68 = ''; + if (result68 === null) { + var result67 = ''; } else { - var result68 = null; + var result67 = null; this._pos = savedPos12; } - if (result68 !== null) { - var result66 = [result67, result68]; + if (result67 !== null) { + var result65 = [result66, result67]; } else { - var result66 = null; + var result65 = null; this._pos = savedPos11; } } else { - var result66 = null; + var result65 = null; this._pos = savedPos11; } - var result65 = result66 !== null - ? (function($1, $2) { return { type: "rule_ref", name: $1 }; }).apply(null, result66) + var result64 = result65 !== null + ? (function($1, $2) { return { type: "rule_ref", name: $1 }; }).apply(null, result65) : null; - if (result65 !== null) { - var result54 = result65; + if (result64 !== null) { + var result53 = result64; } else { - var result64 = this._parse_literal(context); - var result63 = result64 !== null - ? (function($1) { return { type: "literal", value: $1 }; })(result64) + var result63 = this._parse_literal(context); + var result62 = result63 !== null + ? (function($1) { return { type: "literal", value: $1 }; })(result63) : null; - if (result63 !== null) { - var result54 = result63; + if (result62 !== null) { + var result53 = result62; } else { - var result62 = this._parse_dot(context); - var result61 = result62 !== null - ? (function($1) { return { type: "any" }; })(result62) + var result61 = this._parse_dot(context); + var result60 = result61 !== null + ? (function($1) { return { type: "any" }; })(result61) : null; - if (result61 !== null) { - var result54 = result61; + if (result60 !== null) { + var result53 = result60; } else { - var result60 = this._parse_class(context); - if (result60 !== null) { - var result54 = result60; + var result59 = this._parse_class(context); + if (result59 !== null) { + var result53 = result59; } else { var savedPos10 = this._pos; - var result57 = this._parse_lparen(context); - if (result57 !== null) { - var result58 = this._parse_expression(context); - if (result58 !== null) { - var result59 = this._parse_rparen(context); - if (result59 !== null) { - var result56 = [result57, result58, result59]; + var result56 = this._parse_lparen(context); + if (result56 !== null) { + var result57 = this._parse_choice(context); + if (result57 !== null) { + var result58 = this._parse_rparen(context); + if (result58 !== null) { + var result55 = [result56, result57, result58]; } else { - var result56 = null; + var result55 = null; this._pos = savedPos10; } } else { - var result56 = null; + var result55 = null; this._pos = savedPos10; } } else { - var result56 = null; + var result55 = null; this._pos = savedPos10; } - var result55 = result56 !== null - ? (function($1, $2, $3) { return $2; }).apply(null, result56) + var result54 = result55 !== null + ? (function($1, $2, $3) { return $2; }).apply(null, result55) : null; - if (result55 !== null) { - var result54 = result55; + if (result54 !== null) { + var result53 = result54; } else { - var result54 = null;; + var result53 = null;; }; }; }; @@ -642,9 +620,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result54 + result: result53 }; - return result54; + return result53; }, _parse_action: function(context) { @@ -660,32 +638,32 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; var savedPos14 = this._pos; - var result76 = this._parse_braced(context); - if (result76 !== null) { - var result77 = this._parse___(context); - if (result77 !== null) { - var result75 = [result76, result77]; + var result75 = this._parse_braced(context); + if (result75 !== null) { + var result76 = this._parse___(context); + if (result76 !== null) { + var result74 = [result75, result76]; } else { - var result75 = null; + var result74 = null; this._pos = savedPos14; } } else { - var result75 = null; + var result74 = null; this._pos = savedPos14; } - var result74 = result75 !== null - ? (function($1, $2) { return $1.substr(1, $1.length - 2); }).apply(null, result75) + var result73 = result74 !== null + ? (function($1, $2) { return $1.substr(1, $1.length - 2); }).apply(null, result74) : null; context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result74 === null) { + if (context.reportMatchFailures && result73 === null) { this._matchFailed("action"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result74 + result: result73 }; - return result74; + return result73; }, _parse_braced: function(context) { @@ -701,76 +679,76 @@ PEG.grammarParser = (function(){ var savedPos15 = this._pos; if (this._input.substr(this._pos, 1) === "{") { - var result80 = "{"; + var result79 = "{"; this._pos += 1; } else { - var result80 = null; + var result79 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("{")); } } - if (result80 !== null) { - var result81 = []; - var result85 = this._parse_braced(context); - if (result85 !== null) { - var result83 = result85; + if (result79 !== null) { + var result80 = []; + var result84 = this._parse_braced(context); + if (result84 !== null) { + var result82 = result84; } else { - var result84 = this._parse_nonBraceCharacter(context); - if (result84 !== null) { - var result83 = result84; + var result83 = this._parse_nonBraceCharacter(context); + if (result83 !== null) { + var result82 = result83; } else { - var result83 = null;; + var result82 = null;; }; } - while (result83 !== null) { - result81.push(result83); - var result85 = this._parse_braced(context); - if (result85 !== null) { - var result83 = result85; + while (result82 !== null) { + result80.push(result82); + var result84 = this._parse_braced(context); + if (result84 !== null) { + var result82 = result84; } else { - var result84 = this._parse_nonBraceCharacter(context); - if (result84 !== null) { - var result83 = result84; + var result83 = this._parse_nonBraceCharacter(context); + if (result83 !== null) { + var result82 = result83; } else { - var result83 = null;; + var result82 = null;; }; } } - if (result81 !== null) { + if (result80 !== null) { if (this._input.substr(this._pos, 1) === "}") { - var result82 = "}"; + var result81 = "}"; this._pos += 1; } else { - var result82 = null; + var result81 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("}")); } } - if (result82 !== null) { - var result79 = [result80, result81, result82]; + if (result81 !== null) { + var result78 = [result79, result80, result81]; } else { - var result79 = null; + var result78 = null; this._pos = savedPos15; } } else { - var result79 = null; + var result78 = null; this._pos = savedPos15; } } else { - var result79 = null; + var result78 = null; this._pos = savedPos15; } - var result78 = result79 !== null - ? (function($1, $2, $3) { return $1 + $2.join("") + $3; }).apply(null, result79) + var result77 = result78 !== null + ? (function($1, $2, $3) { return $1 + $2.join("") + $3; }).apply(null, result78) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result78 + result: result77 }; - return result78; + return result77; }, _parse_nonBraceCharacters: function(context) { @@ -784,27 +762,27 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result88 = this._parse_nonBraceCharacter(context); - if (result88 !== null) { - var result87 = []; - while (result88 !== null) { - result87.push(result88); - var result88 = this._parse_nonBraceCharacter(context); + var result87 = this._parse_nonBraceCharacter(context); + if (result87 !== null) { + var result86 = []; + while (result87 !== null) { + result86.push(result87); + var result87 = this._parse_nonBraceCharacter(context); } } else { - var result87 = null; + var result86 = null; } - var result86 = result87 !== null - ? (function($1) { return $1.join(""); })(result87) + var result85 = result86 !== null + ? (function($1) { return $1.join(""); })(result86) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result86 + result: result85 }; - return result86; + return result85; }, _parse_nonBraceCharacter: function(context) { @@ -819,25 +797,25 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[^{}]/) !== null) { - var result90 = this._input.charAt(this._pos); + var result89 = this._input.charAt(this._pos); this._pos++; } else { - var result90 = null; + var result89 = null; if (context.reportMatchFailures) { this._matchFailed("[^{}]"); } } - var result89 = result90 !== null - ? (function($1) { return $1; })(result90) + var result88 = result89 !== null + ? (function($1) { return $1; })(result89) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result89 + result: result88 }; - return result89; + return result88; }, _parse_colon: function(context) { @@ -853,37 +831,37 @@ PEG.grammarParser = (function(){ var savedPos16 = this._pos; if (this._input.substr(this._pos, 1) === ":") { - var result93 = ":"; + var result92 = ":"; this._pos += 1; } else { - var result93 = null; + var result92 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString(":")); } } - if (result93 !== null) { - var result94 = this._parse___(context); - if (result94 !== null) { - var result92 = [result93, result94]; + if (result92 !== null) { + var result93 = this._parse___(context); + if (result93 !== null) { + var result91 = [result92, result93]; } else { - var result92 = null; + var result91 = null; this._pos = savedPos16; } } else { - var result92 = null; + var result91 = null; this._pos = savedPos16; } - var result91 = result92 !== null - ? (function($1, $2) { return $1; }).apply(null, result92) + var result90 = result91 !== null + ? (function($1, $2) { return $1; }).apply(null, result91) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result91 + result: result90 }; - return result91; + return result90; }, _parse_slash: function(context) { @@ -899,37 +877,37 @@ PEG.grammarParser = (function(){ var savedPos17 = this._pos; if (this._input.substr(this._pos, 1) === "/") { - var result97 = "/"; + var result96 = "/"; this._pos += 1; } else { - var result97 = null; + var result96 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("/")); } } - if (result97 !== null) { - var result98 = this._parse___(context); - if (result98 !== null) { - var result96 = [result97, result98]; + if (result96 !== null) { + var result97 = this._parse___(context); + if (result97 !== null) { + var result95 = [result96, result97]; } else { - var result96 = null; + var result95 = null; this._pos = savedPos17; } } else { - var result96 = null; + var result95 = null; this._pos = savedPos17; } - var result95 = result96 !== null - ? (function($1, $2) { return $1; }).apply(null, result96) + var result94 = result95 !== null + ? (function($1, $2) { return $1; }).apply(null, result95) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result95 + result: result94 }; - return result95; + return result94; }, _parse_and: function(context) { @@ -945,37 +923,37 @@ PEG.grammarParser = (function(){ var savedPos18 = this._pos; if (this._input.substr(this._pos, 1) === "&") { - var result101 = "&"; + var result100 = "&"; this._pos += 1; } else { - var result101 = null; + var result100 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("&")); } } - if (result101 !== null) { - var result102 = this._parse___(context); - if (result102 !== null) { - var result100 = [result101, result102]; + if (result100 !== null) { + var result101 = this._parse___(context); + if (result101 !== null) { + var result99 = [result100, result101]; } else { - var result100 = null; + var result99 = null; this._pos = savedPos18; } } else { - var result100 = null; + var result99 = null; this._pos = savedPos18; } - var result99 = result100 !== null - ? (function($1, $2) { return $1; }).apply(null, result100) + var result98 = result99 !== null + ? (function($1, $2) { return $1; }).apply(null, result99) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result99 + result: result98 }; - return result99; + return result98; }, _parse_not: function(context) { @@ -991,37 +969,37 @@ PEG.grammarParser = (function(){ var savedPos19 = this._pos; if (this._input.substr(this._pos, 1) === "!") { - var result105 = "!"; + var result104 = "!"; this._pos += 1; } else { - var result105 = null; + var result104 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("!")); } } - if (result105 !== null) { - var result106 = this._parse___(context); - if (result106 !== null) { - var result104 = [result105, result106]; + if (result104 !== null) { + var result105 = this._parse___(context); + if (result105 !== null) { + var result103 = [result104, result105]; } else { - var result104 = null; + var result103 = null; this._pos = savedPos19; } } else { - var result104 = null; + var result103 = null; this._pos = savedPos19; } - var result103 = result104 !== null - ? (function($1, $2) { return $1; }).apply(null, result104) + var result102 = result103 !== null + ? (function($1, $2) { return $1; }).apply(null, result103) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result103 + result: result102 }; - return result103; + return result102; }, _parse_question: function(context) { @@ -1037,37 +1015,37 @@ PEG.grammarParser = (function(){ var savedPos20 = this._pos; if (this._input.substr(this._pos, 1) === "?") { - var result109 = "?"; + var result108 = "?"; this._pos += 1; } else { - var result109 = null; + var result108 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("?")); } } - if (result109 !== null) { - var result110 = this._parse___(context); - if (result110 !== null) { - var result108 = [result109, result110]; + if (result108 !== null) { + var result109 = this._parse___(context); + if (result109 !== null) { + var result107 = [result108, result109]; } else { - var result108 = null; + var result107 = null; this._pos = savedPos20; } } else { - var result108 = null; + var result107 = null; this._pos = savedPos20; } - var result107 = result108 !== null - ? (function($1, $2) { return $1; }).apply(null, result108) + var result106 = result107 !== null + ? (function($1, $2) { return $1; }).apply(null, result107) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result107 + result: result106 }; - return result107; + return result106; }, _parse_star: function(context) { @@ -1083,37 +1061,37 @@ PEG.grammarParser = (function(){ var savedPos21 = this._pos; if (this._input.substr(this._pos, 1) === "*") { - var result113 = "*"; + var result112 = "*"; this._pos += 1; } else { - var result113 = null; + var result112 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("*")); } } - if (result113 !== null) { - var result114 = this._parse___(context); - if (result114 !== null) { - var result112 = [result113, result114]; + if (result112 !== null) { + var result113 = this._parse___(context); + if (result113 !== null) { + var result111 = [result112, result113]; } else { - var result112 = null; + var result111 = null; this._pos = savedPos21; } } else { - var result112 = null; + var result111 = null; this._pos = savedPos21; } - var result111 = result112 !== null - ? (function($1, $2) { return $1; }).apply(null, result112) + var result110 = result111 !== null + ? (function($1, $2) { return $1; }).apply(null, result111) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result111 + result: result110 }; - return result111; + return result110; }, _parse_plus: function(context) { @@ -1129,37 +1107,37 @@ PEG.grammarParser = (function(){ var savedPos22 = this._pos; if (this._input.substr(this._pos, 1) === "+") { - var result117 = "+"; + var result116 = "+"; this._pos += 1; } else { - var result117 = null; + var result116 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("+")); } } - if (result117 !== null) { - var result118 = this._parse___(context); - if (result118 !== null) { - var result116 = [result117, result118]; + if (result116 !== null) { + var result117 = this._parse___(context); + if (result117 !== null) { + var result115 = [result116, result117]; } else { - var result116 = null; + var result115 = null; this._pos = savedPos22; } } else { - var result116 = null; + var result115 = null; this._pos = savedPos22; } - var result115 = result116 !== null - ? (function($1, $2) { return $1; }).apply(null, result116) + var result114 = result115 !== null + ? (function($1, $2) { return $1; }).apply(null, result115) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result115 + result: result114 }; - return result115; + return result114; }, _parse_lparen: function(context) { @@ -1175,37 +1153,37 @@ PEG.grammarParser = (function(){ var savedPos23 = this._pos; if (this._input.substr(this._pos, 1) === "(") { - var result121 = "("; + var result120 = "("; this._pos += 1; } else { - var result121 = null; + var result120 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("(")); } } - if (result121 !== null) { - var result122 = this._parse___(context); - if (result122 !== null) { - var result120 = [result121, result122]; + if (result120 !== null) { + var result121 = this._parse___(context); + if (result121 !== null) { + var result119 = [result120, result121]; } else { - var result120 = null; + var result119 = null; this._pos = savedPos23; } } else { - var result120 = null; + var result119 = null; this._pos = savedPos23; } - var result119 = result120 !== null - ? (function($1, $2) { return $1; }).apply(null, result120) + var result118 = result119 !== null + ? (function($1, $2) { return $1; }).apply(null, result119) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result119 + result: result118 }; - return result119; + return result118; }, _parse_rparen: function(context) { @@ -1221,37 +1199,37 @@ PEG.grammarParser = (function(){ var savedPos24 = this._pos; if (this._input.substr(this._pos, 1) === ")") { - var result125 = ")"; + var result124 = ")"; this._pos += 1; } else { - var result125 = null; + var result124 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString(")")); } } - if (result125 !== null) { - var result126 = this._parse___(context); - if (result126 !== null) { - var result124 = [result125, result126]; + if (result124 !== null) { + var result125 = this._parse___(context); + if (result125 !== null) { + var result123 = [result124, result125]; } else { - var result124 = null; + var result123 = null; this._pos = savedPos24; } } else { - var result124 = null; + var result123 = null; this._pos = savedPos24; } - var result123 = result124 !== null - ? (function($1, $2) { return $1; }).apply(null, result124) + var result122 = result123 !== null + ? (function($1, $2) { return $1; }).apply(null, result123) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result123 + result: result122 }; - return result123; + return result122; }, _parse_dot: function(context) { @@ -1267,37 +1245,37 @@ PEG.grammarParser = (function(){ var savedPos25 = this._pos; if (this._input.substr(this._pos, 1) === ".") { - var result129 = "."; + var result128 = "."; this._pos += 1; } else { - var result129 = null; + var result128 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString(".")); } } - if (result129 !== null) { - var result130 = this._parse___(context); - if (result130 !== null) { - var result128 = [result129, result130]; + if (result128 !== null) { + var result129 = this._parse___(context); + if (result129 !== null) { + var result127 = [result128, result129]; } else { - var result128 = null; + var result127 = null; this._pos = savedPos25; } } else { - var result128 = null; + var result127 = null; this._pos = savedPos25; } - var result127 = result128 !== null - ? (function($1, $2) { return $1; }).apply(null, result128) + var result126 = result127 !== null + ? (function($1, $2) { return $1; }).apply(null, result127) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result127 + result: result126 }; - return result127; + return result126; }, _parse_identifier: function(context) { @@ -1313,148 +1291,148 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; var savedPos26 = this._pos; - var result143 = this._parse_letter(context); - if (result143 !== null) { - var result133 = result143; + var result142 = this._parse_letter(context); + if (result142 !== null) { + var result132 = result142; } else { if (this._input.substr(this._pos, 1) === "_") { - var result142 = "_"; + var result141 = "_"; this._pos += 1; } else { - var result142 = null; + var result141 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("_")); } } - if (result142 !== null) { - var result133 = result142; + if (result141 !== null) { + var result132 = result141; } else { if (this._input.substr(this._pos, 1) === "$") { - var result141 = "$"; + var result140 = "$"; this._pos += 1; } else { - var result141 = null; + var result140 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("$")); } } - if (result141 !== null) { - var result133 = result141; + if (result140 !== null) { + var result132 = result140; } else { - var result133 = null;; + var result132 = null;; }; }; } - if (result133 !== null) { - var result134 = []; - var result140 = this._parse_letter(context); - if (result140 !== null) { - var result136 = result140; + if (result132 !== null) { + var result133 = []; + var result139 = this._parse_letter(context); + if (result139 !== null) { + var result135 = result139; } else { - var result139 = this._parse_digit(context); - if (result139 !== null) { - var result136 = result139; + var result138 = this._parse_digit(context); + if (result138 !== null) { + var result135 = result138; } else { if (this._input.substr(this._pos, 1) === "_") { - var result138 = "_"; + var result137 = "_"; this._pos += 1; } else { - var result138 = null; + var result137 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("_")); } } - if (result138 !== null) { - var result136 = result138; + if (result137 !== null) { + var result135 = result137; } else { if (this._input.substr(this._pos, 1) === "$") { - var result137 = "$"; + var result136 = "$"; this._pos += 1; } else { - var result137 = null; + var result136 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("$")); } } - if (result137 !== null) { - var result136 = result137; + if (result136 !== null) { + var result135 = result136; } else { - var result136 = null;; + var result135 = null;; }; }; }; } - while (result136 !== null) { - result134.push(result136); - var result140 = this._parse_letter(context); - if (result140 !== null) { - var result136 = result140; + while (result135 !== null) { + result133.push(result135); + var result139 = this._parse_letter(context); + if (result139 !== null) { + var result135 = result139; } else { - var result139 = this._parse_digit(context); - if (result139 !== null) { - var result136 = result139; + var result138 = this._parse_digit(context); + if (result138 !== null) { + var result135 = result138; } else { if (this._input.substr(this._pos, 1) === "_") { - var result138 = "_"; + var result137 = "_"; this._pos += 1; } else { - var result138 = null; + var result137 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("_")); } } - if (result138 !== null) { - var result136 = result138; + if (result137 !== null) { + var result135 = result137; } else { if (this._input.substr(this._pos, 1) === "$") { - var result137 = "$"; + var result136 = "$"; this._pos += 1; } else { - var result137 = null; + var result136 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("$")); } } - if (result137 !== null) { - var result136 = result137; + if (result136 !== null) { + var result135 = result136; } else { - var result136 = null;; + var result135 = null;; }; }; }; } } - if (result134 !== null) { - var result135 = this._parse___(context); - if (result135 !== null) { - var result132 = [result133, result134, result135]; + if (result133 !== null) { + var result134 = this._parse___(context); + if (result134 !== null) { + var result131 = [result132, result133, result134]; } else { - var result132 = null; + var result131 = null; this._pos = savedPos26; } } else { - var result132 = null; + var result131 = null; this._pos = savedPos26; } } else { - var result132 = null; + var result131 = null; this._pos = savedPos26; } - var result131 = result132 !== null + var result130 = result131 !== null ? (function($1, $2, $3) { return $1 + $2.join(""); - }).apply(null, result132) + }).apply(null, result131) : null; context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result131 === null) { + if (context.reportMatchFailures && result130 === null) { this._matchFailed("identifier"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result131 + result: result130 }; - return result131; + return result130; }, _parse_literal: function(context) { @@ -1470,42 +1448,42 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; var savedPos27 = this._pos; - var result149 = this._parse_doubleQuotedLiteral(context); - if (result149 !== null) { - var result146 = result149; + var result148 = this._parse_doubleQuotedLiteral(context); + if (result148 !== null) { + var result145 = result148; } else { - var result148 = this._parse_singleQuotedLiteral(context); - if (result148 !== null) { - var result146 = result148; + var result147 = this._parse_singleQuotedLiteral(context); + if (result147 !== null) { + var result145 = result147; } else { - var result146 = null;; + var result145 = null;; }; } - if (result146 !== null) { - var result147 = this._parse___(context); - if (result147 !== null) { - var result145 = [result146, result147]; + if (result145 !== null) { + var result146 = this._parse___(context); + if (result146 !== null) { + var result144 = [result145, result146]; } else { - var result145 = null; + var result144 = null; this._pos = savedPos27; } } else { - var result145 = null; + var result144 = null; this._pos = savedPos27; } - var result144 = result145 !== null - ? (function($1, $2) { return $1; }).apply(null, result145) + var result143 = result144 !== null + ? (function($1, $2) { return $1; }).apply(null, result144) : null; context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result144 === null) { + if (context.reportMatchFailures && result143 === null) { this._matchFailed("literal"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result144 + result: result143 }; - return result144; + return result143; }, _parse_doubleQuotedLiteral: function(context) { @@ -1521,56 +1499,56 @@ PEG.grammarParser = (function(){ var savedPos28 = this._pos; if (this._input.substr(this._pos, 1) === "\"") { - var result152 = "\""; + var result151 = "\""; this._pos += 1; } else { - var result152 = null; + var result151 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\"")); } } - if (result152 !== null) { - var result153 = []; - var result155 = this._parse_doubleQuotedCharacter(context); - while (result155 !== null) { - result153.push(result155); - var result155 = this._parse_doubleQuotedCharacter(context); + if (result151 !== null) { + var result152 = []; + var result154 = this._parse_doubleQuotedCharacter(context); + while (result154 !== null) { + result152.push(result154); + var result154 = this._parse_doubleQuotedCharacter(context); } - if (result153 !== null) { + if (result152 !== null) { if (this._input.substr(this._pos, 1) === "\"") { - var result154 = "\""; + var result153 = "\""; this._pos += 1; } else { - var result154 = null; + var result153 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\"")); } } - if (result154 !== null) { - var result151 = [result152, result153, result154]; + if (result153 !== null) { + var result150 = [result151, result152, result153]; } else { - var result151 = null; + var result150 = null; this._pos = savedPos28; } } else { - var result151 = null; + var result150 = null; this._pos = savedPos28; } } else { - var result151 = null; + var result150 = null; this._pos = savedPos28; } - var result150 = result151 !== null - ? (function($1, $2, $3) { return $2.join(""); }).apply(null, result151) + var result149 = result150 !== null + ? (function($1, $2, $3) { return $2.join(""); }).apply(null, result150) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result150 + result: result149 }; - return result150; + return result149; }, _parse_doubleQuotedCharacter: function(context) { @@ -1584,31 +1562,31 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result162 = this._parse_simpleDoubleQuotedCharacter(context); - if (result162 !== null) { - var result156 = result162; + var result161 = this._parse_simpleDoubleQuotedCharacter(context); + if (result161 !== null) { + var result155 = result161; } else { - var result161 = this._parse_simpleEscapeSequence(context); - if (result161 !== null) { - var result156 = result161; + var result160 = this._parse_simpleEscapeSequence(context); + if (result160 !== null) { + var result155 = result160; } else { - var result160 = this._parse_zeroEscapeSequence(context); - if (result160 !== null) { - var result156 = result160; + var result159 = this._parse_zeroEscapeSequence(context); + if (result159 !== null) { + var result155 = result159; } else { - var result159 = this._parse_hexEscapeSequence(context); - if (result159 !== null) { - var result156 = result159; + var result158 = this._parse_hexEscapeSequence(context); + if (result158 !== null) { + var result155 = result158; } else { - var result158 = this._parse_unicodeEscapeSequence(context); - if (result158 !== null) { - var result156 = result158; + var result157 = this._parse_unicodeEscapeSequence(context); + if (result157 !== null) { + var result155 = result157; } else { - var result157 = this._parse_eolEscapeSequence(context); - if (result157 !== null) { - var result156 = result157; + var result156 = this._parse_eolEscapeSequence(context); + if (result156 !== null) { + var result155 = result156; } else { - var result156 = null;; + var result155 = null;; }; }; }; @@ -1620,9 +1598,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result156 + result: result155 }; - return result156; + return result155; }, _parse_simpleDoubleQuotedCharacter: function(context) { @@ -1641,75 +1619,75 @@ PEG.grammarParser = (function(){ var savedReportMatchFailuresVar1 = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 1) === "\"") { - var result170 = "\""; + var result169 = "\""; this._pos += 1; } else { - var result170 = null; + var result169 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\"")); } } - if (result170 !== null) { - var result167 = result170; + if (result169 !== null) { + var result166 = result169; } else { if (this._input.substr(this._pos, 1) === "\\") { - var result169 = "\\"; + var result168 = "\\"; this._pos += 1; } else { - var result169 = null; + var result168 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\")); } } - if (result169 !== null) { - var result167 = result169; + if (result168 !== null) { + var result166 = result168; } else { - var result168 = this._parse_eolChar(context); - if (result168 !== null) { - var result167 = result168; + var result167 = this._parse_eolChar(context); + if (result167 !== null) { + var result166 = result167; } else { - var result167 = null;; + var result166 = null;; }; }; } context.reportMatchFailures = savedReportMatchFailuresVar1; - if (result167 === null) { - var result165 = ''; + if (result166 === null) { + var result164 = ''; } else { - var result165 = null; + var result164 = null; this._pos = savedPos30; } - if (result165 !== null) { + if (result164 !== null) { if (this._input.length > this._pos) { - var result166 = this._input.charAt(this._pos); + var result165 = this._input.charAt(this._pos); this._pos++; } else { - var result166 = null; + var result165 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result166 !== null) { - var result164 = [result165, result166]; + if (result165 !== null) { + var result163 = [result164, result165]; } else { - var result164 = null; + var result163 = null; this._pos = savedPos29; } } else { - var result164 = null; + var result163 = null; this._pos = savedPos29; } - var result163 = result164 !== null - ? (function($1, $2) { return $2; }).apply(null, result164) + var result162 = result163 !== null + ? (function($1, $2) { return $2; }).apply(null, result163) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result163 + result: result162 }; - return result163; + return result162; }, _parse_singleQuotedLiteral: function(context) { @@ -1725,56 +1703,56 @@ PEG.grammarParser = (function(){ var savedPos31 = this._pos; if (this._input.substr(this._pos, 1) === "'") { - var result173 = "'"; + var result172 = "'"; this._pos += 1; } else { - var result173 = null; + var result172 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("'")); } } - if (result173 !== null) { - var result174 = []; - var result176 = this._parse_singleQuotedCharacter(context); - while (result176 !== null) { - result174.push(result176); - var result176 = this._parse_singleQuotedCharacter(context); + if (result172 !== null) { + var result173 = []; + var result175 = this._parse_singleQuotedCharacter(context); + while (result175 !== null) { + result173.push(result175); + var result175 = this._parse_singleQuotedCharacter(context); } - if (result174 !== null) { + if (result173 !== null) { if (this._input.substr(this._pos, 1) === "'") { - var result175 = "'"; + var result174 = "'"; this._pos += 1; } else { - var result175 = null; + var result174 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("'")); } } - if (result175 !== null) { - var result172 = [result173, result174, result175]; + if (result174 !== null) { + var result171 = [result172, result173, result174]; } else { - var result172 = null; + var result171 = null; this._pos = savedPos31; } } else { - var result172 = null; + var result171 = null; this._pos = savedPos31; } } else { - var result172 = null; + var result171 = null; this._pos = savedPos31; } - var result171 = result172 !== null - ? (function($1, $2, $3) { return $2.join(""); }).apply(null, result172) + var result170 = result171 !== null + ? (function($1, $2, $3) { return $2.join(""); }).apply(null, result171) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result171 + result: result170 }; - return result171; + return result170; }, _parse_singleQuotedCharacter: function(context) { @@ -1788,31 +1766,31 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result183 = this._parse_simpleSingleQuotedCharacter(context); - if (result183 !== null) { - var result177 = result183; + var result182 = this._parse_simpleSingleQuotedCharacter(context); + if (result182 !== null) { + var result176 = result182; } else { - var result182 = this._parse_simpleEscapeSequence(context); - if (result182 !== null) { - var result177 = result182; + var result181 = this._parse_simpleEscapeSequence(context); + if (result181 !== null) { + var result176 = result181; } else { - var result181 = this._parse_zeroEscapeSequence(context); - if (result181 !== null) { - var result177 = result181; + var result180 = this._parse_zeroEscapeSequence(context); + if (result180 !== null) { + var result176 = result180; } else { - var result180 = this._parse_hexEscapeSequence(context); - if (result180 !== null) { - var result177 = result180; + var result179 = this._parse_hexEscapeSequence(context); + if (result179 !== null) { + var result176 = result179; } else { - var result179 = this._parse_unicodeEscapeSequence(context); - if (result179 !== null) { - var result177 = result179; + var result178 = this._parse_unicodeEscapeSequence(context); + if (result178 !== null) { + var result176 = result178; } else { - var result178 = this._parse_eolEscapeSequence(context); - if (result178 !== null) { - var result177 = result178; + var result177 = this._parse_eolEscapeSequence(context); + if (result177 !== null) { + var result176 = result177; } else { - var result177 = null;; + var result176 = null;; }; }; }; @@ -1824,9 +1802,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result177 + result: result176 }; - return result177; + return result176; }, _parse_simpleSingleQuotedCharacter: function(context) { @@ -1845,75 +1823,75 @@ PEG.grammarParser = (function(){ var savedReportMatchFailuresVar2 = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 1) === "'") { - var result191 = "'"; + var result190 = "'"; this._pos += 1; } else { - var result191 = null; + var result190 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("'")); } } - if (result191 !== null) { - var result188 = result191; + if (result190 !== null) { + var result187 = result190; } else { if (this._input.substr(this._pos, 1) === "\\") { - var result190 = "\\"; + var result189 = "\\"; this._pos += 1; } else { - var result190 = null; + var result189 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\")); } } - if (result190 !== null) { - var result188 = result190; + if (result189 !== null) { + var result187 = result189; } else { - var result189 = this._parse_eolChar(context); - if (result189 !== null) { - var result188 = result189; + var result188 = this._parse_eolChar(context); + if (result188 !== null) { + var result187 = result188; } else { - var result188 = null;; + var result187 = null;; }; }; } context.reportMatchFailures = savedReportMatchFailuresVar2; - if (result188 === null) { - var result186 = ''; + if (result187 === null) { + var result185 = ''; } else { - var result186 = null; + var result185 = null; this._pos = savedPos33; } - if (result186 !== null) { + if (result185 !== null) { if (this._input.length > this._pos) { - var result187 = this._input.charAt(this._pos); + var result186 = this._input.charAt(this._pos); this._pos++; } else { - var result187 = null; + var result186 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result187 !== null) { - var result185 = [result186, result187]; + if (result186 !== null) { + var result184 = [result185, result186]; } else { - var result185 = null; + var result184 = null; this._pos = savedPos32; } } else { - var result185 = null; + var result184 = null; this._pos = savedPos32; } - var result184 = result185 !== null - ? (function($1, $2) { return $2; }).apply(null, result185) + var result183 = result184 !== null + ? (function($1, $2) { return $2; }).apply(null, result184) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result184 + result: result183 }; - return result184; + return result183; }, _parse_class: function(context) { @@ -1930,87 +1908,87 @@ PEG.grammarParser = (function(){ context.reportMatchFailures = false; var savedPos34 = this._pos; if (this._input.substr(this._pos, 1) === "[") { - var result194 = "["; + var result193 = "["; this._pos += 1; } else { - var result194 = null; + var result193 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("[")); } } - if (result194 !== null) { + if (result193 !== null) { if (this._input.substr(this._pos, 1) === "^") { - var result202 = "^"; + var result201 = "^"; this._pos += 1; } else { - var result202 = null; + var result201 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("^")); } } - var result195 = result202 !== null ? result202 : ''; - if (result195 !== null) { - var result196 = []; - var result201 = this._parse_classCharacterRange(context); - if (result201 !== null) { - var result199 = result201; + var result194 = result201 !== null ? result201 : ''; + if (result194 !== null) { + var result195 = []; + var result200 = this._parse_classCharacterRange(context); + if (result200 !== null) { + var result198 = result200; } else { - var result200 = this._parse_classCharacter(context); - if (result200 !== null) { - var result199 = result200; + var result199 = this._parse_classCharacter(context); + if (result199 !== null) { + var result198 = result199; } else { - var result199 = null;; + var result198 = null;; }; } - while (result199 !== null) { - result196.push(result199); - var result201 = this._parse_classCharacterRange(context); - if (result201 !== null) { - var result199 = result201; + while (result198 !== null) { + result195.push(result198); + var result200 = this._parse_classCharacterRange(context); + if (result200 !== null) { + var result198 = result200; } else { - var result200 = this._parse_classCharacter(context); - if (result200 !== null) { - var result199 = result200; + var result199 = this._parse_classCharacter(context); + if (result199 !== null) { + var result198 = result199; } else { - var result199 = null;; + var result198 = null;; }; } } - if (result196 !== null) { + if (result195 !== null) { if (this._input.substr(this._pos, 1) === "]") { - var result197 = "]"; + var result196 = "]"; this._pos += 1; } else { - var result197 = null; + var result196 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("]")); } } - if (result197 !== null) { - var result198 = this._parse___(context); - if (result198 !== null) { - var result193 = [result194, result195, result196, result197, result198]; + if (result196 !== null) { + var result197 = this._parse___(context); + if (result197 !== null) { + var result192 = [result193, result194, result195, result196, result197]; } else { - var result193 = null; + var result192 = null; this._pos = savedPos34; } } else { - var result193 = null; + var result192 = null; this._pos = savedPos34; } } else { - var result193 = null; + var result192 = null; this._pos = savedPos34; } } else { - var result193 = null; + var result192 = null; this._pos = savedPos34; } } else { - var result193 = null; + var result192 = null; this._pos = savedPos34; } - var result192 = result193 !== null + var result191 = result192 !== null ? (function($1, $2, $3, $4, $5) { parts = PEG.ArrayUtils.map($3, function(part) { return part.data; }); rawText = "[" @@ -2025,18 +2003,18 @@ PEG.grammarParser = (function(){ // FIXME: Get the raw text from the input directly. rawText: rawText }; - }).apply(null, result193) + }).apply(null, result192) : null; context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result192 === null) { + if (context.reportMatchFailures && result191 === null) { this._matchFailed("character class"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result192 + result: result191 }; - return result192; + return result191; }, _parse_classCharacterRange: function(context) { @@ -2051,34 +2029,34 @@ PEG.grammarParser = (function(){ var savedPos35 = this._pos; - var result205 = this._parse_classCharacter(context); - if (result205 !== null) { + var result204 = this._parse_classCharacter(context); + if (result204 !== null) { if (this._input.substr(this._pos, 1) === "-") { - var result206 = "-"; + var result205 = "-"; this._pos += 1; } else { - var result206 = null; + var result205 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("-")); } } - if (result206 !== null) { - var result207 = this._parse_classCharacter(context); - if (result207 !== null) { - var result204 = [result205, result206, result207]; + if (result205 !== null) { + var result206 = this._parse_classCharacter(context); + if (result206 !== null) { + var result203 = [result204, result205, result206]; } else { - var result204 = null; + var result203 = null; this._pos = savedPos35; } } else { - var result204 = null; + var result203 = null; this._pos = savedPos35; } } else { - var result204 = null; + var result203 = null; this._pos = savedPos35; } - var result203 = result204 !== null + var result202 = result203 !== null ? (function($1, $2, $3) { if ($1.data.charCodeAt(0) > $3.data.charCodeAt(0)) { throw new this.SyntaxError( @@ -2091,16 +2069,16 @@ PEG.grammarParser = (function(){ // FIXME: Get the raw text from the input directly. rawText: $1.rawText + "-" + $3.rawText } - }).apply(null, result204) + }).apply(null, result203) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result203 + result: result202 }; - return result203; + return result202; }, _parse_classCharacter: function(context) { @@ -2114,24 +2092,24 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result209 = this._parse_bracketDelimitedCharacter(context); - var result208 = result209 !== null + var result208 = this._parse_bracketDelimitedCharacter(context); + var result207 = result208 !== null ? (function($1) { return { data: $1, // FIXME: Get the raw text from the input directly. rawText: PEG.RegExpUtils.quoteForClass($1) }; - })(result209) + })(result208) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result208 + result: result207 }; - return result208; + return result207; }, _parse_bracketDelimitedCharacter: function(context) { @@ -2145,31 +2123,31 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result216 = this._parse_simpleBracketDelimitedCharacter(context); - if (result216 !== null) { - var result210 = result216; + var result215 = this._parse_simpleBracketDelimitedCharacter(context); + if (result215 !== null) { + var result209 = result215; } else { - var result215 = this._parse_simpleEscapeSequence(context); - if (result215 !== null) { - var result210 = result215; + var result214 = this._parse_simpleEscapeSequence(context); + if (result214 !== null) { + var result209 = result214; } else { - var result214 = this._parse_zeroEscapeSequence(context); - if (result214 !== null) { - var result210 = result214; + var result213 = this._parse_zeroEscapeSequence(context); + if (result213 !== null) { + var result209 = result213; } else { - var result213 = this._parse_hexEscapeSequence(context); - if (result213 !== null) { - var result210 = result213; + var result212 = this._parse_hexEscapeSequence(context); + if (result212 !== null) { + var result209 = result212; } else { - var result212 = this._parse_unicodeEscapeSequence(context); - if (result212 !== null) { - var result210 = result212; + var result211 = this._parse_unicodeEscapeSequence(context); + if (result211 !== null) { + var result209 = result211; } else { - var result211 = this._parse_eolEscapeSequence(context); - if (result211 !== null) { - var result210 = result211; + var result210 = this._parse_eolEscapeSequence(context); + if (result210 !== null) { + var result209 = result210; } else { - var result210 = null;; + var result209 = null;; }; }; }; @@ -2181,9 +2159,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result210 + result: result209 }; - return result210; + return result209; }, _parse_simpleBracketDelimitedCharacter: function(context) { @@ -2202,75 +2180,75 @@ PEG.grammarParser = (function(){ var savedReportMatchFailuresVar3 = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 1) === "]") { - var result224 = "]"; + var result223 = "]"; this._pos += 1; } else { - var result224 = null; + var result223 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("]")); } } - if (result224 !== null) { - var result221 = result224; + if (result223 !== null) { + var result220 = result223; } else { if (this._input.substr(this._pos, 1) === "\\") { - var result223 = "\\"; + var result222 = "\\"; this._pos += 1; } else { - var result223 = null; + var result222 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\")); } } - if (result223 !== null) { - var result221 = result223; + if (result222 !== null) { + var result220 = result222; } else { - var result222 = this._parse_eolChar(context); - if (result222 !== null) { - var result221 = result222; + var result221 = this._parse_eolChar(context); + if (result221 !== null) { + var result220 = result221; } else { - var result221 = null;; + var result220 = null;; }; }; } context.reportMatchFailures = savedReportMatchFailuresVar3; - if (result221 === null) { - var result219 = ''; + if (result220 === null) { + var result218 = ''; } else { - var result219 = null; + var result218 = null; this._pos = savedPos37; } - if (result219 !== null) { + if (result218 !== null) { if (this._input.length > this._pos) { - var result220 = this._input.charAt(this._pos); + var result219 = this._input.charAt(this._pos); this._pos++; } else { - var result220 = null; + var result219 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result220 !== null) { - var result218 = [result219, result220]; + if (result219 !== null) { + var result217 = [result218, result219]; } else { - var result218 = null; + var result217 = null; this._pos = savedPos36; } } else { - var result218 = null; + var result217 = null; this._pos = savedPos36; } - var result217 = result218 !== null - ? (function($1, $2) { return $2; }).apply(null, result218) + var result216 = result217 !== null + ? (function($1, $2) { return $2; }).apply(null, result217) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result217 + result: result216 }; - return result217; + return result216; }, _parse_simpleEscapeSequence: function(context) { @@ -2286,87 +2264,87 @@ PEG.grammarParser = (function(){ var savedPos38 = this._pos; if (this._input.substr(this._pos, 1) === "\\") { - var result227 = "\\"; + var result226 = "\\"; this._pos += 1; } else { - var result227 = null; + var result226 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\")); } } - if (result227 !== null) { + if (result226 !== null) { var savedPos39 = this._pos; var savedReportMatchFailuresVar4 = context.reportMatchFailures; context.reportMatchFailures = false; - var result234 = this._parse_digit(context); - if (result234 !== null) { - var result230 = result234; + var result233 = this._parse_digit(context); + if (result233 !== null) { + var result229 = result233; } else { if (this._input.substr(this._pos, 1) === "x") { - var result233 = "x"; + var result232 = "x"; this._pos += 1; } else { - var result233 = null; + var result232 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("x")); } } - if (result233 !== null) { - var result230 = result233; + if (result232 !== null) { + var result229 = result232; } else { if (this._input.substr(this._pos, 1) === "u") { - var result232 = "u"; + var result231 = "u"; this._pos += 1; } else { - var result232 = null; + var result231 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("u")); } } - if (result232 !== null) { - var result230 = result232; + if (result231 !== null) { + var result229 = result231; } else { - var result231 = this._parse_eolChar(context); - if (result231 !== null) { - var result230 = result231; + var result230 = this._parse_eolChar(context); + if (result230 !== null) { + var result229 = result230; } else { - var result230 = null;; + var result229 = null;; }; }; }; } context.reportMatchFailures = savedReportMatchFailuresVar4; - if (result230 === null) { - var result228 = ''; + if (result229 === null) { + var result227 = ''; } else { - var result228 = null; + var result227 = null; this._pos = savedPos39; } - if (result228 !== null) { + if (result227 !== null) { if (this._input.length > this._pos) { - var result229 = this._input.charAt(this._pos); + var result228 = this._input.charAt(this._pos); this._pos++; } else { - var result229 = null; + var result228 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result229 !== null) { - var result226 = [result227, result228, result229]; + if (result228 !== null) { + var result225 = [result226, result227, result228]; } else { - var result226 = null; + var result225 = null; this._pos = savedPos38; } } else { - var result226 = null; + var result225 = null; this._pos = savedPos38; } } else { - var result226 = null; + var result225 = null; this._pos = savedPos38; } - var result225 = result226 !== null + var result224 = result225 !== null ? (function($1, $2, $3) { return $3 .replace("b", "\b") @@ -2375,16 +2353,16 @@ PEG.grammarParser = (function(){ .replace("r", "\r") .replace("t", "\t") .replace("v", "\x0B") // IE does not recognize "\v". - }).apply(null, result226) + }).apply(null, result225) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result225 + result: result224 }; - return result225; + return result224; }, _parse_zeroEscapeSequence: function(context) { @@ -2400,47 +2378,47 @@ PEG.grammarParser = (function(){ var savedPos40 = this._pos; if (this._input.substr(this._pos, 2) === "\\0") { - var result237 = "\\0"; + var result236 = "\\0"; this._pos += 2; } else { - var result237 = null; + var result236 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\0")); } } - if (result237 !== null) { + if (result236 !== null) { var savedPos41 = this._pos; var savedReportMatchFailuresVar5 = context.reportMatchFailures; context.reportMatchFailures = false; - var result239 = this._parse_digit(context); + var result238 = this._parse_digit(context); context.reportMatchFailures = savedReportMatchFailuresVar5; - if (result239 === null) { - var result238 = ''; + if (result238 === null) { + var result237 = ''; } else { - var result238 = null; + var result237 = null; this._pos = savedPos41; } - if (result238 !== null) { - var result236 = [result237, result238]; + if (result237 !== null) { + var result235 = [result236, result237]; } else { - var result236 = null; + var result235 = null; this._pos = savedPos40; } } else { - var result236 = null; + var result235 = null; this._pos = savedPos40; } - var result235 = result236 !== null - ? (function($1, $2) { return "\0"; }).apply(null, result236) + var result234 = result235 !== null + ? (function($1, $2) { return "\0"; }).apply(null, result235) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result235 + result: result234 }; - return result235; + return result234; }, _parse_hexEscapeSequence: function(context) { @@ -2456,45 +2434,45 @@ PEG.grammarParser = (function(){ var savedPos42 = this._pos; if (this._input.substr(this._pos, 2) === "\\x") { - var result242 = "\\x"; + var result241 = "\\x"; this._pos += 2; } else { - var result242 = null; + var result241 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\x")); } } - if (result242 !== null) { - var result243 = this._parse_hexDigit(context); - if (result243 !== null) { - var result244 = this._parse_hexDigit(context); - if (result244 !== null) { - var result241 = [result242, result243, result244]; + if (result241 !== null) { + var result242 = this._parse_hexDigit(context); + if (result242 !== null) { + var result243 = this._parse_hexDigit(context); + if (result243 !== null) { + var result240 = [result241, result242, result243]; } else { - var result241 = null; + var result240 = null; this._pos = savedPos42; } } else { - var result241 = null; + var result240 = null; this._pos = savedPos42; } } else { - var result241 = null; + var result240 = null; this._pos = savedPos42; } - var result240 = result241 !== null + var result239 = result240 !== null ? (function($1, $2, $3) { return String.fromCharCode(parseInt("0x" + $2 + $3)); - }).apply(null, result241) + }).apply(null, result240) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result240 + result: result239 }; - return result240; + return result239; }, _parse_unicodeEscapeSequence: function(context) { @@ -2510,57 +2488,57 @@ PEG.grammarParser = (function(){ var savedPos43 = this._pos; if (this._input.substr(this._pos, 2) === "\\u") { - var result247 = "\\u"; + var result246 = "\\u"; this._pos += 2; } else { - var result247 = null; + var result246 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\u")); } } - if (result247 !== null) { - var result248 = this._parse_hexDigit(context); - if (result248 !== null) { - var result249 = this._parse_hexDigit(context); - if (result249 !== null) { - var result250 = this._parse_hexDigit(context); - if (result250 !== null) { - var result251 = this._parse_hexDigit(context); - if (result251 !== null) { - var result246 = [result247, result248, result249, result250, result251]; + if (result246 !== null) { + var result247 = this._parse_hexDigit(context); + if (result247 !== null) { + var result248 = this._parse_hexDigit(context); + if (result248 !== null) { + var result249 = this._parse_hexDigit(context); + if (result249 !== null) { + var result250 = this._parse_hexDigit(context); + if (result250 !== null) { + var result245 = [result246, result247, result248, result249, result250]; } else { - var result246 = null; + var result245 = null; this._pos = savedPos43; } } else { - var result246 = null; + var result245 = null; this._pos = savedPos43; } } else { - var result246 = null; + var result245 = null; this._pos = savedPos43; } } else { - var result246 = null; + var result245 = null; this._pos = savedPos43; } } else { - var result246 = null; + var result245 = null; this._pos = savedPos43; } - var result245 = result246 !== null + var result244 = result245 !== null ? (function($1, $2, $3, $4, $5) { return String.fromCharCode(parseInt("0x" + $2 + $3 + $4 + $5)); - }).apply(null, result246) + }).apply(null, result245) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result245 + result: result244 }; - return result245; + return result244; }, _parse_eolEscapeSequence: function(context) { @@ -2576,37 +2554,37 @@ PEG.grammarParser = (function(){ var savedPos44 = this._pos; if (this._input.substr(this._pos, 1) === "\\") { - var result254 = "\\"; + var result253 = "\\"; this._pos += 1; } else { - var result254 = null; + var result253 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\\")); } } - if (result254 !== null) { - var result255 = this._parse_eol(context); - if (result255 !== null) { - var result253 = [result254, result255]; + if (result253 !== null) { + var result254 = this._parse_eol(context); + if (result254 !== null) { + var result252 = [result253, result254]; } else { - var result253 = null; + var result252 = null; this._pos = savedPos44; } } else { - var result253 = null; + var result252 = null; this._pos = savedPos44; } - var result252 = result253 !== null - ? (function($1, $2) { return $2; }).apply(null, result253) + var result251 = result252 !== null + ? (function($1, $2) { return $2; }).apply(null, result252) : null; this._cache[cacheKey] = { nextPos: this._pos, - result: result252 + result: result251 }; - return result252; + return result251; }, _parse_digit: function(context) { @@ -2621,10 +2599,10 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[0-9]/) !== null) { - var result256 = this._input.charAt(this._pos); + var result255 = this._input.charAt(this._pos); this._pos++; } else { - var result256 = null; + var result255 = null; if (context.reportMatchFailures) { this._matchFailed("[0-9]"); } @@ -2634,9 +2612,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result256 + result: result255 }; - return result256; + return result255; }, _parse_hexDigit: function(context) { @@ -2651,10 +2629,10 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[0-9a-fA-F]/) !== null) { - var result257 = this._input.charAt(this._pos); + var result256 = this._input.charAt(this._pos); this._pos++; } else { - var result257 = null; + var result256 = null; if (context.reportMatchFailures) { this._matchFailed("[0-9a-fA-F]"); } @@ -2664,9 +2642,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result257 + result: result256 }; - return result257; + return result256; }, _parse_letter: function(context) { @@ -2680,15 +2658,15 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result260 = this._parse_lowerCaseLetter(context); - if (result260 !== null) { - var result258 = result260; + var result259 = this._parse_lowerCaseLetter(context); + if (result259 !== null) { + var result257 = result259; } else { - var result259 = this._parse_upperCaseLetter(context); - if (result259 !== null) { - var result258 = result259; + var result258 = this._parse_upperCaseLetter(context); + if (result258 !== null) { + var result257 = result258; } else { - var result258 = null;; + var result257 = null;; }; } @@ -2696,9 +2674,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result258 + result: result257 }; - return result258; + return result257; }, _parse_lowerCaseLetter: function(context) { @@ -2713,10 +2691,10 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[a-z]/) !== null) { - var result261 = this._input.charAt(this._pos); + var result260 = this._input.charAt(this._pos); this._pos++; } else { - var result261 = null; + var result260 = null; if (context.reportMatchFailures) { this._matchFailed("[a-z]"); } @@ -2726,9 +2704,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result261 + result: result260 }; - return result261; + return result260; }, _parse_upperCaseLetter: function(context) { @@ -2743,10 +2721,10 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[A-Z]/) !== null) { - var result262 = this._input.charAt(this._pos); + var result261 = this._input.charAt(this._pos); this._pos++; } else { - var result262 = null; + var result261 = null; if (context.reportMatchFailures) { this._matchFailed("[A-Z]"); } @@ -2756,9 +2734,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result262 + result: result261 }; - return result262; + return result261; }, _parse___: function(context) { @@ -2772,38 +2750,38 @@ PEG.grammarParser = (function(){ var pos = this._pos; - var result263 = []; - var result267 = this._parse_whitespace(context); - if (result267 !== null) { - var result264 = result267; + var result262 = []; + var result266 = this._parse_whitespace(context); + if (result266 !== null) { + var result263 = result266; } else { - var result266 = this._parse_eol(context); - if (result266 !== null) { - var result264 = result266; + var result265 = this._parse_eol(context); + if (result265 !== null) { + var result263 = result265; } else { - var result265 = this._parse_comment(context); - if (result265 !== null) { - var result264 = result265; + var result264 = this._parse_comment(context); + if (result264 !== null) { + var result263 = result264; } else { - var result264 = null;; + var result263 = null;; }; }; } - while (result264 !== null) { - result263.push(result264); - var result267 = this._parse_whitespace(context); - if (result267 !== null) { - var result264 = result267; + while (result263 !== null) { + result262.push(result263); + var result266 = this._parse_whitespace(context); + if (result266 !== null) { + var result263 = result266; } else { - var result266 = this._parse_eol(context); - if (result266 !== null) { - var result264 = result266; + var result265 = this._parse_eol(context); + if (result265 !== null) { + var result263 = result265; } else { - var result265 = this._parse_comment(context); - if (result265 !== null) { - var result264 = result265; + var result264 = this._parse_comment(context); + if (result264 !== null) { + var result263 = result264; } else { - var result264 = null;; + var result263 = null;; }; }; } @@ -2813,9 +2791,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result263 + result: result262 }; - return result263; + return result262; }, _parse_comment: function(context) { @@ -2830,27 +2808,27 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; - var result270 = this._parse_singleLineComment(context); - if (result270 !== null) { - var result268 = result270; + var result269 = this._parse_singleLineComment(context); + if (result269 !== null) { + var result267 = result269; } else { - var result269 = this._parse_multiLineComment(context); - if (result269 !== null) { - var result268 = result269; + var result268 = this._parse_multiLineComment(context); + if (result268 !== null) { + var result267 = result268; } else { - var result268 = null;; + var result267 = null;; }; } context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result268 === null) { + if (context.reportMatchFailures && result267 === null) { this._matchFailed("comment"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result268 + result: result267 }; - return result268; + return result267; }, _parse_singleLineComment: function(context) { @@ -2866,91 +2844,91 @@ PEG.grammarParser = (function(){ var savedPos45 = this._pos; if (this._input.substr(this._pos, 2) === "//") { - var result272 = "//"; + var result271 = "//"; this._pos += 2; } else { - var result272 = null; + var result271 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("//")); } } - if (result272 !== null) { - var result273 = []; + if (result271 !== null) { + var result272 = []; var savedPos46 = this._pos; var savedPos47 = this._pos; var savedReportMatchFailuresVar6 = context.reportMatchFailures; context.reportMatchFailures = false; - var result277 = this._parse_eolChar(context); + var result276 = this._parse_eolChar(context); context.reportMatchFailures = savedReportMatchFailuresVar6; - if (result277 === null) { - var result275 = ''; + if (result276 === null) { + var result274 = ''; } else { - var result275 = null; + var result274 = null; this._pos = savedPos47; } - if (result275 !== null) { + if (result274 !== null) { if (this._input.length > this._pos) { - var result276 = this._input.charAt(this._pos); + var result275 = this._input.charAt(this._pos); this._pos++; } else { - var result276 = null; + var result275 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result276 !== null) { - var result274 = [result275, result276]; + if (result275 !== null) { + var result273 = [result274, result275]; } else { - var result274 = null; + var result273 = null; this._pos = savedPos46; } } else { - var result274 = null; + var result273 = null; this._pos = savedPos46; } - while (result274 !== null) { - result273.push(result274); + while (result273 !== null) { + result272.push(result273); var savedPos46 = this._pos; var savedPos47 = this._pos; var savedReportMatchFailuresVar6 = context.reportMatchFailures; context.reportMatchFailures = false; - var result277 = this._parse_eolChar(context); + var result276 = this._parse_eolChar(context); context.reportMatchFailures = savedReportMatchFailuresVar6; - if (result277 === null) { - var result275 = ''; + if (result276 === null) { + var result274 = ''; } else { - var result275 = null; + var result274 = null; this._pos = savedPos47; } - if (result275 !== null) { + if (result274 !== null) { if (this._input.length > this._pos) { - var result276 = this._input.charAt(this._pos); + var result275 = this._input.charAt(this._pos); this._pos++; } else { - var result276 = null; + var result275 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result276 !== null) { - var result274 = [result275, result276]; + if (result275 !== null) { + var result273 = [result274, result275]; } else { - var result274 = null; + var result273 = null; this._pos = savedPos46; } } else { - var result274 = null; + var result273 = null; this._pos = savedPos46; } } - if (result273 !== null) { - var result271 = [result272, result273]; + if (result272 !== null) { + var result270 = [result271, result272]; } else { - var result271 = null; + var result270 = null; this._pos = savedPos45; } } else { - var result271 = null; + var result270 = null; this._pos = savedPos45; } @@ -2958,9 +2936,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result271 + result: result270 }; - return result271; + return result270; }, _parse_multiLineComment: function(context) { @@ -2976,121 +2954,121 @@ PEG.grammarParser = (function(){ var savedPos48 = this._pos; if (this._input.substr(this._pos, 2) === "/*") { - var result279 = "/*"; + var result278 = "/*"; this._pos += 2; } else { - var result279 = null; + var result278 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("/*")); } } - if (result279 !== null) { - var result280 = []; + if (result278 !== null) { + var result279 = []; var savedPos49 = this._pos; var savedPos50 = this._pos; var savedReportMatchFailuresVar7 = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 2) === "*/") { - var result285 = "*/"; + var result284 = "*/"; this._pos += 2; } else { - var result285 = null; + var result284 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("*/")); } } context.reportMatchFailures = savedReportMatchFailuresVar7; - if (result285 === null) { - var result283 = ''; + if (result284 === null) { + var result282 = ''; } else { - var result283 = null; + var result282 = null; this._pos = savedPos50; } - if (result283 !== null) { + if (result282 !== null) { if (this._input.length > this._pos) { - var result284 = this._input.charAt(this._pos); + var result283 = this._input.charAt(this._pos); this._pos++; } else { - var result284 = null; + var result283 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result284 !== null) { - var result282 = [result283, result284]; + if (result283 !== null) { + var result281 = [result282, result283]; } else { - var result282 = null; + var result281 = null; this._pos = savedPos49; } } else { - var result282 = null; + var result281 = null; this._pos = savedPos49; } - while (result282 !== null) { - result280.push(result282); + while (result281 !== null) { + result279.push(result281); var savedPos49 = this._pos; var savedPos50 = this._pos; var savedReportMatchFailuresVar7 = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 2) === "*/") { - var result285 = "*/"; + var result284 = "*/"; this._pos += 2; } else { - var result285 = null; + var result284 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("*/")); } } context.reportMatchFailures = savedReportMatchFailuresVar7; - if (result285 === null) { - var result283 = ''; + if (result284 === null) { + var result282 = ''; } else { - var result283 = null; + var result282 = null; this._pos = savedPos50; } - if (result283 !== null) { + if (result282 !== null) { if (this._input.length > this._pos) { - var result284 = this._input.charAt(this._pos); + var result283 = this._input.charAt(this._pos); this._pos++; } else { - var result284 = null; + var result283 = null; if (context.reportMatchFailures) { this._matchFailed('any character'); } } - if (result284 !== null) { - var result282 = [result283, result284]; + if (result283 !== null) { + var result281 = [result282, result283]; } else { - var result282 = null; + var result281 = null; this._pos = savedPos49; } } else { - var result282 = null; + var result281 = null; this._pos = savedPos49; } } - if (result280 !== null) { + if (result279 !== null) { if (this._input.substr(this._pos, 2) === "*/") { - var result281 = "*/"; + var result280 = "*/"; this._pos += 2; } else { - var result281 = null; + var result280 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("*/")); } } - if (result281 !== null) { - var result278 = [result279, result280, result281]; + if (result280 !== null) { + var result277 = [result278, result279, result280]; } else { - var result278 = null; + var result277 = null; this._pos = savedPos48; } } else { - var result278 = null; + var result277 = null; this._pos = savedPos48; } } else { - var result278 = null; + var result277 = null; this._pos = savedPos48; } @@ -3098,9 +3076,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result278 + result: result277 }; - return result278; + return result277; }, _parse_eol: function(context) { @@ -3116,81 +3094,81 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos, 1) === "\n") { - var result291 = "\n"; + var result290 = "\n"; this._pos += 1; } else { - var result291 = null; + var result290 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\n")); } } - if (result291 !== null) { - var result286 = result291; + if (result290 !== null) { + var result285 = result290; } else { if (this._input.substr(this._pos, 2) === "\r\n") { - var result290 = "\r\n"; + var result289 = "\r\n"; this._pos += 2; } else { - var result290 = null; + var result289 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\r\n")); } } - if (result290 !== null) { - var result286 = result290; + if (result289 !== null) { + var result285 = result289; } else { if (this._input.substr(this._pos, 1) === "\r") { - var result289 = "\r"; + var result288 = "\r"; this._pos += 1; } else { - var result289 = null; + var result288 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\r")); } } - if (result289 !== null) { - var result286 = result289; + if (result288 !== null) { + var result285 = result288; } else { if (this._input.substr(this._pos, 1) === "\u2028") { - var result288 = "\u2028"; + var result287 = "\u2028"; this._pos += 1; } else { - var result288 = null; + var result287 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\u2028")); } } - if (result288 !== null) { - var result286 = result288; + if (result287 !== null) { + var result285 = result287; } else { if (this._input.substr(this._pos, 1) === "\u2029") { - var result287 = "\u2029"; + var result286 = "\u2029"; this._pos += 1; } else { - var result287 = null; + var result286 = null; if (context.reportMatchFailures) { this._matchFailed(this._quoteString("\u2029")); } } - if (result287 !== null) { - var result286 = result287; + if (result286 !== null) { + var result285 = result286; } else { - var result286 = null;; + var result285 = null;; }; }; }; }; } context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result286 === null) { + if (context.reportMatchFailures && result285 === null) { this._matchFailed("end of line"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result286 + result: result285 }; - return result286; + return result285; }, _parse_eolChar: function(context) { @@ -3205,10 +3183,10 @@ PEG.grammarParser = (function(){ if (this._input.substr(this._pos).match(/^[\n\r\u2028\u2029]/) !== null) { - var result292 = this._input.charAt(this._pos); + var result291 = this._input.charAt(this._pos); this._pos++; } else { - var result292 = null; + var result291 = null; if (context.reportMatchFailures) { this._matchFailed("[\\n\\r\\u2028\\u2029]"); } @@ -3218,9 +3196,9 @@ PEG.grammarParser = (function(){ this._cache[cacheKey] = { nextPos: this._pos, - result: result292 + result: result291 }; - return result292; + return result291; }, _parse_whitespace: function(context) { @@ -3236,24 +3214,24 @@ PEG.grammarParser = (function(){ var savedReportMatchFailures = context.reportMatchFailures; context.reportMatchFailures = false; if (this._input.substr(this._pos).match(/^[   ᠎ -    ]/) !== null) { - var result293 = this._input.charAt(this._pos); + var result292 = this._input.charAt(this._pos); this._pos++; } else { - var result293 = null; + var result292 = null; if (context.reportMatchFailures) { this._matchFailed("[   ᠎ -    ]"); } } context.reportMatchFailures = savedReportMatchFailures; - if (context.reportMatchFailures && result293 === null) { + if (context.reportMatchFailures && result292 === null) { this._matchFailed("whitespace"); } this._cache[cacheKey] = { nextPos: this._pos, - result: result293 + result: result292 }; - return result293; + return result292; }, /*