4999 lines
140 KiB
JavaScript
4999 lines
140 KiB
JavaScript
|
|
// @generated by Peggy 5.0.6.
|
||
|
|
//
|
||
|
|
// https://peggyjs.org/
|
||
|
|
|
||
|
|
|
||
|
|
class peg$SyntaxError extends SyntaxError {
|
||
|
|
constructor(message, expected, found, location) {
|
||
|
|
super(message);
|
||
|
|
this.expected = expected;
|
||
|
|
this.found = found;
|
||
|
|
this.location = location;
|
||
|
|
this.name = "SyntaxError";
|
||
|
|
}
|
||
|
|
|
||
|
|
format(sources) {
|
||
|
|
let str = "Error: " + this.message;
|
||
|
|
if (this.location) {
|
||
|
|
let src = null;
|
||
|
|
const st = sources.find(s => s.source === this.location.source);
|
||
|
|
if (st) {
|
||
|
|
src = st.text.split(/\r\n|\n|\r/g);
|
||
|
|
}
|
||
|
|
const s = this.location.start;
|
||
|
|
const offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
|
||
|
|
? this.location.source.offset(s)
|
||
|
|
: s;
|
||
|
|
const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
|
||
|
|
if (src) {
|
||
|
|
const e = this.location.end;
|
||
|
|
const filler = "".padEnd(offset_s.line.toString().length, " ");
|
||
|
|
const line = src[s.line - 1];
|
||
|
|
const last = s.line === e.line ? e.column : line.length + 1;
|
||
|
|
const hatLen = (last - s.column) || 1;
|
||
|
|
str += "\n --> " + loc + "\n"
|
||
|
|
+ filler + " |\n"
|
||
|
|
+ offset_s.line + " | " + line + "\n"
|
||
|
|
+ filler + " | " + "".padEnd(s.column - 1, " ")
|
||
|
|
+ "".padEnd(hatLen, "^");
|
||
|
|
} else {
|
||
|
|
str += "\n at " + loc;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return str;
|
||
|
|
}
|
||
|
|
|
||
|
|
static buildMessage(expected, found) {
|
||
|
|
function hex(ch) {
|
||
|
|
return ch.codePointAt(0).toString(16).toUpperCase();
|
||
|
|
}
|
||
|
|
|
||
|
|
const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode")
|
||
|
|
? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu")
|
||
|
|
: null;
|
||
|
|
function unicodeEscape(s) {
|
||
|
|
if (nonPrintable) {
|
||
|
|
return s.replace(nonPrintable, ch => "\\u{" + hex(ch) + "}");
|
||
|
|
}
|
||
|
|
return s;
|
||
|
|
}
|
||
|
|
|
||
|
|
function literalEscape(s) {
|
||
|
|
return unicodeEscape(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, ch => "\\x0" + hex(ch))
|
||
|
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
|
||
|
|
}
|
||
|
|
|
||
|
|
function classEscape(s) {
|
||
|
|
return unicodeEscape(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, ch => "\\x0" + hex(ch))
|
||
|
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
|
||
|
|
}
|
||
|
|
|
||
|
|
const DESCRIBE_EXPECTATION_FNS = {
|
||
|
|
literal(expectation) {
|
||
|
|
return "\"" + literalEscape(expectation.text) + "\"";
|
||
|
|
},
|
||
|
|
|
||
|
|
class(expectation) {
|
||
|
|
const escapedParts = expectation.parts.map(
|
||
|
|
part => (Array.isArray(part)
|
||
|
|
? classEscape(part[0]) + "-" + classEscape(part[1])
|
||
|
|
: classEscape(part))
|
||
|
|
);
|
||
|
|
|
||
|
|
return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
|
||
|
|
},
|
||
|
|
|
||
|
|
any() {
|
||
|
|
return "any character";
|
||
|
|
},
|
||
|
|
|
||
|
|
end() {
|
||
|
|
return "end of input";
|
||
|
|
},
|
||
|
|
|
||
|
|
other(expectation) {
|
||
|
|
return expectation.description;
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
function describeExpectation(expectation) {
|
||
|
|
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
||
|
|
}
|
||
|
|
|
||
|
|
function describeExpected(expected) {
|
||
|
|
const descriptions = expected.map(describeExpectation);
|
||
|
|
descriptions.sort();
|
||
|
|
|
||
|
|
if (descriptions.length > 0) {
|
||
|
|
let j = 1;
|
||
|
|
for (let i = 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 !== undefined ? options : {};
|
||
|
|
|
||
|
|
const peg$FAILED = {};
|
||
|
|
const peg$source = options.grammarSource;
|
||
|
|
|
||
|
|
const peg$startRuleFunctions = {
|
||
|
|
Program: peg$parseProgram,
|
||
|
|
};
|
||
|
|
let peg$startRuleFunction = peg$parseProgram;
|
||
|
|
|
||
|
|
const peg$c0 = "definition";
|
||
|
|
const peg$c1 = "type";
|
||
|
|
const peg$c2 = "{";
|
||
|
|
const peg$c3 = "}";
|
||
|
|
const peg$c4 = ":";
|
||
|
|
const peg$c5 = "[]";
|
||
|
|
const peg$c6 = "fact";
|
||
|
|
const peg$c7 = "relation";
|
||
|
|
const peg$c8 = "(";
|
||
|
|
const peg$c9 = ")";
|
||
|
|
const peg$c10 = "evidence";
|
||
|
|
const peg$c11 = "!";
|
||
|
|
const peg$c12 = "measure";
|
||
|
|
const peg$c13 = "return";
|
||
|
|
const peg$c14 = "NEVER";
|
||
|
|
const peg$c15 = "ALWAYS";
|
||
|
|
const peg$c16 = "REQUIRES";
|
||
|
|
const peg$c17 = "WHEN";
|
||
|
|
const peg$c18 = "UNLESS";
|
||
|
|
const peg$c19 = "|";
|
||
|
|
const peg$c20 = "fusion";
|
||
|
|
const peg$c21 = ",";
|
||
|
|
const peg$c22 = "*";
|
||
|
|
const peg$c23 = "with";
|
||
|
|
const peg$c24 = "aggregate";
|
||
|
|
const peg$c25 = "USING";
|
||
|
|
const peg$c26 = "PROVIDES";
|
||
|
|
const peg$c27 = "BEHAVES";
|
||
|
|
const peg$c28 = "AS";
|
||
|
|
const peg$c29 = "edge";
|
||
|
|
const peg$c30 = "transitive";
|
||
|
|
const peg$c31 = "hierarchical";
|
||
|
|
const peg$c32 = "symmetrical_graph";
|
||
|
|
const peg$c33 = "symmetrical";
|
||
|
|
const peg$c34 = "limit";
|
||
|
|
const peg$c35 = "decaying";
|
||
|
|
const peg$c36 = "up";
|
||
|
|
const peg$c37 = "down";
|
||
|
|
const peg$c38 = "neutral";
|
||
|
|
const peg$c39 = "stable";
|
||
|
|
const peg$c40 = "hourly";
|
||
|
|
const peg$c41 = "daily";
|
||
|
|
const peg$c42 = "weekly";
|
||
|
|
const peg$c43 = "monthly";
|
||
|
|
const peg$c44 = "blurring";
|
||
|
|
const peg$c45 = "fixed";
|
||
|
|
const peg$c46 = "adaptive";
|
||
|
|
const peg$c47 = "confidence";
|
||
|
|
const peg$c48 = "confidence_90";
|
||
|
|
const peg$c49 = "confidence_95";
|
||
|
|
const peg$c50 = "confidence_99";
|
||
|
|
const peg$c51 = "ttl";
|
||
|
|
const peg$c52 = "CACHE";
|
||
|
|
const peg$c53 = "eager";
|
||
|
|
const peg$c54 = "lazy";
|
||
|
|
const peg$c55 = "||";
|
||
|
|
const peg$c56 = "&&";
|
||
|
|
const peg$c57 = "is";
|
||
|
|
const peg$c58 = "==";
|
||
|
|
const peg$c59 = "!=";
|
||
|
|
const peg$c60 = ">=";
|
||
|
|
const peg$c61 = "<=";
|
||
|
|
const peg$c62 = "within";
|
||
|
|
const peg$c63 = "NOT";
|
||
|
|
const peg$c64 = ".";
|
||
|
|
const peg$c65 = "\"";
|
||
|
|
const peg$c66 = "\\";
|
||
|
|
const peg$c67 = "'";
|
||
|
|
const peg$c68 = "true";
|
||
|
|
const peg$c69 = "false";
|
||
|
|
const peg$c70 = "//";
|
||
|
|
const peg$c71 = "/*";
|
||
|
|
const peg$c72 = "*/";
|
||
|
|
|
||
|
|
const peg$r0 = /^[<>]/;
|
||
|
|
const peg$r1 = /^[+\-]/;
|
||
|
|
const peg$r2 = /^[*\/]/;
|
||
|
|
const peg$r3 = /^["\\]/;
|
||
|
|
const peg$r4 = /^['\\]/;
|
||
|
|
const peg$r5 = /^[0-9]/;
|
||
|
|
const peg$r6 = /^[dhmw]/;
|
||
|
|
const peg$r7 = /^[a-zA-Z_]/;
|
||
|
|
const peg$r8 = /^[a-zA-Z0-9_]/;
|
||
|
|
const peg$r9 = /^[ \t\r\n]/;
|
||
|
|
const peg$r10 = /^[^\r\n]/;
|
||
|
|
|
||
|
|
const peg$e0 = peg$otherExpectation("A type definition");
|
||
|
|
const peg$e1 = peg$literalExpectation("definition", false);
|
||
|
|
const peg$e2 = peg$literalExpectation("type", false);
|
||
|
|
const peg$e3 = peg$literalExpectation("{", false);
|
||
|
|
const peg$e4 = peg$literalExpectation("}", false);
|
||
|
|
const peg$e5 = peg$literalExpectation(":", false);
|
||
|
|
const peg$e6 = peg$literalExpectation("[]", false);
|
||
|
|
const peg$e7 = peg$otherExpectation("A statement of fact (or relation in ADR-000)");
|
||
|
|
const peg$e8 = peg$literalExpectation("fact", false);
|
||
|
|
const peg$e9 = peg$literalExpectation("relation", false);
|
||
|
|
const peg$e10 = peg$literalExpectation("(", false);
|
||
|
|
const peg$e11 = peg$literalExpectation(")", false);
|
||
|
|
const peg$e12 = peg$otherExpectation("An evidence rule");
|
||
|
|
const peg$e13 = peg$literalExpectation("evidence", false);
|
||
|
|
const peg$e14 = peg$literalExpectation("!", false);
|
||
|
|
const peg$e15 = peg$otherExpectation("A derived measurement or value");
|
||
|
|
const peg$e16 = peg$literalExpectation("measure", false);
|
||
|
|
const peg$e17 = peg$literalExpectation("return", false);
|
||
|
|
const peg$e18 = peg$literalExpectation("NEVER", false);
|
||
|
|
const peg$e19 = peg$literalExpectation("ALWAYS", false);
|
||
|
|
const peg$e20 = peg$literalExpectation("REQUIRES", false);
|
||
|
|
const peg$e21 = peg$literalExpectation("WHEN", false);
|
||
|
|
const peg$e22 = peg$literalExpectation("UNLESS", false);
|
||
|
|
const peg$e23 = peg$literalExpectation("|", false);
|
||
|
|
const peg$e24 = peg$literalExpectation("fusion", false);
|
||
|
|
const peg$e25 = peg$literalExpectation(",", false);
|
||
|
|
const peg$e26 = peg$literalExpectation("*", false);
|
||
|
|
const peg$e27 = peg$literalExpectation("with", false);
|
||
|
|
const peg$e28 = peg$literalExpectation("aggregate", false);
|
||
|
|
const peg$e29 = peg$literalExpectation("USING", false);
|
||
|
|
const peg$e30 = peg$literalExpectation("PROVIDES", false);
|
||
|
|
const peg$e31 = peg$literalExpectation("BEHAVES", false);
|
||
|
|
const peg$e32 = peg$literalExpectation("AS", false);
|
||
|
|
const peg$e33 = peg$literalExpectation("edge", false);
|
||
|
|
const peg$e34 = peg$literalExpectation("transitive", false);
|
||
|
|
const peg$e35 = peg$literalExpectation("hierarchical", false);
|
||
|
|
const peg$e36 = peg$literalExpectation("symmetrical_graph", false);
|
||
|
|
const peg$e37 = peg$literalExpectation("symmetrical", false);
|
||
|
|
const peg$e38 = peg$literalExpectation("limit", false);
|
||
|
|
const peg$e39 = peg$literalExpectation("decaying", false);
|
||
|
|
const peg$e40 = peg$literalExpectation("up", false);
|
||
|
|
const peg$e41 = peg$literalExpectation("down", false);
|
||
|
|
const peg$e42 = peg$literalExpectation("neutral", false);
|
||
|
|
const peg$e43 = peg$literalExpectation("stable", false);
|
||
|
|
const peg$e44 = peg$literalExpectation("hourly", false);
|
||
|
|
const peg$e45 = peg$literalExpectation("daily", false);
|
||
|
|
const peg$e46 = peg$literalExpectation("weekly", false);
|
||
|
|
const peg$e47 = peg$literalExpectation("monthly", false);
|
||
|
|
const peg$e48 = peg$literalExpectation("blurring", false);
|
||
|
|
const peg$e49 = peg$literalExpectation("fixed", false);
|
||
|
|
const peg$e50 = peg$literalExpectation("adaptive", false);
|
||
|
|
const peg$e51 = peg$literalExpectation("confidence", false);
|
||
|
|
const peg$e52 = peg$literalExpectation("confidence_90", false);
|
||
|
|
const peg$e53 = peg$literalExpectation("confidence_95", false);
|
||
|
|
const peg$e54 = peg$literalExpectation("confidence_99", false);
|
||
|
|
const peg$e55 = peg$literalExpectation("ttl", false);
|
||
|
|
const peg$e56 = peg$literalExpectation("CACHE", false);
|
||
|
|
const peg$e57 = peg$literalExpectation("eager", false);
|
||
|
|
const peg$e58 = peg$literalExpectation("lazy", false);
|
||
|
|
const peg$e59 = peg$literalExpectation("||", false);
|
||
|
|
const peg$e60 = peg$literalExpectation("&&", false);
|
||
|
|
const peg$e61 = peg$literalExpectation("is", false);
|
||
|
|
const peg$e62 = peg$literalExpectation("==", false);
|
||
|
|
const peg$e63 = peg$literalExpectation("!=", false);
|
||
|
|
const peg$e64 = peg$literalExpectation(">=", false);
|
||
|
|
const peg$e65 = peg$literalExpectation("<=", false);
|
||
|
|
const peg$e66 = peg$classExpectation(["<", ">"], false, false, false);
|
||
|
|
const peg$e67 = peg$literalExpectation("within", false);
|
||
|
|
const peg$e68 = peg$classExpectation(["+", "-"], false, false, false);
|
||
|
|
const peg$e69 = peg$classExpectation(["*", "/"], false, false, false);
|
||
|
|
const peg$e70 = peg$literalExpectation("NOT", false);
|
||
|
|
const peg$e71 = peg$literalExpectation(".", false);
|
||
|
|
const peg$e72 = peg$otherExpectation("The non-recursive base for an expression chain");
|
||
|
|
const peg$e73 = peg$otherExpectation("A string literal");
|
||
|
|
const peg$e74 = peg$literalExpectation("\"", false);
|
||
|
|
const peg$e75 = peg$classExpectation(["\"", "\\"], false, false, false);
|
||
|
|
const peg$e76 = peg$anyExpectation();
|
||
|
|
const peg$e77 = peg$literalExpectation("\\", false);
|
||
|
|
const peg$e78 = peg$literalExpectation("'", false);
|
||
|
|
const peg$e79 = peg$classExpectation(["'", "\\"], false, false, false);
|
||
|
|
const peg$e80 = peg$otherExpectation("A floating-point number");
|
||
|
|
const peg$e81 = peg$classExpectation([["0", "9"]], false, false, false);
|
||
|
|
const peg$e82 = peg$otherExpectation("An integer");
|
||
|
|
const peg$e83 = peg$otherExpectation("A boolean literal");
|
||
|
|
const peg$e84 = peg$literalExpectation("true", false);
|
||
|
|
const peg$e85 = peg$literalExpectation("false", false);
|
||
|
|
const peg$e86 = peg$otherExpectation("A time duration literal");
|
||
|
|
const peg$e87 = peg$classExpectation(["d", "h", "m", "w"], false, false, false);
|
||
|
|
const peg$e88 = peg$classExpectation([["a", "z"], ["A", "Z"], "_"], false, false, false);
|
||
|
|
const peg$e89 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_"], false, false, false);
|
||
|
|
const peg$e90 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false, false);
|
||
|
|
const peg$e91 = peg$literalExpectation("//", false);
|
||
|
|
const peg$e92 = peg$classExpectation(["\r", "\n"], true, false, false);
|
||
|
|
const peg$e93 = peg$literalExpectation("/*", false);
|
||
|
|
const peg$e94 = peg$literalExpectation("*/", false);
|
||
|
|
|
||
|
|
function peg$f0(statements) {
|
||
|
|
const allStatements = statements.map(s => s[0]);
|
||
|
|
return {
|
||
|
|
type: "Program",
|
||
|
|
body: allStatements,
|
||
|
|
definitions: allStatements.filter(s => s.type === "Definition"),
|
||
|
|
facts: allStatements.filter(s => s.type === "Fact"),
|
||
|
|
evidence: allStatements.filter(s => s.type === "Evidence"),
|
||
|
|
measures: allStatements.filter(s => s.type === "Measure")
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f1(name, fields) {
|
||
|
|
return { type: "Definition", name, fields: fields.map(f => f[0]) };
|
||
|
|
}
|
||
|
|
function peg$f2(name, fieldType, isArray, behavior, cache) {
|
||
|
|
return {
|
||
|
|
type: "Field",
|
||
|
|
name,
|
||
|
|
fieldType,
|
||
|
|
isArray: !!isArray,
|
||
|
|
behavior: behavior || null,
|
||
|
|
cache: cache || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f3(name, params, behavior, properties, cache, limit) {
|
||
|
|
return {
|
||
|
|
type: "Fact",
|
||
|
|
name,
|
||
|
|
params: params || [],
|
||
|
|
behavior: behavior || null,
|
||
|
|
properties: properties.map(p => p[0]),
|
||
|
|
cache: cache || null,
|
||
|
|
limit: limit || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f4(bang, name, params, limit, body, provides) {
|
||
|
|
return {
|
||
|
|
type: "Evidence",
|
||
|
|
name,
|
||
|
|
params: params || [],
|
||
|
|
limit: limit || null,
|
||
|
|
body,
|
||
|
|
provides: provides || null,
|
||
|
|
challenge: !!bang
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f5(name, params, body, provides) {
|
||
|
|
return {
|
||
|
|
type: "Measure",
|
||
|
|
name,
|
||
|
|
params: params || [],
|
||
|
|
body,
|
||
|
|
provides: provides || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f6(statements) {
|
||
|
|
return { type: "EvidenceBody", statements: statements.map(s => s[0]) };
|
||
|
|
}
|
||
|
|
function peg$f7(statements, returnStmt) {
|
||
|
|
return {
|
||
|
|
type: "MeasureBody",
|
||
|
|
statements: statements.map(s => s[0]),
|
||
|
|
returnStatement: returnStmt || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f8(expression) {
|
||
|
|
return { type: "ReturnStatement", expression };
|
||
|
|
}
|
||
|
|
function peg$f9(type, condition) {
|
||
|
|
return { type: "DefeasibleLogic", logicType: type, condition };
|
||
|
|
}
|
||
|
|
function peg$f10(condition, defeater) {
|
||
|
|
return { type: "DefeasibleLogic", logicType: "WHEN", condition, defeater };
|
||
|
|
}
|
||
|
|
function peg$f11(condition) {
|
||
|
|
return { type: "DefeasibleLogic", logicType: "WHEN", condition };
|
||
|
|
}
|
||
|
|
function peg$f12(predicate, binding, body, limit, withClause) {
|
||
|
|
return {
|
||
|
|
type: "PatternMatch",
|
||
|
|
predicate,
|
||
|
|
binding: binding || null,
|
||
|
|
limit: limit || null,
|
||
|
|
body,
|
||
|
|
withClause: withClause || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f13(measure, variable, fusionStrategy, body, limit) {
|
||
|
|
return {
|
||
|
|
type: "CollectionProcessing",
|
||
|
|
measure,
|
||
|
|
variable,
|
||
|
|
fusion: fusionStrategy ? { strategy: fusionStrategy[1] } : null,
|
||
|
|
body,
|
||
|
|
limit: limit || null
|
||
|
|
};
|
||
|
|
}
|
||
|
|
function peg$f14(name, args) {
|
||
|
|
return { type: "Predicate", name, args: args || [] };
|
||
|
|
}
|
||
|
|
function peg$f15(head, tail) {
|
||
|
|
return [head, ...tail.map(t => t[3])];
|
||
|
|
}
|
||
|
|
function peg$f16(name) { return { type: "Wildcard", name }; }
|
||
|
|
function peg$f17(name) { return name; }
|
||
|
|
function peg$f18(condition) { return condition; }
|
||
|
|
function peg$f19(strategy, expressions) {
|
||
|
|
return { type: "Fusion", strategy, expressions };
|
||
|
|
}
|
||
|
|
function peg$f20(expressions, using) {
|
||
|
|
return { type: "Aggregation", expressions, using: using || null };
|
||
|
|
}
|
||
|
|
function peg$f21(method) { return method; }
|
||
|
|
function peg$f22(name) { return { type: "TypeName", name }; }
|
||
|
|
function peg$f23(literal) { return { type: "TypeName", name: literal.value }; }
|
||
|
|
function peg$f24(head, tail) {
|
||
|
|
return [head, ...tail.map(t => t[3])];
|
||
|
|
}
|
||
|
|
function peg$f25(name, paramType, isArray) {
|
||
|
|
return { type: "Parameter", name, paramType, isArray: !!isArray };
|
||
|
|
}
|
||
|
|
function peg$f26(providesType) { return providesType; }
|
||
|
|
function peg$f27(behavior) {
|
||
|
|
return { type: "BehaviorAnnotation", behavior };
|
||
|
|
}
|
||
|
|
function peg$f28() { return "transitive"; }
|
||
|
|
function peg$f29() { return "symmetrical"; }
|
||
|
|
function peg$f30(value) { return value; }
|
||
|
|
function peg$f31(b) { return b; }
|
||
|
|
function peg$f32(direction, period) {
|
||
|
|
return { type: "Behavior", behaviorType: "decay", direction, period };
|
||
|
|
}
|
||
|
|
function peg$f33(mode, confidence) {
|
||
|
|
return { type: "Behavior", behaviorType: "blur", mode, confidence: confidence ? confidence[1] : null };
|
||
|
|
}
|
||
|
|
function peg$f34(duration) {
|
||
|
|
return { type: "Behavior", behaviorType: "ttl", duration };
|
||
|
|
}
|
||
|
|
function peg$f35(directive) { return directive; }
|
||
|
|
function peg$f36(head, tail) { return buildLeftAssoc(head, tail); }
|
||
|
|
function peg$f37(head, tail) { return buildLeftAssoc(head, tail); }
|
||
|
|
function peg$f38(head, typeName) {
|
||
|
|
return { type: "BinaryExpression", operator: "is", left: head, right: typeName };
|
||
|
|
}
|
||
|
|
function peg$f39(head, tail) { return buildLeftAssoc(head, tail); }
|
||
|
|
function peg$f40(head, right) {
|
||
|
|
return { type: "BinaryExpression", operator: "within", left: head, right };
|
||
|
|
}
|
||
|
|
function peg$f41(head, tail) { return buildLeftAssoc(head, tail); }
|
||
|
|
function peg$f42(head, tail) { return buildLeftAssoc(head, tail); }
|
||
|
|
function peg$f43(operator, operand) { return { type: "UnaryExpression", operator: "NOT", operand }; }
|
||
|
|
function peg$f44(primary, binding) {
|
||
|
|
if (binding) {
|
||
|
|
return { type: "BindingAccess", expression: primary, binding };
|
||
|
|
}
|
||
|
|
return primary;
|
||
|
|
}
|
||
|
|
function peg$f45(head, tail) {
|
||
|
|
return tail.reduce((obj, part) => {
|
||
|
|
return {
|
||
|
|
type: "AttributeAccess",
|
||
|
|
object: obj,
|
||
|
|
attribute: part[3], // The Identifier is the 4th element (index 3)
|
||
|
|
location: location()
|
||
|
|
};
|
||
|
|
}, head);
|
||
|
|
}
|
||
|
|
function peg$f46(expr) { return expr; }
|
||
|
|
function peg$f47(name, args) {
|
||
|
|
return { type: "PredicateCall", name, args: args || [], challenge: true };
|
||
|
|
}
|
||
|
|
function peg$f48(name, args) {
|
||
|
|
return { type: "PredicateCall", name, args: args || [] };
|
||
|
|
}
|
||
|
|
function peg$f49(name) { return { type: "Variable", name }; }
|
||
|
|
function peg$f50(head, tail) {
|
||
|
|
return [head, ...tail.map(t => t[3])];
|
||
|
|
}
|
||
|
|
function peg$f51(head, tail) {
|
||
|
|
return [head, ...tail.map(t => t[3])];
|
||
|
|
}
|
||
|
|
function peg$f52(chars) {
|
||
|
|
return { type: "Literal", value: JSON.parse(text()) };
|
||
|
|
}
|
||
|
|
function peg$f53(chars) {
|
||
|
|
return { type: "Literal", value: JSON.parse("\"" + chars.map(c => c[0] === '\\' ? c[1] : c[1]).join('') + "\"") };
|
||
|
|
}
|
||
|
|
function peg$f54(value) { return { type: "Literal", value: parseFloat(text()) }; }
|
||
|
|
function peg$f55(value) { return { type: "Literal", value: parseInt(text(), 10) }; }
|
||
|
|
function peg$f56(value) { return { type: "Literal", value: value === "true" }; }
|
||
|
|
function peg$f57(value) { return { type: "Literal", value: text(), unit: text().slice(-1) }; }
|
||
|
|
function peg$f58(name) { return name; }
|
||
|
|
let peg$currPos = options.peg$currPos | 0;
|
||
|
|
let peg$savedPos = peg$currPos;
|
||
|
|
const peg$posDetailsCache = [{ line: 1, column: 1 }];
|
||
|
|
let peg$maxFailPos = peg$currPos;
|
||
|
|
let peg$maxFailExpected = options.peg$maxFailExpected || [];
|
||
|
|
let peg$silentFails = options.peg$silentFails | 0;
|
||
|
|
|
||
|
|
let peg$result;
|
||
|
|
|
||
|
|
if (options.startRule) {
|
||
|
|
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 offset() {
|
||
|
|
return peg$savedPos;
|
||
|
|
}
|
||
|
|
|
||
|
|
function range() {
|
||
|
|
return {
|
||
|
|
source: peg$source,
|
||
|
|
start: peg$savedPos,
|
||
|
|
end: peg$currPos,
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
function location() {
|
||
|
|
return peg$computeLocation(peg$savedPos, peg$currPos);
|
||
|
|
}
|
||
|
|
|
||
|
|
function expected(description, location) {
|
||
|
|
location = location !== undefined
|
||
|
|
? 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 !== undefined
|
||
|
|
? location
|
||
|
|
: peg$computeLocation(peg$savedPos, peg$currPos);
|
||
|
|
|
||
|
|
throw peg$buildSimpleError(message, location);
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$getUnicode(pos = peg$currPos) {
|
||
|
|
const cp = input.codePointAt(pos);
|
||
|
|
if (cp === undefined) {
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
return String.fromCodePoint(cp);
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$literalExpectation(text, ignoreCase) {
|
||
|
|
return { type: "literal", text, ignoreCase };
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
|
||
|
|
return { type: "class", parts, inverted, ignoreCase, unicode };
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$anyExpectation() {
|
||
|
|
return { type: "any" };
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$endExpectation() {
|
||
|
|
return { type: "end" };
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$otherExpectation(description) {
|
||
|
|
return { type: "other", description };
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$computePosDetails(pos) {
|
||
|
|
let details = peg$posDetailsCache[pos];
|
||
|
|
let p;
|
||
|
|
|
||
|
|
if (details) {
|
||
|
|
return details;
|
||
|
|
} else {
|
||
|
|
if (pos >= peg$posDetailsCache.length) {
|
||
|
|
p = peg$posDetailsCache.length - 1;
|
||
|
|
} else {
|
||
|
|
p = pos;
|
||
|
|
while (!peg$posDetailsCache[--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, offset) {
|
||
|
|
const startPosDetails = peg$computePosDetails(startPos);
|
||
|
|
const endPosDetails = peg$computePosDetails(endPos);
|
||
|
|
|
||
|
|
const res = {
|
||
|
|
source: peg$source,
|
||
|
|
start: {
|
||
|
|
offset: startPos,
|
||
|
|
line: startPosDetails.line,
|
||
|
|
column: startPosDetails.column,
|
||
|
|
},
|
||
|
|
end: {
|
||
|
|
offset: endPos,
|
||
|
|
line: endPosDetails.line,
|
||
|
|
column: endPosDetails.column,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
if (offset && peg$source && (typeof peg$source.offset === "function")) {
|
||
|
|
res.start = peg$source.offset(res.start);
|
||
|
|
res.end = peg$source.offset(res.end);
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|
||
|
|
|
||
|
|
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$parseProgram() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parse_();
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parseStatement();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parse_();
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parseStatement();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parse_();
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
s3 = peg$parse_();
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f0(s2);
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseStatement() {
|
||
|
|
let s0;
|
||
|
|
|
||
|
|
s0 = peg$parseDefinition();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseFact();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseEvidence();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseMeasure();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseDefinition() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 10) === peg$c0) {
|
||
|
|
s1 = peg$c0;
|
||
|
|
peg$currPos += 10;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e1); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c1) {
|
||
|
|
s1 = peg$c1;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e2); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s5 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = [];
|
||
|
|
s8 = peg$currPos;
|
||
|
|
s9 = peg$parseField();
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
s10 = peg$parse_();
|
||
|
|
s9 = [s9, s10];
|
||
|
|
s8 = s9;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s8;
|
||
|
|
s8 = peg$FAILED;
|
||
|
|
}
|
||
|
|
while (s8 !== peg$FAILED) {
|
||
|
|
s7.push(s8);
|
||
|
|
s8 = peg$currPos;
|
||
|
|
s9 = peg$parseField();
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
s10 = peg$parse_();
|
||
|
|
s9 = [s9, s10];
|
||
|
|
s8 = s9;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s8;
|
||
|
|
s8 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s8 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s8 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s8 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f1(s3, s7);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e0); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseField() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
|
s3 = peg$c4;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e5); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parseIdentifier();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c5) {
|
||
|
|
s7 = peg$c5;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e6); }
|
||
|
|
}
|
||
|
|
if (s7 === peg$FAILED) {
|
||
|
|
s7 = null;
|
||
|
|
}
|
||
|
|
s8 = peg$parse_();
|
||
|
|
s9 = peg$parseBehavior();
|
||
|
|
if (s9 === peg$FAILED) {
|
||
|
|
s9 = null;
|
||
|
|
}
|
||
|
|
s10 = peg$parse_();
|
||
|
|
s11 = peg$parseCacheDirective();
|
||
|
|
if (s11 === peg$FAILED) {
|
||
|
|
s11 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f2(s1, s5, s7, s9, s11);
|
||
|
|
} 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$parseFact() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c6) {
|
||
|
|
s1 = peg$c6;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e8); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c7) {
|
||
|
|
s1 = peg$c7;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e9); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s5 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseParameterList();
|
||
|
|
if (s7 === peg$FAILED) {
|
||
|
|
s7 = null;
|
||
|
|
}
|
||
|
|
s8 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s9 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
s10 = peg$parse_();
|
||
|
|
s11 = peg$parseBehaviorAnnotation();
|
||
|
|
if (s11 === peg$FAILED) {
|
||
|
|
s11 = null;
|
||
|
|
}
|
||
|
|
s12 = peg$parse_();
|
||
|
|
s13 = [];
|
||
|
|
s14 = peg$currPos;
|
||
|
|
s15 = peg$parseFactProperty();
|
||
|
|
if (s15 !== peg$FAILED) {
|
||
|
|
s16 = peg$parse_();
|
||
|
|
s15 = [s15, s16];
|
||
|
|
s14 = s15;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s14;
|
||
|
|
s14 = peg$FAILED;
|
||
|
|
}
|
||
|
|
while (s14 !== peg$FAILED) {
|
||
|
|
s13.push(s14);
|
||
|
|
s14 = peg$currPos;
|
||
|
|
s15 = peg$parseFactProperty();
|
||
|
|
if (s15 !== peg$FAILED) {
|
||
|
|
s16 = peg$parse_();
|
||
|
|
s15 = [s15, s16];
|
||
|
|
s14 = s15;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s14;
|
||
|
|
s14 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
s14 = peg$parseCacheDirective();
|
||
|
|
if (s14 === peg$FAILED) {
|
||
|
|
s14 = null;
|
||
|
|
}
|
||
|
|
s15 = peg$parse_();
|
||
|
|
s16 = peg$parseLimit();
|
||
|
|
if (s16 === peg$FAILED) {
|
||
|
|
s16 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f3(s3, s7, s11, s13, s14, s16);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e7); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseEvidence() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c10) {
|
||
|
|
s1 = peg$c10;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e13); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
||
|
|
s3 = peg$c11;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e14); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
s3 = null;
|
||
|
|
}
|
||
|
|
s4 = peg$parseIdentifier();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s6 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s6 !== peg$FAILED) {
|
||
|
|
s7 = peg$parse_();
|
||
|
|
s8 = peg$parseParameterList();
|
||
|
|
if (s8 === peg$FAILED) {
|
||
|
|
s8 = null;
|
||
|
|
}
|
||
|
|
s9 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s10 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s10 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s10 !== peg$FAILED) {
|
||
|
|
s11 = peg$parse_();
|
||
|
|
s12 = peg$parseLimit();
|
||
|
|
if (s12 === peg$FAILED) {
|
||
|
|
s12 = null;
|
||
|
|
}
|
||
|
|
s13 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s14 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s14 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s14 !== peg$FAILED) {
|
||
|
|
s15 = peg$parse_();
|
||
|
|
s16 = peg$parseEvidenceBody();
|
||
|
|
s17 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s18 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s18 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s18 !== peg$FAILED) {
|
||
|
|
s19 = peg$parse_();
|
||
|
|
s20 = peg$parseProvides();
|
||
|
|
if (s20 === peg$FAILED) {
|
||
|
|
s20 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f4(s3, s4, s8, s12, s16, s20);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e12); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseMeasure() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c12) {
|
||
|
|
s1 = peg$c12;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e16); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s5 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseParameterList();
|
||
|
|
if (s7 === peg$FAILED) {
|
||
|
|
s7 = null;
|
||
|
|
}
|
||
|
|
s8 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s9 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
s10 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s11 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s11 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s11 !== peg$FAILED) {
|
||
|
|
s12 = peg$parse_();
|
||
|
|
s13 = peg$parseMeasureBody();
|
||
|
|
s14 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s15 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s15 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s15 !== peg$FAILED) {
|
||
|
|
s16 = peg$parse_();
|
||
|
|
s17 = peg$parseProvides();
|
||
|
|
if (s17 === peg$FAILED) {
|
||
|
|
s17 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f5(s3, s7, s13, s17);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e15); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseEvidenceBody() {
|
||
|
|
let s0, s1, s2, s3, s4;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = [];
|
||
|
|
s2 = peg$currPos;
|
||
|
|
s3 = peg$parseEvidenceStatement();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s3 = [s3, s4];
|
||
|
|
s2 = s3;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s2;
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
while (s2 !== peg$FAILED) {
|
||
|
|
s1.push(s2);
|
||
|
|
s2 = peg$currPos;
|
||
|
|
s3 = peg$parseEvidenceStatement();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s3 = [s3, s4];
|
||
|
|
s2 = s3;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s2;
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f6(s1);
|
||
|
|
s0 = s1;
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseEvidenceStatement() {
|
||
|
|
let s0;
|
||
|
|
|
||
|
|
s0 = peg$parseDefeasibleLogic();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseFusion();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseCollectionProcessing();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parsePatternMatch();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseLogicalOr();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseMeasureBody() {
|
||
|
|
let s0, s1, s2, s3, s4;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = [];
|
||
|
|
s2 = peg$currPos;
|
||
|
|
s3 = peg$parseMeasureStatement();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s3 = [s3, s4];
|
||
|
|
s2 = s3;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s2;
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
while (s2 !== peg$FAILED) {
|
||
|
|
s1.push(s2);
|
||
|
|
s2 = peg$currPos;
|
||
|
|
s3 = peg$parseMeasureStatement();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s3 = [s3, s4];
|
||
|
|
s2 = s3;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s2;
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
s2 = peg$parseReturnStatement();
|
||
|
|
if (s2 === peg$FAILED) {
|
||
|
|
s2 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f7(s1, s2);
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseMeasureStatement() {
|
||
|
|
let s0;
|
||
|
|
|
||
|
|
s0 = peg$parseFusion();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseAggregation();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parsePatternMatch();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseLogicalOr();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseReturnStatement() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c13) {
|
||
|
|
s1 = peg$c13;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e17); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f8(s3);
|
||
|
|
} 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$parseDefeasibleLogic() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c14) {
|
||
|
|
s1 = peg$c14;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e18); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c15) {
|
||
|
|
s1 = peg$c15;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e19); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c16) {
|
||
|
|
s1 = peg$c16;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e20); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f9(s1, s3);
|
||
|
|
} 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.substr(peg$currPos, 4) === peg$c17) {
|
||
|
|
s1 = peg$c17;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e21); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c18) {
|
||
|
|
s5 = peg$c18;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e22); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse__();
|
||
|
|
if (s6 !== peg$FAILED) {
|
||
|
|
s7 = peg$parseLogicalOr();
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f10(s3, s7);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c17) {
|
||
|
|
s1 = peg$c17;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e21); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f11(s3);
|
||
|
|
} 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$parsePatternMatch() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parsePatternPredicate();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
s3 = peg$parseBindingClause();
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
s3 = null;
|
||
|
|
}
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s5 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseEvidenceBody();
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
s8 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s9 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
s10 = peg$parse_();
|
||
|
|
s11 = peg$parseLimit();
|
||
|
|
if (s11 === peg$FAILED) {
|
||
|
|
s11 = null;
|
||
|
|
}
|
||
|
|
s12 = peg$parse_();
|
||
|
|
s13 = peg$parseWithClause();
|
||
|
|
if (s13 === peg$FAILED) {
|
||
|
|
s13 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f12(s1, s3, s7, s11, s13);
|
||
|
|
} 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$parseCollectionProcessing() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseLogicalOr();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 124) {
|
||
|
|
s3 = peg$c19;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e23); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parseIdentifier();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 124) {
|
||
|
|
s7 = peg$c19;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e23); }
|
||
|
|
}
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
s8 = peg$parse_();
|
||
|
|
s9 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c20) {
|
||
|
|
s10 = peg$c20;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s10 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e24); }
|
||
|
|
}
|
||
|
|
if (s10 !== peg$FAILED) {
|
||
|
|
s11 = peg$parse__();
|
||
|
|
if (s11 !== peg$FAILED) {
|
||
|
|
s12 = peg$parseIdentifier();
|
||
|
|
if (s12 !== peg$FAILED) {
|
||
|
|
s10 = [s10, s11, s12];
|
||
|
|
s9 = s10;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s9;
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s9;
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s9;
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s9 === peg$FAILED) {
|
||
|
|
s9 = null;
|
||
|
|
}
|
||
|
|
s10 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s11 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s11 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s11 !== peg$FAILED) {
|
||
|
|
s12 = peg$parse_();
|
||
|
|
s13 = peg$parseEvidenceBody();
|
||
|
|
if (s13 !== peg$FAILED) {
|
||
|
|
s14 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s15 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s15 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s15 !== peg$FAILED) {
|
||
|
|
s16 = peg$parse_();
|
||
|
|
s17 = peg$parseLimit();
|
||
|
|
if (s17 === peg$FAILED) {
|
||
|
|
s17 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f13(s1, s5, s9, s13, s17);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parsePatternPredicate() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s3 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parsePatternArgumentList();
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s5 = null;
|
||
|
|
}
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s7 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f14(s1, s5);
|
||
|
|
} 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$parsePatternArgumentList() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parsePatternArgument();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parsePatternArgument();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parsePatternArgument();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f15(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parsePatternArgument() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 42) {
|
||
|
|
s1 = peg$c22;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e26); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f16(s3);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseLogicalOr();
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseBindingClause() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 124) {
|
||
|
|
s1 = peg$c19;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e23); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 124) {
|
||
|
|
s5 = peg$c19;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e23); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f17(s3);
|
||
|
|
} 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$parseWithClause() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c23) {
|
||
|
|
s1 = peg$c23;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e27); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f18(s3);
|
||
|
|
} 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$parseFusion() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c20) {
|
||
|
|
s1 = peg$c20;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e24); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s5 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseExpressionList();
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
s8 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s9 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s9 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s9 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f19(s3, s7);
|
||
|
|
} 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;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseAggregation() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 9) === peg$c24) {
|
||
|
|
s1 = peg$c24;
|
||
|
|
peg$currPos += 9;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e28); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s3 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parseExpressionList();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s7 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
s8 = peg$parse_();
|
||
|
|
s9 = peg$parseUsing();
|
||
|
|
if (s9 === peg$FAILED) {
|
||
|
|
s9 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f20(s5, s9);
|
||
|
|
} 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$parseUsing() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c25) {
|
||
|
|
s1 = peg$c25;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e29); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f21(s3);
|
||
|
|
} 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$parseTypeName() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f22(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseString();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f23(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseParameterList() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseParameter();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseParameter();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseParameter();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f24(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseParameter() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
|
s3 = peg$c4;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e5); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parseIdentifier();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c5) {
|
||
|
|
s7 = peg$c5;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e6); }
|
||
|
|
}
|
||
|
|
if (s7 === peg$FAILED) {
|
||
|
|
s7 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f25(s1, s5, s7);
|
||
|
|
} 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$parseProvides() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c26) {
|
||
|
|
s1 = peg$c26;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e30); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseIdentifier();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f26(s3);
|
||
|
|
} 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$parseBehaviorAnnotation() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c27) {
|
||
|
|
s1 = peg$c27;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e31); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c28) {
|
||
|
|
s3 = peg$c28;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e32); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c29) {
|
||
|
|
s5 = peg$c29;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e33); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 10) === peg$c30) {
|
||
|
|
s5 = peg$c30;
|
||
|
|
peg$currPos += 10;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e34); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 12) === peg$c31) {
|
||
|
|
s5 = peg$c31;
|
||
|
|
peg$currPos += 12;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e35); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 17) === peg$c32) {
|
||
|
|
s5 = peg$c32;
|
||
|
|
peg$currPos += 17;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e36); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f27(s5);
|
||
|
|
} 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$parseFactProperty() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
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$e34); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f28();
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 11) === peg$c33) {
|
||
|
|
s1 = peg$c33;
|
||
|
|
peg$currPos += 11;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e37); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f29();
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseLimit() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c34) {
|
||
|
|
s1 = peg$c34;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e38); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseInteger();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f30(s3);
|
||
|
|
} 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$parseBehavior() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c27) {
|
||
|
|
s1 = peg$c27;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e31); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
|
s3 = peg$c2;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e3); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = peg$parseDecayBehavior();
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s5 = peg$parseBlurBehavior();
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s5 = peg$parseTTLBehavior();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
|
s7 = peg$c3;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s7 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e4); }
|
||
|
|
}
|
||
|
|
if (s7 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f31(s5);
|
||
|
|
} 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$parseDecayBehavior() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c35) {
|
||
|
|
s1 = peg$c35;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e39); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c36) {
|
||
|
|
s3 = peg$c36;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e40); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c37) {
|
||
|
|
s3 = peg$c37;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e41); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c38) {
|
||
|
|
s3 = peg$c38;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e42); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c39) {
|
||
|
|
s3 = peg$c39;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e43); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c40) {
|
||
|
|
s5 = peg$c40;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e44); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c41) {
|
||
|
|
s5 = peg$c41;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e45); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c42) {
|
||
|
|
s5 = peg$c42;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e46); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c43) {
|
||
|
|
s5 = peg$c43;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e47); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f32(s3, s5);
|
||
|
|
} 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$parseBlurBehavior() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c44) {
|
||
|
|
s1 = peg$c44;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e48); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c45) {
|
||
|
|
s3 = peg$c45;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e49); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c46) {
|
||
|
|
s3 = peg$c46;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e50); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 10) === peg$c47) {
|
||
|
|
s3 = peg$c47;
|
||
|
|
peg$currPos += 10;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e51); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$currPos;
|
||
|
|
s5 = peg$parse__();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 13) === peg$c48) {
|
||
|
|
s6 = peg$c48;
|
||
|
|
peg$currPos += 13;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e52); }
|
||
|
|
}
|
||
|
|
if (s6 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 13) === peg$c49) {
|
||
|
|
s6 = peg$c49;
|
||
|
|
peg$currPos += 13;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e53); }
|
||
|
|
}
|
||
|
|
if (s6 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 13) === peg$c50) {
|
||
|
|
s6 = peg$c50;
|
||
|
|
peg$currPos += 13;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e54); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s6 !== peg$FAILED) {
|
||
|
|
s5 = [s5, s6];
|
||
|
|
s4 = s5;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 === peg$FAILED) {
|
||
|
|
s4 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f33(s3, s4);
|
||
|
|
} 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$parseTTLBehavior() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 3) === peg$c51) {
|
||
|
|
s1 = peg$c51;
|
||
|
|
peg$currPos += 3;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e55); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseDuration();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f34(s3);
|
||
|
|
} 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$parseCacheDirective() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c52) {
|
||
|
|
s1 = peg$c52;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e56); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c53) {
|
||
|
|
s3 = peg$c53;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e57); }
|
||
|
|
}
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c54) {
|
||
|
|
s3 = peg$c54;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e58); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f35(s3);
|
||
|
|
} 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$parseLogicalOr() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseLogicalAnd();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c55) {
|
||
|
|
s5 = peg$c55;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e59); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalAnd();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c55) {
|
||
|
|
s5 = peg$c55;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e59); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalAnd();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f36(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseLogicalAnd() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseComparison();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c56) {
|
||
|
|
s5 = peg$c56;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e60); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseComparison();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c56) {
|
||
|
|
s5 = peg$c56;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e60); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseComparison();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f37(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseComparison() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseTemporalComparison();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c57) {
|
||
|
|
s3 = peg$c57;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e61); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parseTypeName();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f38(s1, s5);
|
||
|
|
} 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;
|
||
|
|
s1 = peg$parseTemporalComparison();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c58) {
|
||
|
|
s5 = peg$c58;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e62); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c59) {
|
||
|
|
s5 = peg$c59;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e63); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c60) {
|
||
|
|
s5 = peg$c60;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e64); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c61) {
|
||
|
|
s5 = peg$c61;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e65); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r0.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e66); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseTemporalComparison();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c58) {
|
||
|
|
s5 = peg$c58;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e62); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c59) {
|
||
|
|
s5 = peg$c59;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e63); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c60) {
|
||
|
|
s5 = peg$c60;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e64); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c61) {
|
||
|
|
s5 = peg$c61;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e65); }
|
||
|
|
}
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r0.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e66); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseTemporalComparison();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f39(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseTemporalComparison() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseAddition();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c62) {
|
||
|
|
s3 = peg$c62;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e67); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse__();
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parseDuration();
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f40(s1, s5);
|
||
|
|
} 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$parseAddition();
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseAddition() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseMultiplication();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r1.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e68); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseMultiplication();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r1.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e68); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseMultiplication();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f41(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseMultiplication() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseUnary();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r2.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e69); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseUnary();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r2.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e69); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseUnary();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f42(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseUnary() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 3) === peg$c63) {
|
||
|
|
s1 = peg$c63;
|
||
|
|
peg$currPos += 3;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e70); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
||
|
|
s1 = peg$c11;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e14); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse__();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parseUnary();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f43(s1, s3);
|
||
|
|
} 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$parsePostfix();
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parsePostfix() {
|
||
|
|
let s0, s1, s2;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseAttributeAccess();
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
s1 = peg$parsePrimaryTerm();
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parseBindingClause();
|
||
|
|
if (s2 === peg$FAILED) {
|
||
|
|
s2 = null;
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f44(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseAttributeAccess() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parsePrimaryTerm();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
|
s5 = peg$c64;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e71); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseIdentifier();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
|
s5 = peg$c64;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e71); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseIdentifier();
|
||
|
|
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 {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f45(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parsePrimaryTerm() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$parseChallengePredicate();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseLiteral();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parsePredicateCall();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseVariable();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s1 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parse_();
|
||
|
|
s3 = peg$parseLogicalOr();
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s5 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f46(s3);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e72); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseChallengePredicate() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 33) {
|
||
|
|
s1 = peg$c11;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e14); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$parseIdentifier();
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s4 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = peg$parse_();
|
||
|
|
s6 = peg$parseArgumentList();
|
||
|
|
if (s6 === peg$FAILED) {
|
||
|
|
s6 = null;
|
||
|
|
}
|
||
|
|
s7 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s8 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s8 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s8 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f47(s2, s6);
|
||
|
|
} 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$parsePredicateCall() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
|
s2 = peg$c8;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e10); }
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = peg$parse_();
|
||
|
|
s4 = peg$parseArgumentList();
|
||
|
|
if (s4 === peg$FAILED) {
|
||
|
|
s4 = null;
|
||
|
|
}
|
||
|
|
s5 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
|
s6 = peg$c9;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e11); }
|
||
|
|
}
|
||
|
|
if (s6 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f48(s1, s4);
|
||
|
|
} 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$parseVariable() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseIdentifier();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f49(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseArgumentList() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseLogicalOr();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalOr();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalOr();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f50(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseExpressionList() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$parseLogicalOr();
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalOr();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$parse_();
|
||
|
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
|
s5 = peg$c21;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e25); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s6 = peg$parse_();
|
||
|
|
s7 = peg$parseLogicalOr();
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f51(s1, s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseLiteral() {
|
||
|
|
let s0;
|
||
|
|
|
||
|
|
s0 = peg$parseString();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseFloat();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseInteger();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseBoolean();
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$parseDuration();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseString() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
|
s1 = peg$c65;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e74); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r3.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e75); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
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$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
|
s4 = peg$c66;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e77); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} 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$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r3.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e75); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
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$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
|
s4 = peg$c66;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e77); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
|
s3 = peg$c65;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e74); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f52(s2);
|
||
|
|
} 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) === 39) {
|
||
|
|
s1 = peg$c67;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e78); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r4.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e79); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
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$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
|
s4 = peg$c66;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e77); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} 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$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r4.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e79); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
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$currPos;
|
||
|
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
|
s4 = peg$c66;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e77); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
|
s3 = peg$c67;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e78); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f53(s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e73); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseFloat() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$currPos;
|
||
|
|
s2 = [];
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
|
s3 = peg$c64;
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e71); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s4 = [];
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
while (s5 !== peg$FAILED) {
|
||
|
|
s4.push(s5);
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s5)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s2 = [s2, s3, s4];
|
||
|
|
s1 = s2;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f54(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e80); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseInteger() {
|
||
|
|
let s0, s1, s2;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = [];
|
||
|
|
s2 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s2)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
while (s2 !== peg$FAILED) {
|
||
|
|
s1.push(s2);
|
||
|
|
s2 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s2)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f55(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e82); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseBoolean() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c68) {
|
||
|
|
s1 = peg$c68;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e84); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c69) {
|
||
|
|
s1 = peg$c69;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e85); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f56(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e83); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseDuration() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
peg$silentFails++;
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$currPos;
|
||
|
|
s2 = [];
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r5.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e81); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
s2 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r6.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e87); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s2 = [s2, s3];
|
||
|
|
s1 = s2;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s1 = peg$f57(s1);
|
||
|
|
}
|
||
|
|
s0 = s1;
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e86); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseIdentifier() {
|
||
|
|
let s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
s1 = peg$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s2 = peg$parseKeyword();
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s2 === peg$FAILED) {
|
||
|
|
s1 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s1;
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$currPos;
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r7.test(s4)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e88); }
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
s5 = [];
|
||
|
|
s6 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r8.test(s6)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e89); }
|
||
|
|
}
|
||
|
|
while (s6 !== peg$FAILED) {
|
||
|
|
s5.push(s6);
|
||
|
|
s6 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r8.test(s6)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s6 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e89); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s2 = input.substring(s2, peg$currPos);
|
||
|
|
} else {
|
||
|
|
s2 = s3;
|
||
|
|
}
|
||
|
|
if (s2 !== peg$FAILED) {
|
||
|
|
peg$savedPos = s0;
|
||
|
|
s0 = peg$f58(s2);
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseKeyword() {
|
||
|
|
let s0, s1, s2, s3;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 10) === peg$c0) {
|
||
|
|
s1 = peg$c0;
|
||
|
|
peg$currPos += 10;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e1); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c1) {
|
||
|
|
s1 = peg$c1;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e2); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c6) {
|
||
|
|
s1 = peg$c6;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e8); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c7) {
|
||
|
|
s1 = peg$c7;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e9); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c10) {
|
||
|
|
s1 = peg$c10;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e13); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c12) {
|
||
|
|
s1 = peg$c12;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e16); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 7) === peg$c27) {
|
||
|
|
s1 = peg$c27;
|
||
|
|
peg$currPos += 7;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e31); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c28) {
|
||
|
|
s1 = peg$c28;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e32); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c52) {
|
||
|
|
s1 = peg$c52;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e56); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c35) {
|
||
|
|
s1 = peg$c35;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e39); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c44) {
|
||
|
|
s1 = peg$c44;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e48); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 3) === peg$c51) {
|
||
|
|
s1 = peg$c51;
|
||
|
|
peg$currPos += 3;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e55); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
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$e34); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 11) === peg$c33) {
|
||
|
|
s1 = peg$c33;
|
||
|
|
peg$currPos += 11;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e37); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 12) === peg$c31) {
|
||
|
|
s1 = peg$c31;
|
||
|
|
peg$currPos += 12;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e35); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 17) === peg$c32) {
|
||
|
|
s1 = peg$c32;
|
||
|
|
peg$currPos += 17;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e36); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c29) {
|
||
|
|
s1 = peg$c29;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e33); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c34) {
|
||
|
|
s1 = peg$c34;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e38); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c26) {
|
||
|
|
s1 = peg$c26;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e30); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c20) {
|
||
|
|
s1 = peg$c20;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e24); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 9) === peg$c24) {
|
||
|
|
s1 = peg$c24;
|
||
|
|
peg$currPos += 9;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e28); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c25) {
|
||
|
|
s1 = peg$c25;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e29); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c14) {
|
||
|
|
s1 = peg$c14;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e18); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c15) {
|
||
|
|
s1 = peg$c15;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e19); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c17) {
|
||
|
|
s1 = peg$c17;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e21); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c18) {
|
||
|
|
s1 = peg$c18;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e22); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 8) === peg$c16) {
|
||
|
|
s1 = peg$c16;
|
||
|
|
peg$currPos += 8;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e20); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c23) {
|
||
|
|
s1 = peg$c23;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e27); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 4) === peg$c68) {
|
||
|
|
s1 = peg$c68;
|
||
|
|
peg$currPos += 4;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e84); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 5) === peg$c69) {
|
||
|
|
s1 = peg$c69;
|
||
|
|
peg$currPos += 5;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e85); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 3) === peg$c63) {
|
||
|
|
s1 = peg$c63;
|
||
|
|
peg$currPos += 3;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e70); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c62) {
|
||
|
|
s1 = peg$c62;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e67); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 6) === peg$c13) {
|
||
|
|
s1 = peg$c13;
|
||
|
|
peg$currPos += 6;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e17); }
|
||
|
|
}
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c57) {
|
||
|
|
s1 = peg$c57;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e61); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = peg$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r8.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e89); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s3 === peg$FAILED) {
|
||
|
|
s2 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s2;
|
||
|
|
s2 = 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$parse_() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
s0 = [];
|
||
|
|
s1 = peg$parseWhiteSpace();
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
s1 = peg$parseComment();
|
||
|
|
}
|
||
|
|
while (s1 !== peg$FAILED) {
|
||
|
|
s0.push(s1);
|
||
|
|
s1 = peg$parseWhiteSpace();
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
s1 = peg$parseComment();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parse__() {
|
||
|
|
let s0, s1;
|
||
|
|
|
||
|
|
s0 = [];
|
||
|
|
s1 = peg$parseWhiteSpace();
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
s1 = peg$parseComment();
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
while (s1 !== peg$FAILED) {
|
||
|
|
s0.push(s1);
|
||
|
|
s1 = peg$parseWhiteSpace();
|
||
|
|
if (s1 === peg$FAILED) {
|
||
|
|
s1 = peg$parseComment();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseWhiteSpace() {
|
||
|
|
let s0;
|
||
|
|
|
||
|
|
s0 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r9.test(s0)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e90); }
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
function peg$parseComment() {
|
||
|
|
let s0, s1, s2, s3, s4, s5;
|
||
|
|
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c70) {
|
||
|
|
s1 = peg$c70;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e91); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r10.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e92); }
|
||
|
|
}
|
||
|
|
while (s3 !== peg$FAILED) {
|
||
|
|
s2.push(s3);
|
||
|
|
s3 = input.charAt(peg$currPos);
|
||
|
|
if (peg$r10.test(s3)) {
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e92); }
|
||
|
|
}
|
||
|
|
}
|
||
|
|
s1 = [s1, s2];
|
||
|
|
s0 = s1;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s0 === peg$FAILED) {
|
||
|
|
s0 = peg$currPos;
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c71) {
|
||
|
|
s1 = peg$c71;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s1 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e93); }
|
||
|
|
}
|
||
|
|
if (s1 !== peg$FAILED) {
|
||
|
|
s2 = [];
|
||
|
|
s3 = peg$currPos;
|
||
|
|
s4 = peg$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c72) {
|
||
|
|
s5 = peg$c72;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e94); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} 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$currPos;
|
||
|
|
peg$silentFails++;
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c72) {
|
||
|
|
s5 = peg$c72;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e94); }
|
||
|
|
}
|
||
|
|
peg$silentFails--;
|
||
|
|
if (s5 === peg$FAILED) {
|
||
|
|
s4 = undefined;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s4;
|
||
|
|
s4 = peg$FAILED;
|
||
|
|
}
|
||
|
|
if (s4 !== peg$FAILED) {
|
||
|
|
if (input.length > peg$currPos) {
|
||
|
|
s5 = input.charAt(peg$currPos);
|
||
|
|
peg$currPos++;
|
||
|
|
} else {
|
||
|
|
s5 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e76); }
|
||
|
|
}
|
||
|
|
if (s5 !== peg$FAILED) {
|
||
|
|
s4 = [s4, s5];
|
||
|
|
s3 = s4;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s3;
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (input.substr(peg$currPos, 2) === peg$c72) {
|
||
|
|
s3 = peg$c72;
|
||
|
|
peg$currPos += 2;
|
||
|
|
} else {
|
||
|
|
s3 = peg$FAILED;
|
||
|
|
if (peg$silentFails === 0) { peg$fail(peg$e94); }
|
||
|
|
}
|
||
|
|
if (s3 !== peg$FAILED) {
|
||
|
|
s1 = [s1, s2, s3];
|
||
|
|
s0 = s1;
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
peg$currPos = s0;
|
||
|
|
s0 = peg$FAILED;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return s0;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// The location() function provides line/column info for error reporting.
|
||
|
|
// The text() function returns the matched text for a rule.
|
||
|
|
|
||
|
|
// Helper function to build a left-associative binary expression tree.
|
||
|
|
function buildLeftAssoc(head, tail) {
|
||
|
|
return tail.reduce((result, element) => {
|
||
|
|
return {
|
||
|
|
type: "BinaryExpression",
|
||
|
|
operator: element[1],
|
||
|
|
left: result,
|
||
|
|
right: element[3],
|
||
|
|
location: location()
|
||
|
|
};
|
||
|
|
}, head);
|
||
|
|
}
|
||
|
|
|
||
|
|
peg$result = peg$startRuleFunction();
|
||
|
|
|
||
|
|
const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);
|
||
|
|
function peg$throw() {
|
||
|
|
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
||
|
|
peg$fail(peg$endExpectation());
|
||
|
|
}
|
||
|
|
|
||
|
|
throw peg$buildStructuredError(
|
||
|
|
peg$maxFailExpected,
|
||
|
|
peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,
|
||
|
|
peg$maxFailPos < input.length
|
||
|
|
? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
|
||
|
|
: peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
if (options.peg$library) {
|
||
|
|
return /** @type {any} */ ({
|
||
|
|
peg$result,
|
||
|
|
peg$currPos,
|
||
|
|
peg$FAILED,
|
||
|
|
peg$maxFailExpected,
|
||
|
|
peg$maxFailPos,
|
||
|
|
peg$success,
|
||
|
|
peg$throw: peg$success ? undefined : peg$throw,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
if (peg$success) {
|
||
|
|
return peg$result;
|
||
|
|
} else {
|
||
|
|
peg$throw();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
const peg$allowedStartRules = [
|
||
|
|
"Program"
|
||
|
|
];
|
||
|
|
|
||
|
|
export {
|
||
|
|
peg$allowedStartRules as StartRules,
|
||
|
|
peg$SyntaxError as SyntaxError,
|
||
|
|
peg$parse as parse
|
||
|
|
};
|