asl-path-validator
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -155,26 +155,28 @@ // Generated by Peggy 2.0.1. | ||
var peg$c3 = "States.Array"; | ||
var peg$c4 = "@"; | ||
var peg$c5 = ".."; | ||
var peg$c6 = "$$"; | ||
var peg$c7 = "$"; | ||
var peg$c8 = "."; | ||
var peg$c9 = "*"; | ||
var peg$c10 = "=="; | ||
var peg$c11 = ">="; | ||
var peg$c12 = ">"; | ||
var peg$c13 = "<="; | ||
var peg$c14 = "<"; | ||
var peg$c15 = "["; | ||
var peg$c16 = "]"; | ||
var peg$c17 = ","; | ||
var peg$c18 = "("; | ||
var peg$c19 = ")"; | ||
var peg$c20 = "?"; | ||
var peg$c21 = ":"; | ||
var peg$c22 = "true"; | ||
var peg$c23 = "false"; | ||
var peg$c24 = "null"; | ||
var peg$c25 = "\\"; | ||
var peg$c4 = ".length"; | ||
var peg$c5 = "@"; | ||
var peg$c6 = ".."; | ||
var peg$c7 = "$$"; | ||
var peg$c8 = "$"; | ||
var peg$c9 = "."; | ||
var peg$c10 = "*"; | ||
var peg$c11 = "=="; | ||
var peg$c12 = ">="; | ||
var peg$c13 = ">"; | ||
var peg$c14 = "<="; | ||
var peg$c15 = "<"; | ||
var peg$c16 = "-"; | ||
var peg$c17 = "["; | ||
var peg$c18 = "]"; | ||
var peg$c19 = ","; | ||
var peg$c20 = "("; | ||
var peg$c21 = ")"; | ||
var peg$c22 = "?"; | ||
var peg$c23 = ":"; | ||
var peg$c24 = "true"; | ||
var peg$c25 = "false"; | ||
var peg$c26 = "null"; | ||
var peg$c27 = "\\"; | ||
var peg$r0 = /^[0-9]/; | ||
var peg$r1 = /^[^),'"\\.[\]]/; | ||
var peg$r1 = /^[^),'"\\.[\] ><!=]/; | ||
var peg$r2 = /^[']/; | ||
@@ -190,33 +192,35 @@ var peg$r3 = /^[^'\\]/; | ||
var peg$e3 = peg$literalExpectation("States.Array", false); | ||
var peg$e4 = peg$literalExpectation("@", false); | ||
var peg$e5 = peg$literalExpectation("..", false); | ||
var peg$e6 = peg$literalExpectation("$$", false); | ||
var peg$e7 = peg$literalExpectation("$", false); | ||
var peg$e8 = peg$literalExpectation(".", false); | ||
var peg$e9 = peg$literalExpectation("*", false); | ||
var peg$e10 = peg$literalExpectation("==", false); | ||
var peg$e11 = peg$literalExpectation(">=", false); | ||
var peg$e12 = peg$literalExpectation(">", false); | ||
var peg$e13 = peg$literalExpectation("<=", false); | ||
var peg$e14 = peg$literalExpectation("<", false); | ||
var peg$e15 = peg$literalExpectation("[", false); | ||
var peg$e16 = peg$literalExpectation("]", false); | ||
var peg$e17 = peg$literalExpectation(",", false); | ||
var peg$e18 = peg$literalExpectation("(", false); | ||
var peg$e19 = peg$literalExpectation(")", false); | ||
var peg$e20 = peg$literalExpectation("?", false); | ||
var peg$e21 = peg$classExpectation([["0", "9"]], false, false); | ||
var peg$e22 = peg$literalExpectation(":", false); | ||
var peg$e23 = peg$literalExpectation("true", false); | ||
var peg$e24 = peg$literalExpectation("false", false); | ||
var peg$e25 = peg$literalExpectation("null", false); | ||
var peg$e26 = peg$classExpectation([")", ",", "'", "\"", "\\", ".", "[", "]"], true, false); | ||
var peg$e27 = peg$classExpectation(["'"], false, false); | ||
var peg$e28 = peg$classExpectation(["'", "\\"], true, false); | ||
var peg$e29 = peg$classExpectation(["\""], false, false); | ||
var peg$e30 = peg$classExpectation(["\"", "\\"], true, false); | ||
var peg$e31 = peg$literalExpectation("\\", false); | ||
var peg$e32 = peg$classExpectation(["\\", "n"], true, false); | ||
var peg$e33 = peg$otherExpectation("whitespace"); | ||
var peg$e34 = peg$classExpectation([" ", "\t", "\n"], false, false); | ||
var peg$e4 = peg$literalExpectation(".length", false); | ||
var peg$e5 = peg$literalExpectation("@", false); | ||
var peg$e6 = peg$literalExpectation("..", false); | ||
var peg$e7 = peg$literalExpectation("$$", false); | ||
var peg$e8 = peg$literalExpectation("$", false); | ||
var peg$e9 = peg$literalExpectation(".", false); | ||
var peg$e10 = peg$literalExpectation("*", false); | ||
var peg$e11 = peg$literalExpectation("==", false); | ||
var peg$e12 = peg$literalExpectation(">=", false); | ||
var peg$e13 = peg$literalExpectation(">", false); | ||
var peg$e14 = peg$literalExpectation("<=", false); | ||
var peg$e15 = peg$literalExpectation("<", false); | ||
var peg$e16 = peg$literalExpectation("-", false); | ||
var peg$e17 = peg$literalExpectation("[", false); | ||
var peg$e18 = peg$literalExpectation("]", false); | ||
var peg$e19 = peg$literalExpectation(",", false); | ||
var peg$e20 = peg$literalExpectation("(", false); | ||
var peg$e21 = peg$literalExpectation(")", false); | ||
var peg$e22 = peg$literalExpectation("?", false); | ||
var peg$e23 = peg$classExpectation([["0", "9"]], false, false); | ||
var peg$e24 = peg$literalExpectation(":", false); | ||
var peg$e25 = peg$literalExpectation("true", false); | ||
var peg$e26 = peg$literalExpectation("false", false); | ||
var peg$e27 = peg$literalExpectation("null", false); | ||
var peg$e28 = peg$classExpectation([")", ",", "'", "\"", "\\", ".", "[", "]", " ", ">", "<", "!", "="], true, false); | ||
var peg$e29 = peg$classExpectation(["'"], false, false); | ||
var peg$e30 = peg$classExpectation(["'", "\\"], true, false); | ||
var peg$e31 = peg$classExpectation(["\""], false, false); | ||
var peg$e32 = peg$classExpectation(["\"", "\\"], true, false); | ||
var peg$e33 = peg$literalExpectation("\\", false); | ||
var peg$e34 = peg$classExpectation(["\\", "n"], true, false); | ||
var peg$e35 = peg$otherExpectation("whitespace"); | ||
var peg$e36 = peg$classExpectation([" ", "\t", "\n"], false, false); | ||
var peg$f0 = function (sub) { return { node: "$$", sub: sub, isRoot: true }; }; | ||
@@ -235,3 +239,3 @@ var peg$f1 = function (sub) { return { node: "$", sub: sub, isRoot: true }; }; | ||
head: head, | ||
tail: tail.map(function (t) { return t[1]; }) | ||
tail: tail.map(function (t) { return t[2]; }) | ||
}; | ||
@@ -260,8 +264,9 @@ }; | ||
var peg$f21 = function (exp) { return { exp: exp }; }; | ||
var peg$f22 = function (exp) { return { exp: exp }; }; | ||
var peg$f23 = function (path, op, val) { return { path: path, op: op, val: val }; }; | ||
var peg$f24 = function (v) { return v.join(''); }; | ||
var peg$f25 = function (v) { return v.join(""); }; | ||
var peg$f22 = function (offset) { return { node: "@", offset: -offset }; }; | ||
var peg$f23 = function (exp) { return { exp: exp }; }; | ||
var peg$f24 = function (path, op, val) { return { path: path, op: op, val: val }; }; | ||
var peg$f25 = function (v) { return v.join(''); }; | ||
var peg$f26 = function (v) { return v.join(""); }; | ||
var peg$f27 = function (c) { return c; }; | ||
var peg$f27 = function (v) { return v.join(""); }; | ||
var peg$f28 = function (c) { return c; }; | ||
var peg$currPos = 0; | ||
@@ -574,12 +579,14 @@ var peg$savedPos = 0; | ||
function peg$parsesubscriptables() { | ||
var s0, s1, s2, s3, s4, s5, s6; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | ||
s0 = peg$currPos; | ||
s1 = peg$parseBRACKET_LEFT(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parsesubscriptable(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseBRACKET_RIGHT(); | ||
if (s3 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parsesubscriptable(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parseBRACKET_RIGHT(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f9(s2); | ||
s0 = peg$f9(s3); | ||
} | ||
@@ -604,46 +611,51 @@ else { | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parseNUMBER(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = []; | ||
s4 = peg$currPos; | ||
s5 = peg$parseCOMMA(); | ||
if (s5 !== peg$FAILED) { | ||
s6 = peg$parseNUMBER(); | ||
if (s6 !== peg$FAILED) { | ||
s5 = [s5, s6]; | ||
s4 = s5; | ||
s2 = peg$parse_(); | ||
s3 = peg$parseNUMBER(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = []; | ||
s6 = peg$currPos; | ||
s7 = peg$parseCOMMA(); | ||
if (s7 !== peg$FAILED) { | ||
s8 = peg$parse_(); | ||
s9 = peg$parseNUMBER(); | ||
if (s9 !== peg$FAILED) { | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
} | ||
else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
while (s4 !== peg$FAILED) { | ||
s3.push(s4); | ||
s4 = peg$currPos; | ||
s5 = peg$parseCOMMA(); | ||
if (s5 !== peg$FAILED) { | ||
s6 = peg$parseNUMBER(); | ||
if (s6 !== peg$FAILED) { | ||
s5 = [s5, s6]; | ||
s4 = s5; | ||
while (s6 !== peg$FAILED) { | ||
s5.push(s6); | ||
s6 = peg$currPos; | ||
s7 = peg$parseCOMMA(); | ||
if (s7 !== peg$FAILED) { | ||
s8 = peg$parse_(); | ||
s9 = peg$parseNUMBER(); | ||
if (s9 !== peg$FAILED) { | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
} | ||
else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} | ||
s4 = peg$parseBRACKET_RIGHT(); | ||
if (s4 !== peg$FAILED) { | ||
s6 = peg$parse_(); | ||
s7 = peg$parseBRACKET_RIGHT(); | ||
if (s7 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f10(s2, s3); | ||
s0 = peg$f10(s3, s5); | ||
} | ||
@@ -817,3 +829,3 @@ else { | ||
function peg$parsefunction_args() { | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | ||
s0 = peg$currPos; | ||
@@ -852,4 +864,3 @@ s1 = peg$parsePAREN_LEFT(); | ||
if (s9 !== peg$FAILED) { | ||
s10 = peg$parse_(); | ||
s7 = [s7, s8, s9, s10]; | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
@@ -874,4 +885,3 @@ } | ||
if (s9 !== peg$FAILED) { | ||
s10 = peg$parse_(); | ||
s7 = [s7, s8, s9, s10]; | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
@@ -913,3 +923,3 @@ } | ||
function peg$parsesubscriptable() { | ||
var s0, s1, s2, s3, s4; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | ||
s0 = peg$parseSTRING(); | ||
@@ -987,8 +997,10 @@ if (s0 === peg$FAILED) { | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseexpression_(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parsePAREN_RIGHT(); | ||
if (s4 !== peg$FAILED) { | ||
s3 = peg$parse_(); | ||
s4 = peg$parseexpression_(); | ||
if (s4 !== peg$FAILED) { | ||
s5 = peg$parse_(); | ||
s6 = peg$parsePAREN_RIGHT(); | ||
if (s6 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f21(s3); | ||
s0 = peg$f21(s4); | ||
} | ||
@@ -1015,3 +1027,63 @@ else { | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath_(); | ||
s0 = peg$currPos; | ||
s1 = peg$parsePAREN_LEFT(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parseCURRENT_VALUE(); | ||
if (s3 !== peg$FAILED) { | ||
if (input.substr(peg$currPos, 7) === peg$c4) { | ||
s4 = peg$c4; | ||
peg$currPos += 7; | ||
} | ||
else { | ||
s4 = peg$FAILED; | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e4); | ||
} | ||
} | ||
if (s4 !== peg$FAILED) { | ||
s5 = peg$parse_(); | ||
s6 = peg$parseMINUS(); | ||
if (s6 !== peg$FAILED) { | ||
s7 = peg$parse_(); | ||
s8 = peg$parseNUMBER(); | ||
if (s8 !== peg$FAILED) { | ||
s9 = peg$parse_(); | ||
s10 = peg$parsePAREN_RIGHT(); | ||
if (s10 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f22(s8); | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath_(); | ||
} | ||
} | ||
@@ -1027,12 +1099,14 @@ } | ||
function peg$parseexpression_() { | ||
var s0, s1, s2, s3; | ||
var s0, s1, s2, s3, s4, s5; | ||
s0 = peg$currPos; | ||
s1 = peg$parsePAREN_LEFT(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parseexpression_(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parsePAREN_RIGHT(); | ||
if (s3 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parseexpression_(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parsePAREN_RIGHT(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f22(s2); | ||
s0 = peg$f23(s3); | ||
} | ||
@@ -1054,18 +1128,13 @@ else { | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath__(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$currPos; | ||
s1 = peg$parsejsonpath__(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parsecomparison_op(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseNUMBER(); | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f23(s1, s2, s3); | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
s0 = peg$currPos; | ||
s1 = peg$parsejsonpath__(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parsecomparison_op(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parseNUMBER(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f24(s1, s3, s5); | ||
} | ||
@@ -1082,2 +1151,9 @@ else { | ||
} | ||
else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath__(); | ||
} | ||
} | ||
@@ -1090,9 +1166,9 @@ return s0; | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseLT(); | ||
s0 = peg$parseLE(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseLE(); | ||
s0 = peg$parseLT(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseGT(); | ||
s0 = peg$parseGE(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseGE(); | ||
s0 = peg$parseGT(); | ||
} | ||
@@ -1124,3 +1200,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 64) { | ||
s0 = peg$c4; | ||
s0 = peg$c5; | ||
peg$currPos++; | ||
@@ -1131,3 +1207,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e4); | ||
peg$fail(peg$e5); | ||
} | ||
@@ -1139,4 +1215,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 2) === peg$c5) { | ||
s0 = peg$c5; | ||
if (input.substr(peg$currPos, 2) === peg$c6) { | ||
s0 = peg$c6; | ||
peg$currPos += 2; | ||
@@ -1147,3 +1223,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e5); | ||
peg$fail(peg$e6); | ||
} | ||
@@ -1155,4 +1231,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 2) === peg$c6) { | ||
s0 = peg$c6; | ||
if (input.substr(peg$currPos, 2) === peg$c7) { | ||
s0 = peg$c7; | ||
peg$currPos += 2; | ||
@@ -1163,3 +1239,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e6); | ||
peg$fail(peg$e7); | ||
} | ||
@@ -1172,3 +1248,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 36) { | ||
s0 = peg$c7; | ||
s0 = peg$c8; | ||
peg$currPos++; | ||
@@ -1179,3 +1255,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e7); | ||
peg$fail(peg$e8); | ||
} | ||
@@ -1188,3 +1264,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s0 = peg$c8; | ||
s0 = peg$c9; | ||
peg$currPos++; | ||
@@ -1195,3 +1271,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e8); | ||
peg$fail(peg$e9); | ||
} | ||
@@ -1204,3 +1280,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 42) { | ||
s0 = peg$c9; | ||
s0 = peg$c10; | ||
peg$currPos++; | ||
@@ -1211,3 +1287,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e9); | ||
peg$fail(peg$e10); | ||
} | ||
@@ -1219,4 +1295,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 2) === peg$c10) { | ||
s0 = peg$c10; | ||
if (input.substr(peg$currPos, 2) === peg$c11) { | ||
s0 = peg$c11; | ||
peg$currPos += 2; | ||
@@ -1227,3 +1303,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e10); | ||
peg$fail(peg$e11); | ||
} | ||
@@ -1235,4 +1311,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 2) === peg$c11) { | ||
s0 = peg$c11; | ||
if (input.substr(peg$currPos, 2) === peg$c12) { | ||
s0 = peg$c12; | ||
peg$currPos += 2; | ||
@@ -1243,3 +1319,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e11); | ||
peg$fail(peg$e12); | ||
} | ||
@@ -1252,3 +1328,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 62) { | ||
s0 = peg$c12; | ||
s0 = peg$c13; | ||
peg$currPos++; | ||
@@ -1259,3 +1335,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e12); | ||
peg$fail(peg$e13); | ||
} | ||
@@ -1267,4 +1343,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 2) === peg$c13) { | ||
s0 = peg$c13; | ||
if (input.substr(peg$currPos, 2) === peg$c14) { | ||
s0 = peg$c14; | ||
peg$currPos += 2; | ||
@@ -1275,3 +1351,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e13); | ||
peg$fail(peg$e14); | ||
} | ||
@@ -1284,3 +1360,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 60) { | ||
s0 = peg$c14; | ||
s0 = peg$c15; | ||
peg$currPos++; | ||
@@ -1291,3 +1367,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e14); | ||
peg$fail(peg$e15); | ||
} | ||
@@ -1297,6 +1373,20 @@ } | ||
} | ||
function peg$parseMINUS() { | ||
var s0; | ||
if (input.charCodeAt(peg$currPos) === 45) { | ||
s0 = peg$c16; | ||
peg$currPos++; | ||
} | ||
else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e16); | ||
} | ||
} | ||
return s0; | ||
} | ||
function peg$parseBRACKET_LEFT() { | ||
var s0; | ||
if (input.charCodeAt(peg$currPos) === 91) { | ||
s0 = peg$c15; | ||
s0 = peg$c17; | ||
peg$currPos++; | ||
@@ -1307,3 +1397,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e15); | ||
peg$fail(peg$e17); | ||
} | ||
@@ -1316,3 +1406,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 93) { | ||
s0 = peg$c16; | ||
s0 = peg$c18; | ||
peg$currPos++; | ||
@@ -1323,3 +1413,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e16); | ||
peg$fail(peg$e18); | ||
} | ||
@@ -1332,3 +1422,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 44) { | ||
s0 = peg$c17; | ||
s0 = peg$c19; | ||
peg$currPos++; | ||
@@ -1339,3 +1429,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e17); | ||
peg$fail(peg$e19); | ||
} | ||
@@ -1348,3 +1438,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 40) { | ||
s0 = peg$c18; | ||
s0 = peg$c20; | ||
peg$currPos++; | ||
@@ -1355,3 +1445,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e18); | ||
peg$fail(peg$e20); | ||
} | ||
@@ -1364,3 +1454,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 41) { | ||
s0 = peg$c19; | ||
s0 = peg$c21; | ||
peg$currPos++; | ||
@@ -1371,3 +1461,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e19); | ||
peg$fail(peg$e21); | ||
} | ||
@@ -1380,3 +1470,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 63) { | ||
s0 = peg$c20; | ||
s0 = peg$c22; | ||
peg$currPos++; | ||
@@ -1387,3 +1477,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e20); | ||
peg$fail(peg$e22); | ||
} | ||
@@ -1404,3 +1494,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e21); | ||
peg$fail(peg$e23); | ||
} | ||
@@ -1418,3 +1508,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e21); | ||
peg$fail(peg$e23); | ||
} | ||
@@ -1438,3 +1528,3 @@ } | ||
if (input.charCodeAt(peg$currPos) === 58) { | ||
s0 = peg$c21; | ||
s0 = peg$c23; | ||
peg$currPos++; | ||
@@ -1445,3 +1535,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e22); | ||
peg$fail(peg$e24); | ||
} | ||
@@ -1453,4 +1543,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 4) === peg$c22) { | ||
s0 = peg$c22; | ||
if (input.substr(peg$currPos, 4) === peg$c24) { | ||
s0 = peg$c24; | ||
peg$currPos += 4; | ||
@@ -1461,3 +1551,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e23); | ||
peg$fail(peg$e25); | ||
} | ||
@@ -1469,4 +1559,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 5) === peg$c23) { | ||
s0 = peg$c23; | ||
if (input.substr(peg$currPos, 5) === peg$c25) { | ||
s0 = peg$c25; | ||
peg$currPos += 5; | ||
@@ -1477,3 +1567,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e24); | ||
peg$fail(peg$e26); | ||
} | ||
@@ -1485,4 +1575,4 @@ } | ||
var s0; | ||
if (input.substr(peg$currPos, 4) === peg$c24) { | ||
s0 = peg$c24; | ||
if (input.substr(peg$currPos, 4) === peg$c26) { | ||
s0 = peg$c26; | ||
peg$currPos += 4; | ||
@@ -1493,3 +1583,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e25); | ||
peg$fail(peg$e27); | ||
} | ||
@@ -1512,3 +1602,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e26); | ||
peg$fail(peg$e28); | ||
} | ||
@@ -1528,3 +1618,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e26); | ||
peg$fail(peg$e28); | ||
} | ||
@@ -1535,3 +1625,3 @@ } | ||
peg$savedPos = s0; | ||
s1 = peg$f24(s1); | ||
s1 = peg$f25(s1); | ||
s0 = s1; | ||
@@ -1558,3 +1648,3 @@ return s0; | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e27); | ||
peg$fail(peg$e29); | ||
} | ||
@@ -1573,3 +1663,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e28); | ||
peg$fail(peg$e30); | ||
} | ||
@@ -1589,3 +1679,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e28); | ||
peg$fail(peg$e30); | ||
} | ||
@@ -1602,3 +1692,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e27); | ||
peg$fail(peg$e29); | ||
} | ||
@@ -1608,3 +1698,3 @@ } | ||
peg$savedPos = s0; | ||
s0 = peg$f25(s2); | ||
s0 = peg$f26(s2); | ||
} | ||
@@ -1632,3 +1722,3 @@ else { | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e29); | ||
peg$fail(peg$e31); | ||
} | ||
@@ -1647,3 +1737,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e30); | ||
peg$fail(peg$e32); | ||
} | ||
@@ -1663,3 +1753,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e30); | ||
peg$fail(peg$e32); | ||
} | ||
@@ -1676,3 +1766,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e29); | ||
peg$fail(peg$e31); | ||
} | ||
@@ -1682,3 +1772,3 @@ } | ||
peg$savedPos = s0; | ||
s0 = peg$f26(s2); | ||
s0 = peg$f27(s2); | ||
} | ||
@@ -1700,3 +1790,3 @@ else { | ||
if (input.charCodeAt(peg$currPos) === 92) { | ||
s1 = peg$c25; | ||
s1 = peg$c27; | ||
peg$currPos++; | ||
@@ -1707,3 +1797,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e31); | ||
peg$fail(peg$e33); | ||
} | ||
@@ -1715,3 +1805,3 @@ } | ||
peg$savedPos = s0; | ||
s0 = peg$f27(s2); | ||
s0 = peg$f28(s2); | ||
} | ||
@@ -1739,3 +1829,3 @@ else { | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e32); | ||
peg$fail(peg$e34); | ||
} | ||
@@ -1762,3 +1852,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e34); | ||
peg$fail(peg$e36); | ||
} | ||
@@ -1775,3 +1865,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e34); | ||
peg$fail(peg$e36); | ||
} | ||
@@ -1783,3 +1873,3 @@ } | ||
if (peg$silentFails === 0) { | ||
peg$fail(peg$e33); | ||
peg$fail(peg$e35); | ||
} | ||
@@ -1786,0 +1876,0 @@ return s0; |
{ | ||
"name": "asl-path-validator", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "Validates the path expressions for the Amazon States Language", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -180,27 +180,29 @@ // Generated by Peggy 2.0.1. | ||
var peg$c3 = "States.Array"; | ||
var peg$c4 = "@"; | ||
var peg$c5 = ".."; | ||
var peg$c6 = "$$"; | ||
var peg$c7 = "$"; | ||
var peg$c8 = "."; | ||
var peg$c9 = "*"; | ||
var peg$c10 = "=="; | ||
var peg$c11 = ">="; | ||
var peg$c12 = ">"; | ||
var peg$c13 = "<="; | ||
var peg$c14 = "<"; | ||
var peg$c15 = "["; | ||
var peg$c16 = "]"; | ||
var peg$c17 = ","; | ||
var peg$c18 = "("; | ||
var peg$c19 = ")"; | ||
var peg$c20 = "?"; | ||
var peg$c21 = ":"; | ||
var peg$c22 = "true"; | ||
var peg$c23 = "false"; | ||
var peg$c24 = "null"; | ||
var peg$c25 = "\\"; | ||
var peg$c4 = ".length"; | ||
var peg$c5 = "@"; | ||
var peg$c6 = ".."; | ||
var peg$c7 = "$$"; | ||
var peg$c8 = "$"; | ||
var peg$c9 = "."; | ||
var peg$c10 = "*"; | ||
var peg$c11 = "=="; | ||
var peg$c12 = ">="; | ||
var peg$c13 = ">"; | ||
var peg$c14 = "<="; | ||
var peg$c15 = "<"; | ||
var peg$c16 = "-"; | ||
var peg$c17 = "["; | ||
var peg$c18 = "]"; | ||
var peg$c19 = ","; | ||
var peg$c20 = "("; | ||
var peg$c21 = ")"; | ||
var peg$c22 = "?"; | ||
var peg$c23 = ":"; | ||
var peg$c24 = "true"; | ||
var peg$c25 = "false"; | ||
var peg$c26 = "null"; | ||
var peg$c27 = "\\"; | ||
var peg$r0 = /^[0-9]/; | ||
var peg$r1 = /^[^),'"\\.[\]]/; | ||
var peg$r1 = /^[^),'"\\.[\] ><!=]/; | ||
var peg$r2 = /^[']/; | ||
@@ -217,33 +219,35 @@ var peg$r3 = /^[^'\\]/; | ||
var peg$e3 = peg$literalExpectation("States.Array", false); | ||
var peg$e4 = peg$literalExpectation("@", false); | ||
var peg$e5 = peg$literalExpectation("..", false); | ||
var peg$e6 = peg$literalExpectation("$$", false); | ||
var peg$e7 = peg$literalExpectation("$", false); | ||
var peg$e8 = peg$literalExpectation(".", false); | ||
var peg$e9 = peg$literalExpectation("*", false); | ||
var peg$e10 = peg$literalExpectation("==", false); | ||
var peg$e11 = peg$literalExpectation(">=", false); | ||
var peg$e12 = peg$literalExpectation(">", false); | ||
var peg$e13 = peg$literalExpectation("<=", false); | ||
var peg$e14 = peg$literalExpectation("<", false); | ||
var peg$e15 = peg$literalExpectation("[", false); | ||
var peg$e16 = peg$literalExpectation("]", false); | ||
var peg$e17 = peg$literalExpectation(",", false); | ||
var peg$e18 = peg$literalExpectation("(", false); | ||
var peg$e19 = peg$literalExpectation(")", false); | ||
var peg$e20 = peg$literalExpectation("?", false); | ||
var peg$e21 = peg$classExpectation([["0", "9"]], false, false); | ||
var peg$e22 = peg$literalExpectation(":", false); | ||
var peg$e23 = peg$literalExpectation("true", false); | ||
var peg$e24 = peg$literalExpectation("false", false); | ||
var peg$e25 = peg$literalExpectation("null", false); | ||
var peg$e26 = peg$classExpectation([")", ",", "'", "\"", "\\", ".", "[", "]"], true, false); | ||
var peg$e27 = peg$classExpectation(["'"], false, false); | ||
var peg$e28 = peg$classExpectation(["'", "\\"], true, false); | ||
var peg$e29 = peg$classExpectation(["\""], false, false); | ||
var peg$e30 = peg$classExpectation(["\"", "\\"], true, false); | ||
var peg$e31 = peg$literalExpectation("\\", false); | ||
var peg$e32 = peg$classExpectation(["\\", "n"], true, false); | ||
var peg$e33 = peg$otherExpectation("whitespace"); | ||
var peg$e34 = peg$classExpectation([" ", "\t", "\n"], false, false); | ||
var peg$e4 = peg$literalExpectation(".length", false); | ||
var peg$e5 = peg$literalExpectation("@", false); | ||
var peg$e6 = peg$literalExpectation("..", false); | ||
var peg$e7 = peg$literalExpectation("$$", false); | ||
var peg$e8 = peg$literalExpectation("$", false); | ||
var peg$e9 = peg$literalExpectation(".", false); | ||
var peg$e10 = peg$literalExpectation("*", false); | ||
var peg$e11 = peg$literalExpectation("==", false); | ||
var peg$e12 = peg$literalExpectation(">=", false); | ||
var peg$e13 = peg$literalExpectation(">", false); | ||
var peg$e14 = peg$literalExpectation("<=", false); | ||
var peg$e15 = peg$literalExpectation("<", false); | ||
var peg$e16 = peg$literalExpectation("-", false); | ||
var peg$e17 = peg$literalExpectation("[", false); | ||
var peg$e18 = peg$literalExpectation("]", false); | ||
var peg$e19 = peg$literalExpectation(",", false); | ||
var peg$e20 = peg$literalExpectation("(", false); | ||
var peg$e21 = peg$literalExpectation(")", false); | ||
var peg$e22 = peg$literalExpectation("?", false); | ||
var peg$e23 = peg$classExpectation([["0", "9"]], false, false); | ||
var peg$e24 = peg$literalExpectation(":", false); | ||
var peg$e25 = peg$literalExpectation("true", false); | ||
var peg$e26 = peg$literalExpectation("false", false); | ||
var peg$e27 = peg$literalExpectation("null", false); | ||
var peg$e28 = peg$classExpectation([")", ",", "'", "\"", "\\", ".", "[", "]", " ", ">", "<", "!", "="], true, false); | ||
var peg$e29 = peg$classExpectation(["'"], false, false); | ||
var peg$e30 = peg$classExpectation(["'", "\\"], true, false); | ||
var peg$e31 = peg$classExpectation(["\""], false, false); | ||
var peg$e32 = peg$classExpectation(["\"", "\\"], true, false); | ||
var peg$e33 = peg$literalExpectation("\\", false); | ||
var peg$e34 = peg$classExpectation(["\\", "n"], true, false); | ||
var peg$e35 = peg$otherExpectation("whitespace"); | ||
var peg$e36 = peg$classExpectation([" ", "\t", "\n"], false, false); | ||
@@ -263,3 +267,3 @@ var peg$f0 = function(sub) {return {node: "$$", sub, isRoot:true}}; | ||
head, | ||
tail: tail.map((t) => t[1]) | ||
tail: tail.map((t) => t[2]) | ||
} | ||
@@ -284,8 +288,9 @@ }; | ||
var peg$f21 = function(exp) {return {exp}}; | ||
var peg$f22 = function(exp) {return {exp}}; | ||
var peg$f23 = function(path, op, val) {return {path, op, val}}; | ||
var peg$f24 = function(v) {return v.join('')}; | ||
var peg$f25 = function(v) {return v.join("")}; | ||
var peg$f22 = function(offset) {return {node:"@", offset: -offset}}; | ||
var peg$f23 = function(exp) {return {exp}}; | ||
var peg$f24 = function(path, op, val) {return {path, op, val}}; | ||
var peg$f25 = function(v) {return v.join('')}; | ||
var peg$f26 = function(v) {return v.join("")}; | ||
var peg$f27 = function(c) { return c; }; | ||
var peg$f27 = function(v) {return v.join("")}; | ||
var peg$f28 = function(c) { return c; }; | ||
var peg$currPos = 0; | ||
@@ -634,3 +639,3 @@ var peg$savedPos = 0; | ||
function peg$parsesubscriptables() { | ||
var s0, s1, s2, s3, s4, s5, s6; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | ||
@@ -640,8 +645,10 @@ s0 = peg$currPos; | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parsesubscriptable(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseBRACKET_RIGHT(); | ||
if (s3 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parsesubscriptable(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parseBRACKET_RIGHT(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f9(s2); | ||
s0 = peg$f9(s3); | ||
} else { | ||
@@ -663,42 +670,47 @@ peg$currPos = s0; | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parseNUMBER(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = []; | ||
s4 = peg$currPos; | ||
s5 = peg$parseCOMMA(); | ||
if (s5 !== peg$FAILED) { | ||
s6 = peg$parseNUMBER(); | ||
if (s6 !== peg$FAILED) { | ||
s5 = [s5, s6]; | ||
s4 = s5; | ||
s2 = peg$parse_(); | ||
s3 = peg$parseNUMBER(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = []; | ||
s6 = peg$currPos; | ||
s7 = peg$parseCOMMA(); | ||
if (s7 !== peg$FAILED) { | ||
s8 = peg$parse_(); | ||
s9 = peg$parseNUMBER(); | ||
if (s9 !== peg$FAILED) { | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
} else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
while (s4 !== peg$FAILED) { | ||
s3.push(s4); | ||
s4 = peg$currPos; | ||
s5 = peg$parseCOMMA(); | ||
if (s5 !== peg$FAILED) { | ||
s6 = peg$parseNUMBER(); | ||
if (s6 !== peg$FAILED) { | ||
s5 = [s5, s6]; | ||
s4 = s5; | ||
while (s6 !== peg$FAILED) { | ||
s5.push(s6); | ||
s6 = peg$currPos; | ||
s7 = peg$parseCOMMA(); | ||
if (s7 !== peg$FAILED) { | ||
s8 = peg$parse_(); | ||
s9 = peg$parseNUMBER(); | ||
if (s9 !== peg$FAILED) { | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
} else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s4; | ||
s4 = peg$FAILED; | ||
peg$currPos = s6; | ||
s6 = peg$FAILED; | ||
} | ||
} | ||
s4 = peg$parseBRACKET_RIGHT(); | ||
if (s4 !== peg$FAILED) { | ||
s6 = peg$parse_(); | ||
s7 = peg$parseBRACKET_RIGHT(); | ||
if (s7 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f10(s2, s3); | ||
s0 = peg$f10(s3, s5); | ||
} else { | ||
@@ -857,3 +869,3 @@ peg$currPos = s0; | ||
function peg$parsefunction_args() { | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; | ||
@@ -891,4 +903,3 @@ s0 = peg$currPos; | ||
if (s9 !== peg$FAILED) { | ||
s10 = peg$parse_(); | ||
s7 = [s7, s8, s9, s10]; | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
@@ -911,4 +922,3 @@ } else { | ||
if (s9 !== peg$FAILED) { | ||
s10 = peg$parse_(); | ||
s7 = [s7, s8, s9, s10]; | ||
s7 = [s7, s8, s9]; | ||
s6 = s7; | ||
@@ -947,3 +957,3 @@ } else { | ||
function peg$parsesubscriptable() { | ||
var s0, s1, s2, s3, s4; | ||
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | ||
@@ -1015,8 +1025,10 @@ s0 = peg$parseSTRING(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseexpression_(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parsePAREN_RIGHT(); | ||
if (s4 !== peg$FAILED) { | ||
s3 = peg$parse_(); | ||
s4 = peg$parseexpression_(); | ||
if (s4 !== peg$FAILED) { | ||
s5 = peg$parse_(); | ||
s6 = peg$parsePAREN_RIGHT(); | ||
if (s6 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f21(s3); | ||
s0 = peg$f21(s4); | ||
} else { | ||
@@ -1039,3 +1051,54 @@ peg$currPos = s0; | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath_(); | ||
s0 = peg$currPos; | ||
s1 = peg$parsePAREN_LEFT(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parseCURRENT_VALUE(); | ||
if (s3 !== peg$FAILED) { | ||
if (input.substr(peg$currPos, 7) === peg$c4) { | ||
s4 = peg$c4; | ||
peg$currPos += 7; | ||
} else { | ||
s4 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e4); } | ||
} | ||
if (s4 !== peg$FAILED) { | ||
s5 = peg$parse_(); | ||
s6 = peg$parseMINUS(); | ||
if (s6 !== peg$FAILED) { | ||
s7 = peg$parse_(); | ||
s8 = peg$parseNUMBER(); | ||
if (s8 !== peg$FAILED) { | ||
s9 = peg$parse_(); | ||
s10 = peg$parsePAREN_RIGHT(); | ||
if (s10 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f22(s8); | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath_(); | ||
} | ||
} | ||
@@ -1053,3 +1116,3 @@ } | ||
function peg$parseexpression_() { | ||
var s0, s1, s2, s3; | ||
var s0, s1, s2, s3, s4, s5; | ||
@@ -1059,8 +1122,10 @@ s0 = peg$currPos; | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parseexpression_(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parsePAREN_RIGHT(); | ||
if (s3 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parseexpression_(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parsePAREN_RIGHT(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f22(s2); | ||
s0 = peg$f23(s3); | ||
} else { | ||
@@ -1079,17 +1144,13 @@ peg$currPos = s0; | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath__(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$currPos; | ||
s1 = peg$parsejsonpath__(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parsecomparison_op(); | ||
if (s2 !== peg$FAILED) { | ||
s3 = peg$parseNUMBER(); | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f23(s1, s2, s3); | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
s0 = peg$currPos; | ||
s1 = peg$parsejsonpath__(); | ||
if (s1 !== peg$FAILED) { | ||
s2 = peg$parse_(); | ||
s3 = peg$parsecomparison_op(); | ||
if (s3 !== peg$FAILED) { | ||
s4 = peg$parse_(); | ||
s5 = peg$parseNUMBER(); | ||
if (s5 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f24(s1, s3, s5); | ||
} else { | ||
@@ -1103,3 +1164,9 @@ peg$currPos = s0; | ||
} | ||
} else { | ||
peg$currPos = s0; | ||
s0 = peg$FAILED; | ||
} | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parsejsonpath__(); | ||
} | ||
} | ||
@@ -1115,9 +1182,9 @@ | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseLT(); | ||
s0 = peg$parseLE(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseLE(); | ||
s0 = peg$parseLT(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseGT(); | ||
s0 = peg$parseGE(); | ||
if (s0 === peg$FAILED) { | ||
s0 = peg$parseGE(); | ||
s0 = peg$parseGT(); | ||
} | ||
@@ -1155,7 +1222,7 @@ } | ||
if (input.charCodeAt(peg$currPos) === 64) { | ||
s0 = peg$c4; | ||
s0 = peg$c5; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e4); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e5); } | ||
} | ||
@@ -1169,8 +1236,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c5) { | ||
s0 = peg$c5; | ||
if (input.substr(peg$currPos, 2) === peg$c6) { | ||
s0 = peg$c6; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e5); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e6); } | ||
} | ||
@@ -1184,8 +1251,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c6) { | ||
s0 = peg$c6; | ||
if (input.substr(peg$currPos, 2) === peg$c7) { | ||
s0 = peg$c7; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e6); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e7); } | ||
} | ||
@@ -1200,7 +1267,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 36) { | ||
s0 = peg$c7; | ||
s0 = peg$c8; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e7); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e8); } | ||
} | ||
@@ -1215,7 +1282,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 46) { | ||
s0 = peg$c8; | ||
s0 = peg$c9; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e8); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e9); } | ||
} | ||
@@ -1230,7 +1297,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 42) { | ||
s0 = peg$c9; | ||
s0 = peg$c10; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e9); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e10); } | ||
} | ||
@@ -1244,8 +1311,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c10) { | ||
s0 = peg$c10; | ||
if (input.substr(peg$currPos, 2) === peg$c11) { | ||
s0 = peg$c11; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e10); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e11); } | ||
} | ||
@@ -1259,8 +1326,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c11) { | ||
s0 = peg$c11; | ||
if (input.substr(peg$currPos, 2) === peg$c12) { | ||
s0 = peg$c12; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e11); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e12); } | ||
} | ||
@@ -1275,7 +1342,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 62) { | ||
s0 = peg$c12; | ||
s0 = peg$c13; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e12); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e13); } | ||
} | ||
@@ -1289,8 +1356,8 @@ | ||
if (input.substr(peg$currPos, 2) === peg$c13) { | ||
s0 = peg$c13; | ||
if (input.substr(peg$currPos, 2) === peg$c14) { | ||
s0 = peg$c14; | ||
peg$currPos += 2; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e13); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e14); } | ||
} | ||
@@ -1305,7 +1372,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 60) { | ||
s0 = peg$c14; | ||
s0 = peg$c15; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e14); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e15); } | ||
} | ||
@@ -1316,2 +1383,16 @@ | ||
function peg$parseMINUS() { | ||
var s0; | ||
if (input.charCodeAt(peg$currPos) === 45) { | ||
s0 = peg$c16; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e16); } | ||
} | ||
return s0; | ||
} | ||
function peg$parseBRACKET_LEFT() { | ||
@@ -1321,7 +1402,7 @@ var s0; | ||
if (input.charCodeAt(peg$currPos) === 91) { | ||
s0 = peg$c15; | ||
s0 = peg$c17; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e15); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e17); } | ||
} | ||
@@ -1336,7 +1417,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 93) { | ||
s0 = peg$c16; | ||
s0 = peg$c18; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e16); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e18); } | ||
} | ||
@@ -1351,7 +1432,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 44) { | ||
s0 = peg$c17; | ||
s0 = peg$c19; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e17); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e19); } | ||
} | ||
@@ -1366,7 +1447,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 40) { | ||
s0 = peg$c18; | ||
s0 = peg$c20; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e18); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e20); } | ||
} | ||
@@ -1381,7 +1462,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 41) { | ||
s0 = peg$c19; | ||
s0 = peg$c21; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e19); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e21); } | ||
} | ||
@@ -1396,7 +1477,7 @@ | ||
if (input.charCodeAt(peg$currPos) === 63) { | ||
s0 = peg$c20; | ||
s0 = peg$c22; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e20); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e22); } | ||
} | ||
@@ -1417,3 +1498,3 @@ | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e21); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e23); } | ||
} | ||
@@ -1428,3 +1509,3 @@ if (s2 !== peg$FAILED) { | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e21); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e23); } | ||
} | ||
@@ -1448,7 +1529,7 @@ } | ||
if (input.charCodeAt(peg$currPos) === 58) { | ||
s0 = peg$c21; | ||
s0 = peg$c23; | ||
peg$currPos++; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e22); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e24); } | ||
} | ||
@@ -1462,8 +1543,8 @@ | ||
if (input.substr(peg$currPos, 4) === peg$c22) { | ||
s0 = peg$c22; | ||
if (input.substr(peg$currPos, 4) === peg$c24) { | ||
s0 = peg$c24; | ||
peg$currPos += 4; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e23); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e25); } | ||
} | ||
@@ -1477,8 +1558,8 @@ | ||
if (input.substr(peg$currPos, 5) === peg$c23) { | ||
s0 = peg$c23; | ||
if (input.substr(peg$currPos, 5) === peg$c25) { | ||
s0 = peg$c25; | ||
peg$currPos += 5; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e24); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e26); } | ||
} | ||
@@ -1492,8 +1573,8 @@ | ||
if (input.substr(peg$currPos, 4) === peg$c24) { | ||
s0 = peg$c24; | ||
if (input.substr(peg$currPos, 4) === peg$c26) { | ||
s0 = peg$c26; | ||
peg$currPos += 4; | ||
} else { | ||
s0 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e25); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e27); } | ||
} | ||
@@ -1516,3 +1597,3 @@ | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e26); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e28); } | ||
} | ||
@@ -1529,3 +1610,3 @@ } | ||
s2 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e26); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e28); } | ||
} | ||
@@ -1535,3 +1616,3 @@ } | ||
peg$savedPos = s0; | ||
s1 = peg$f24(s1); | ||
s1 = peg$f25(s1); | ||
s0 = s1; | ||
@@ -1562,3 +1643,3 @@ | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e27); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e29); } | ||
} | ||
@@ -1574,3 +1655,3 @@ if (s1 !== peg$FAILED) { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e28); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e30); } | ||
} | ||
@@ -1587,3 +1668,3 @@ } | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e28); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e30); } | ||
} | ||
@@ -1597,7 +1678,7 @@ } | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e27); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e29); } | ||
} | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f25(s2); | ||
s0 = peg$f26(s2); | ||
} else { | ||
@@ -1624,3 +1705,3 @@ peg$currPos = s0; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e29); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e31); } | ||
} | ||
@@ -1636,3 +1717,3 @@ if (s1 !== peg$FAILED) { | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e30); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e32); } | ||
} | ||
@@ -1649,3 +1730,3 @@ } | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e30); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e32); } | ||
} | ||
@@ -1659,7 +1740,7 @@ } | ||
s3 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e29); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e31); } | ||
} | ||
if (s3 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f26(s2); | ||
s0 = peg$f27(s2); | ||
} else { | ||
@@ -1682,7 +1763,7 @@ peg$currPos = s0; | ||
if (input.charCodeAt(peg$currPos) === 92) { | ||
s1 = peg$c25; | ||
s1 = peg$c27; | ||
peg$currPos++; | ||
} else { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e31); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e33); } | ||
} | ||
@@ -1693,3 +1774,3 @@ if (s1 !== peg$FAILED) { | ||
peg$savedPos = s0; | ||
s0 = peg$f27(s2); | ||
s0 = peg$f28(s2); | ||
} else { | ||
@@ -1716,3 +1797,3 @@ peg$currPos = s0; | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e32); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e34); } | ||
} | ||
@@ -1738,3 +1819,3 @@ if (s1 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e34); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e36); } | ||
} | ||
@@ -1748,3 +1829,3 @@ while (s1 !== peg$FAILED) { | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e34); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e36); } | ||
} | ||
@@ -1754,3 +1835,3 @@ } | ||
s1 = peg$FAILED; | ||
if (peg$silentFails === 0) { peg$fail(peg$e33); } | ||
if (peg$silentFails === 0) { peg$fail(peg$e35); } | ||
@@ -1757,0 +1838,0 @@ return s0; |
Sorry, the diff of this file is not supported yet
126676
3669