7518 lines
204 KiB
JavaScript
7518 lines
204 KiB
JavaScript
|
/*
|
||
|
* Generated by PEG.js 0.10.0.
|
||
|
*
|
||
|
* http://pegjs.org/
|
||
|
*/
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
function peg$subclass(child, parent) {
|
||
|
function ctor() { this.constructor = child; }
|
||
|
ctor.prototype = parent.prototype;
|
||
|
child.prototype = new ctor();
|
||
|
}
|
||
|
|
||
|
function peg$SyntaxError(message, expected, found, location) {
|
||
|
this.message = message;
|
||
|
this.expected = expected;
|
||
|
this.found = found;
|
||
|
this.location = location;
|
||
|
this.name = "SyntaxError";
|
||
|
|
||
|
if (typeof Error.captureStackTrace === "function") {
|
||
|
Error.captureStackTrace(this, peg$SyntaxError);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$subclass(peg$SyntaxError, Error);
|
||
|
|
||
|
peg$SyntaxError.buildMessage = function(expected, found) {
|
||
|
var DESCRIBE_EXPECTATION_FNS = {
|
||
|
literal: function(expectation) {
|
||
|
return "\"" + literalEscape(expectation.text) + "\"";
|
||
|
},
|
||
|
|
||
|
"class": function(expectation) {
|
||
|
var escapedParts = "",
|
||
|
i;
|
||
|
|
||
|
for (i = 0; i < expectation.parts.length; i++) {
|
||
|
escapedParts += expectation.parts[i] instanceof Array
|
||
|
? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
|
||
|
: classEscape(expectation.parts[i]);
|
||
|
}
|
||
|
|
||
|
return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
|
||
|
},
|
||
|
|
||
|
any: function(expectation) {
|
||
|
return "any character";
|
||
|
},
|
||
|
|
||
|
end: function(expectation) {
|
||
|
return "end of input";
|
||
|
},
|
||
|
|
||
|
other: function(expectation) {
|
||
|
return expectation.description;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
function hex(ch) {
|
||
|
return ch.charCodeAt(0).toString(16).toUpperCase();
|
||
|
}
|
||
|
|
||
|
function literalEscape(s) {
|
||
|
return s
|
||
|
.replace(/\\/g, '\\\\')
|
||
|
.replace(/"/g, '\\"')
|
||
|
.replace(/\0/g, '\\0')
|
||
|
.replace(/\t/g, '\\t')
|
||
|
.replace(/\n/g, '\\n')
|
||
|
.replace(/\r/g, '\\r')
|
||
|
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
|
||
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
|
||
|
}
|
||
|
|
||
|
function classEscape(s) {
|
||
|
return s
|
||
|
.replace(/\\/g, '\\\\')
|
||
|
.replace(/\]/g, '\\]')
|
||
|
.replace(/\^/g, '\\^')
|
||
|
.replace(/-/g, '\\-')
|
||
|
.replace(/\0/g, '\\0')
|
||
|
.replace(/\t/g, '\\t')
|
||
|
.replace(/\n/g, '\\n')
|
||
|
.replace(/\r/g, '\\r')
|
||
|
.replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
|
||
|
.replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); });
|
||
|
}
|
||
|
|
||
|
function describeExpectation(expectation) {
|
||
|
return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
|
||
|
}
|
||
|
|
||
|
function describeExpected(expected) {
|
||
|
var descriptions = new Array(expected.length),
|
||
|
i, j;
|
||
|
|
||
|
for (i = 0; i < expected.length; i++) {
|
||
|
descriptions[i] = describeExpectation(expected[i]);
|
||
|
}
|
||
|
|
||
|
descriptions.sort();
|
||
|
|
||
|
if (descriptions.length > 0) {
|
||
|
for (i = 1, j = 1; i < descriptions.length; i++) {
|
||
|
if (descriptions[i - 1] !== descriptions[i]) {
|
||
|
descriptions[j] = descriptions[i];
|
||
|
j++;
|
||
|
}
|
||
|
}
|
||
|
descriptions.length = j;
|
||
|
}
|
||
|
|
||
|
switch (descriptions.length) {
|
||
|
case 1:
|
||
|
return descriptions[0];
|
||
|
|
||
|
case 2:
|
||
|
return descriptions[0] + " or " + descriptions[1];
|
||
|
|
||
|
default:
|
||
|
return descriptions.slice(0, -1).join(", ")
|
||
|
+ ", or "
|
||
|
+ descriptions[descriptions.length - 1];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function describeFound(found) {
|
||
|
return found ? "\"" + literalEscape(found) + "\"" : "end of input";
|
||
|
}
|
||
|
|
||
|
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
||
|
};
|
||
|
|
||
|
function peg$parse(input, options) {
|
||
|
options = options !== void 0 ? options : {};
|
||
|
|
||
|
var peg$FAILED = {},
|
||
|
|
||
|
peg$startRuleFunctions = { TopTypeExpr: peg$parseTopTypeExpr, NamepathExpr: peg$parseNamepathExpr, BroadNamepathExpr: peg$parseBroadNamepathExpr, ExternalNameExpr: peg$parseExternalNameExpr, ModuleNameExpr: peg$parseModuleNameExpr },
|
||
|
peg$startRuleFunction = peg$parseTopTypeExpr,
|
||
|
|
||
|
peg$c0 = function(expr) {
|
||
|
return expr;
|
||
|
},
|
||
|
peg$c1 = /^[ \t]/,
|
||
|
peg$c2 = peg$classExpectation([" ", "\t"], false, false),
|
||
|
peg$c3 = /^[\r]/,
|
||
|
peg$c4 = peg$classExpectation(["\r"], false, false),
|
||
|
peg$c5 = /^[\n]/,
|
||
|
peg$c6 = peg$classExpectation(["\n"], false, false),
|
||
|
peg$c7 = /^[a-zA-Z_$]/,
|
||
|
peg$c8 = peg$classExpectation([["a", "z"], ["A", "Z"], "_", "$"], false, false),
|
||
|
peg$c9 = /^[a-zA-Z0-9_$]/,
|
||
|
peg$c10 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "$"], false, false),
|
||
|
peg$c11 = "event:",
|
||
|
peg$c12 = peg$literalExpectation("event:", false),
|
||
|
peg$c13 = function(rootOwner, memberPartWithOperators) {
|
||
|
return memberPartWithOperators.reduce(function(owner, tokens) {
|
||
|
const operatorType = tokens[1];
|
||
|
const eventNamespace = tokens[3];
|
||
|
const MemberName = tokens[5];
|
||
|
const {quoteStyle, name: memberName} = MemberName;
|
||
|
|
||
|
switch (operatorType) {
|
||
|
case NamepathOperatorType.MEMBER:
|
||
|
return {
|
||
|
type: NodeType.MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INSTANCE_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INSTANCE_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INNER_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INNER_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
/* istanbul ignore next */
|
||
|
default:
|
||
|
throw new Error('Unexpected operator type: "' + operatorType + '"');
|
||
|
}
|
||
|
}, rootOwner);
|
||
|
},
|
||
|
peg$c14 = /^[a-zA-Z0-9_$\-]/,
|
||
|
peg$c15 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "$", "-"], false, false),
|
||
|
peg$c16 = function(name) {
|
||
|
return {
|
||
|
type: NodeType.NAME,
|
||
|
name
|
||
|
};
|
||
|
},
|
||
|
peg$c17 = "'",
|
||
|
peg$c18 = peg$literalExpectation("'", false),
|
||
|
peg$c19 = /^[^\\']/,
|
||
|
peg$c20 = peg$classExpectation(["\\", "'"], true, false),
|
||
|
peg$c21 = "\\",
|
||
|
peg$c22 = peg$literalExpectation("\\", false),
|
||
|
peg$c23 = peg$anyExpectation(),
|
||
|
peg$c24 = function(name) {
|
||
|
return {
|
||
|
quoteStyle: 'single',
|
||
|
name: name.replace(/\\'/g, "'")
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c25 = "\"",
|
||
|
peg$c26 = peg$literalExpectation("\"", false),
|
||
|
peg$c27 = /^[^\\"]/,
|
||
|
peg$c28 = peg$classExpectation(["\\", "\""], true, false),
|
||
|
peg$c29 = function(name) {
|
||
|
return {
|
||
|
quoteStyle: 'double',
|
||
|
name: name.replace(/\\"/gu, '"')
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c30 = function(name) {
|
||
|
return {
|
||
|
quoteStyle: 'none',
|
||
|
name
|
||
|
};
|
||
|
},
|
||
|
peg$c31 = ".",
|
||
|
peg$c32 = peg$literalExpectation(".", false),
|
||
|
peg$c33 = function(rootOwner, memberPart) {
|
||
|
return memberPart.reduce(function(owner, tokens) {
|
||
|
return {
|
||
|
type: NodeType.MEMBER,
|
||
|
owner,
|
||
|
name: tokens[3]
|
||
|
}
|
||
|
}, rootOwner);
|
||
|
},
|
||
|
peg$c34 = function() {
|
||
|
return NamepathOperatorType.MEMBER;
|
||
|
},
|
||
|
peg$c35 = "~",
|
||
|
peg$c36 = peg$literalExpectation("~", false),
|
||
|
peg$c37 = function() {
|
||
|
return NamepathOperatorType.INNER_MEMBER;
|
||
|
},
|
||
|
peg$c38 = "#",
|
||
|
peg$c39 = peg$literalExpectation("#", false),
|
||
|
peg$c40 = function() {
|
||
|
return NamepathOperatorType.INSTANCE_MEMBER;
|
||
|
},
|
||
|
peg$c41 = "external",
|
||
|
peg$c42 = peg$literalExpectation("external", false),
|
||
|
peg$c43 = ":",
|
||
|
peg$c44 = peg$literalExpectation(":", false),
|
||
|
peg$c45 = function(external, memberPartWithOperators) {
|
||
|
return memberPartWithOperators.reduce(function(owner, tokens) {
|
||
|
const operatorType = tokens[1];
|
||
|
const eventNamespace = tokens[3];
|
||
|
const MemberName = tokens[5];
|
||
|
const {quoteStyle, name: memberName} = MemberName;
|
||
|
|
||
|
switch (operatorType) {
|
||
|
case NamepathOperatorType.MEMBER:
|
||
|
return {
|
||
|
type: NodeType.MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INSTANCE_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INSTANCE_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INNER_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INNER_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
/* istanbul ignore next */
|
||
|
default:
|
||
|
throw new Error('Unexpected operator type: "' + operatorType + '"');
|
||
|
}
|
||
|
}, Object.assign({
|
||
|
type: NodeType.EXTERNAL
|
||
|
}, external));
|
||
|
},
|
||
|
peg$c46 = "module",
|
||
|
peg$c47 = peg$literalExpectation("module", false),
|
||
|
peg$c48 = function(value) {
|
||
|
return {
|
||
|
type: NodeType.MODULE,
|
||
|
value,
|
||
|
};
|
||
|
},
|
||
|
peg$c49 = function(rootOwner, memberPartWithOperators) {
|
||
|
return memberPartWithOperators.reduce(function(owner, tokens) {
|
||
|
const operatorType = tokens[1];
|
||
|
const eventNamespace = tokens[3];
|
||
|
const MemberName = tokens[5];
|
||
|
const {quoteStyle, name: memberName} = MemberName;
|
||
|
|
||
|
switch (operatorType) {
|
||
|
case NamepathOperatorType.MEMBER:
|
||
|
return {
|
||
|
type: NodeType.MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INSTANCE_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INSTANCE_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
case NamepathOperatorType.INNER_MEMBER:
|
||
|
return {
|
||
|
type: NodeType.INNER_MEMBER,
|
||
|
owner,
|
||
|
name: memberName,
|
||
|
quoteStyle,
|
||
|
hasEventPrefix: Boolean(eventNamespace),
|
||
|
};
|
||
|
/* istanbul ignore next */
|
||
|
default:
|
||
|
throw new Error('Unexpected operator type: "' + operatorType + '"');
|
||
|
}
|
||
|
}, rootOwner);
|
||
|
},
|
||
|
peg$c50 = function(path) {
|
||
|
return {
|
||
|
quoteStyle: 'single',
|
||
|
type: NodeType.FILE_PATH,
|
||
|
path: path.replace(/\\'/g, "'")
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c51 = function(path) {
|
||
|
return {
|
||
|
quoteStyle: 'double',
|
||
|
type: NodeType.FILE_PATH,
|
||
|
path: path.replace(/\\"/gu, '"')
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c52 = /^[a-zA-Z0-9_$\/\-]/,
|
||
|
peg$c53 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"], "_", "$", "/", "-"], false, false),
|
||
|
peg$c54 = function(path) {
|
||
|
return {
|
||
|
quoteStyle: 'none',
|
||
|
type: NodeType.FILE_PATH,
|
||
|
path,
|
||
|
};
|
||
|
},
|
||
|
peg$c55 = "*",
|
||
|
peg$c56 = peg$literalExpectation("*", false),
|
||
|
peg$c57 = function() {
|
||
|
return { type: NodeType.ANY };
|
||
|
},
|
||
|
peg$c58 = "?",
|
||
|
peg$c59 = peg$literalExpectation("?", false),
|
||
|
peg$c60 = function() {
|
||
|
return { type: NodeType.UNKNOWN };
|
||
|
},
|
||
|
peg$c61 = function(value) {
|
||
|
return {
|
||
|
type: NodeType.STRING_VALUE,
|
||
|
quoteStyle: 'double',
|
||
|
string: value.replace(/\\"/gu, '"')
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c62 = function(value) {
|
||
|
return {
|
||
|
type: NodeType.STRING_VALUE,
|
||
|
quoteStyle: 'single',
|
||
|
string: value.replace(/\\'/g, "'")
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c63 = function(value) {
|
||
|
return {
|
||
|
type: NodeType.NUMBER_VALUE,
|
||
|
number: value
|
||
|
};
|
||
|
},
|
||
|
peg$c64 = "+",
|
||
|
peg$c65 = peg$literalExpectation("+", false),
|
||
|
peg$c66 = "-",
|
||
|
peg$c67 = peg$literalExpectation("-", false),
|
||
|
peg$c68 = /^[0-9]/,
|
||
|
peg$c69 = peg$classExpectation([["0", "9"]], false, false),
|
||
|
peg$c70 = "e",
|
||
|
peg$c71 = peg$literalExpectation("e", false),
|
||
|
peg$c72 = "0b",
|
||
|
peg$c73 = peg$literalExpectation("0b", false),
|
||
|
peg$c74 = /^[01]/,
|
||
|
peg$c75 = peg$classExpectation(["0", "1"], false, false),
|
||
|
peg$c76 = "0o",
|
||
|
peg$c77 = peg$literalExpectation("0o", false),
|
||
|
peg$c78 = /^[0-7]/,
|
||
|
peg$c79 = peg$classExpectation([["0", "7"]], false, false),
|
||
|
peg$c80 = "0x",
|
||
|
peg$c81 = peg$literalExpectation("0x", false),
|
||
|
peg$c82 = /^[0-9a-fA-F]/,
|
||
|
peg$c83 = peg$classExpectation([["0", "9"], ["a", "f"], ["A", "F"]], false, false),
|
||
|
peg$c84 = "&",
|
||
|
peg$c85 = peg$literalExpectation("&", false),
|
||
|
peg$c86 = function(left, right) {
|
||
|
return {
|
||
|
type: NodeType.INTERSECTION,
|
||
|
left,
|
||
|
right,
|
||
|
};
|
||
|
},
|
||
|
peg$c87 = "|",
|
||
|
peg$c88 = peg$literalExpectation("|", false),
|
||
|
peg$c89 = function(left, right) {
|
||
|
return {
|
||
|
type: NodeType.UNION,
|
||
|
left,
|
||
|
right,
|
||
|
};
|
||
|
},
|
||
|
peg$c90 = "typeof",
|
||
|
peg$c91 = peg$literalExpectation("typeof", false),
|
||
|
peg$c92 = function(operator, name) {
|
||
|
return {
|
||
|
type: NodeType.TYPE_QUERY,
|
||
|
name,
|
||
|
};
|
||
|
},
|
||
|
peg$c93 = "keyof",
|
||
|
peg$c94 = peg$literalExpectation("keyof", false),
|
||
|
peg$c95 = function(operator, operand) {
|
||
|
return {
|
||
|
type: NodeType.KEY_QUERY,
|
||
|
value: operand,
|
||
|
}
|
||
|
},
|
||
|
peg$c96 = "import",
|
||
|
peg$c97 = peg$literalExpectation("import", false),
|
||
|
peg$c98 = "(",
|
||
|
peg$c99 = peg$literalExpectation("(", false),
|
||
|
peg$c100 = ")",
|
||
|
peg$c101 = peg$literalExpectation(")", false),
|
||
|
peg$c102 = function(operator, path) {
|
||
|
return { type: NodeType.IMPORT, path };
|
||
|
},
|
||
|
peg$c103 = function(operator, operand) {
|
||
|
return {
|
||
|
type: NodeType.NULLABLE,
|
||
|
value: operand,
|
||
|
meta: { syntax: NullableTypeSyntax.PREFIX_QUESTION_MARK },
|
||
|
};
|
||
|
},
|
||
|
peg$c104 = "!",
|
||
|
peg$c105 = peg$literalExpectation("!", false),
|
||
|
peg$c106 = function(operator, operand) {
|
||
|
return {
|
||
|
type: NodeType.NOT_NULLABLE,
|
||
|
value: operand,
|
||
|
meta: { syntax: NotNullableTypeSyntax.PREFIX_BANG },
|
||
|
};
|
||
|
},
|
||
|
peg$c107 = "=",
|
||
|
peg$c108 = peg$literalExpectation("=", false),
|
||
|
peg$c109 = function(operator, operand) {
|
||
|
return {
|
||
|
type: NodeType.OPTIONAL,
|
||
|
value: operand,
|
||
|
meta: { syntax: OptionalTypeSyntax.PREFIX_EQUALS_SIGN },
|
||
|
};
|
||
|
},
|
||
|
peg$c110 = function(operand, operator) {
|
||
|
return {
|
||
|
type: NodeType.NULLABLE,
|
||
|
value: operand,
|
||
|
meta: { syntax: NullableTypeSyntax.SUFFIX_QUESTION_MARK },
|
||
|
};
|
||
|
},
|
||
|
peg$c111 = function(operand, operator) {
|
||
|
return {
|
||
|
type: NodeType.NOT_NULLABLE,
|
||
|
value: operand,
|
||
|
meta: { syntax: NotNullableTypeSyntax.SUFFIX_BANG },
|
||
|
};
|
||
|
},
|
||
|
peg$c112 = function(operand, operator) {
|
||
|
return {
|
||
|
type: NodeType.OPTIONAL,
|
||
|
value: operand,
|
||
|
meta: { syntax: OptionalTypeSyntax.SUFFIX_EQUALS_SIGN },
|
||
|
};
|
||
|
},
|
||
|
peg$c113 = function(operand, syntax, params) {
|
||
|
return {
|
||
|
type: NodeType.GENERIC,
|
||
|
subject: operand,
|
||
|
objects: params,
|
||
|
meta: { syntax },
|
||
|
};
|
||
|
},
|
||
|
peg$c114 = ",",
|
||
|
peg$c115 = peg$literalExpectation(",", false),
|
||
|
peg$c116 = function(first, restsWithComma) {
|
||
|
return restsWithComma.reduce(function(params, tokens) {
|
||
|
return params.concat([tokens[3]]);
|
||
|
}, [first]);
|
||
|
},
|
||
|
peg$c117 = ".<",
|
||
|
peg$c118 = peg$literalExpectation(".<", false),
|
||
|
peg$c119 = function() {
|
||
|
return GenericTypeSyntax.ANGLE_BRACKET_WITH_DOT;
|
||
|
},
|
||
|
peg$c120 = "<",
|
||
|
peg$c121 = peg$literalExpectation("<", false),
|
||
|
peg$c122 = function() {
|
||
|
return GenericTypeSyntax.ANGLE_BRACKET;
|
||
|
},
|
||
|
peg$c123 = ">",
|
||
|
peg$c124 = peg$literalExpectation(">", false),
|
||
|
peg$c125 = "[",
|
||
|
peg$c126 = peg$literalExpectation("[", false),
|
||
|
peg$c127 = "]",
|
||
|
peg$c128 = peg$literalExpectation("]", false),
|
||
|
peg$c129 = function(operand, brackets) {
|
||
|
return brackets.reduce(function(operand) {
|
||
|
return {
|
||
|
type: NodeType.GENERIC,
|
||
|
subject: {
|
||
|
type: NodeType.NAME,
|
||
|
name: 'Array'
|
||
|
},
|
||
|
objects: [ operand ],
|
||
|
meta: { syntax: GenericTypeSyntax.SQUARE_BRACKET },
|
||
|
};
|
||
|
}, operand);
|
||
|
},
|
||
|
peg$c130 = "new",
|
||
|
peg$c131 = peg$literalExpectation("new", false),
|
||
|
peg$c132 = "=>",
|
||
|
peg$c133 = peg$literalExpectation("=>", false),
|
||
|
peg$c134 = function(newModifier, paramsPart, returnedTypeNode) {
|
||
|
return {
|
||
|
type: NodeType.ARROW,
|
||
|
params: paramsPart,
|
||
|
returns: returnedTypeNode,
|
||
|
new: newModifier
|
||
|
};
|
||
|
},
|
||
|
peg$c135 = function() {
|
||
|
return [];
|
||
|
},
|
||
|
peg$c136 = function(params) {
|
||
|
return params;
|
||
|
},
|
||
|
peg$c137 = function(paramsWithComma, lastParam) {
|
||
|
return paramsWithComma.reduceRight(function(params, tokens) {
|
||
|
const param = { type: NodeType.NAMED_PARAMETER, name: tokens[0], typeName: tokens[4] };
|
||
|
return [param].concat(params);
|
||
|
}, lastParam ? [lastParam] : []);
|
||
|
},
|
||
|
peg$c138 = "...",
|
||
|
peg$c139 = peg$literalExpectation("...", false),
|
||
|
peg$c140 = function(spread, id, type) {
|
||
|
const operand = { type: NodeType.NAMED_PARAMETER, name: id, typeName: type };
|
||
|
if (spread) {
|
||
|
return {
|
||
|
type: NodeType.VARIADIC,
|
||
|
value: operand,
|
||
|
meta: { syntax: VariadicTypeSyntax.PREFIX_DOTS },
|
||
|
};
|
||
|
}
|
||
|
else {
|
||
|
return operand;
|
||
|
}
|
||
|
},
|
||
|
peg$c141 = "function",
|
||
|
peg$c142 = peg$literalExpectation("function", false),
|
||
|
peg$c143 = function(paramsPart, returnedTypePart) {
|
||
|
const returnedTypeNode = returnedTypePart ? returnedTypePart[2] : null;
|
||
|
|
||
|
return {
|
||
|
type: NodeType.FUNCTION,
|
||
|
params: paramsPart.params,
|
||
|
returns: returnedTypeNode,
|
||
|
this: paramsPart.modifier.nodeThis,
|
||
|
new: paramsPart.modifier.nodeNew,
|
||
|
};
|
||
|
},
|
||
|
peg$c144 = function(modifier, params) {
|
||
|
return { params, modifier };
|
||
|
},
|
||
|
peg$c145 = function(modifier) {
|
||
|
return { params: [], modifier };
|
||
|
},
|
||
|
peg$c146 = function() {
|
||
|
return { params: [], modifier: { nodeThis: null, nodeNew: null } };
|
||
|
},
|
||
|
peg$c147 = function(params) {
|
||
|
return { params, modifier: { nodeThis: null, nodeNew: null } };
|
||
|
},
|
||
|
peg$c148 = "this",
|
||
|
peg$c149 = peg$literalExpectation("this", false),
|
||
|
peg$c150 = function(modifierThis) {
|
||
|
return { nodeThis: modifierThis[4], nodeNew: null };
|
||
|
},
|
||
|
peg$c151 = function(modifierNew) {
|
||
|
return { nodeThis: null, nodeNew: modifierNew[4] };
|
||
|
},
|
||
|
peg$c152 = function(paramsWithComma, lastParam) {
|
||
|
return paramsWithComma.reduceRight(function(params, tokens) {
|
||
|
const [param] = tokens;
|
||
|
return [param].concat(params);
|
||
|
}, lastParam ? [lastParam] : []);
|
||
|
},
|
||
|
peg$c153 = "{",
|
||
|
peg$c154 = peg$literalExpectation("{", false),
|
||
|
peg$c155 = "}",
|
||
|
peg$c156 = peg$literalExpectation("}", false),
|
||
|
peg$c157 = function(entries) {
|
||
|
return {
|
||
|
type: NodeType.RECORD,
|
||
|
entries: entries || [],
|
||
|
};
|
||
|
},
|
||
|
peg$c158 = ";",
|
||
|
peg$c159 = peg$literalExpectation(";", false),
|
||
|
peg$c160 = function(first, restWithComma) {
|
||
|
return restWithComma.reduce(function(entries, tokens) {
|
||
|
const entry = tokens[2];
|
||
|
return entries.concat([entry]);
|
||
|
}, [first]);
|
||
|
},
|
||
|
peg$c161 = "readonly",
|
||
|
peg$c162 = peg$literalExpectation("readonly", false),
|
||
|
peg$c163 = function(readonly, keyInfo, optional, value) {
|
||
|
const {quoteStyle, key} = keyInfo;
|
||
|
return {
|
||
|
type: NodeType.RECORD_ENTRY,
|
||
|
key,
|
||
|
quoteStyle,
|
||
|
value:
|
||
|
optional === '?' ? {
|
||
|
type: NodeType.OPTIONAL,
|
||
|
value,
|
||
|
meta: { syntax: OptionalTypeSyntax.SUFFIX_KEY_QUESTION_MARK },
|
||
|
} :
|
||
|
value,
|
||
|
readonly: Boolean(readonly)
|
||
|
};
|
||
|
},
|
||
|
peg$c164 = function(readonly, keyInfo) {
|
||
|
const {quoteStyle, key} = keyInfo;
|
||
|
return {
|
||
|
type: NodeType.RECORD_ENTRY,
|
||
|
key,
|
||
|
quoteStyle,
|
||
|
value: null,
|
||
|
readonly: Boolean(readonly)
|
||
|
};
|
||
|
},
|
||
|
peg$c165 = function(key) {
|
||
|
return {
|
||
|
quoteStyle: 'double',
|
||
|
key: key.replace(/\\"/gu, '"')
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c166 = function(key) {
|
||
|
return {
|
||
|
quoteStyle: 'single',
|
||
|
key: key.replace(/\\'/g, "'")
|
||
|
.replace(/\\\\/gu, '\\')
|
||
|
};
|
||
|
},
|
||
|
peg$c167 = function(key) {
|
||
|
return {
|
||
|
quoteStyle: 'none',
|
||
|
key
|
||
|
};
|
||
|
},
|
||
|
peg$c168 = function(entries) {
|
||
|
return {
|
||
|
type: NodeType.TUPLE,
|
||
|
entries,
|
||
|
}
|
||
|
},
|
||
|
peg$c169 = function(restWithComma, last) {
|
||
|
return restWithComma.reduceRight((entries, tokens) => {
|
||
|
let [entry] = tokens;
|
||
|
return [entry].concat(entries);
|
||
|
}, last ? [last] : []);
|
||
|
},
|
||
|
peg$c170 = function(wrapped) {
|
||
|
return {
|
||
|
type: NodeType.PARENTHESIS,
|
||
|
value: wrapped,
|
||
|
};
|
||
|
},
|
||
|
peg$c171 = function(operand) {
|
||
|
return {
|
||
|
type: NodeType.VARIADIC,
|
||
|
value: operand,
|
||
|
meta: { syntax: VariadicTypeSyntax.PREFIX_DOTS },
|
||
|
};
|
||
|
},
|
||
|
peg$c172 = function(operand) {
|
||
|
return {
|
||
|
type: NodeType.VARIADIC,
|
||
|
value: operand,
|
||
|
meta: { syntax: VariadicTypeSyntax.SUFFIX_DOTS },
|
||
|
};
|
||
|
},
|
||
|
peg$c173 = function() {
|
||
|
return {
|
||
|
type: NodeType.VARIADIC,
|
||
|
value: { type: NodeType.ANY },
|
||
|
meta: { syntax: VariadicTypeSyntax.ONLY_DOTS },
|
||
|
};
|
||
|
},
|
||
|
|
||
|
peg$currPos = 0,
|
||
|
peg$savedPos = 0,
|
||
|
peg$posDetailsCache = [{ line: 1, column: 1 }],
|
||
|
peg$maxFailPos = 0,
|
||
|
peg$maxFailExpected = [],
|
||
|
peg$silentFails = 0,
|
||
|
|
||
|
peg$resultsCache = {},
|
||
|
|
||
|
peg$result;
|
||
|
|
||
|
if ("startRule" in options) {
|
||
|
if (!(options.startRule in peg$startRuleFunctions)) {
|
||
|
throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
|
||
|
}
|
||
|
|
||
|
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
||
|
}
|
||
|
|
||
|
function text() {
|
||
|
return input.substring(peg$savedPos, peg$currPos);
|
||
|
}
|
||
|
|
||
|
function location() {
|
||
|
return peg$computeLocation(peg$savedPos, peg$currPos);
|
||
|
}
|
||
|
|
||
|
function expected(description, location) {
|
||
|
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
|
||
|
|
||
|
throw peg$buildStructuredError(
|
||
|
[peg$otherExpectation(description)],
|
||
|
input.substring(peg$savedPos, peg$currPos),
|
||
|
location
|
||
|
);
|
||
|
}
|
||
|
|
||
|
function error(message, location) {
|
||
|
location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)
|
||
|
|
||
|
throw peg$buildSimpleError(message, location);
|
||
|
}
|
||
|
|
||
|
function peg$literalExpectation(text, ignoreCase) {
|
||
|
return { type: "literal", text: text, ignoreCase: ignoreCase };
|
||
|
}
|
||
|
|
||
|
function peg$classExpectation(parts, inverted, ignoreCase) {
|
||
|
return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
|
||
|
}
|
||
|
|
||
|
function peg$anyExpectation() {
|
||
|
return { type: "any" };
|
||
|
}
|
||
|
|
||
|
function peg$endExpectation() {
|
||
|
return { type: "end" };
|
||
|
}
|
||
|
|
||
|
function peg$otherExpectation(description) {
|
||
|
return { type: "other", description: description };
|
||
|
}
|
||
|
|
||
|
function peg$computePosDetails(pos) {
|
||
|
var details = peg$posDetailsCache[pos], p;
|
||
|
|
||
|
if (details) {
|
||
|
return details;
|
||
|
} else {
|
||
|
p = pos - 1;
|
||
|
while (!peg$posDetailsCache[p]) {
|
||
|
p--;
|
||
|
}
|
||
|
|
||
|
details = peg$posDetailsCache[p];
|
||
|
details = {
|
||
|
line: details.line,
|
||
|
column: details.column
|
||
|
};
|
||
|
|
||
|
while (p < pos) {
|
||
|
if (input.charCodeAt(p) === 10) {
|
||
|
details.line++;
|
||
|
details.column = 1;
|
||
|
} else {
|
||
|
details.column++;
|
||
|
}
|
||
|
|
||
|
p++;
|
||
|
}
|
||
|
|
||
|
peg$posDetailsCache[pos] = details;
|
||
|
return details;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function peg$computeLocation(startPos, endPos) {
|
||
|
var startPosDetails = peg$computePosDetails(startPos),
|
||
|
endPosDetails = peg$computePosDetails(endPos);
|
||
|
|
||
|
return {
|
||
|
start: {
|
||
|
offset: startPos,
|
||
|
line: startPosDetails.line,
|
||
|
column: startPosDetails.column
|
||
|
},
|
||
|
end: {
|
||
|
offset: endPos,
|
||
|
line: endPosDetails.line,
|
||
|
column: endPosDetails.column
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function peg$fail(expected) {
|
||
|
if (peg$currPos < peg$maxFailPos) { return; }
|
||
|
|
||
|
if (peg$currPos > peg$maxFailPos) {
|
||
|
peg$maxFailPos = peg$currPos;
|
||
|
peg$maxFailExpected = [];
|
||
|
}
|
||
|
|
||
|
peg$maxFailExpected.push(expected);
|
||
|
}
|
||
|
|
||
|
function peg$buildSimpleError(message, location) {
|
||
|
return new peg$SyntaxError(message, null, null, location);
|
||
|
}
|
||
|
|
||
|
function peg$buildStructuredError(expected, found, location) {
|
||
|
return new peg$SyntaxError(
|
||
|
peg$SyntaxError.buildMessage(expected, found),
|
||
|
expected,
|
||
|
found,
|
||
|
location
|
||
|
);
|
||
|
}
|
||
|
|
||
|
function peg$parseTopTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 0,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parse_();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseUnionTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseIntersectionTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseArrayTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseGenericTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseRecordTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseTupleTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseArrowTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseFunctionTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseTypeQueryExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseKeyQueryExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseBroadNamepathExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseParenthesizedExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseValueExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseAnyTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse_();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c0(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseWS() {
|
||
|
var s0, s1, s2;
|
||
|
|
||
|
var key = peg$currPos * 82 + 1,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s0 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s0 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (peg$c3.test(input.charAt(peg$currPos))) {
|
||
|
s1 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c4); }
|
||
|
}
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = null;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
if (peg$c5.test(input.charAt(peg$currPos))) {
|
||
|
s2 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c6); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s1 = [s1, s2];
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parse_() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 2,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = [];
|
||
|
s1 = peg$parseWS();
|
||
|
while (s1 !== peg$FAILED) {
|
||
|
s0.push(s1);
|
||
|
s1 = peg$parseWS();
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parse__() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 3,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = [];
|
||
|
s1 = peg$parseWS();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
while (s1 !== peg$FAILED) {
|
||
|
s0.push(s1);
|
||
|
s1 = peg$parseWS();
|
||
|
}
|
||
|
} else {
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseJsIdentifier() {
|
||
|
var s0, s1, s2, s3, s4;
|
||
|
|
||
|
var key = peg$currPos * 82 + 4,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (peg$c7.test(input.charAt(peg$currPos))) {
|
||
|
s2 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c8); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = [];
|
||
|
if (peg$c9.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c10); }
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c9.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c10); }
|
||
|
}
|
||
|
}
|
||
|
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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseNamepathExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
||
|
|
||
|
var key = peg$currPos * 82 + 5,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseParenthesizedExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseImportTypeExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseTypeNameExprJsDocFlavored();
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseInfixNamepathOperator();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s7 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseMemberName();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7, s8, s9];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseInfixNamepathOperator();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s7 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseMemberName();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7, s8, s9];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c13(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseTypeNameExprJsDocFlavored() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 6,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
s2 = peg$currPos;
|
||
|
if (peg$c7.test(input.charAt(peg$currPos))) {
|
||
|
s3 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c8); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = [];
|
||
|
if (peg$c14.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c15); }
|
||
|
}
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c14.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c15); }
|
||
|
}
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s3 = [s3, s4];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s1 = input.substring(s1, peg$currPos);
|
||
|
} else {
|
||
|
s1 = s2;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c16(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseMemberName() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 7,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s1 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s3 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c24(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s1 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s3 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c29(s2);
|
||
|
s0 = s1;
|
||
|
} 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$parseJsIdentifier();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c30(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseInfixNamepathOperator() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 8,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseMemberTypeOperator();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseInstanceMemberTypeOperator();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseInnerMemberTypeOperator();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseQualifiedMemberName() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 9,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseTypeNameExprJsDocFlavored();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
s5 = peg$c31;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c32); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseTypeNameExprJsDocFlavored();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
s5 = peg$c31;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c32); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseTypeNameExprJsDocFlavored();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c33(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseMemberTypeOperator() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 10,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
s1 = peg$c31;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c32); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c34();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseInnerMemberTypeOperator() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 11,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 126) {
|
||
|
s1 = peg$c35;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c36); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c37();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseInstanceMemberTypeOperator() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 12,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 35) {
|
||
|
s1 = peg$c38;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c39); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c40();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseBroadNamepathExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 13,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseExternalNameExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseModuleNameExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseNamepathExpr();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseExternalNameExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
||
|
|
||
|
var key = peg$currPos * 82 + 14,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 8) === peg$c41) {
|
||
|
s1 = peg$c41;
|
||
|
peg$currPos += 8;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c42); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s3 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseMemberName();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = [];
|
||
|
s7 = peg$currPos;
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseInfixNamepathOperator();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s10 = peg$parse_();
|
||
|
if (s10 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s11 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s11 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s11 === peg$FAILED) {
|
||
|
s11 = null;
|
||
|
}
|
||
|
if (s11 !== peg$FAILED) {
|
||
|
s12 = peg$parse_();
|
||
|
if (s12 !== peg$FAILED) {
|
||
|
s13 = peg$parseMemberName();
|
||
|
if (s13 !== peg$FAILED) {
|
||
|
s8 = [s8, s9, s10, s11, s12, s13];
|
||
|
s7 = s8;
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
while (s7 !== peg$FAILED) {
|
||
|
s6.push(s7);
|
||
|
s7 = peg$currPos;
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseInfixNamepathOperator();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s10 = peg$parse_();
|
||
|
if (s10 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s11 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s11 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s11 === peg$FAILED) {
|
||
|
s11 = null;
|
||
|
}
|
||
|
if (s11 !== peg$FAILED) {
|
||
|
s12 = peg$parse_();
|
||
|
if (s12 !== peg$FAILED) {
|
||
|
s13 = peg$parseMemberName();
|
||
|
if (s13 !== peg$FAILED) {
|
||
|
s8 = [s8, s9, s10, s11, s12, s13];
|
||
|
s7 = s8;
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s7;
|
||
|
s7 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c45(s5, s6);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseModuleNameExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 15,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 6) === peg$c46) {
|
||
|
s1 = peg$c46;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c47); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s3 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseModulePathExpr();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c48(s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseModulePathExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
||
|
|
||
|
var key = peg$currPos * 82 + 16,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseFilePathExpr();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseInfixNamepathOperator();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s7 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseMemberName();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7, s8, s9];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseInfixNamepathOperator();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 6) === peg$c11) {
|
||
|
s7 = peg$c11;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c12); }
|
||
|
}
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s9 = peg$parseMemberName();
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7, s8, s9];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c49(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFilePathExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 17,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s1 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s3 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c50(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s1 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s3 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c51(s2);
|
||
|
s0 = s1;
|
||
|
} 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$currPos;
|
||
|
s2 = [];
|
||
|
if (peg$c52.test(input.charAt(peg$currPos))) {
|
||
|
s3 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c53); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
if (peg$c52.test(input.charAt(peg$currPos))) {
|
||
|
s3 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c53); }
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s1 = input.substring(s1, peg$currPos);
|
||
|
} else {
|
||
|
s1 = s2;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c54(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseAnyTypeExpr() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 18,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 42) {
|
||
|
s1 = peg$c55;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c56); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c57();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseUnknownTypeExpr() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 19,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 63) {
|
||
|
s1 = peg$c58;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c59); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c60();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseValueExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 20,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseStringLiteralExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseNumberLiteralExpr();
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseStringLiteralExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 21,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s1 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s3 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c61(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s1 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s3 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c62(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseNumberLiteralExpr() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 22,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseBinNumberLiteralExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseOctNumberLiteralExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseHexNumberLiteralExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseDecimalNumberLiteralExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c63(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseDecimalNumberLiteralExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 23,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 43) {
|
||
|
s2 = peg$c64;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c65); }
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 45) {
|
||
|
s2 = peg$c66;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c67); }
|
||
|
}
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseUnsignedDecimalNumberLiteralExpr();
|
||
|
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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseUnsignedDecimalNumberLiteralExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 24,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
s5 = peg$c31;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c32); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = [];
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
while (s7 !== peg$FAILED) {
|
||
|
s6.push(s7);
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
}
|
||
|
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;
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s3 = [s3, s4];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 46) {
|
||
|
s3 = peg$c31;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c32); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = [];
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s3 = [s3, s4];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 101) {
|
||
|
s4 = peg$c70;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c71); }
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 43) {
|
||
|
s5 = peg$c64;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c65); }
|
||
|
}
|
||
|
if (s5 === peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 45) {
|
||
|
s5 = peg$c66;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c67); }
|
||
|
}
|
||
|
}
|
||
|
if (s5 === peg$FAILED) {
|
||
|
s5 = null;
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = [];
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
while (s7 !== peg$FAILED) {
|
||
|
s6.push(s7);
|
||
|
if (peg$c68.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c69); }
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
if (s3 === peg$FAILED) {
|
||
|
s3 = null;
|
||
|
}
|
||
|
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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseBinNumberLiteralExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 25,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 45) {
|
||
|
s2 = peg$c66;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c67); }
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== 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$c73); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = [];
|
||
|
if (peg$c74.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c75); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c74.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c75); }
|
||
|
}
|
||
|
}
|
||
|
} 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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseOctNumberLiteralExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 26,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 45) {
|
||
|
s2 = peg$c66;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c67); }
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 2) === peg$c76) {
|
||
|
s3 = peg$c76;
|
||
|
peg$currPos += 2;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c77); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = [];
|
||
|
if (peg$c78.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c79); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c78.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c79); }
|
||
|
}
|
||
|
}
|
||
|
} 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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseHexNumberLiteralExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 27,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 45) {
|
||
|
s2 = peg$c66;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c67); }
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 2) === peg$c80) {
|
||
|
s3 = peg$c80;
|
||
|
peg$currPos += 2;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c81); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = [];
|
||
|
if (peg$c82.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c83); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c82.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c83); }
|
||
|
}
|
||
|
}
|
||
|
} 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) {
|
||
|
s0 = input.substring(s0, peg$currPos);
|
||
|
} else {
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseIntersectionTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 28,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseIntersectionTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 38) {
|
||
|
s3 = peg$c84;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c85); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseIntersectionTypeExpr();
|
||
|
if (s5 === peg$FAILED) {
|
||
|
s5 = peg$parseIntersectionTypeExprOperand();
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c86(s1, s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseIntersectionTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 29,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseUnionTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 30,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseUnionTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 124) {
|
||
|
s3 = peg$c87;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c88); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseUnionTypeExpr();
|
||
|
if (s5 === peg$FAILED) {
|
||
|
s5 = peg$parseUnionTypeExprOperand();
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c89(s1, s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseUnionTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 31,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseUnaryUnionTypeExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 32,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseSuffixUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parsePrefixUnaryUnionTypeExpr();
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixUnaryUnionTypeExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 33,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parsePrefixOptionalTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parsePrefixNotNullableTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parsePrefixNullableTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixUnaryUnionTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 34,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseTypeQueryExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 35,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 6) === peg$c90) {
|
||
|
s1 = peg$c90;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c91); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse__();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseQualifiedMemberName();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c92(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseKeyQueryExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 36,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 5) === peg$c93) {
|
||
|
s1 = peg$c93;
|
||
|
peg$currPos += 5;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c94); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse__();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseKeyQueryExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c95(s1, s3);
|
||
|
s0 = s1;
|
||
|
} 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, 5) === peg$c93) {
|
||
|
s1 = peg$c93;
|
||
|
peg$currPos += 5;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c94); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseParenthesizedExpr();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c95(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseKeyQueryExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 37,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseImportTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 38,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 6) === peg$c96) {
|
||
|
s1 = peg$c96;
|
||
|
peg$currPos += 6;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c97); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s3 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseStringLiteralExpr();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s7 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c102(s1, s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixNullableTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 39,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 63) {
|
||
|
s1 = peg$c58;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c59); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parsePrefixUnaryUnionTypeExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c103(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixNotNullableTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 40,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 33) {
|
||
|
s1 = peg$c104;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c105); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parsePrefixUnaryUnionTypeExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c106(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixOptionalTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 41,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 61) {
|
||
|
s1 = peg$c107;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c108); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parsePrefixUnaryUnionTypeExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c109(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixUnaryUnionTypeExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 42,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseSuffixOptionalTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseSuffixNullableTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseSuffixNotNullableTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixUnaryUnionTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 43,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parsePrefixUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixNullableTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 44,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseSuffixUnaryUnionTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 63) {
|
||
|
s3 = peg$c58;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c59); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c110(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixNotNullableTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 45,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseSuffixUnaryUnionTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 33) {
|
||
|
s3 = peg$c104;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c105); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c111(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixOptionalTypeExpr() {
|
||
|
var s0, s1, s2, s3;
|
||
|
|
||
|
var key = peg$currPos * 82 + 46,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseSuffixNullableTypeExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseSuffixNotNullableTypeExpr();
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = peg$parseSuffixUnaryUnionTypeExprOperand();
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 61) {
|
||
|
s3 = peg$c107;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c108); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c112(s1, s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 47,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseGenericTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseGenericTypeStartToken();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parseGenericTypeExprTypeParamList();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseGenericTypeEndToken();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c113(s1, s3, s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 48,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeExprTypeParamOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 49,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeExprTypeParamList() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 50,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseGenericTypeExprTypeParamOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseGenericTypeExprTypeParamOperand();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseGenericTypeExprTypeParamOperand();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c116(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeStartToken() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 51,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseGenericTypeEcmaScriptFlavoredStartToken();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeTypeScriptFlavoredStartToken();
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeEcmaScriptFlavoredStartToken() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 52,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 2) === peg$c117) {
|
||
|
s1 = peg$c117;
|
||
|
peg$currPos += 2;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c118); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c119();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeTypeScriptFlavoredStartToken() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 53,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 60) {
|
||
|
s1 = peg$c120;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c121); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c122();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseGenericTypeEndToken() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 54,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
if (input.charCodeAt(peg$currPos) === 62) {
|
||
|
s0 = peg$c123;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s0 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c124); }
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseArrayTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 55,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseArrayTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 91) {
|
||
|
s5 = peg$c125;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c126); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 93) {
|
||
|
s7 = peg$c127;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c128); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 91) {
|
||
|
s5 = peg$c125;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c126); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 93) {
|
||
|
s7 = peg$c127;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c128); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6, s7];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c129(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseArrayTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 56,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseArrowTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 57,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 3) === peg$c130) {
|
||
|
s1 = peg$c130;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c131); }
|
||
|
}
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = null;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseArrowTypeExprParamsList();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 2) === peg$c132) {
|
||
|
s5 = peg$c132;
|
||
|
peg$currPos += 2;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c133); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseFunctionTypeExprReturnableOperand();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c134(s1, s3, s7);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseArrowTypeExprParamsList() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 58,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s3 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c135();
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseArrowTypeExprParams();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s5 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c136(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseArrowTypeExprParams() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
|
||
|
|
||
|
var key = peg$currPos * 82 + 59,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = [];
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseJsIdentifier();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s5 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s9 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s9 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s10 = peg$parse_();
|
||
|
if (s10 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6, s7, s8, s9, s10];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
while (s2 !== peg$FAILED) {
|
||
|
s1.push(s2);
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseJsIdentifier();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s5 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s9 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s9 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
s10 = peg$parse_();
|
||
|
if (s10 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6, s7, s8, s9, s10];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseVariadicNameExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c137(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseVariadicNameExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 60,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 3) === peg$c138) {
|
||
|
s1 = peg$c138;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c139); }
|
||
|
}
|
||
|
if (s1 === peg$FAILED) {
|
||
|
s1 = null;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseJsIdentifier();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s5 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s7 === peg$FAILED) {
|
||
|
s7 = null;
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c140(s1, s3, s7);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
||
|
|
||
|
var key = peg$currPos * 82 + 61,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 8) === peg$c141) {
|
||
|
s1 = peg$c141;
|
||
|
peg$currPos += 8;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c142); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseFunctionTypeExprParamsList();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s6 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parse_();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parseFunctionTypeExprReturnableOperand();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
s6 = [s6, s7, s8];
|
||
|
s5 = s6;
|
||
|
} else {
|
||
|
peg$currPos = s5;
|
||
|
s5 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s5;
|
||
|
s5 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s5;
|
||
|
s5 = peg$FAILED;
|
||
|
}
|
||
|
if (s5 === peg$FAILED) {
|
||
|
s5 = null;
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c143(s3, s5);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExprParamsList() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
|
||
|
|
||
|
var key = peg$currPos * 82 + 62,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseFunctionTypeExprModifier();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parseFunctionTypeExprParams();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parse_();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s9 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s9 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s9 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c144(s3, s7);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseFunctionTypeExprModifier();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s5 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c145(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s3 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c146();
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseFunctionTypeExprParams();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s5 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c147(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExprModifier() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 63,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 4) === peg$c148) {
|
||
|
s2 = peg$c148;
|
||
|
peg$currPos += 4;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c149); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse_();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s4 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s2 = [s2, s3, s4, s5, s6];
|
||
|
s1 = s2;
|
||
|
} else {
|
||
|
peg$currPos = s1;
|
||
|
s1 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s1;
|
||
|
s1 = peg$FAILED;
|
||
|
}
|
||
|
} 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$c150(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 3) === peg$c130) {
|
||
|
s2 = peg$c130;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c131); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse_();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s4 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s2 = [s2, s3, s4, s5, s6];
|
||
|
s1 = s2;
|
||
|
} else {
|
||
|
peg$currPos = s1;
|
||
|
s1 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s1;
|
||
|
s1 = peg$FAILED;
|
||
|
}
|
||
|
} 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$c151(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExprParams() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 64,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = [];
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
while (s2 !== peg$FAILED) {
|
||
|
s1.push(s2);
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseFunctionTypeExprParamOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExprOperand();
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c152(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExprParamOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 65,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseFunctionTypeExprReturnableOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 66,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parsePrefixUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseRecordTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 67,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 123) {
|
||
|
s1 = peg$c153;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c154); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseRecordTypeExprEntries();
|
||
|
if (s3 === peg$FAILED) {
|
||
|
s3 = null;
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 125) {
|
||
|
s5 = peg$c155;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c156); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c157(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseRecordTypeExprEntries() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7;
|
||
|
|
||
|
var key = peg$currPos * 82 + 68,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseRecordTypeExprEntry();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = [];
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$currPos;
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s6 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
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 = peg$currPos;
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 59) {
|
||
|
s6 = peg$c158;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c159); }
|
||
|
}
|
||
|
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 = peg$currPos;
|
||
|
s5 = [];
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
while (s6 !== peg$FAILED) {
|
||
|
s5.push(s6);
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (peg$c3.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c4); }
|
||
|
}
|
||
|
if (s6 === peg$FAILED) {
|
||
|
s6 = null;
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (peg$c5.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c6); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s5 = [s5, s6, s7];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parseRecordTypeExprEntry();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
while (s3 !== peg$FAILED) {
|
||
|
s2.push(s3);
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$currPos;
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s6 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
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 = peg$currPos;
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 59) {
|
||
|
s6 = peg$c158;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c159); }
|
||
|
}
|
||
|
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 = peg$currPos;
|
||
|
s5 = [];
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
while (s6 !== peg$FAILED) {
|
||
|
s5.push(s6);
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (peg$c3.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c4); }
|
||
|
}
|
||
|
if (s6 === peg$FAILED) {
|
||
|
s6 = null;
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
if (peg$c5.test(input.charAt(peg$currPos))) {
|
||
|
s7 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s7 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c6); }
|
||
|
}
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s5 = [s5, s6, s7];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parseRecordTypeExprEntry();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$currPos;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
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;
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 59) {
|
||
|
s5 = peg$c158;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c159); }
|
||
|
}
|
||
|
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;
|
||
|
s4 = [];
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
while (s5 !== peg$FAILED) {
|
||
|
s4.push(s5);
|
||
|
if (peg$c1.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c2); }
|
||
|
}
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (peg$c3.test(input.charAt(peg$currPos))) {
|
||
|
s5 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c4); }
|
||
|
}
|
||
|
if (s5 === peg$FAILED) {
|
||
|
s5 = null;
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (peg$c5.test(input.charAt(peg$currPos))) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c6); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s4 = [s4, s5, s6];
|
||
|
s3 = s4;
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s3;
|
||
|
s3 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 === peg$FAILED) {
|
||
|
s3 = null;
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c160(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseRecordTypeExprEntry() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
|
||
|
|
||
|
var key = peg$currPos * 82 + 69,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 8) === peg$c161) {
|
||
|
s2 = peg$c161;
|
||
|
peg$currPos += 8;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c162); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse__();
|
||
|
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) {
|
||
|
s1 = null;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseRecordTypeExprEntryKey();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse_();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 63) {
|
||
|
s4 = peg$c58;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c59); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = null;
|
||
|
}
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
s5 = peg$parse_();
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 58) {
|
||
|
s6 = peg$c43;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c44); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s7 = peg$parse_();
|
||
|
if (s7 !== peg$FAILED) {
|
||
|
s8 = peg$parseRecordTypeExprEntryOperand();
|
||
|
if (s8 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c163(s1, s2, s4, s8);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} 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$currPos;
|
||
|
if (input.substr(peg$currPos, 8) === peg$c161) {
|
||
|
s2 = peg$c161;
|
||
|
peg$currPos += 8;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c162); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parse__();
|
||
|
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) {
|
||
|
s1 = null;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseRecordTypeExprEntryKey();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c164(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseRecordTypeExprEntryKey() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 70,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s1 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c27.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c28); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 34) {
|
||
|
s3 = peg$c25;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c26); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c165(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s1 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$currPos;
|
||
|
s3 = [];
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
while (s4 !== peg$FAILED) {
|
||
|
s3.push(s4);
|
||
|
if (peg$c19.test(input.charAt(peg$currPos))) {
|
||
|
s4 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s4 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c20); }
|
||
|
}
|
||
|
if (s4 === peg$FAILED) {
|
||
|
s4 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 92) {
|
||
|
s5 = peg$c21;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c22); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
if (input.length > peg$currPos) {
|
||
|
s6 = input.charAt(peg$currPos);
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s6 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c23); }
|
||
|
}
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s5 = [s5, s6];
|
||
|
s4 = s5;
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s4;
|
||
|
s4 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s2 = input.substring(s2, peg$currPos);
|
||
|
} else {
|
||
|
s2 = s3;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 39) {
|
||
|
s3 = peg$c17;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s3 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c18); }
|
||
|
}
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c166(s2);
|
||
|
s0 = s1;
|
||
|
} 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$currPos;
|
||
|
s2 = peg$parseJsIdentifier();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseUnsignedDecimalNumberLiteralExpr();
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s1 = input.substring(s1, peg$currPos);
|
||
|
} else {
|
||
|
s1 = s2;
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c167(s1);
|
||
|
}
|
||
|
s0 = s1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseRecordTypeExprEntryOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 71,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseTupleTypeExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 72,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 91) {
|
||
|
s1 = peg$c125;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c126); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseTupleTypeExprEntries();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 93) {
|
||
|
s5 = peg$c127;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c128); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c168(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseTupleTypeExprEntries() {
|
||
|
var s0, s1, s2, s3, s4, s5, s6;
|
||
|
|
||
|
var key = peg$currPos * 82 + 73,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = [];
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseTupleTypeExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
while (s2 !== peg$FAILED) {
|
||
|
s1.push(s2);
|
||
|
s2 = peg$currPos;
|
||
|
s3 = peg$parseTupleTypeExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 44) {
|
||
|
s5 = peg$c114;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c115); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
s6 = peg$parse_();
|
||
|
if (s6 !== peg$FAILED) {
|
||
|
s3 = [s3, s4, s5, s6];
|
||
|
s2 = s3;
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s2;
|
||
|
s2 = peg$FAILED;
|
||
|
}
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExpr();
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExprOperand();
|
||
|
}
|
||
|
if (s2 === peg$FAILED) {
|
||
|
s2 = null;
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c169(s1, s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseTupleTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 74,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseParenthesizedExpr() {
|
||
|
var s0, s1, s2, s3, s4, s5;
|
||
|
|
||
|
var key = peg$currPos * 82 + 75,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.charCodeAt(peg$currPos) === 40) {
|
||
|
s1 = peg$c98;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c99); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parse_();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
s3 = peg$parseParenthesizedExprOperand();
|
||
|
if (s3 !== peg$FAILED) {
|
||
|
s4 = peg$parse_();
|
||
|
if (s4 !== peg$FAILED) {
|
||
|
if (input.charCodeAt(peg$currPos) === 41) {
|
||
|
s5 = peg$c100;
|
||
|
peg$currPos++;
|
||
|
} else {
|
||
|
s5 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c101); }
|
||
|
}
|
||
|
if (s5 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c170(s3);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseParenthesizedExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 76,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseVariadicTypeExpr() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 77,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parsePrefixVariadicTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseSuffixVariadicTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyVariadicTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parsePrefixVariadicTypeExpr() {
|
||
|
var s0, s1, s2;
|
||
|
|
||
|
var key = peg$currPos * 82 + 78,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 3) === peg$c138) {
|
||
|
s1 = peg$c138;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c139); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
s2 = peg$parseVariadicTypeExprOperand();
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c171(s2);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseSuffixVariadicTypeExpr() {
|
||
|
var s0, s1, s2;
|
||
|
|
||
|
var key = peg$currPos * 82 + 79,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
s1 = peg$parseVariadicTypeExprOperand();
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
if (input.substr(peg$currPos, 3) === peg$c138) {
|
||
|
s2 = peg$c138;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s2 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c139); }
|
||
|
}
|
||
|
if (s2 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c172(s1);
|
||
|
s0 = s1;
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
} else {
|
||
|
peg$currPos = s0;
|
||
|
s0 = peg$FAILED;
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseAnyVariadicTypeExpr() {
|
||
|
var s0, s1;
|
||
|
|
||
|
var key = peg$currPos * 82 + 80,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$currPos;
|
||
|
if (input.substr(peg$currPos, 3) === peg$c138) {
|
||
|
s1 = peg$c138;
|
||
|
peg$currPos += 3;
|
||
|
} else {
|
||
|
s1 = peg$FAILED;
|
||
|
if (peg$silentFails === 0) { peg$fail(peg$c139); }
|
||
|
}
|
||
|
if (s1 !== peg$FAILED) {
|
||
|
peg$savedPos = s0;
|
||
|
s1 = peg$c173();
|
||
|
}
|
||
|
s0 = s1;
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
function peg$parseVariadicTypeExprOperand() {
|
||
|
var s0;
|
||
|
|
||
|
var key = peg$currPos * 82 + 81,
|
||
|
cached = peg$resultsCache[key];
|
||
|
|
||
|
if (cached) {
|
||
|
peg$currPos = cached.nextPos;
|
||
|
|
||
|
return cached.result;
|
||
|
}
|
||
|
|
||
|
s0 = peg$parseUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseIntersectionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnaryUnionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseRecordTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTupleTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrowTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseFunctionTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseParenthesizedExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseTypeQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseKeyQueryExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseArrayTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseGenericTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseBroadNamepathExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseValueExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseAnyTypeExpr();
|
||
|
if (s0 === peg$FAILED) {
|
||
|
s0 = peg$parseUnknownTypeExpr();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
|
||
|
|
||
|
return s0;
|
||
|
}
|
||
|
|
||
|
|
||
|
const meta = require('../lib/SyntaxType.js');
|
||
|
const {
|
||
|
GenericTypeSyntax,
|
||
|
VariadicTypeSyntax, OptionalTypeSyntax,
|
||
|
NullableTypeSyntax, NotNullableTypeSyntax,
|
||
|
} = meta;
|
||
|
const NodeType = require('../lib/NodeType.js');
|
||
|
|
||
|
const NamepathOperatorType = {
|
||
|
MEMBER: 'MEMBER',
|
||
|
INNER_MEMBER: 'INNER_MEMBER',
|
||
|
INSTANCE_MEMBER: 'INSTANCE_MEMBER',
|
||
|
};
|
||
|
|
||
|
|
||
|
peg$result = peg$startRuleFunction();
|
||
|
|
||
|
if (peg$result !== peg$FAILED && peg$currPos === input.length) {
|
||
|
return peg$result;
|
||
|
} else {
|
||
|
if (peg$result !== peg$FAILED && peg$currPos < input.length) {
|
||
|
peg$fail(peg$endExpectation());
|
||
|
}
|
||
|
|
||
|
throw peg$buildStructuredError(
|
||
|
peg$maxFailExpected,
|
||
|
peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
|
||
|
peg$maxFailPos < input.length
|
||
|
? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
|
||
|
: peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
SyntaxError: peg$SyntaxError,
|
||
|
parse: peg$parse
|
||
|
};
|