@redocly/respect-core
Version:
API testing framework core
1,911 lines (1,755 loc) • 51.8 kB
JavaScript
/*
* Generated by PEG.js 0.10.0.
*
* http://pegjs.org/
*/
"use strict";
function peg$subclass(child, parent) {
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor();
}
function peg$SyntaxError(message, expected, found, location) {
this.message = message;
this.expected = expected;
this.found = found;
this.location = location;
this.name = "SyntaxError";
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, peg$SyntaxError);
}
}
peg$subclass(peg$SyntaxError, Error);
peg$SyntaxError.buildMessage = function(expected, found) {
var DESCRIBE_EXPECTATION_FNS = {
literal: function(expectation) {
return "\"" + literalEscape(expectation.text) + "\"";
},
"class": function(expectation) {
var escapedParts = "",
i;
for (i = 0; i < expectation.parts.length; i++) {
escapedParts += expectation.parts[i] instanceof Array
? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
: classEscape(expectation.parts[i]);
}
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
},
any: function(expectation) {
return "any character";
},
end: function(expectation) {
return "end of input";
},
other: function(expectation) {
return expectation.description;
}
};
function hex(ch) {
return ch.charCodeAt(0).toString(16).toUpperCase();
}
function literalEscape(s) {
return s
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\0/g, '\\0')
.replace(/\t/g, '\\t')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
}
function classEscape(s) {
return s
.replace(/\\/g, '\\\\')
.replace(/\]/g, '\\]')
.replace(/\^/g, '\\^')
.replace(/-/g, '\\-')
.replace(/\0/g, '\\0')
.replace(/\t/g, '\\t')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
}
function describeExpectation(expectation) {
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
}
function describeExpected(expected) {
var descriptions = new Array(expected.length),
i, j;
for (i = 0; i < expected.length; i++) {
descriptions[i] = describeExpectation(expected[i]);
}
descriptions.sort();
if (descriptions.length > 0) {
for (i = 1, j = 1; i < descriptions.length; i++) {
if (descriptions[i - 1] !== descriptions[i]) {
descriptions[j] = descriptions[i];
j++;
}
}
descriptions.length = j;
}
switch (descriptions.length) {
case 1:
return descriptions[0];
case 2:
return descriptions[0] + " or " + descriptions[1];
default:
return descriptions.slice(0, -1).join(", ")
+ ", or "
+ descriptions[descriptions.length - 1];
}
}
function describeFound(found) {
return found ? "\"" + literalEscape(found) + "\"" : "end of input";
}
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
};
function peg$parse(input, options) {
options = options !== void 0 ? options : {};
var peg$FAILED = {},
peg$startRuleFunctions = { Start: peg$parseStart },
peg$startRuleFunction = peg$parseStart,
peg$c0 = "&&",
peg$c1 = peg$literalExpectation("&&", false),
peg$c2 = "||",
peg$c3 = peg$literalExpectation("||", false),
peg$c4 = "!",
peg$c5 = peg$literalExpectation("!", false),
peg$c6 = "==",
peg$c7 = peg$literalExpectation("==", false),
peg$c8 = "!=",
peg$c9 = peg$literalExpectation("!=", false),
peg$c10 = "<=",
peg$c11 = peg$literalExpectation("<=", false),
peg$c12 = "<",
peg$c13 = peg$literalExpectation("<", false),
peg$c14 = ">=",
peg$c15 = peg$literalExpectation(">=", false),
peg$c16 = ">",
peg$c17 = peg$literalExpectation(">", false),
peg$c18 = "{",
peg$c19 = peg$literalExpectation("{", false),
peg$c20 = "}",
peg$c21 = peg$literalExpectation("}", false),
peg$c22 = "$url",
peg$c23 = peg$literalExpectation("$url", false),
peg$c24 = "$method",
peg$c25 = peg$literalExpectation("$method", false),
peg$c26 = "$statusCode",
peg$c27 = peg$literalExpectation("$statusCode", false),
peg$c28 = "$request.",
peg$c29 = peg$literalExpectation("$request.", false),
peg$c30 = "$response.",
peg$c31 = peg$literalExpectation("$response.", false),
peg$c32 = "$inputs.",
peg$c33 = peg$literalExpectation("$inputs.", false),
peg$c34 = "$steps.",
peg$c35 = peg$literalExpectation("$steps.", false),
peg$c36 = "$workflows.",
peg$c37 = peg$literalExpectation("$workflows.", false),
peg$c38 = "$sourceDescriptions.",
peg$c39 = peg$literalExpectation("$sourceDescriptions.", false),
peg$c40 = "$components.",
peg$c41 = peg$literalExpectation("$components.", false),
peg$c42 = "$components.parameters.",
peg$c43 = peg$literalExpectation("$components.parameters.", false),
peg$c44 = "$outputs.",
peg$c45 = peg$literalExpectation("$outputs.", false),
peg$c46 = ".",
peg$c47 = peg$literalExpectation(".", false),
peg$c48 = "outputs.",
peg$c49 = peg$literalExpectation("outputs.", false),
peg$c50 = "header.",
peg$c51 = peg$literalExpectation("header.", false),
peg$c52 = "query.",
peg$c53 = peg$literalExpectation("query.", false),
peg$c54 = "path.",
peg$c55 = peg$literalExpectation("path.", false),
peg$c56 = "body",
peg$c57 = peg$literalExpectation("body", false),
peg$c58 = "#",
peg$c59 = peg$literalExpectation("#", false),
peg$c60 = "/",
peg$c61 = peg$literalExpectation("/", false),
peg$c62 = /^[!-.0-9A-Z_a-z]/,
peg$c63 = peg$classExpectation([["!", "."], ["0", "9"], ["A", "Z"], "_", ["a", "z"]], false, false),
peg$c64 = "~",
peg$c65 = peg$literalExpectation("~", false),
peg$c66 = "0",
peg$c67 = peg$literalExpectation("0", false),
peg$c68 = "1",
peg$c69 = peg$literalExpectation("1", false),
peg$c70 = /^[a-zA-Z]/,
peg$c71 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false),
peg$c72 = /^[a-zA-Z0-9_\-]/,
peg$c73 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "-"], false, false),
peg$c74 = /^[!#$%&'*+\-.\^_`|~a-zA-Z0-9\-]/,
peg$c75 = peg$classExpectation(["!", "#", "$", "%", "&", "'", "*", "+", "-", ".", "^", "_", "`", "|", "~", ["a", "z"], ["A", "Z"], ["0", "9"], "-"], false, false),
peg$c76 = "[",
peg$c77 = peg$literalExpectation("[", false),
peg$c78 = "]",
peg$c79 = peg$literalExpectation("]", false),
peg$c80 = /^[1-9]/,
peg$c81 = peg$classExpectation([["1", "9"]], false, false),
peg$c82 = /^[0-9]/,
peg$c83 = peg$classExpectation([["0", "9"]], false, false),
peg$c84 = "\"",
peg$c85 = peg$literalExpectation("\"", false),
peg$c86 = /^[^"]/,
peg$c87 = peg$classExpectation(["\""], true, false),
peg$c88 = "'",
peg$c89 = peg$literalExpectation("'", false),
peg$c90 = /^[^']/,
peg$c91 = peg$classExpectation(["'"], true, false),
peg$c92 = "true",
peg$c93 = peg$literalExpectation("true", false),
peg$c94 = "false",
peg$c95 = peg$literalExpectation("false", false),
peg$c96 = "null",
peg$c97 = peg$literalExpectation("null", false),
peg$c98 = "undefined",
peg$c99 = peg$literalExpectation("undefined", false),
peg$c100 = /^[ \t\r\n]/,
peg$c101 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false),
peg$currPos = 0,
peg$savedPos = 0,
peg$posDetailsCache = [{ line: 1, column: 1 }],
peg$maxFailPos = 0,
peg$maxFailExpected = [],
peg$silentFails = 0,
peg$result;
if ("startRule" in options) {
if (!(options.startRule in peg$startRuleFunctions)) {
throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
}
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
}
function text() {
return input.substring(peg$savedPos, peg$currPos);
}
function location() {
return peg$computeLocation(peg$savedPos, peg$currPos);
}
function expected(description, location) {
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
throw peg$buildStructuredError(
[peg$otherExpectation(description)],
input.substring(peg$savedPos, peg$currPos),
location
);
}
function error(message, location) {
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
throw peg$buildSimpleError(message, location);
}
function peg$literalExpectation(text, ignoreCase) {
return { type: "literal", text: text, ignoreCase: ignoreCase };
}
function peg$classExpectation(parts, inverted, ignoreCase) {
return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
}
function peg$anyExpectation() {
return { type: "any" };
}
function peg$endExpectation() {
return { type: "end" };
}
function peg$otherExpectation(description) {
return { type: "other", description: description };
}
function peg$computePosDetails(pos) {
var details = peg$posDetailsCache[pos], p;
if (details) {
return details;
} else {
p = pos - 1;
while (!peg$posDetailsCache[p]) {
p--;
}
details = peg$posDetailsCache[p];
details = {
line: details.line,
column: details.column
};
while (p < pos) {
if (input.charCodeAt(p) === 10) {
details.line++;
details.column = 1;
} else {
details.column++;
}
p++;
}
peg$posDetailsCache[pos] = details;
return details;
}
}
function peg$computeLocation(startPos, endPos) {
var startPosDetails = peg$computePosDetails(startPos),
endPosDetails = peg$computePosDetails(endPos);
return {
start: {
offset: startPos,
line: startPosDetails.line,
column: startPosDetails.column
},
end: {
offset: endPos,
line: endPosDetails.line,
column: endPosDetails.column
}
};
}
function peg$fail(expected) {
if (peg$currPos < peg$maxFailPos) { return; }
if (peg$currPos > peg$maxFailPos) {
peg$maxFailPos = peg$currPos;
peg$maxFailExpected = [];
}
peg$maxFailExpected.push(expected);
}
function peg$buildSimpleError(message, location) {
return new peg$SyntaxError(message, null, null, location);
}
function peg$buildStructuredError(expected, found, location) {
return new peg$SyntaxError(
peg$SyntaxError.buildMessage(expected, found),
expected,
found,
location
);
}
function peg$parseStart() {
var s0;
s0 = peg$parseLogicalExpression();
return s0;
}
function peg$parseLogicalExpression() {
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
s1 = peg$parseComparisonExpression();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$currPos;
s4 = peg$parse_();
if (s4 !== peg$FAILED) {
s5 = peg$parseLogicalOperator();
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
if (s6 !== peg$FAILED) {
s7 = peg$parseComparisonExpression();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$currPos;
s4 = peg$parse_();
if (s4 !== peg$FAILED) {
s5 = peg$parseLogicalOperator();
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
if (s6 !== peg$FAILED) {
s7 = peg$parseComparisonExpression();
if (s7 !== peg$FAILED) {
s4 = [s4, s5, s6, s7];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseLogicalOperator() {
var s0;
if (input.substr(peg$currPos, 2) === peg$c0) {
s0 = peg$c0;
peg$currPos += 2;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c1); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 2) === peg$c2) {
s0 = peg$c2;
peg$currPos += 2;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c3); }
}
if (s0 === peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 33) {
s0 = peg$c4;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c5); }
}
}
}
return s0;
}
function peg$parseOperator() {
var s0;
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$c7); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 2) === peg$c8) {
s0 = peg$c8;
peg$currPos += 2;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c9); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 2) === peg$c10) {
s0 = peg$c10;
peg$currPos += 2;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c11); }
}
if (s0 === peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 60) {
s0 = peg$c12;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c13); }
}
if (s0 === peg$FAILED) {
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$c15); }
}
if (s0 === peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 62) {
s0 = peg$c16;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c17); }
}
}
}
}
}
}
return s0;
}
function peg$parseComparisonExpression() {
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
s1 = peg$parseCurlyExpression();
if (s1 === peg$FAILED) {
s1 = peg$parseBasicExpression();
if (s1 === peg$FAILED) {
s1 = peg$parseValue();
}
}
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$currPos;
s5 = peg$parseOperator();
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
if (s6 !== peg$FAILED) {
s7 = peg$parseCurlyExpression();
if (s7 === peg$FAILED) {
s7 = peg$parseBasicExpression();
if (s7 === peg$FAILED) {
s7 = peg$parseValue();
}
}
if (s7 !== peg$FAILED) {
s5 = [s5, s6, s7];
s4 = s5;
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$currPos;
s5 = peg$parseOperator();
if (s5 !== peg$FAILED) {
s6 = peg$parse_();
if (s6 !== peg$FAILED) {
s7 = peg$parseCurlyExpression();
if (s7 === peg$FAILED) {
s7 = peg$parseBasicExpression();
if (s7 === peg$FAILED) {
s7 = peg$parseValue();
}
}
if (s7 !== peg$FAILED) {
s5 = [s5, s6, s7];
s4 = s5;
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
} else {
peg$currPos = s4;
s4 = peg$FAILED;
}
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseCurlyExpression() {
var s0, s1, s2, s3, s4, s5;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 123) {
s1 = peg$c18;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c19); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
if (s2 !== peg$FAILED) {
s3 = peg$parseBasicExpression();
if (s3 !== peg$FAILED) {
s4 = peg$parse_();
if (s4 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 125) {
s5 = peg$c20;
peg$currPos++;
} else {
s5 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c21); }
}
if (s5 !== peg$FAILED) {
s1 = [s1, s2, s3, s4, s5];
s0 = s1;
} 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$currPos;
if (input.charCodeAt(peg$currPos) === 123) {
s1 = peg$c18;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c19); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
if (s2 !== peg$FAILED) {
s3 = peg$parseLogicalExpression();
if (s3 !== peg$FAILED) {
s4 = peg$parse_();
if (s4 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 125) {
s5 = peg$c20;
peg$currPos++;
} else {
s5 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c21); }
}
if (s5 !== peg$FAILED) {
s1 = [s1, s2, s3, s4, s5];
s0 = s1;
} 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;
}
}
return s0;
}
function peg$parseBasicExpression() {
var s0, s1, s2;
if (input.substr(peg$currPos, 4) === peg$c22) {
s0 = peg$c22;
peg$currPos += 4;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c23); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 7) === peg$c24) {
s0 = peg$c24;
peg$currPos += 7;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c25); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 11) === peg$c26) {
s0 = peg$c26;
peg$currPos += 11;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c27); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 9) === peg$c28) {
s1 = peg$c28;
peg$currPos += 9;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c29); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseSource();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 10) === peg$c30) {
s1 = peg$c30;
peg$currPos += 10;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseSource();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 8) === peg$c32) {
s1 = peg$c32;
peg$currPos += 8;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parsePropertyNameChain();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$parseOutputsExpression();
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c34) {
s1 = peg$c34;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c35); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseStepsExpression();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 11) === peg$c36) {
s1 = peg$c36;
peg$currPos += 11;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseWorkflowsExpression();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 20) === peg$c38) {
s1 = peg$c38;
peg$currPos += 20;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c39); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parsePropertyNameChain();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 12) === peg$c40) {
s1 = peg$c40;
peg$currPos += 12;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c41); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parsePropertyNameChain();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (input.substr(peg$currPos, 23) === peg$c42) {
s1 = peg$c42;
peg$currPos += 23;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c43); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parsePropertyNameChain();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
}
}
}
}
}
}
}
}
}
}
return s0;
}
function peg$parseOutputsExpression() {
var s0, s1, s2, s3, s4;
s0 = peg$currPos;
if (input.substr(peg$currPos, 9) === peg$c44) {
s1 = peg$c44;
peg$currPos += 9;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c45); }
}
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
s3 = peg$parsePropertyNameChain();
if (s3 !== peg$FAILED) {
s4 = peg$parsejsonPointer();
if (s4 === peg$FAILED) {
s4 = null;
}
if (s4 !== peg$FAILED) {
s3 = [s3, s4];
s2 = s3;
} else {
peg$currPos = s2;
s2 = peg$FAILED;
}
} else {
peg$currPos = s2;
s2 = peg$FAILED;
}
if (s2 === peg$FAILED) {
s2 = peg$parsePropertyNameWithPointer();
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseStepsExpression() {
var s0, s1, s2, s3, s4, s5;
s0 = peg$currPos;
s1 = peg$parsePropertyName();
if (s1 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 46) {
s2 = peg$c46;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c47); }
}
if (s2 !== peg$FAILED) {
s3 = peg$currPos;
if (input.substr(peg$currPos, 8) === peg$c48) {
s4 = peg$c48;
peg$currPos += 8;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s4 !== peg$FAILED) {
s5 = peg$parsePropertyNameWithPointer();
if (s5 !== peg$FAILED) {
s4 = [s4, s5];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 === peg$FAILED) {
s3 = peg$parsePropertyNameChain();
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseWorkflowsExpression() {
var s0, s1, s2, s3, s4, s5;
s0 = peg$currPos;
s1 = peg$parsePropertyName();
if (s1 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 46) {
s2 = peg$c46;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c47); }
}
if (s2 !== peg$FAILED) {
s3 = peg$currPos;
if (input.substr(peg$currPos, 8) === peg$c48) {
s4 = peg$c48;
peg$currPos += 8;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c49); }
}
if (s4 !== peg$FAILED) {
s5 = peg$parsePropertyNameWithPointer();
if (s5 !== peg$FAILED) {
s4 = [s4, s5];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
if (s3 === peg$FAILED) {
s3 = peg$parsePropertyNameChain();
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parsePropertyNameWithPointer() {
var s0, s1, s2;
s0 = peg$currPos;
s1 = peg$parsePropertyName();
if (s1 !== peg$FAILED) {
s2 = peg$parsejsonPointer();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parsePropertyNameChain() {
var s0, s1, s2, s3, s4, s5, s6;
s0 = peg$currPos;
s1 = peg$parsePropertyName();
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 46) {
s4 = peg$c46;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c47); }
}
if (s4 !== peg$FAILED) {
s5 = peg$parse_();
if (s5 !== peg$FAILED) {
s6 = peg$parsePropertyName();
if (s6 !== peg$FAILED) {
s4 = [s4, s5, s6];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 46) {
s4 = peg$c46;
peg$currPos++;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c47); }
}
if (s4 !== peg$FAILED) {
s5 = peg$parse_();
if (s5 !== peg$FAILED) {
s6 = peg$parsePropertyName();
if (s6 !== peg$FAILED) {
s4 = [s4, s5, s6];
s3 = s4;
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
} else {
peg$currPos = s3;
s3 = peg$FAILED;
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parsePropertyName() {
var s0;
s0 = peg$parseName();
if (s0 === peg$FAILED) {
s0 = peg$parseNumber();
}
return s0;
}
function peg$parseSource() {
var s0;
s0 = peg$parseHeaderReference();
if (s0 === peg$FAILED) {
s0 = peg$parseQueryReference();
if (s0 === peg$FAILED) {
s0 = peg$parsePathReference();
if (s0 === peg$FAILED) {
s0 = peg$parseBodyReference();
}
}
}
return s0;
}
function peg$parseHeaderReference() {
var s0, s1, s2;
s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c50) {
s1 = peg$c50;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c51); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseToken();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseQueryReference() {
var s0, s1, s2;
s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c52) {
s1 = peg$c52;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c53); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseName();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parsePathReference() {
var s0, s1, s2;
s0 = peg$currPos;
if (input.substr(peg$currPos, 5) === peg$c54) {
s1 = peg$c54;
peg$currPos += 5;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parseName();
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseBodyReference() {
var s0, s1, s2;
s0 = peg$currPos;
if (input.substr(peg$currPos, 4) === peg$c56) {
s1 = peg$c56;
peg$currPos += 4;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parsejsonPointer();
if (s2 === peg$FAILED) {
s2 = null;
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parsejsonPointer() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 35) {
s1 = peg$c58;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c59); }
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseJsonPathSegment();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseJsonPathSegment();
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseJsonPathSegment() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 47) {
s1 = peg$c60;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c61); }
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parseUnescaped();
if (s3 === peg$FAILED) {
s3 = peg$parseEscaped();
}
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parseUnescaped();
if (s3 === peg$FAILED) {
s3 = peg$parseEscaped();
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseUnescaped() {
var s0;
if (peg$c62.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c63); }
}
return s0;
}
function peg$parseEscaped() {
var s0, s1, s2;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 126) {
s1 = peg$c64;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c65); }
}
if (s1 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 48) {
s2 = peg$c66;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c67); }
}
if (s2 === peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 49) {
s2 = peg$c68;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseName() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (peg$c70.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c71); }
}
if (s1 !== peg$FAILED) {
s2 = [];
if (peg$c72.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c73); }
}
while (s3 !== peg$FAILED) {
s2.push(s3);
if (peg$c72.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c73); }
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseToken() {
var s0, s1;
s0 = [];
if (peg$c74.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c75); }
}
if (s1 !== peg$FAILED) {
while (s1 !== peg$FAILED) {
s0.push(s1);
if (peg$c74.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c75); }
}
}
} else {
s0 = peg$FAILED;
}
return s0;
}
function peg$parseValue() {
var s0;
s0 = peg$parseArray();
if (s0 === peg$FAILED) {
s0 = peg$parseNumber();
if (s0 === peg$FAILED) {
s0 = peg$parseString();
if (s0 === peg$FAILED) {
s0 = peg$parseBoolean();
if (s0 === peg$FAILED) {
s0 = peg$parseNull();
if (s0 === peg$FAILED) {
s0 = peg$parseUndefined();
}
}
}
}
}
return s0;
}
function peg$parseArray() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 91) {
s1 = peg$c76;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c77); }
}
if (s1 !== peg$FAILED) {
s2 = peg$parse_();
if (s2 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 93) {
s3 = peg$c78;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c79); }
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseNumber() {
var s0, s1, s2, s3, s4;
s0 = peg$currPos;
s1 = peg$parseInteger();
if (s1 !== peg$FAILED) {
s2 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 46) {
s3 = peg$c46;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c47); }
}
if (s3 !== peg$FAILED) {
s4 = peg$parseDigits();
if (s4 !== peg$FAILED) {
s3 = [s3, s4];
s2 = s3;
} else {
peg$currPos = s2;
s2 = peg$FAILED;
}
} else {
peg$currPos = s2;
s2 = peg$FAILED;
}
if (s2 === peg$FAILED) {
s2 = null;
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseInteger() {
var s0, s1, s2, s3;
if (input.charCodeAt(peg$currPos) === 48) {
s0 = peg$c66;
peg$currPos++;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c67); }
}
if (s0 === peg$FAILED) {
s0 = peg$currPos;
if (peg$c80.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c81); }
}
if (s1 !== peg$FAILED) {
s2 = [];
if (peg$c82.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c83); }
}
while (s3 !== peg$FAILED) {
s2.push(s3);
if (peg$c82.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c83); }
}
}
if (s2 !== peg$FAILED) {
s1 = [s1, s2];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
}
return s0;
}
function peg$parseDigits() {
var s0, s1;
s0 = [];
if (peg$c82.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c83); }
}
if (s1 !== peg$FAILED) {
while (s1 !== peg$FAILED) {
s0.push(s1);
if (peg$c82.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c83); }
}
}
} else {
s0 = peg$FAILED;
}
return s0;
}
function peg$parseString() {
var s0;
s0 = peg$parseDoubleQuotedString();
if (s0 === peg$FAILED) {
s0 = peg$parseSingleQuotedString();
}
return s0;
}
function peg$parseDoubleQuotedString() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 34) {
s1 = peg$c84;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c85); }
}
if (s1 !== peg$FAILED) {
s2 = [];
if (peg$c86.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c87); }
}
while (s3 !== peg$FAILED) {
s2.push(s3);
if (peg$c86.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c87); }
}
}
if (s2 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 34) {
s3 = peg$c84;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c85); }
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseSingleQuotedString() {
var s0, s1, s2, s3;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 39) {
s1 = peg$c88;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c89); }
}
if (s1 !== peg$FAILED) {
s2 = [];
if (peg$c90.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c91); }
}
while (s3 !== peg$FAILED) {
s2.push(s3);
if (peg$c90.test(input.charAt(peg$currPos))) {
s3 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c91); }
}
}
if (s2 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 39) {
s3 = peg$c88;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c89); }
}
if (s3 !== peg$FAILED) {
s1 = [s1, s2, s3];
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
} else {
peg$currPos = s0;
s0 = peg$FAILED;
}
return s0;
}
function peg$parseBoolean() {
var s0;
if (input.substr(peg$currPos, 4) === peg$c92) {
s0 = peg$c92;
peg$currPos += 4;
} else {
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c93); }
}
if (s0 === peg$FAILED) {
if (input.substr(peg$currPos, 5) === peg$c94) {
s0 = peg$c94;
peg$currPos += 5;
} else {
s0 = peg$FAILED;