From 1e4aecd4fcd8efe47e7ea10a4c4e96eecfb28dc0 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Tue, 24 May 2022 14:23:26 -0400 Subject: [PATCH] Delete Reducer_Peggy_GeneratedParser.js I'm pretty sure this should be in the gitignore. --- .../Reducer_Peggy_GeneratedParser.js | 4740 ----------------- 1 file changed, 4740 deletions(-) delete mode 100644 packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.js diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.js b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.js deleted file mode 100644 index 239cc876..00000000 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Peggy/Reducer_Peggy_GeneratedParser.js +++ /dev/null @@ -1,4740 +0,0 @@ -// Generated by Peggy 1.2.0. -// -// https://peggyjs.org/ - -"use strict"; - - - var toFunction = { - '-': 'subtract', - '->': 'pipe', - '!=': 'unequal', - '.-': 'dotSubtract', - '.*': 'dotMultiply', - './': 'dotDivide', - '.^': 'dotPow', - '.+': 'dotAdd', - '*': 'multiply', - '/': 'divide', - '&&': 'and', - '^': 'pow', // or xor - '+': 'add', - '<': 'smaller', - '<=': 'smallerEq', - '==': 'equal', - '>': 'larger', - '>=': 'largerEq', - '||': 'or', - 'to': 'credibleIntervalToDistribution', - } - - var unaryToFunction = { - '-': 'unaryMinus', - '!': 'not', - '.-': 'unaryDotMinus', - } - - var postOperatorToFunction = { - '.': '$_atIndex_$', - '()': '$$_applyAll_$$', - '[]': '$_atIndex_$', - } - - function nodeBlock(statements) {return{type: 'Block', statements: statements}} - function nodeBoolean(value) {return {type: 'Boolean', value: value}} - function nodeCallIndentifier(value) {return {type: 'CallIdentifier', value: value}} - function nodeExpression(args) {return {type: 'Expression', nodes: args}} - function nodeFloat(value) {return {type: 'Float', value: value}} - function makeFunctionCall(fn, args) { - if (fn === '$$_applyAll_$$') { - // Any list of values is applied from left to right anyway. - // Like in Haskell and Lisp. - // So we remove the redundant $$_applyAll_$$. - if (args[0].type === "Identifier") {args[0].type = "CallIdentifier"} - return nodeExpression(args) - } else { - return nodeExpression([nodeCallIndentifier(fn), ...args]) - } - } - function nodeIdentifier(value) {return {type: 'Identifier', value: value}} - function nodeInteger(value) {return {type: 'Integer', value: value}} - function nodeKeyValue(key, value) { - if (key.type === 'Identifier') {key.type = 'String'} - return {type: 'KeyValue', key: key, value: value}} - function nodeLambda(args, body) {return {type: 'Lambda', args: args, body: body}} - function nodeLetStatment(variable, value) {return {type: 'LetStatement', variable: variable, value: value}} - function nodeString(value) {return {type: 'String', value: value}} - function nodeTernary(condition, trueExpression, falseExpression) {return {type: 'Ternary', condition: condition, trueExpression: trueExpression, falseExpression: falseExpression}} - - -function peg$subclass(child, parent) { - function C() { this.constructor = child; } - C.prototype = parent.prototype; - child.prototype = new C(); -} - -function peg$SyntaxError(message, expected, found, location) { - var self = Error.call(this, message); - if (Object.setPrototypeOf) { - Object.setPrototypeOf(self, peg$SyntaxError.prototype); - } - self.expected = expected; - self.found = found; - self.location = location; - self.name = "SyntaxError"; - return self; -} - -peg$subclass(peg$SyntaxError, Error); - -function peg$padEnd(str, targetLength, padString) { - padString = padString || " "; - if (str.length > targetLength) { return str; } - targetLength -= str.length; - padString += padString.repeat(targetLength); - return str + padString.slice(0, targetLength); -} - -peg$SyntaxError.prototype.format = function(sources) { - var str = "Error: " + this.message; - if (this.location) { - var src = null; - var k; - for (k = 0; k < sources.length; k++) { - if (sources[k].source === this.location.source) { - src = sources[k].text.split(/\r\n|\n|\r/g); - break; - } - } - var s = this.location.start; - var loc = this.location.source + ":" + s.line + ":" + s.column; - if (src) { - var e = this.location.end; - var filler = peg$padEnd("", s.line.toString().length); - var line = src[s.line - 1]; - var last = s.line === e.line ? e.column : line.length + 1; - str += "\n --> " + loc + "\n" - + filler + " |\n" - + s.line + " | " + line + "\n" - + filler + " | " + peg$padEnd("", s.column - 1) - + peg$padEnd("", last - s.column, "^"); - } else { - str += "\n at " + loc; - } - } - return str; -}; - -peg$SyntaxError.buildMessage = function(expected, found) { - var DESCRIBE_EXPECTATION_FNS = { - literal: function(expectation) { - return "\"" + literalEscape(expectation.text) + "\""; - }, - - class: function(expectation) { - var escapedParts = expectation.parts.map(function(part) { - return Array.isArray(part) - ? classEscape(part[0]) + "-" + classEscape(part[1]) - : classEscape(part); - }); - - return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; - }, - - any: function() { - return "any character"; - }, - - end: function() { - 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 = expected.map(describeExpectation); - var i, j; - - 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 !== undefined ? options : {}; - - var peg$FAILED = {}; - var peg$source = options.grammarSource; - - var peg$startRuleFunctions = { start: peg$parsestart }; - var peg$startRuleFunction = peg$parsestart; - - var peg$c0 = "{"; - var peg$c1 = "}"; - var peg$c2 = "("; - var peg$c3 = ")"; - var peg$c4 = "="; - var peg$c5 = ","; - var peg$c6 = "if"; - var peg$c7 = "then"; - var peg$c8 = "else"; - var peg$c9 = "?"; - var peg$c10 = ":"; - var peg$c11 = "||"; - var peg$c12 = "&&"; - var peg$c13 = "=="; - var peg$c14 = "!="; - var peg$c15 = "<="; - var peg$c16 = "<"; - var peg$c17 = ">="; - var peg$c18 = ">"; - var peg$c19 = "+"; - var peg$c20 = "-"; - var peg$c21 = ".+"; - var peg$c22 = ".-"; - var peg$c23 = "*"; - var peg$c24 = "/"; - var peg$c25 = ".*"; - var peg$c26 = "./"; - var peg$c27 = "^"; - var peg$c28 = ".^"; - var peg$c29 = "to"; - var peg$c30 = "->"; - var peg$c31 = "|>"; - var peg$c32 = "!"; - var peg$c33 = "["; - var peg$c34 = "."; - var peg$c35 = "]"; - var peg$c36 = "'"; - var peg$c37 = "\""; - var peg$c38 = "true"; - var peg$c39 = "false"; - var peg$c40 = "|"; - var peg$c41 = ";"; - var peg$c42 = "//"; - var peg$c43 = "#"; - var peg$c44 = "/*"; - var peg$c45 = "*/"; - - var peg$r0 = /^[_a-z]/; - var peg$r1 = /^[_a-z0-9]/i; - var peg$r2 = /^[$_a-z]/; - var peg$r3 = /^[$_a-z0-9]/i; - var peg$r4 = /^[^']/; - var peg$r5 = /^[^"]/; - var peg$r6 = /^[e]/i; - var peg$r7 = /^[0-9]/; - var peg$r8 = /^[^\r\n]/; - var peg$r9 = /^[^*]/; - var peg$r10 = /^[ \t]/; - var peg$r11 = /^[\n\r]/; - - var peg$e0 = peg$literalExpectation("{", false); - var peg$e1 = peg$literalExpectation("}", false); - var peg$e2 = peg$literalExpectation("(", false); - var peg$e3 = peg$literalExpectation(")", false); - var peg$e4 = peg$otherExpectation("assignment"); - var peg$e5 = peg$literalExpectation("=", false); - var peg$e6 = peg$literalExpectation(",", false); - var peg$e7 = peg$literalExpectation("if", false); - var peg$e8 = peg$literalExpectation("then", false); - var peg$e9 = peg$literalExpectation("else", false); - var peg$e10 = peg$literalExpectation("?", false); - var peg$e11 = peg$literalExpectation(":", false); - var peg$e12 = peg$otherExpectation("operator"); - var peg$e13 = peg$literalExpectation("||", false); - var peg$e14 = peg$literalExpectation("&&", false); - var peg$e15 = peg$literalExpectation("==", false); - var peg$e16 = peg$literalExpectation("!=", false); - var peg$e17 = peg$literalExpectation("<=", false); - var peg$e18 = peg$literalExpectation("<", false); - var peg$e19 = peg$literalExpectation(">=", false); - var peg$e20 = peg$literalExpectation(">", false); - var peg$e21 = peg$literalExpectation("+", false); - var peg$e22 = peg$literalExpectation("-", false); - var peg$e23 = peg$literalExpectation(".+", false); - var peg$e24 = peg$literalExpectation(".-", false); - var peg$e25 = peg$literalExpectation("*", false); - var peg$e26 = peg$literalExpectation("/", false); - var peg$e27 = peg$literalExpectation(".*", false); - var peg$e28 = peg$literalExpectation("./", false); - var peg$e29 = peg$literalExpectation("^", false); - var peg$e30 = peg$literalExpectation(".^", false); - var peg$e31 = peg$literalExpectation("to", false); - var peg$e32 = peg$literalExpectation("->", false); - var peg$e33 = peg$literalExpectation("|>", false); - var peg$e34 = peg$otherExpectation("unary operator"); - var peg$e35 = peg$literalExpectation("!", false); - var peg$e36 = peg$literalExpectation("[", false); - var peg$e37 = peg$literalExpectation(".", false); - var peg$e38 = peg$literalExpectation("]", false); - var peg$e39 = peg$otherExpectation("identifier"); - var peg$e40 = peg$classExpectation(["_", ["a", "z"]], false, false); - var peg$e41 = peg$classExpectation(["_", ["a", "z"], ["0", "9"]], false, true); - var peg$e42 = peg$otherExpectation("$identifier"); - var peg$e43 = peg$classExpectation(["$", "_", ["a", "z"]], false, false); - var peg$e44 = peg$classExpectation(["$", "_", ["a", "z"], ["0", "9"]], false, true); - var peg$e45 = peg$otherExpectation("string"); - var peg$e46 = peg$literalExpectation("'", false); - var peg$e47 = peg$classExpectation(["'"], true, false); - var peg$e48 = peg$literalExpectation("\"", false); - var peg$e49 = peg$classExpectation(["\""], true, false); - var peg$e50 = peg$otherExpectation("integer"); - var peg$e51 = peg$classExpectation(["e"], false, true); - var peg$e52 = peg$otherExpectation("float"); - var peg$e53 = peg$classExpectation([["0", "9"]], false, false); - var peg$e54 = peg$otherExpectation("boolean"); - var peg$e55 = peg$literalExpectation("true", false); - var peg$e56 = peg$literalExpectation("false", false); - var peg$e57 = peg$literalExpectation("|", false); - var peg$e58 = peg$otherExpectation("array"); - var peg$e59 = peg$otherExpectation("record"); - var peg$e60 = peg$otherExpectation("whitespace"); - var peg$e61 = peg$otherExpectation("optional whitespace or newline"); - var peg$e62 = peg$otherExpectation("whitespace or newline"); - var peg$e63 = peg$otherExpectation("statement separator"); - var peg$e64 = peg$literalExpectation(";", false); - var peg$e65 = peg$otherExpectation("line comment"); - var peg$e66 = peg$literalExpectation("//", false); - var peg$e67 = peg$literalExpectation("#", false); - var peg$e68 = peg$classExpectation(["\r", "\n"], true, false); - var peg$e69 = peg$otherExpectation("comment"); - var peg$e70 = peg$literalExpectation("/*", false); - var peg$e71 = peg$classExpectation(["*"], true, false); - var peg$e72 = peg$literalExpectation("*/", false); - var peg$e73 = peg$classExpectation([" ", "\t"], false, false); - var peg$e74 = peg$otherExpectation("newline"); - var peg$e75 = peg$classExpectation(["\n", "\r"], false, false); - - var peg$f0 = function(start) {return start}; - var peg$f1 = function(statements, finalExpression) { if (finalExpression != null) { statements.push(finalExpression) } - return nodeBlock(statements) }; - var peg$f2 = function(finalExpression) { return nodeBlock([finalExpression])}; - var peg$f3 = function(statements, finalExpression) { statements.push(finalExpression) - return nodeBlock(statements) }; - var peg$f4 = function(finalExpression) { return nodeBlock([finalExpression]) }; - var peg$f5 = function(head, tail) { return [head, ...tail] }; - var peg$f6 = function(head) { return [head] }; - var peg$f7 = function(variable, value) { return nodeLetStatment(variable, value) }; - var peg$f8 = function(variable, args, body) { var value = nodeLambda(args, body) - return nodeLetStatment(variable, value) }; - var peg$f9 = function(head, tail) { return [head, ...tail]; }; - var peg$f10 = function(condition, trueExpression, falseExpression) { return nodeTernary(condition, trueExpression, falseExpression) }; - var peg$f11 = function(head, operator, arg) {return {operator: operator, right: arg}}; - var peg$f12 = function(head, tail) { return tail.reduce(function(result, element) { - return makeFunctionCall(toFunction[element.operator], [result, element.right]) - }, head)}; - var peg$f13 = function(left, operator, right) { return makeFunctionCall(toFunction[operator], [left, right])}; - var peg$f14 = function(head, chained) {return chained}; - var peg$f15 = function(head, tail) { return tail.reduce(function(result, element) { - return makeFunctionCall(element.fnName, [result, ...element.args]) - }, head)}; - var peg$f16 = function(fn, args) { return {fnName: fn.value, args: args}}; - var peg$f17 = function(fn) { return {fnName: fn.value, args: []}}; - var peg$f18 = function(unaryOperator, right) { return makeFunctionCall(unaryToFunction[unaryOperator], [right])}; - var peg$f19 = function(head, arg) {return {fn: postOperatorToFunction['[]'], args: [arg]}}; - var peg$f20 = function(head, args) {return {fn: postOperatorToFunction['()'], args: args}}; - var peg$f21 = function(head, arg) {return {fn: postOperatorToFunction['[]'], args: [nodeString(arg)]}}; - var peg$f22 = function(head, tail) { return tail.reduce(function(result, element) { - return makeFunctionCall(element.fn, [result, ...element.args]) - }, head)}; - var peg$f23 = function(head, arg) {return {fn: postOperatorToFunction['.'], args: [nodeString(arg)]}}; - var peg$f24 = function(head, tail) { return tail.reduce(function(result, element) { - return makeFunctionCall(element.fn, [result, ...element.args]) - }, head)}; - var peg$f25 = function(expression) {return expression}; - var peg$f26 = function() {return nodeIdentifier(text())}; - var peg$f27 = function(characters) {return nodeString(characters.join(''))}; - var peg$f28 = function(number, unit) { - if (unit === null) - { return number } - else - { return makeFunctionCall('fromUnit_'+unit.value, [number]) - } - }; - var peg$f29 = function() { return nodeInteger(parseInt(text()))}; - var peg$f30 = function() { return nodeFloat(parseFloat(text()))}; - var peg$f31 = function() { return nodeBoolean(text() === 'true')}; - var peg$f32 = function(args, statements, finalExpression) { statements.push(finalExpression) - return nodeLambda(args, nodeBlock(statements)) }; - var peg$f33 = function(args, finalExpression) { return nodeLambda(args, nodeBlock([finalExpression])) }; - var peg$f34 = function() { return makeFunctionCall('$_constructArray_$', [nodeExpression([])])}; - var peg$f35 = function(args) { return makeFunctionCall('$_constructArray_$', [nodeExpression(args)])}; - var peg$f36 = function(args) { return makeFunctionCall('$_constructRecord_$', [nodeExpression(args)])}; - var peg$f37 = function(key, value) { return nodeKeyValue(key, value)}; - - var peg$currPos = 0; - var peg$savedPos = 0; - var peg$posDetailsCache = [{ line: 1, column: 1 }]; - var peg$maxFailPos = 0; - var peg$maxFailExpected = []; - var peg$silentFails = 0; - - var peg$resultsCache = {}; - - var 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 offset() { - return peg$savedPos; - } - - function range() { - return { - source: peg$source, - start: peg$savedPos, - end: peg$currPos - }; - } - - function location() { - return peg$computeLocation(peg$savedPos, peg$currPos); - } - - function expected(description, location) { - location = location !== undefined - ? location - : peg$computeLocation(peg$savedPos, peg$currPos); - - throw peg$buildStructuredError( - [peg$otherExpectation(description)], - input.substring(peg$savedPos, peg$currPos), - location - ); - } - - function error(message, location) { - location = location !== undefined - ? location - : peg$computeLocation(peg$savedPos, peg$currPos); - - throw peg$buildSimpleError(message, location); - } - - function peg$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]; - var 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); - var endPosDetails = peg$computePosDetails(endPos); - - return { - source: peg$source, - start: { - offset: startPos, - line: startPosDetails.line, - column: startPosDetails.column - }, - end: { - offset: endPos, - line: endPosDetails.line, - column: endPosDetails.column - } - }; - } - - function peg$fail(expected) { - if (peg$currPos < peg$maxFailPos) { return; } - - if (peg$currPos > peg$maxFailPos) { - peg$maxFailPos = peg$currPos; - peg$maxFailExpected = []; - } - - peg$maxFailExpected.push(expected); - } - - function peg$buildSimpleError(message, location) { - return new peg$SyntaxError(message, null, null, location); - } - - function peg$buildStructuredError(expected, found, location) { - return new peg$SyntaxError( - peg$SyntaxError.buildMessage(expected, found), - expected, - found, - location - ); - } - - function peg$parsestart() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 0; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parse_nl(); - s2 = peg$parseouterBlock(); - if (s2 !== peg$FAILED) { - s3 = peg$parse_nl(); - s4 = peg$parsefinalComment(); - if (s4 === peg$FAILED) { - s4 = null; - } - peg$savedPos = s0; - s0 = peg$f0(s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsezeroOMoreArgumentsBlockOrExpression() { - var s0; - - var key = peg$currPos * 68 + 1; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parseinnerBlockOrExpression(); - if (s0 === peg$FAILED) { - s0 = peg$parselambda(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseouterBlock() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 2; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsearray_statements(); - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - s3 = peg$parsestatementSeparator(); - if (s3 !== peg$FAILED) { - s4 = peg$parseexpression(); - if (s4 !== peg$FAILED) { - s2 = s4; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 === peg$FAILED) { - s2 = null; - } - peg$savedPos = s0; - s0 = peg$f1(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseexpression(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f2(s1); - } - s0 = s1; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseinnerBlockOrExpression() { - var s0, s1; - - var key = peg$currPos * 68 + 3; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parsequotedInnerBlock(); - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parseexpression(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f2(s1); - } - s0 = s1; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsequotedInnerBlock() { - var s0, s1, s2, s3, s4, s5, s6; - - var key = peg$currPos * 68 + 4; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 123) { - s1 = peg$c0; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parsearray_statements(); - if (s3 !== peg$FAILED) { - s4 = peg$currPos; - s5 = peg$parsestatementSeparator(); - if (s5 !== peg$FAILED) { - s6 = peg$parseexpression(); - if (s6 !== peg$FAILED) { - s4 = s6; - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - s5 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 125) { - s6 = peg$c1; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f3(s3, s4); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 123) { - s1 = peg$c0; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parseexpression(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 125) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f4(s3); - } 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$parsearray_statements() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 5; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsestatement(); - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - s3 = peg$parsestatementSeparator(); - if (s3 !== peg$FAILED) { - s4 = peg$parsearray_statements(); - if (s4 !== peg$FAILED) { - s2 = s4; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f5(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$parsestatement(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f6(s1); - } - s0 = s1; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsestatement() { - var s0; - - var key = peg$currPos * 68 + 6; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parseletStatement(); - if (s0 === peg$FAILED) { - s0 = peg$parsedefunStatement(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseletStatement() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 7; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseidentifier(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - s3 = peg$parseassignmentOp(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parsezeroOMoreArgumentsBlockOrExpression(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f7(s1, s5); - } 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$parsedefunStatement() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - - var key = peg$currPos * 68 + 8; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseidentifier(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s2 = peg$c2; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_nl(); - s4 = peg$parsearray_parameters(); - if (s4 !== peg$FAILED) { - s5 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s6 = peg$c3; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_(); - s8 = peg$parseassignmentOp(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_nl(); - s10 = peg$parseinnerBlockOrExpression(); - if (s10 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f8(s1, s4, s10); - } 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$parseassignmentOp() { - var s0, s1; - - var key = peg$currPos * 68 + 9; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 61) { - s0 = peg$c4; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e5); } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e4); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsearray_parameters() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 10; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsedollarIdentifier(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsedollarIdentifier(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsedollarIdentifier(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f9(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseexpression() { - var s0; - - var key = peg$currPos * 68 + 11; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parseifthenelse(); - if (s0 === peg$FAILED) { - s0 = peg$parseternary(); - if (s0 === peg$FAILED) { - s0 = peg$parselogicalAdditive(); - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseifthenelse() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; - - var key = peg$currPos * 68 + 12; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c6) { - s1 = peg$c6; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e7); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse__nl(); - if (s2 !== peg$FAILED) { - s3 = peg$parselogicalAdditive(); - if (s3 !== peg$FAILED) { - s4 = peg$parse__nl(); - if (s4 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c7) { - s5 = peg$c7; - peg$currPos += 4; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e8); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse__nl(); - if (s6 !== peg$FAILED) { - s7 = peg$parseinnerBlockOrExpression(); - if (s7 !== peg$FAILED) { - s8 = peg$parse__nl(); - if (s8 !== peg$FAILED) { - if (input.substr(peg$currPos, 4) === peg$c8) { - s9 = peg$c8; - peg$currPos += 4; - } else { - s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e9); } - } - if (s9 !== peg$FAILED) { - s10 = peg$parse__nl(); - if (s10 !== peg$FAILED) { - s11 = peg$parseifthenelse(); - if (s11 === peg$FAILED) { - s11 = peg$parseinnerBlockOrExpression(); - } - if (s11 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f10(s3, s7, s11); - } 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; - } - } 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$parseternary() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - - var key = peg$currPos * 68 + 13; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parselogicalAdditive(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 63) { - s3 = peg$c9; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e10); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parselogicalAdditive(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 58) { - s7 = peg$c10; - peg$currPos++; - } else { - s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e11); } - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_nl(); - s9 = peg$parseternary(); - if (s9 === peg$FAILED) { - s9 = peg$parselogicalAdditive(); - } - if (s9 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f10(s1, s5, s9); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parselogicalAdditive() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 14; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parselogicalMultiplicative(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parselogicalAdditiveOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parselogicalMultiplicative(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parselogicalAdditiveOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parselogicalMultiplicative(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parselogicalAdditiveOp() { - var s0, s1; - - var key = peg$currPos * 68 + 15; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c11) { - s0 = peg$c11; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e13); } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parselogicalMultiplicative() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 16; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseequality(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parselogicalMultiplicativeOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseequality(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parselogicalMultiplicativeOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseequality(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parselogicalMultiplicativeOp() { - var s0, s1; - - var key = peg$currPos * 68 + 17; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c12) { - s0 = peg$c12; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e14); } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseequality() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 18; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parserelational(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - s3 = peg$parseequalityOp(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parserelational(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f13(s1, s3, s5); - } 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$parserelational(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseequalityOp() { - var s0, s1; - - var key = peg$currPos * 68 + 19; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c13) { - s0 = peg$c13; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e15); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c14) { - s0 = peg$c14; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parserelational() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 20; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseadditive(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - s3 = peg$parserelationalOp(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parseadditive(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f13(s1, s3, s5); - } 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$parseadditive(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parserelationalOp() { - var s0, s1; - - var key = peg$currPos * 68 + 21; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c15) { - s0 = peg$c15; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e17); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 60) { - s0 = peg$c16; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e18); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c17) { - s0 = peg$c17; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e19); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 62) { - s0 = peg$c18; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e20); } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseadditive() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 22; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsemultiplicative(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parseadditiveOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsemultiplicative(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parseadditiveOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsemultiplicative(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseadditiveOp() { - var s0, s1; - - var key = peg$currPos * 68 + 23; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c19; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e21); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c20; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c21) { - s0 = peg$c21; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e23); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c22) { - s0 = peg$c22; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsemultiplicative() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 24; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsepower(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parsemultiplicativeOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsepower(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parsemultiplicativeOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsepower(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsemultiplicativeOp() { - var s0, s1; - - var key = peg$currPos * 68 + 25; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c23; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e25); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 47) { - s0 = peg$c24; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e26); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c25) { - s0 = peg$c25; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e27); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c26) { - s0 = peg$c26; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e28); } - } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsepower() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 26; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsecredibleInterval(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parsepowerOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsecredibleInterval(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - s5 = peg$parsepowerOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsecredibleInterval(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsepowerOp() { - var s0, s1; - - var key = peg$currPos * 68 + 27; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 94) { - s0 = peg$c27; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e29); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c28) { - s0 = peg$c28; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e30); } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsecredibleInterval() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 28; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsechainFunctionCall(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse__(); - if (s4 !== peg$FAILED) { - s5 = peg$parsecredibleIntervalOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse__nl(); - if (s6 !== peg$FAILED) { - s7 = peg$parsechainFunctionCall(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } 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$parsecredibleIntervalOp(); - if (s5 !== peg$FAILED) { - s6 = peg$parse__nl(); - if (s6 !== peg$FAILED) { - s7 = peg$parsechainFunctionCall(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f11(s1, s5, s7); - } 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; - } - } - peg$savedPos = s0; - s0 = peg$f12(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsecredibleIntervalOp() { - var s0, s1; - - var key = peg$currPos * 68 + 29; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.substr(peg$currPos, 2) === peg$c29) { - s0 = peg$c29; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e31); } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsechainFunctionCall() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 30; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseunary(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.substr(peg$currPos, 2) === peg$c30) { - s5 = peg$c30; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } - } - if (s5 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c31) { - s5 = peg$c31; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } - } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsechainedFunction(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f14(s1, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.substr(peg$currPos, 2) === peg$c30) { - s5 = peg$c30; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e32); } - } - if (s5 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c31) { - s5 = peg$c31; - peg$currPos += 2; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e33); } - } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsechainedFunction(); - if (s7 !== peg$FAILED) { - peg$savedPos = s3; - s3 = peg$f14(s1, s7); - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f15(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsechainedFunction() { - var s0, s1, s2, s3, s4, s5, s6; - - var key = peg$currPos * 68 + 31; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsedollarIdentifier(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s2 = peg$c2; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_nl(); - s4 = peg$parsearray_functionArguments(); - if (s4 !== peg$FAILED) { - s5 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s6 = peg$c3; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s6 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f16(s1, s4); - } 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$parsedollarIdentifier(); - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s2 = peg$c2; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s4 = peg$c3; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s4 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f17(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$parsedollarIdentifier(); - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f17(s1); - } - s0 = s1; - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseunary() { - var s0, s1, s2, s3; - - var key = peg$currPos * 68 + 32; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseunaryOperator(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parseunary(); - if (s3 === peg$FAILED) { - s3 = peg$parseindexedValue(); - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f18(s1, s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parseindexedValue(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseunaryOperator() { - var s0, s1; - - var key = peg$currPos * 68 + 33; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c20; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } - } - if (s0 === peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c22) { - s0 = peg$c22; - peg$currPos += 2; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e24); } - } - if (s0 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 33) { - s0 = peg$c32; - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e35); } - } - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e34); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseindexedValue() { - var s0; - - var key = peg$currPos * 68 + 34; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parsecollectionElement(); - if (s0 === peg$FAILED) { - s0 = peg$parserecordElement(); - if (s0 === peg$FAILED) { - s0 = peg$parseatom(); - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsecollectionElement() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - - var key = peg$currPos * 68 + 35; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseatom(); - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 91) { - s3 = peg$c33; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s3 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 40) { - s3 = peg$c2; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s3 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c34; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - } - } - peg$silentFails--; - if (s3 !== peg$FAILED) { - peg$currPos = s2; - s2 = undefined; - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 91) { - s6 = peg$c33; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$parseexpression(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 93) { - s10 = peg$c35; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - if (s10 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f19(s1, s8); - } 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) { - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 40) { - s6 = peg$c2; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$parsearray_functionArguments(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s10 = peg$c3; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s10 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f20(s1, s8); - } 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) { - s4 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c34; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s5 !== peg$FAILED) { - s6 = peg$currPos; - s7 = peg$parsedollarIdentifier(); - if (s7 !== peg$FAILED) { - s6 = input.substring(s6, peg$currPos); - } else { - s6 = s7; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f21(s1, s6); - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 91) { - s6 = peg$c33; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$parseexpression(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 93) { - s10 = peg$c35; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - if (s10 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f19(s1, s8); - } 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) { - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 40) { - s6 = peg$c2; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$parsearray_functionArguments(); - if (s8 !== peg$FAILED) { - s9 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s10 = peg$c3; - peg$currPos++; - } else { - s10 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s10 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f20(s1, s8); - } 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) { - s4 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c34; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s5 !== peg$FAILED) { - s6 = peg$currPos; - s7 = peg$parsedollarIdentifier(); - if (s7 !== peg$FAILED) { - s6 = input.substring(s6, peg$currPos); - } else { - s6 = s7; - } - if (s6 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f21(s1, s6); - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } - } - } - peg$savedPos = s0; - s0 = peg$f22(s1, s3); - } 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$parsearray_functionArguments() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 36; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseexpression(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseexpression(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseexpression(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f9(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parserecordElement() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - - var key = peg$currPos * 68 + 37; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsedollarIdentifier(); - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c34; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - peg$silentFails--; - if (s3 !== peg$FAILED) { - peg$currPos = s2; - s2 = undefined; - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = []; - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 46) { - s6 = peg$c34; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$currPos; - s9 = peg$parsedollarIdentifier(); - if (s9 !== peg$FAILED) { - s8 = input.substring(s8, peg$currPos); - } else { - s8 = s9; - } - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f23(s1, s8); - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$currPos; - s5 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 46) { - s6 = peg$c34; - peg$currPos++; - } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s6 !== peg$FAILED) { - s7 = peg$parse_nl(); - s8 = peg$currPos; - s9 = peg$parsedollarIdentifier(); - if (s9 !== peg$FAILED) { - s8 = input.substring(s8, peg$currPos); - } else { - s8 = s9; - } - if (s8 !== peg$FAILED) { - peg$savedPos = s4; - s4 = peg$f23(s1, s8); - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } else { - peg$currPos = s4; - s4 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f24(s1, s3); - } 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$parseatom() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 38; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c2; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parseexpression(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c3; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f25(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - if (s0 === peg$FAILED) { - s0 = peg$parsebasicValue(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsebasicValue() { - var s0; - - var key = peg$currPos * 68 + 39; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parsevalueConstructor(); - if (s0 === peg$FAILED) { - s0 = peg$parsebasicLiteral(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsebasicLiteral() { - var s0; - - var key = peg$currPos * 68 + 40; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parsestring(); - if (s0 === peg$FAILED) { - s0 = peg$parsenumber(); - if (s0 === peg$FAILED) { - s0 = peg$parseboolean(); - if (s0 === peg$FAILED) { - s0 = peg$parsedollarIdentifier(); - } - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseidentifier() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 41; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - s2 = []; - if (peg$r0.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } - } - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$r0.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e40); } - } - } - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = []; - if (peg$r1.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - if (peg$r1.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e41); } - } - } - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f26(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e39); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsedollarIdentifier() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 42; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - s2 = []; - if (peg$r2.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } - } - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$r2.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e43); } - } - } - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = []; - if (peg$r3.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - if (peg$r3.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e44); } - } - } - s2 = [s2, s3]; - s1 = s2; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f26(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e42); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsestring() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 43; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 39) { - s2 = peg$c36; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } - } - if (s2 !== peg$FAILED) { - s3 = []; - if (peg$r4.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - if (peg$r4.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e47); } - } - } - if (input.charCodeAt(peg$currPos) === 39) { - s4 = peg$c36; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e46); } - } - if (s4 !== peg$FAILED) { - s1 = s3; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f27(s1); - } - s0 = s1; - if (s0 === peg$FAILED) { - s0 = peg$currPos; - s1 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 34) { - s2 = peg$c37; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } - } - if (s2 !== peg$FAILED) { - s3 = []; - if (peg$r5.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - if (peg$r5.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e49); } - } - } - if (input.charCodeAt(peg$currPos) === 34) { - s4 = peg$c37; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e48); } - } - if (s4 !== peg$FAILED) { - s1 = s3; - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - } else { - peg$currPos = s1; - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f27(s1); - } - s0 = s1; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e45); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsenumber() { - var s0, s1, s2; - - var key = peg$currPos * 68 + 44; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsefloat(); - if (s1 === peg$FAILED) { - s1 = peg$parseinteger(); - } - if (s1 !== peg$FAILED) { - s2 = peg$parseidentifier(); - if (s2 === peg$FAILED) { - s2 = null; - } - peg$savedPos = s0; - s0 = peg$f28(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseinteger() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 45; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = []; - s2 = peg$parsed(); - if (s2 !== peg$FAILED) { - while (s2 !== peg$FAILED) { - s1.push(s2); - s2 = peg$parsed(); - } - } else { - s1 = peg$FAILED; - } - if (s1 !== peg$FAILED) { - s2 = peg$currPos; - peg$silentFails++; - if (input.charCodeAt(peg$currPos) === 46) { - s3 = peg$c34; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - peg$silentFails--; - if (s3 === peg$FAILED) { - s2 = undefined; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = peg$currPos; - peg$silentFails++; - if (peg$r6.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } - } - peg$silentFails--; - if (s4 === peg$FAILED) { - s3 = undefined; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f29(); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e50); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsefloat() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 46; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$currPos; - s2 = peg$currPos; - s3 = peg$currPos; - s4 = []; - s5 = peg$parsed(); - if (s5 !== peg$FAILED) { - while (s5 !== peg$FAILED) { - s4.push(s5); - s5 = peg$parsed(); - } - } else { - s4 = peg$FAILED; - } - if (s4 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 46) { - s5 = peg$c34; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s5 !== peg$FAILED) { - s6 = []; - s7 = peg$parsed(); - while (s7 !== peg$FAILED) { - s6.push(s7); - s7 = peg$parsed(); - } - s4 = [s4, s5, s6]; - s3 = s4; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - if (s3 === peg$FAILED) { - s3 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 46) { - s4 = peg$c34; - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - if (s4 !== peg$FAILED) { - s5 = []; - s6 = peg$parsed(); - if (s6 !== peg$FAILED) { - while (s6 !== peg$FAILED) { - s5.push(s6); - s6 = peg$parsed(); - } - } else { - s5 = peg$FAILED; - } - 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) { - s4 = peg$parsefloatExponent(); - if (s4 === peg$FAILED) { - s4 = null; - } - s3 = [s3, s4]; - s2 = s3; - } else { - peg$currPos = s2; - s2 = peg$FAILED; - } - if (s2 === peg$FAILED) { - s2 = peg$currPos; - s3 = []; - s4 = peg$parsed(); - if (s4 !== peg$FAILED) { - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parsed(); - } - } else { - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - s4 = peg$parsefloatExponent(); - 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$f30(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e52); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsefloatExponent() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 47; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - if (peg$r6.test(input.charAt(peg$currPos))) { - s1 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e51); } - } - if (s1 !== peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 45) { - s2 = peg$c20; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e22); } - } - if (s2 === peg$FAILED) { - s2 = null; - } - s3 = []; - s4 = peg$parsed(); - if (s4 !== peg$FAILED) { - while (s4 !== peg$FAILED) { - s3.push(s4); - s4 = peg$parsed(); - } - } else { - s3 = peg$FAILED; - } - if (s3 !== peg$FAILED) { - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsed() { - var s0; - - var key = peg$currPos * 68 + 48; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - if (peg$r7.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e53); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parseboolean() { - var s0, s1; - - var key = peg$currPos * 68 + 49; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 4) === peg$c38) { - s1 = peg$c38; - peg$currPos += 4; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e55); } - } - if (s1 === peg$FAILED) { - if (input.substr(peg$currPos, 5) === peg$c39) { - s1 = peg$c39; - peg$currPos += 5; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e56); } - } - } - if (s1 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$f31(); - } - s0 = s1; - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e54); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsevalueConstructor() { - var s0; - - var key = peg$currPos * 68 + 50; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parserecordConstructor(); - if (s0 === peg$FAILED) { - s0 = peg$parsearrayConstructor(); - if (s0 === peg$FAILED) { - s0 = peg$parselambda(); - if (s0 === peg$FAILED) { - s0 = peg$parsequotedInnerBlock(); - } - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parselambda() { - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12; - - var key = peg$currPos * 68 + 51; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 123) { - s1 = peg$c0; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 124) { - s3 = peg$c40; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parsearray_parameters(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 124) { - s7 = peg$c40; - peg$currPos++; - } else { - s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_nl(); - s9 = peg$parsearray_statements(); - if (s9 !== peg$FAILED) { - s10 = peg$currPos; - s11 = peg$parsestatementSeparator(); - if (s11 !== peg$FAILED) { - s12 = peg$parseexpression(); - if (s12 !== peg$FAILED) { - s10 = s12; - } else { - peg$currPos = s10; - s10 = peg$FAILED; - } - } else { - peg$currPos = s10; - s10 = peg$FAILED; - } - if (s10 !== peg$FAILED) { - s11 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 125) { - s12 = peg$c1; - peg$currPos++; - } else { - s12 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s12 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f32(s5, s9, s10); - } 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) === 123) { - s1 = peg$c0; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 124) { - s3 = peg$c40; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parsearray_parameters(); - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 124) { - s7 = peg$c40; - peg$currPos++; - } else { - s7 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e57); } - } - if (s7 !== peg$FAILED) { - s8 = peg$parse_nl(); - s9 = peg$parseexpression(); - if (s9 !== peg$FAILED) { - s10 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 125) { - s11 = peg$c1; - peg$currPos++; - } else { - s11 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s11 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f33(s5, s9); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsearrayConstructor() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 52; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 91) { - s1 = peg$c33; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 93) { - s3 = peg$c35; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f34(); - } 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) === 91) { - s1 = peg$c33; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parsearray_elements(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 93) { - s5 = peg$c35; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f35(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e58); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsearray_elements() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 53; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseexpression(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseexpression(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parseexpression(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f9(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parserecordConstructor() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 54; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - if (input.charCodeAt(peg$currPos) === 123) { - s1 = peg$c0; - peg$currPos++; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - if (s1 !== peg$FAILED) { - s2 = peg$parse_nl(); - s3 = peg$parsearray_recordArguments(); - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - if (input.charCodeAt(peg$currPos) === 125) { - s5 = peg$c1; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f36(s3); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e59); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsearray_recordArguments() { - var s0, s1, s2, s3, s4, s5, s6, s7; - - var key = peg$currPos * 68 + 55; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsekeyValuePair(); - if (s1 !== peg$FAILED) { - s2 = []; - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsekeyValuePair(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - while (s3 !== peg$FAILED) { - s2.push(s3); - s3 = peg$currPos; - s4 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 44) { - s5 = peg$c5; - peg$currPos++; - } else { - s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } - if (s5 !== peg$FAILED) { - s6 = peg$parse_nl(); - s7 = peg$parsekeyValuePair(); - if (s7 !== peg$FAILED) { - s3 = s7; - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } else { - peg$currPos = s3; - s3 = peg$FAILED; - } - } - peg$savedPos = s0; - s0 = peg$f9(s1, s2); - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsekeyValuePair() { - var s0, s1, s2, s3, s4, s5; - - var key = peg$currPos * 68 + 56; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parseexpression(); - if (s1 !== peg$FAILED) { - s2 = peg$parse_(); - if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c10; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e11); } - } - if (s3 !== peg$FAILED) { - s4 = peg$parse_nl(); - s5 = peg$parseexpression(); - if (s5 !== peg$FAILED) { - peg$savedPos = s0; - s0 = peg$f37(s1, s5); - } 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$parse_() { - var s0, s1; - - var key = peg$currPos * 68 + 57; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = []; - s1 = peg$parsewhiteSpaceCharactersOrComment(); - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsewhiteSpaceCharactersOrComment(); - } - peg$silentFails--; - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parse_nl() { - var s0, s1; - - var key = peg$currPos * 68 + 58; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = []; - s1 = peg$parsewhiteSpaceCharactersOrComment(); - if (s1 === peg$FAILED) { - s1 = peg$parsecommentOrNewLine(); - } - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsewhiteSpaceCharactersOrComment(); - if (s1 === peg$FAILED) { - s1 = peg$parsecommentOrNewLine(); - } - } - peg$silentFails--; - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e61); } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parse__() { - var s0, s1; - - var key = peg$currPos * 68 + 59; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = []; - s1 = peg$parsewhiteSpaceCharactersOrComment(); - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsewhiteSpaceCharactersOrComment(); - } - } else { - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e60); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parse__nl() { - var s0, s1; - - var key = peg$currPos * 68 + 60; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = []; - s1 = peg$parsewhiteSpaceCharactersOrComment(); - if (s1 === peg$FAILED) { - s1 = peg$parsecommentOrNewLine(); - } - if (s1 !== peg$FAILED) { - while (s1 !== peg$FAILED) { - s0.push(s1); - s1 = peg$parsewhiteSpaceCharactersOrComment(); - if (s1 === peg$FAILED) { - s1 = peg$parsecommentOrNewLine(); - } - } - } else { - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e62); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsestatementSeparator() { - var s0, s1, s2, s3; - - var key = peg$currPos * 68 + 61; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parse_(); - s2 = []; - if (input.charCodeAt(peg$currPos) === 59) { - s3 = peg$c41; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } - } - if (s3 === peg$FAILED) { - s3 = peg$parsecommentOrNewLine(); - } - if (s3 !== peg$FAILED) { - while (s3 !== peg$FAILED) { - s2.push(s3); - if (input.charCodeAt(peg$currPos) === 59) { - s3 = peg$c41; - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e64); } - } - if (s3 === peg$FAILED) { - s3 = peg$parsecommentOrNewLine(); - } - } - } else { - s2 = peg$FAILED; - } - if (s2 !== peg$FAILED) { - s3 = peg$parse_nl(); - s1 = [s1, s2, s3]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e63); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsecommentOrNewLine() { - var s0, s1, s2; - - var key = peg$currPos * 68 + 62; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$currPos; - s1 = peg$parsefinalComment(); - if (s1 === peg$FAILED) { - s1 = null; - } - s2 = peg$parsenewLine(); - if (s2 !== peg$FAILED) { - s1 = [s1, s2]; - s0 = s1; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsefinalComment() { - var s0, s1, s2, s3, s4; - - var key = peg$currPos * 68 + 63; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - s1 = peg$parse_(); - if (input.substr(peg$currPos, 2) === peg$c42) { - s2 = peg$c42; - peg$currPos += 2; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e66); } - } - if (s2 === peg$FAILED) { - if (input.charCodeAt(peg$currPos) === 35) { - s2 = peg$c43; - peg$currPos++; - } else { - s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } - } - } - if (s2 !== peg$FAILED) { - s3 = []; - if (peg$r8.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } - } - while (s4 !== peg$FAILED) { - s3.push(s4); - if (peg$r8.test(input.charAt(peg$currPos))) { - s4 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } - } - } - s0 = s3; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e65); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsewhiteSpaceCharactersOrComment() { - var s0; - - var key = peg$currPos * 68 + 64; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - s0 = peg$parsewhiteSpaceCharacters(); - if (s0 === peg$FAILED) { - s0 = peg$parsedelimitedComment(); - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsedelimitedComment() { - var s0, s1, s2, s3; - - var key = peg$currPos * 68 + 65; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c44) { - s1 = peg$c44; - peg$currPos += 2; - } else { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } - } - if (s1 !== peg$FAILED) { - s2 = []; - if (peg$r9.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } - } - while (s3 !== peg$FAILED) { - s2.push(s3); - if (peg$r9.test(input.charAt(peg$currPos))) { - s3 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } - } - } - if (input.substr(peg$currPos, 2) === peg$c45) { - s3 = peg$c45; - peg$currPos += 2; - } else { - s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e72); } - } - if (s3 !== peg$FAILED) { - s0 = s2; - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - } else { - peg$currPos = s0; - s0 = peg$FAILED; - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsewhiteSpaceCharacters() { - var s0; - - var key = peg$currPos * 68 + 66; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - if (peg$r10.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e73); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - function peg$parsenewLine() { - var s0, s1; - - var key = peg$currPos * 68 + 67; - var cached = peg$resultsCache[key]; - - if (cached) { - peg$currPos = cached.nextPos; - - return cached.result; - } - - peg$silentFails++; - if (peg$r11.test(input.charAt(peg$currPos))) { - s0 = input.charAt(peg$currPos); - peg$currPos++; - } else { - s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e75); } - } - peg$silentFails--; - if (s0 === peg$FAILED) { - s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e74); } - } - - peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 }; - - return s0; - } - - 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 -};