/* * 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.UNION, left, right, }; }, peg$c87 = "typeof", peg$c88 = peg$literalExpectation("typeof", false), peg$c89 = function(operator, name) { return { type: NodeType.TYPE_QUERY, name, }; }, peg$c90 = function(operator, operand) { return { type: NodeType.NULLABLE, value: operand, meta: { syntax: NullableTypeSyntax.PREFIX_QUESTION_MARK }, }; }, peg$c91 = "!", peg$c92 = peg$literalExpectation("!", false), peg$c93 = function(operator, operand) { return { type: NodeType.NOT_NULLABLE, value: operand, meta: { syntax: NotNullableTypeSyntax.PREFIX_BANG }, }; }, peg$c94 = "=", peg$c95 = peg$literalExpectation("=", false), peg$c96 = function(operator, operand) { return { type: NodeType.OPTIONAL, value: operand, meta: { syntax: OptionalTypeSyntax.PREFIX_EQUALS_SIGN }, }; }, peg$c97 = function(operand, operator) { return { type: NodeType.NULLABLE, value: operand, meta: { syntax: NullableTypeSyntax.SUFFIX_QUESTION_MARK }, }; }, peg$c98 = function(operand, operator) { return { type: NodeType.NOT_NULLABLE, value: operand, meta: { syntax: NotNullableTypeSyntax.SUFFIX_BANG }, }; }, peg$c99 = function(operand, operator) { return { type: NodeType.OPTIONAL, value: operand, meta: { syntax: OptionalTypeSyntax.SUFFIX_EQUALS_SIGN }, }; }, peg$c100 = function(operand, syntax, params) { return { type: NodeType.GENERIC, subject: operand, objects: params, meta: { syntax }, }; }, peg$c101 = ",", peg$c102 = peg$literalExpectation(",", false), peg$c103 = function(first, restsWithComma) { return restsWithComma.reduce(function(params, tokens) { return params.concat([tokens[3]]); }, [first]); }, peg$c104 = ".<", peg$c105 = peg$literalExpectation(".<", false), peg$c106 = function() { return GenericTypeSyntax.ANGLE_BRACKET_WITH_DOT; }, peg$c107 = "<", peg$c108 = peg$literalExpectation("<", false), peg$c109 = function() { return GenericTypeSyntax.ANGLE_BRACKET; }, peg$c110 = ">", peg$c111 = peg$literalExpectation(">", false), peg$c112 = "function", peg$c113 = peg$literalExpectation("function", false), peg$c114 = 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$c115 = "(", peg$c116 = peg$literalExpectation("(", false), peg$c117 = ")", peg$c118 = peg$literalExpectation(")", false), peg$c119 = function(modifier, params) { return { params, modifier }; }, peg$c120 = function(modifier) { return { params: [], modifier }; }, peg$c121 = function() { return { params: [], modifier: { nodeThis: null, nodeNew: null } }; }, peg$c122 = function(params) { return { params, modifier: { nodeThis: null, nodeNew: null } }; }, peg$c123 = "this", peg$c124 = peg$literalExpectation("this", false), peg$c125 = function(modifierThis) { return { nodeThis: modifierThis[4], nodeNew: null }; }, peg$c126 = "new", peg$c127 = peg$literalExpectation("new", false), peg$c128 = function(modifierNew) { return { nodeThis: null, nodeNew: modifierNew[4] }; }, peg$c129 = function(paramsWithComma, lastParam) { return paramsWithComma.reduceRight(function(params, tokens) { const [param] = tokens; return [param].concat(params); }, lastParam ? [lastParam] : []); }, peg$c130 = "{", peg$c131 = peg$literalExpectation("{", false), peg$c132 = "}", peg$c133 = peg$literalExpectation("}", false), peg$c134 = function(entries) { return { type: NodeType.RECORD, entries: entries || [], }; }, peg$c135 = ";", peg$c136 = peg$literalExpectation(";", false), peg$c137 = function(first, restWithComma) { return restWithComma.reduce(function(entries, tokens) { const entry = tokens[2]; return entries.concat([entry]); }, [first]); }, peg$c138 = "readonly", peg$c139 = peg$literalExpectation("readonly", false), peg$c140 = 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$c141 = function(readonly, keyInfo) { const {quoteStyle, key} = keyInfo; return { type: NodeType.RECORD_ENTRY, key, quoteStyle, value: null, readonly: Boolean(readonly) }; }, peg$c142 = function(key) { return { quoteStyle: 'double', key: key.replace(/\\"/gu, '"') .replace(/\\\\/gu, '\\') }; }, peg$c143 = function(key) { return { quoteStyle: 'single', key: key.replace(/\\'/g, "'") .replace(/\\\\/gu, '\\') }; }, peg$c144 = function(key) { return { quoteStyle: 'none', key }; }, peg$c145 = function(wrapped) { return { type: NodeType.PARENTHESIS, value: wrapped, }; }, peg$c146 = "...", peg$c147 = peg$literalExpectation("...", false), peg$c148 = function(operand) { return { type: NodeType.VARIADIC, value: operand, meta: { syntax: VariadicTypeSyntax.PREFIX_DOTS }, }; }, peg$c149 = function(operand) { return { type: NodeType.VARIADIC, value: operand, meta: { syntax: VariadicTypeSyntax.SUFFIX_DOTS }, }; }, peg$c150 = 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 * 68 + 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$parseUnaryUnionTypeExpr(); if (s2 === peg$FAILED) { s2 = peg$parseGenericTypeExpr(); if (s2 === peg$FAILED) { s2 = peg$parseRecordTypeExpr(); if (s2 === peg$FAILED) { s2 = peg$parseFunctionTypeExpr(); if (s2 === peg$FAILED) { s2 = peg$parseTypeQueryExpr(); 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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$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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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 * 68 + 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$parseUnionTypeExpr() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 68 + 28, 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$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$parseUnionTypeExpr(); if (s5 === peg$FAILED) { s5 = peg$parseUnionTypeExprOperand(); } 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$parseUnionTypeExprOperand() { var s0; var key = peg$currPos * 68 + 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$parseFunctionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseParenthesizedExpr(); if (s0 === peg$FAILED) { s0 = peg$parseTypeQueryExpr(); 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$parseUnaryUnionTypeExpr() { var s0; var key = peg$currPos * 68 + 30, 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 * 68 + 31, 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 * 68 + 32, 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$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 * 68 + 33, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c87) { s1 = peg$c87; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s1 !== peg$FAILED) { s2 = peg$parse__(); if (s2 !== peg$FAILED) { s3 = peg$parseQualifiedMemberName(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c89(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$parsePrefixNullableTypeExpr() { var s0, s1, s2, s3; var key = peg$currPos * 68 + 34, 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$c90(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 * 68 + 35, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { s1 = peg$c91; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = peg$parsePrefixUnaryUnionTypeExprOperand(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c93(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 * 68 + 36, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 61) { s1 = peg$c94; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = peg$parsePrefixUnaryUnionTypeExprOperand(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c96(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 * 68 + 37, 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 * 68 + 38, 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$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 * 68 + 39, 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$c97(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 * 68 + 40, 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$c91; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c98(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 * 68 + 41, 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$c94; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c95); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c99(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 * 68 + 42, 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$c100(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 * 68 + 43, 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 * 68 + 44, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseUnaryUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseRecordTypeExpr(); 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$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 * 68 + 45, 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c103(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 * 68 + 46, 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 * 68 + 47, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c104) { s1 = peg$c104; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c106(); } s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseGenericTypeTypeScriptFlavoredStartToken() { var s0, s1; var key = peg$currPos * 68 + 48, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { s1 = peg$c107; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c109(); } s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseGenericTypeEndToken() { var s0; var key = peg$currPos * 68 + 49, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (input.charCodeAt(peg$currPos) === 62) { s0 = peg$c110; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c111); } } 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 * 68 + 50, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 8) === peg$c112) { s1 = peg$c112; peg$currPos += 8; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c113); } } 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$c114(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 * 68 + 51, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c115; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c117; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s9 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c119(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$c115; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } 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$c117; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c120(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$c115; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { s3 = peg$c117; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c121(); 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$c115; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } 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$c117; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c122(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 * 68 + 52, 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$c123) { s2 = peg$c123; peg$currPos += 4; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c124); } } 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$c125(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c126) { s2 = peg$c126; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c127); } } 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$c128(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 * 68 + 53, 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$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$parseFunctionTypeExprParamOperand() { var s0; var key = peg$currPos * 68 + 54, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseTypeQueryExpr(); if (s0 === peg$FAILED) { s0 = peg$parseUnaryUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseRecordTypeExpr(); 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$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 * 68 + 55, 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$parseFunctionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseParenthesizedExpr(); if (s0 === peg$FAILED) { s0 = peg$parseTypeQueryExpr(); 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 * 68 + 56, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 123) { s1 = peg$c130; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c131); } } 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$c132; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c133); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c134(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 * 68 + 57, 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$c101; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c135; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c136); } } 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$c101; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c135; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c136); } } 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$c101; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c102); } } 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$c135; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c136); } } 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$c137(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 * 68 + 58, 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$c138) { s2 = peg$c138; peg$currPos += 8; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c139); } } 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$c140(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$c138) { s2 = peg$c138; peg$currPos += 8; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c139); } } 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$c141(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 * 68 + 59, 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$c142(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$c143(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$c144(s1); } s0 = s1; } } peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseRecordTypeExprEntryOperand() { var s0; var key = peg$currPos * 68 + 60, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseUnaryUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseRecordTypeExpr(); 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$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 * 68 + 61, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { s1 = peg$c115; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } 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$c117; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c118); } } 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; } peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseParenthesizedExprOperand() { var s0; var key = peg$currPos * 68 + 62, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseUnaryUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseRecordTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseFunctionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseTypeQueryExpr(); 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 * 68 + 63, 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 * 68 + 64, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c146) { s1 = peg$c146; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c147); } } if (s1 !== peg$FAILED) { s2 = peg$parseVariadicTypeExprOperand(); if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c148(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 * 68 + 65, 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$c146) { s2 = peg$c146; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c147); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c149(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 * 68 + 66, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c146) { s1 = peg$c146; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c147); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c150(); } s0 = s1; peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseVariadicTypeExprOperand() { var s0; var key = peg$currPos * 68 + 67, cached = peg$resultsCache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseUnaryUnionTypeExpr(); if (s0 === peg$FAILED) { s0 = peg$parseRecordTypeExpr(); 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$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 };