From 89db6cf917002aab329ad35b89444fe1eab1d1f8 Mon Sep 17 00:00:00 2001 From: Lizzy Hunt Date: Tue, 5 Mar 2024 15:36:31 -0700 Subject: [PATCH] add naive record construction support --- src/interpreter/denotable.ts | 10 +- src/interpreter/interpreter.ts | 103 +- src/parser/grammar.pegjs | 62 +- src/parser/parser.ts | 10600 ++++++++++++++++--------------- test/programs/record.cps | 4 +- 5 files changed, 5651 insertions(+), 5128 deletions(-) diff --git a/src/interpreter/denotable.ts b/src/interpreter/denotable.ts index 119cccf..ea1ddfb 100644 --- a/src/interpreter/denotable.ts +++ b/src/interpreter/denotable.ts @@ -22,9 +22,14 @@ export type DenotableType = | 'real' | 'bool' | 'string' + | 'record' | 'bytearray' - | 'function' - | 'reference'; + | 'function'; + +export type DenotableRecord = { + length: number; + record: Array; +}; export type DenotableValue = | null @@ -32,6 +37,7 @@ export type DenotableValue = | string | Uint8Array | DenotableFunction + | DenotableRecord | Identifier; export type Denotable = { diff --git a/src/interpreter/interpreter.ts b/src/interpreter/interpreter.ts index 7a49f7d..cfbb042 100644 --- a/src/interpreter/interpreter.ts +++ b/src/interpreter/interpreter.ts @@ -2,13 +2,17 @@ import { type ContinuationExpression, type PrimitiveOperationExpression, type ApplicationExpression, + type RecordExpression, type Program, type Value, + type RecordExpressionTuple, + type SelectExpression, } from '@/parser'; -import { Environment, type Denotable } from '.'; +import { Environment, type Denotable, type DenotableRecord } from '.'; import { BadArgumentError, InvalidStateError, + InvalidType, NotImplementedError, type TracingLogger, } from '@/utils'; @@ -112,6 +116,89 @@ const evaluatePrimitiveOperation = ( ); }; +export const evaluateRecordTuple = ( + tuple: RecordExpressionTuple, + env: Environment, + logger: TracingLogger, +): Denotable => { + const { value, accessPath } = tuple; + const record = evaluateValue(value, env, logger.createChild('evaluateValue')); + if (record.type === 'record') { + // TODO: Implement nested records at accessPath + logger.debug(JSON.stringify(accessPath, null, 2)); + throw new NotImplementedError('Nested records are not yet supported'); + } + + return record; +}; + +export const evaluateRecordExpression = ( + { record }: RecordExpression, + env: Environment, + logger: TracingLogger, +): Denotable => { + const { + records, + address: { name: address }, + body, + } = record; + + const childEnv = env.createChild(); + const recordTuple = records.map(record => + evaluateRecordTuple( + record, + childEnv, + logger.createChild('evaluateRecordTuple'), + ), + ); + const length = recordTuple.length; + + childEnv.set(address, { + type: 'record', + value: { length, record: recordTuple }, + }); + + return evaluteContinuationExpression( + body, + childEnv, + logger.createChild('evaluteContinuationExpression'), + ); +}; + +export const evaluateSelectExpression = ( + { select }: SelectExpression, + env: Environment, + logger: TracingLogger, +): Denotable => { + const { + index: { int: index }, + record, + bind, + continuation, + } = select; + const childEnv = env.createChild(); + + const recordValue = evaluateValue( + record, + env, + logger.createChild('evaluateValue'), + ); + if (recordValue.type !== 'record') { + throw new InvalidType('Expected record type'); + } + + const { value } = recordValue as { value: DenotableRecord }; + + const selected = value.record[index]; + childEnv.set(bind.name, selected); + + return evaluteContinuationExpression( + continuation, + childEnv, + logger.createChild('evaluteContinuationExpression'), + ); +}; + const evaluteContinuationExpression = ( expr: ContinuationExpression, env: Environment, @@ -136,10 +223,20 @@ const evaluteContinuationExpression = ( } if ('record' in expr) { - throw new NotImplementedError('Continuation records are not supported yet'); + logger.debug('Evaluating record'); + return evaluateRecordExpression( + expr, + env, + logger.createChild('evaluateRecordExpression'), + ); } if ('select' in expr) { - throw new NotImplementedError('Continuation select is not supported yet'); + logger.debug('Evaluating select'); + return evaluateSelectExpression( + expr, + env, + logger.createChild('evaluateSelectExpression'), + ); } if ('offset' in expr) { throw new NotImplementedError('Continuation offset is not supported yet'); diff --git a/src/parser/grammar.pegjs b/src/parser/grammar.pegjs index 0017b18..229c922 100644 --- a/src/parser/grammar.pegjs +++ b/src/parser/grammar.pegjs @@ -17,11 +17,11 @@ SelectExpression _? LPAREN _? - record:Integer + index:Integer _? COMMA _? - val:Value + record:VarStatement _? COMMA _? @@ -31,7 +31,7 @@ SelectExpression _? continuation:ContinuationExpression _? - RPAREN { return { select: { record, val, bind, continuation } }; } + RPAREN { return { select: { index, record, bind, continuation } }; } OffsetExpression = OFFSET @@ -86,9 +86,17 @@ SwitchExpression RPAREN { return { switch: { switchIndex, continuations } }; } ApplicationExpression - = APP _? LPAREN _? fn:(LabelStatement / VarStatement) _? COMMA _? args:ValueList _? RPAREN { - return { application: { fn, args } }; - } + = APP + _? + LPAREN + _? + fn:(LabelStatement / VarStatement) + _? + COMMA + _? + args:ValueList + _? + RPAREN { return { application: { fn, args } }; } FixBinding = LPAREN @@ -169,16 +177,29 @@ PrimitiveOperationExpression }; } -RecordExpressionTuple - = LPAREN +AccessPath + = OffsetPath + / SelectPath + +OffsetPath = OFFP _ offset:Integer { return { offset: offset.int }; } + +SelectPath + = SELP _? - value:Value + LPAREN + _? + index:Integer _? COMMA _? - offset:OffsetStatement + accessPath:AccessPath _? - RPAREN { return { value, offset }; } + RPAREN { return { select: { index, accessPath } }; } + +RecordExpressionTuple + = LPAREN _? value:Value _? COMMA _? accessPath:AccessPath _? RPAREN { + return { value, accessPath }; + } RecordExpressionTupleList = LBRACKET @@ -238,14 +259,6 @@ BoolStatement = BOOL _ bool:Integer { return { bool: bool.int }; } StringStatement = STRING _ string:QuotedString { return string; } -AccessStatement - = OffsetStatement - / SelectStatement - -OffsetStatement = OFFP _ offset:Integer { return offset; } - -SelectStatement = SELP _ offset:Integer { return offset; } - Identifier = name:([A-Za-z] (LETTER / DIGIT / SAFE_SYMBOL)*) { return { name: name[0] + name[1].join('') }; @@ -291,7 +304,8 @@ ComparisonOperation / "||" / "&&" -Integer = digits:("-"? [0-9]+) !"." { return { int: parseInt(digits.join(''), 10) }; } +Integer + = digits:("-"? [0-9]+) !"." { return { int: parseInt(digits.join(''), 10) }; } QuotedString = "'" content:[^']* "'" { return content.join(''); } @@ -299,9 +313,11 @@ QuotedString Real = value:("-"? [0-9]+ ("." [0-9]+)?) { - return { real: parseFloat( - value.map(x => (Array.isArray(x) ? x.join('') : x)).join(''), - ) }; + return { + real: parseFloat( + value.map(x => (Array.isArray(x) ? x.join('') : x)).join(''), + ), + }; } Literal diff --git a/src/parser/parser.ts b/src/parser/parser.ts index b73df78..190d692 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -1,5226 +1,5612 @@ /* eslint-disable */ +const peggyParser: { parse: any; SyntaxError: any; DefaultTracer?: any } = // @generated by Peggy 4.0.0. + // + // https://peggyjs.org/ + // @ts-ignore + (function () { + // @ts-ignore + 'use strict'; - -const peggyParser: {parse: any, SyntaxError: any, DefaultTracer?: any} = // @generated by Peggy 4.0.0. -// -// https://peggyjs.org/ -// @ts-ignore -(function() { -// @ts-ignore - "use strict"; - -// @ts-ignore -function peg$subclass(child, parent) { -// @ts-ignore - function C() { this.constructor = child; } -// @ts-ignore - C.prototype = parent.prototype; -// @ts-ignore - child.prototype = new C(); -} - -// @ts-ignore -function peg$SyntaxError(message, expected, found, location) { -// @ts-ignore - var self = Error.call(this, message); - // istanbul ignore next Check is a necessary evil to support older environments -// @ts-ignore - if (Object.setPrototypeOf) { -// @ts-ignore - Object.setPrototypeOf(self, peg$SyntaxError.prototype); - } -// @ts-ignore - self.expected = expected; -// @ts-ignore - self.found = found; -// @ts-ignore - self.location = location; -// @ts-ignore - self.name = "SyntaxError"; -// @ts-ignore - return self; -} - -// @ts-ignore -peg$subclass(peg$SyntaxError, Error); - -// @ts-ignore -function peg$padEnd(str, targetLength, padString) { -// @ts-ignore - padString = padString || " "; -// @ts-ignore - if (str.length > targetLength) { return str; } -// @ts-ignore - targetLength -= str.length; -// @ts-ignore - padString += padString.repeat(targetLength); -// @ts-ignore - return str + padString.slice(0, targetLength); -} - -// @ts-ignore -peg$SyntaxError.prototype.format = function(sources) { -// @ts-ignore - var str = "Error: " + this.message; -// @ts-ignore - if (this.location) { -// @ts-ignore - var src = null; -// @ts-ignore - var k; -// @ts-ignore - for (k = 0; k < sources.length; k++) { -// @ts-ignore - if (sources[k].source === this.location.source) { -// @ts-ignore - src = sources[k].text.split(/\r\n|\n|\r/g); -// @ts-ignore - break; + // @ts-ignore + function peg$subclass(child, parent) { + // @ts-ignore + function C() { + this.constructor = child; } + // @ts-ignore + C.prototype = parent.prototype; + // @ts-ignore + child.prototype = new C(); } -// @ts-ignore - var s = this.location.start; -// @ts-ignore - var offset_s = (this.location.source && (typeof this.location.source.offset === "function")) -// @ts-ignore - ? this.location.source.offset(s) -// @ts-ignore - : s; -// @ts-ignore - var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column; -// @ts-ignore - if (src) { -// @ts-ignore - var e = this.location.end; -// @ts-ignore - var filler = peg$padEnd("", offset_s.line.toString().length, ' '); -// @ts-ignore - var line = src[s.line - 1]; -// @ts-ignore - var last = s.line === e.line ? e.column : line.length + 1; -// @ts-ignore - var hatLen = (last - s.column) || 1; -// @ts-ignore - str += "\n --> " + loc + "\n" -// @ts-ignore - + filler + " |\n" -// @ts-ignore - + offset_s.line + " | " + line + "\n" -// @ts-ignore - + filler + " | " + peg$padEnd("", s.column - 1, ' ') -// @ts-ignore - + peg$padEnd("", hatLen, "^"); -// @ts-ignore - } else { -// @ts-ignore - str += "\n at " + loc; + + // @ts-ignore + function peg$SyntaxError(message, expected, found, location) { + // @ts-ignore + var self = Error.call(this, message); + // istanbul ignore next Check is a necessary evil to support older environments + // @ts-ignore + if (Object.setPrototypeOf) { + // @ts-ignore + Object.setPrototypeOf(self, peg$SyntaxError.prototype); + } + // @ts-ignore + self.expected = expected; + // @ts-ignore + self.found = found; + // @ts-ignore + self.location = location; + // @ts-ignore + self.name = 'SyntaxError'; + // @ts-ignore + return self; } - } -// @ts-ignore - return str; -}; -// @ts-ignore -peg$SyntaxError.buildMessage = function(expected, found) { -// @ts-ignore - var DESCRIBE_EXPECTATION_FNS = { -// @ts-ignore - literal: function(expectation) { -// @ts-ignore - return "\"" + literalEscape(expectation.text) + "\""; - }, + // @ts-ignore + peg$subclass(peg$SyntaxError, Error); -// @ts-ignore - class: function(expectation) { -// @ts-ignore - var escapedParts = expectation.parts.map(function(part) { -// @ts-ignore - return Array.isArray(part) -// @ts-ignore - ? classEscape(part[0]) + "-" + classEscape(part[1]) -// @ts-ignore - : classEscape(part); - }); - -// @ts-ignore - return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]"; - }, - -// @ts-ignore - any: function() { -// @ts-ignore - return "any character"; - }, - -// @ts-ignore - end: function() { -// @ts-ignore - return "end of input"; - }, - -// @ts-ignore - other: function(expectation) { -// @ts-ignore - return expectation.description; + // @ts-ignore + function peg$padEnd(str, targetLength, padString) { + // @ts-ignore + padString = padString || ' '; + // @ts-ignore + if (str.length > targetLength) { + return str; + } + // @ts-ignore + targetLength -= str.length; + // @ts-ignore + padString += padString.repeat(targetLength); + // @ts-ignore + return str + padString.slice(0, targetLength); } - }; -// @ts-ignore - function hex(ch) { -// @ts-ignore - return ch.charCodeAt(0).toString(16).toUpperCase(); - } - -// @ts-ignore - function literalEscape(s) { -// @ts-ignore - return s -// @ts-ignore - .replace(/\\/g, "\\\\") -// @ts-ignore - .replace(/"/g, "\\\"") -// @ts-ignore - .replace(/\0/g, "\\0") -// @ts-ignore - .replace(/\t/g, "\\t") -// @ts-ignore - .replace(/\n/g, "\\n") -// @ts-ignore - .replace(/\r/g, "\\r") -// @ts-ignore - .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) -// @ts-ignore - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); - } - -// @ts-ignore - function classEscape(s) { -// @ts-ignore - return s -// @ts-ignore - .replace(/\\/g, "\\\\") -// @ts-ignore - .replace(/\]/g, "\\]") -// @ts-ignore - .replace(/\^/g, "\\^") -// @ts-ignore - .replace(/-/g, "\\-") -// @ts-ignore - .replace(/\0/g, "\\0") -// @ts-ignore - .replace(/\t/g, "\\t") -// @ts-ignore - .replace(/\n/g, "\\n") -// @ts-ignore - .replace(/\r/g, "\\r") -// @ts-ignore - .replace(/[\x00-\x0F]/g, function(ch) { return "\\x0" + hex(ch); }) -// @ts-ignore - .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x" + hex(ch); }); - } - -// @ts-ignore - function describeExpectation(expectation) { -// @ts-ignore - return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); - } - -// @ts-ignore - function describeExpected(expected) { -// @ts-ignore - var descriptions = expected.map(describeExpectation); -// @ts-ignore - var i, j; - -// @ts-ignore - descriptions.sort(); - -// @ts-ignore - if (descriptions.length > 0) { -// @ts-ignore - for (i = 1, j = 1; i < descriptions.length; i++) { -// @ts-ignore - if (descriptions[i - 1] !== descriptions[i]) { -// @ts-ignore - descriptions[j] = descriptions[i]; -// @ts-ignore - j++; + // @ts-ignore + peg$SyntaxError.prototype.format = function (sources) { + // @ts-ignore + var str = 'Error: ' + this.message; + // @ts-ignore + if (this.location) { + // @ts-ignore + var src = null; + // @ts-ignore + var k; + // @ts-ignore + for (k = 0; k < sources.length; k++) { + // @ts-ignore + if (sources[k].source === this.location.source) { + // @ts-ignore + src = sources[k].text.split(/\r\n|\n|\r/g); + // @ts-ignore + break; + } + } + // @ts-ignore + var s = this.location.start; + // @ts-ignore + var offset_s = + this.location.source && + typeof this.location.source.offset === 'function' + ? // @ts-ignore + this.location.source.offset(s) + : // @ts-ignore + s; + // @ts-ignore + var loc = + this.location.source + ':' + offset_s.line + ':' + offset_s.column; + // @ts-ignore + if (src) { + // @ts-ignore + var e = this.location.end; + // @ts-ignore + var filler = peg$padEnd('', offset_s.line.toString().length, ' '); + // @ts-ignore + var line = src[s.line - 1]; + // @ts-ignore + var last = s.line === e.line ? e.column : line.length + 1; + // @ts-ignore + var hatLen = last - s.column || 1; + // @ts-ignore + str += + '\n --> ' + + loc + + '\n' + + // @ts-ignore + filler + + ' |\n' + + // @ts-ignore + offset_s.line + + ' | ' + + line + + '\n' + + // @ts-ignore + filler + + ' | ' + + peg$padEnd('', s.column - 1, ' ') + + // @ts-ignore + peg$padEnd('', hatLen, '^'); + // @ts-ignore + } else { + // @ts-ignore + str += '\n at ' + loc; } } -// @ts-ignore - descriptions.length = j; - } + // @ts-ignore + return str; + }; -// @ts-ignore - switch (descriptions.length) { -// @ts-ignore - case 1: -// @ts-ignore - return descriptions[0]; + // @ts-ignore + peg$SyntaxError.buildMessage = function (expected, found) { + // @ts-ignore + var DESCRIBE_EXPECTATION_FNS = { + // @ts-ignore + literal: function (expectation) { + // @ts-ignore + return '"' + literalEscape(expectation.text) + '"'; + }, -// @ts-ignore - case 2: -// @ts-ignore - return descriptions[0] + " or " + descriptions[1]; + // @ts-ignore + class: function (expectation) { + // @ts-ignore + var escapedParts = expectation.parts.map(function (part) { + // @ts-ignore + return Array.isArray(part) + ? // @ts-ignore + classEscape(part[0]) + '-' + classEscape(part[1]) + : // @ts-ignore + classEscape(part); + }); -// @ts-ignore - default: -// @ts-ignore - return descriptions.slice(0, -1).join(", ") -// @ts-ignore - + ", or " -// @ts-ignore - + descriptions[descriptions.length - 1]; - } - } + // @ts-ignore + return ( + '[' + + (expectation.inverted ? '^' : '') + + escapedParts.join('') + + ']' + ); + }, -// @ts-ignore - function describeFound(found) { -// @ts-ignore - return found ? "\"" + literalEscape(found) + "\"" : "end of input"; - } + // @ts-ignore + any: function () { + // @ts-ignore + return 'any character'; + }, -// @ts-ignore - return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; -}; + // @ts-ignore + end: function () { + // @ts-ignore + return 'end of input'; + }, -// @ts-ignore -function peg$parse(input, options) { -// @ts-ignore - options = options !== undefined ? options : {}; - -// @ts-ignore - var peg$FAILED = {}; -// @ts-ignore - var peg$source = options.grammarSource; - -// @ts-ignore - var peg$startRuleFunctions = { Program: peg$parseProgram }; -// @ts-ignore - var peg$startRuleFunction = peg$parseProgram; - -// @ts-ignore - var peg$c0 = "**"; - var peg$c1 = "%"; - var peg$c2 = ">>"; - var peg$c3 = "<<"; - var peg$c4 = "=="; - var peg$c5 = "<="; - var peg$c6 = ">="; - var peg$c7 = "!="; - var peg$c8 = "||"; - var peg$c9 = "&&"; - var peg$c10 = "-"; - var peg$c11 = "."; - var peg$c12 = "'"; - var peg$c13 = "\""; - var peg$c14 = "OFFSET"; - var peg$c15 = "OFFp"; - var peg$c16 = "SELp"; - var peg$c17 = "VAR"; - var peg$c18 = "INT"; - var peg$c19 = "REAL"; - var peg$c20 = "BOOL"; - var peg$c21 = "STRING"; - var peg$c22 = "APP"; - var peg$c23 = "RECORD"; - var peg$c24 = "SELECT"; - var peg$c25 = "FIX"; - var peg$c26 = "SWITCH"; - var peg$c27 = "PRIMOP"; - var peg$c28 = "LABEL"; - var peg$c29 = "store"; - var peg$c30 = "update"; - var peg$c31 = "makeref"; - var peg$c32 = "makerefunboxed"; - var peg$c33 = "unboxedupdate"; - var peg$c34 = "subscript"; - var peg$c35 = "boxed"; - var peg$c36 = "_"; - var peg$c37 = "["; - var peg$c38 = "]"; - var peg$c39 = ","; - var peg$c40 = "="; - var peg$c41 = "("; - var peg$c42 = ")"; - var peg$c43 = "\r\n"; - - var peg$r0 = /^[A-Za-z]/; - var peg$r1 = /^[0-9A-Z_a-z]/; - var peg$r2 = /^[*-+\-\/]/; - var peg$r3 = /^[\^~]/; - var peg$r4 = /^[!<>]/; - var peg$r5 = /^[0-9]/; - var peg$r6 = /^[^']/; - var peg$r7 = /^[^"]/; - var peg$r8 = /^[\t-\n ]/; - - var peg$e0 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false); - var peg$e1 = peg$classExpectation([["0", "9"], ["A", "Z"], "_", ["a", "z"]], false, false); - var peg$e2 = peg$classExpectation([["*", "+"], "-", "/"], false, false); - var peg$e3 = peg$literalExpectation("**", false); - var peg$e4 = peg$literalExpectation("%", false); - var peg$e5 = peg$literalExpectation(">>", false); - var peg$e6 = peg$literalExpectation("<<", false); - var peg$e7 = peg$classExpectation(["^", "~"], false, false); - var peg$e8 = peg$literalExpectation("==", false); - var peg$e9 = peg$literalExpectation("<=", false); - var peg$e10 = peg$literalExpectation(">=", false); - var peg$e11 = peg$literalExpectation("!=", false); - var peg$e12 = peg$classExpectation(["!", "<", ">"], false, false); - var peg$e13 = peg$literalExpectation("||", false); - var peg$e14 = peg$literalExpectation("&&", false); - var peg$e15 = peg$literalExpectation("-", false); - var peg$e16 = peg$classExpectation([["0", "9"]], false, false); - var peg$e17 = peg$literalExpectation(".", false); - var peg$e18 = peg$literalExpectation("'", false); - var peg$e19 = peg$classExpectation(["'"], true, false); - var peg$e20 = peg$literalExpectation("\"", false); - var peg$e21 = peg$classExpectation(["\""], true, false); - var peg$e22 = peg$literalExpectation("OFFSET", false); - var peg$e23 = peg$literalExpectation("OFFp", false); - var peg$e24 = peg$literalExpectation("SELp", false); - var peg$e25 = peg$literalExpectation("VAR", false); - var peg$e26 = peg$literalExpectation("INT", false); - var peg$e27 = peg$literalExpectation("REAL", false); - var peg$e28 = peg$literalExpectation("BOOL", false); - var peg$e29 = peg$literalExpectation("STRING", false); - var peg$e30 = peg$literalExpectation("APP", false); - var peg$e31 = peg$literalExpectation("RECORD", false); - var peg$e32 = peg$literalExpectation("SELECT", false); - var peg$e33 = peg$literalExpectation("FIX", false); - var peg$e34 = peg$literalExpectation("SWITCH", false); - var peg$e35 = peg$literalExpectation("PRIMOP", false); - var peg$e36 = peg$literalExpectation("LABEL", false); - var peg$e37 = peg$literalExpectation("store", false); - var peg$e38 = peg$literalExpectation("update", false); - var peg$e39 = peg$literalExpectation("makeref", false); - var peg$e40 = peg$literalExpectation("makerefunboxed", false); - var peg$e41 = peg$literalExpectation("unboxedupdate", false); - var peg$e42 = peg$literalExpectation("subscript", false); - var peg$e43 = peg$literalExpectation("boxed", false); - var peg$e44 = peg$literalExpectation("_", false); - var peg$e45 = peg$literalExpectation("[", false); - var peg$e46 = peg$literalExpectation("]", false); - var peg$e47 = peg$literalExpectation(",", false); - var peg$e48 = peg$literalExpectation("=", false); - var peg$e49 = peg$literalExpectation("(", false); - var peg$e50 = peg$literalExpectation(")", false); - var peg$e51 = peg$classExpectation([["\t", "\n"], " "], false, false); - var peg$e52 = peg$literalExpectation("\r\n", false); -// @ts-ignore - - var peg$f0 = function(exprs) { -// @ts-ignore - return exprs.filter(x => !Array.isArray(x)); - };// @ts-ignore - - var peg$f1 = function(record, val, bind, continuation) {// @ts-ignore - return { select: { record, val, bind, continuation } }; };// @ts-ignore - - var peg$f2 = function(index, val, bind, continuation) {// @ts-ignore - return { offset: { index, val, bind, continuation } }; };// @ts-ignore - - var peg$f3 = function(identifiers, lastIdent) { -// @ts-ignore - return identifiers.length || lastIdent -// @ts-ignore - ? [...identifiers.map(x => x[0]), lastIdent] - : []; - };// @ts-ignore - - var peg$f4 = function(values, lastValue) { -// @ts-ignore - return values.length || lastValue -// @ts-ignore - ? [...values.map(x => x[0]), lastValue] - : []; - };// @ts-ignore - - var peg$f5 = function(switchIndex, continuations) {// @ts-ignore - return { switch: { switchIndex, continuations } }; };// @ts-ignore - - var peg$f6 = function(fn, args) { -// @ts-ignore - return { application: { fn, args } }; - };// @ts-ignore - - var peg$f7 = function(bindings, lastBinding) { -// @ts-ignore - return bindings.length || lastBinding -// @ts-ignore - ? [...bindings.map(x => x[0]), lastBinding] - : []; - };// @ts-ignore - - var peg$f8 = function(fixBindings, continuation) {// @ts-ignore - return { fix: { fixBindings, continuation } }; };// @ts-ignore - - var peg$f9 = function(continuations, lastContinuation) { -// @ts-ignore - return lastContinuation || continuations.length -// @ts-ignore - ? [...continuations.map(x => x[0]), lastContinuation] - : []; - };// @ts-ignore - - var peg$f10 = function(opr, operands, resultBindings, continuations) { -// @ts-ignore - return { -// @ts-ignore - primitiveOperation: { opr, operands, resultBindings, continuations }, - }; - };// @ts-ignore - - var peg$f11 = function(value, offset) {// @ts-ignore - return { value, offset }; };// @ts-ignore - - var peg$f12 = function(records, lastRecord) { -// @ts-ignore - return records.length || lastRecord -// @ts-ignore - ? [...records.map(x => x[0]), lastRecord] - : []; - };// @ts-ignore - - var peg$f13 = function(records, address, body) { -// @ts-ignore - return { -// @ts-ignore - record: { -// @ts-ignore - records, -// @ts-ignore - address, -// @ts-ignore - body, + // @ts-ignore + other: function (expectation) { + // @ts-ignore + return expectation.description; }, }; - };// @ts-ignore - var peg$f14 = function(ident) {// @ts-ignore - return ident; };// @ts-ignore - - var peg$f15 = function(ident) {// @ts-ignore - return ident; };// @ts-ignore - - var peg$f16 = function(int) {// @ts-ignore - return int; };// @ts-ignore - - var peg$f17 = function(real) {// @ts-ignore - return real; };// @ts-ignore - - var peg$f18 = function(bool) {// @ts-ignore - return { bool: bool.int }; };// @ts-ignore - - var peg$f19 = function(string) {// @ts-ignore - return string; };// @ts-ignore - - var peg$f20 = function(offset) {// @ts-ignore - return offset; };// @ts-ignore - - var peg$f21 = function(offset) {// @ts-ignore - return offset; };// @ts-ignore - - var peg$f22 = function(name) { -// @ts-ignore - return { name: name[0] + name[1].join('') }; - };// @ts-ignore - - var peg$f23 = function(digits) {// @ts-ignore - return { int: parseInt(digits.join(''), 10) }; };// @ts-ignore - - var peg$f24 = function(content) {// @ts-ignore - return content.join(''); };// @ts-ignore - - var peg$f25 = function(content) {// @ts-ignore - return content.join(''); };// @ts-ignore - - var peg$f26 = function(value) { -// @ts-ignore - return { real: parseFloat( -// @ts-ignore - value.map(x => (Array.isArray(x) ? x.join('') : x)).join(''), - ) }; - }; -// @ts-ignore - var peg$currPos = options.peg$currPos | 0; -// @ts-ignore - var peg$savedPos = peg$currPos; -// @ts-ignore - var peg$posDetailsCache = [{ line: 1, column: 1 }]; -// @ts-ignore - var peg$maxFailPos = peg$currPos; -// @ts-ignore - var peg$maxFailExpected = options.peg$maxFailExpected || []; -// @ts-ignore - var peg$silentFails = options.peg$silentFails | 0; - -// @ts-ignore - var peg$result; - -// @ts-ignore - if (options.startRule) { -// @ts-ignore - if (!(options.startRule in peg$startRuleFunctions)) { -// @ts-ignore - throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); - } - -// @ts-ignore - peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; - } - -// @ts-ignore - function text() { -// @ts-ignore - return input.substring(peg$savedPos, peg$currPos); - } - -// @ts-ignore - function offset() { -// @ts-ignore - return peg$savedPos; - } - -// @ts-ignore - function range() { -// @ts-ignore - return { -// @ts-ignore - source: peg$source, -// @ts-ignore - start: peg$savedPos, -// @ts-ignore - end: peg$currPos - }; - } - -// @ts-ignore - function location() { -// @ts-ignore - return peg$computeLocation(peg$savedPos, peg$currPos); - } - -// @ts-ignore - function expected(description, location) { -// @ts-ignore - location = location !== undefined -// @ts-ignore - ? location -// @ts-ignore - : peg$computeLocation(peg$savedPos, peg$currPos); - -// @ts-ignore - throw peg$buildStructuredError( -// @ts-ignore - [peg$otherExpectation(description)], -// @ts-ignore - input.substring(peg$savedPos, peg$currPos), -// @ts-ignore - location - ); - } - -// @ts-ignore - function error(message, location) { -// @ts-ignore - location = location !== undefined -// @ts-ignore - ? location -// @ts-ignore - : peg$computeLocation(peg$savedPos, peg$currPos); - -// @ts-ignore - throw peg$buildSimpleError(message, location); - } - -// @ts-ignore - function peg$literalExpectation(text, ignoreCase) { -// @ts-ignore - return { type: "literal", text: text, ignoreCase: ignoreCase }; - } - -// @ts-ignore - function peg$classExpectation(parts, inverted, ignoreCase) { -// @ts-ignore - return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; - } - -// @ts-ignore - function peg$anyExpectation() { -// @ts-ignore - return { type: "any" }; - } - -// @ts-ignore - function peg$endExpectation() { -// @ts-ignore - return { type: "end" }; - } - -// @ts-ignore - function peg$otherExpectation(description) { -// @ts-ignore - return { type: "other", description: description }; - } - -// @ts-ignore - function peg$computePosDetails(pos) { -// @ts-ignore - var details = peg$posDetailsCache[pos]; -// @ts-ignore - var p; - -// @ts-ignore - if (details) { -// @ts-ignore - return details; -// @ts-ignore - } else { -// @ts-ignore - if (pos >= peg$posDetailsCache.length) { -// @ts-ignore - p = peg$posDetailsCache.length - 1; -// @ts-ignore - } else { -// @ts-ignore - p = pos; -// @ts-ignore - while (!peg$posDetailsCache[--p]) {} + // @ts-ignore + function hex(ch) { + // @ts-ignore + return ch.charCodeAt(0).toString(16).toUpperCase(); } -// @ts-ignore - details = peg$posDetailsCache[p]; -// @ts-ignore - details = { -// @ts-ignore - line: details.line, -// @ts-ignore - column: details.column + // @ts-ignore + function literalEscape(s) { + // @ts-ignore + return ( + s + // @ts-ignore + .replace(/\\/g, '\\\\') + // @ts-ignore + .replace(/"/g, '\\"') + // @ts-ignore + .replace(/\0/g, '\\0') + // @ts-ignore + .replace(/\t/g, '\\t') + // @ts-ignore + .replace(/\n/g, '\\n') + // @ts-ignore + .replace(/\r/g, '\\r') + // @ts-ignore + .replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }) + // @ts-ignore + .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }) + ); + } + + // @ts-ignore + function classEscape(s) { + // @ts-ignore + return ( + s + // @ts-ignore + .replace(/\\/g, '\\\\') + // @ts-ignore + .replace(/\]/g, '\\]') + // @ts-ignore + .replace(/\^/g, '\\^') + // @ts-ignore + .replace(/-/g, '\\-') + // @ts-ignore + .replace(/\0/g, '\\0') + // @ts-ignore + .replace(/\t/g, '\\t') + // @ts-ignore + .replace(/\n/g, '\\n') + // @ts-ignore + .replace(/\r/g, '\\r') + // @ts-ignore + .replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }) + // @ts-ignore + .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }) + ); + } + + // @ts-ignore + function describeExpectation(expectation) { + // @ts-ignore + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + // @ts-ignore + function describeExpected(expected) { + // @ts-ignore + var descriptions = expected.map(describeExpectation); + // @ts-ignore + var i, j; + + // @ts-ignore + descriptions.sort(); + + // @ts-ignore + if (descriptions.length > 0) { + // @ts-ignore + for (i = 1, j = 1; i < descriptions.length; i++) { + // @ts-ignore + if (descriptions[i - 1] !== descriptions[i]) { + // @ts-ignore + descriptions[j] = descriptions[i]; + // @ts-ignore + j++; + } + } + // @ts-ignore + descriptions.length = j; + } + + // @ts-ignore + switch (descriptions.length) { + // @ts-ignore + case 1: + // @ts-ignore + return descriptions[0]; + + // @ts-ignore + case 2: + // @ts-ignore + return descriptions[0] + ' or ' + descriptions[1]; + + // @ts-ignore + default: + // @ts-ignore + return ( + descriptions.slice(0, -1).join(', ') + + // @ts-ignore + ', or ' + + // @ts-ignore + descriptions[descriptions.length - 1] + ); + } + } + + // @ts-ignore + function describeFound(found) { + // @ts-ignore + return found ? '"' + literalEscape(found) + '"' : 'end of input'; + } + + // @ts-ignore + return ( + 'Expected ' + + describeExpected(expected) + + ' but ' + + describeFound(found) + + ' found.' + ); + }; + + // @ts-ignore + function peg$parse(input, options) { + // @ts-ignore + options = options !== undefined ? options : {}; + + // @ts-ignore + var peg$FAILED = {}; + // @ts-ignore + var peg$source = options.grammarSource; + + // @ts-ignore + var peg$startRuleFunctions = { Program: peg$parseProgram }; + // @ts-ignore + var peg$startRuleFunction = peg$parseProgram; + + // @ts-ignore + var peg$c0 = '**'; + var peg$c1 = '%'; + var peg$c2 = '>>'; + var peg$c3 = '<<'; + var peg$c4 = '=='; + var peg$c5 = '<='; + var peg$c6 = '>='; + var peg$c7 = '!='; + var peg$c8 = '||'; + var peg$c9 = '&&'; + var peg$c10 = '-'; + var peg$c11 = '.'; + var peg$c12 = "'"; + var peg$c13 = '"'; + var peg$c14 = 'OFFSET'; + var peg$c15 = 'OFFp'; + var peg$c16 = 'SELp'; + var peg$c17 = 'VAR'; + var peg$c18 = 'INT'; + var peg$c19 = 'REAL'; + var peg$c20 = 'BOOL'; + var peg$c21 = 'STRING'; + var peg$c22 = 'APP'; + var peg$c23 = 'RECORD'; + var peg$c24 = 'SELECT'; + var peg$c25 = 'FIX'; + var peg$c26 = 'SWITCH'; + var peg$c27 = 'PRIMOP'; + var peg$c28 = 'LABEL'; + var peg$c29 = 'store'; + var peg$c30 = 'update'; + var peg$c31 = 'makeref'; + var peg$c32 = 'makerefunboxed'; + var peg$c33 = 'unboxedupdate'; + var peg$c34 = 'subscript'; + var peg$c35 = 'boxed'; + var peg$c36 = '_'; + var peg$c37 = '['; + var peg$c38 = ']'; + var peg$c39 = ','; + var peg$c40 = '='; + var peg$c41 = '('; + var peg$c42 = ')'; + var peg$c43 = '\r\n'; + + var peg$r0 = /^[A-Za-z]/; + var peg$r1 = /^[0-9A-Z_a-z]/; + var peg$r2 = /^[*-+\-\/]/; + var peg$r3 = /^[\^~]/; + var peg$r4 = /^[!<>]/; + var peg$r5 = /^[0-9]/; + var peg$r6 = /^[^']/; + var peg$r7 = /^[^"]/; + var peg$r8 = /^[\t-\n ]/; + + var peg$e0 = peg$classExpectation( + [ + ['A', 'Z'], + ['a', 'z'], + ], + false, + false, + ); + var peg$e1 = peg$classExpectation( + [['0', '9'], ['A', 'Z'], '_', ['a', 'z']], + false, + false, + ); + var peg$e2 = peg$classExpectation([['*', '+'], '-', '/'], false, false); + var peg$e3 = peg$literalExpectation('**', false); + var peg$e4 = peg$literalExpectation('%', false); + var peg$e5 = peg$literalExpectation('>>', false); + var peg$e6 = peg$literalExpectation('<<', false); + var peg$e7 = peg$classExpectation(['^', '~'], false, false); + var peg$e8 = peg$literalExpectation('==', false); + var peg$e9 = peg$literalExpectation('<=', false); + var peg$e10 = peg$literalExpectation('>=', false); + var peg$e11 = peg$literalExpectation('!=', false); + var peg$e12 = peg$classExpectation(['!', '<', '>'], false, false); + var peg$e13 = peg$literalExpectation('||', false); + var peg$e14 = peg$literalExpectation('&&', false); + var peg$e15 = peg$literalExpectation('-', false); + var peg$e16 = peg$classExpectation([['0', '9']], false, false); + var peg$e17 = peg$literalExpectation('.', false); + var peg$e18 = peg$literalExpectation("'", false); + var peg$e19 = peg$classExpectation(["'"], true, false); + var peg$e20 = peg$literalExpectation('"', false); + var peg$e21 = peg$classExpectation(['"'], true, false); + var peg$e22 = peg$literalExpectation('OFFSET', false); + var peg$e23 = peg$literalExpectation('OFFp', false); + var peg$e24 = peg$literalExpectation('SELp', false); + var peg$e25 = peg$literalExpectation('VAR', false); + var peg$e26 = peg$literalExpectation('INT', false); + var peg$e27 = peg$literalExpectation('REAL', false); + var peg$e28 = peg$literalExpectation('BOOL', false); + var peg$e29 = peg$literalExpectation('STRING', false); + var peg$e30 = peg$literalExpectation('APP', false); + var peg$e31 = peg$literalExpectation('RECORD', false); + var peg$e32 = peg$literalExpectation('SELECT', false); + var peg$e33 = peg$literalExpectation('FIX', false); + var peg$e34 = peg$literalExpectation('SWITCH', false); + var peg$e35 = peg$literalExpectation('PRIMOP', false); + var peg$e36 = peg$literalExpectation('LABEL', false); + var peg$e37 = peg$literalExpectation('store', false); + var peg$e38 = peg$literalExpectation('update', false); + var peg$e39 = peg$literalExpectation('makeref', false); + var peg$e40 = peg$literalExpectation('makerefunboxed', false); + var peg$e41 = peg$literalExpectation('unboxedupdate', false); + var peg$e42 = peg$literalExpectation('subscript', false); + var peg$e43 = peg$literalExpectation('boxed', false); + var peg$e44 = peg$literalExpectation('_', false); + var peg$e45 = peg$literalExpectation('[', false); + var peg$e46 = peg$literalExpectation(']', false); + var peg$e47 = peg$literalExpectation(',', false); + var peg$e48 = peg$literalExpectation('=', false); + var peg$e49 = peg$literalExpectation('(', false); + var peg$e50 = peg$literalExpectation(')', false); + var peg$e51 = peg$classExpectation([['\t', '\n'], ' '], false, false); + var peg$e52 = peg$literalExpectation('\r\n', false); + // @ts-ignore + + var peg$f0 = function (exprs) { + // @ts-ignore + return exprs.filter(x => !Array.isArray(x)); + }; // @ts-ignore + + var peg$f1 = function (index, record, bind, continuation) { + // @ts-ignore + return { select: { index, record, bind, continuation } }; + }; // @ts-ignore + + var peg$f2 = function (index, val, bind, continuation) { + // @ts-ignore + return { offset: { index, val, bind, continuation } }; + }; // @ts-ignore + + var peg$f3 = function (identifiers, lastIdent) { + // @ts-ignore + return identifiers.length || lastIdent + ? // @ts-ignore + [...identifiers.map(x => x[0]), lastIdent] + : []; + }; // @ts-ignore + + var peg$f4 = function (values, lastValue) { + // @ts-ignore + return values.length || lastValue + ? // @ts-ignore + [...values.map(x => x[0]), lastValue] + : []; + }; // @ts-ignore + + var peg$f5 = function (switchIndex, continuations) { + // @ts-ignore + return { switch: { switchIndex, continuations } }; + }; // @ts-ignore + + var peg$f6 = function (fn, args) { + // @ts-ignore + return { application: { fn, args } }; + }; // @ts-ignore + + var peg$f7 = function (bindings, lastBinding) { + // @ts-ignore + return bindings.length || lastBinding + ? // @ts-ignore + [...bindings.map(x => x[0]), lastBinding] + : []; + }; // @ts-ignore + + var peg$f8 = function (fixBindings, continuation) { + // @ts-ignore + return { fix: { fixBindings, continuation } }; + }; // @ts-ignore + + var peg$f9 = function (continuations, lastContinuation) { + // @ts-ignore + return lastContinuation || continuations.length + ? // @ts-ignore + [...continuations.map(x => x[0]), lastContinuation] + : []; + }; // @ts-ignore + + var peg$f10 = function (opr, operands, resultBindings, continuations) { + // @ts-ignore + return { + // @ts-ignore + primitiveOperation: { opr, operands, resultBindings, continuations }, + }; + }; // @ts-ignore + + var peg$f11 = function (offset) { + // @ts-ignore + return { offset: offset.int }; + }; // @ts-ignore + + var peg$f12 = function (index, accessPath) { + // @ts-ignore + return { select: { index, accessPath } }; + }; // @ts-ignore + + var peg$f13 = function (value, accessPath) { + // @ts-ignore + return { value, accessPath }; + }; // @ts-ignore + + var peg$f14 = function (records, lastRecord) { + // @ts-ignore + return records.length || lastRecord + ? // @ts-ignore + [...records.map(x => x[0]), lastRecord] + : []; + }; // @ts-ignore + + var peg$f15 = function (records, address, body) { + // @ts-ignore + return { + // @ts-ignore + record: { + // @ts-ignore + records, + // @ts-ignore + address, + // @ts-ignore + body, + }, + }; + }; // @ts-ignore + + var peg$f16 = function (ident) { + // @ts-ignore + return ident; + }; // @ts-ignore + + var peg$f17 = function (ident) { + // @ts-ignore + return ident; + }; // @ts-ignore + + var peg$f18 = function (int) { + // @ts-ignore + return int; + }; // @ts-ignore + + var peg$f19 = function (real) { + // @ts-ignore + return real; + }; // @ts-ignore + + var peg$f20 = function (bool) { + // @ts-ignore + return { bool: bool.int }; + }; // @ts-ignore + + var peg$f21 = function (string) { + // @ts-ignore + return string; + }; // @ts-ignore + + var peg$f22 = function (name) { + // @ts-ignore + return { name: name[0] + name[1].join('') }; + }; // @ts-ignore + + var peg$f23 = function (digits) { + // @ts-ignore + return { int: parseInt(digits.join(''), 10) }; + }; // @ts-ignore + + var peg$f24 = function (content) { + // @ts-ignore + return content.join(''); + }; // @ts-ignore + + var peg$f25 = function (content) { + // @ts-ignore + return content.join(''); + }; // @ts-ignore + + var peg$f26 = function (value) { + // @ts-ignore + return { + // @ts-ignore + real: parseFloat( + // @ts-ignore + value.map(x => (Array.isArray(x) ? x.join('') : x)).join(''), + ), + }; }; + // @ts-ignore + var peg$currPos = options.peg$currPos | 0; + // @ts-ignore + var peg$savedPos = peg$currPos; + // @ts-ignore + var peg$posDetailsCache = [{ line: 1, column: 1 }]; + // @ts-ignore + var peg$maxFailPos = peg$currPos; + // @ts-ignore + var peg$maxFailExpected = options.peg$maxFailExpected || []; + // @ts-ignore + var peg$silentFails = options.peg$silentFails | 0; -// @ts-ignore - while (p < pos) { -// @ts-ignore - if (input.charCodeAt(p) === 10) { -// @ts-ignore - details.line++; -// @ts-ignore - details.column = 1; -// @ts-ignore - } else { -// @ts-ignore - details.column++; + // @ts-ignore + var peg$result; + + // @ts-ignore + if (options.startRule) { + // @ts-ignore + if (!(options.startRule in peg$startRuleFunctions)) { + // @ts-ignore + throw new Error( + 'Can\'t start parsing from rule "' + options.startRule + '".', + ); } -// @ts-ignore - p++; + // @ts-ignore + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } -// @ts-ignore - peg$posDetailsCache[pos] = details; - -// @ts-ignore - return details; - } - } - -// @ts-ignore - function peg$computeLocation(startPos, endPos, offset) { -// @ts-ignore - var startPosDetails = peg$computePosDetails(startPos); -// @ts-ignore - var endPosDetails = peg$computePosDetails(endPos); - -// @ts-ignore - var res = { -// @ts-ignore - source: peg$source, -// @ts-ignore - start: { -// @ts-ignore - offset: startPos, -// @ts-ignore - line: startPosDetails.line, -// @ts-ignore - column: startPosDetails.column - }, -// @ts-ignore - end: { -// @ts-ignore - offset: endPos, -// @ts-ignore - line: endPosDetails.line, -// @ts-ignore - column: endPosDetails.column + // @ts-ignore + function text() { + // @ts-ignore + return input.substring(peg$savedPos, peg$currPos); } - }; -// @ts-ignore - if (offset && peg$source && (typeof peg$source.offset === "function")) { -// @ts-ignore - res.start = peg$source.offset(res.start); -// @ts-ignore - res.end = peg$source.offset(res.end); - } -// @ts-ignore - return res; - } -// @ts-ignore - function peg$fail(expected) { -// @ts-ignore - if (peg$currPos < peg$maxFailPos) { return; } - -// @ts-ignore - if (peg$currPos > peg$maxFailPos) { -// @ts-ignore - peg$maxFailPos = peg$currPos; -// @ts-ignore - peg$maxFailExpected = []; - } - -// @ts-ignore - peg$maxFailExpected.push(expected); - } - -// @ts-ignore - function peg$buildSimpleError(message, location) { -// @ts-ignore - return new peg$SyntaxError(message, null, null, location); - } - -// @ts-ignore - function peg$buildStructuredError(expected, found, location) { -// @ts-ignore - return new peg$SyntaxError( -// @ts-ignore - peg$SyntaxError.buildMessage(expected, found), -// @ts-ignore - expected, -// @ts-ignore - found, -// @ts-ignore - location - ); - } - -// @ts-ignore - function // @ts-ignore -peg$parseProgram() { -// @ts-ignore - var s0, s1, s2; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = []; -// @ts-ignore - s2 = peg$parseContinuationExpression(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); - } -// @ts-ignore - while (s2 !== peg$FAILED) { -// @ts-ignore - s1.push(s2); -// @ts-ignore - s2 = peg$parseContinuationExpression(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); + // @ts-ignore + function offset() { + // @ts-ignore + return peg$savedPos; } - } -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s1 = peg$f0(s1); -// @ts-ignore - s0 = s1; -// @ts-ignore - return s0; - } + // @ts-ignore + function range() { + // @ts-ignore + return { + // @ts-ignore + source: peg$source, + // @ts-ignore + start: peg$savedPos, + // @ts-ignore + end: peg$currPos, + }; + } -// @ts-ignore - function // @ts-ignore -peg$parseContinuationExpression() { -// @ts-ignore - var s0; + // @ts-ignore + function location() { + // @ts-ignore + return peg$computeLocation(peg$savedPos, peg$currPos); + } -// @ts-ignore - s0 = peg$parseRecordExpression(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseSelectExpression(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseOffsetExpression(); -// @ts-ignore + // @ts-ignore + function expected(description, location) { + // @ts-ignore + location = + location !== undefined + ? // @ts-ignore + location + : // @ts-ignore + peg$computeLocation(peg$savedPos, peg$currPos); + + // @ts-ignore + throw peg$buildStructuredError( + // @ts-ignore + [peg$otherExpectation(description)], + // @ts-ignore + input.substring(peg$savedPos, peg$currPos), + // @ts-ignore + location, + ); + } + + // @ts-ignore + function error(message, location) { + // @ts-ignore + location = + location !== undefined + ? // @ts-ignore + location + : // @ts-ignore + peg$computeLocation(peg$savedPos, peg$currPos); + + // @ts-ignore + throw peg$buildSimpleError(message, location); + } + + // @ts-ignore + function peg$literalExpectation(text, ignoreCase) { + // @ts-ignore + return { type: 'literal', text: text, ignoreCase: ignoreCase }; + } + + // @ts-ignore + function peg$classExpectation(parts, inverted, ignoreCase) { + // @ts-ignore + return { + type: 'class', + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase, + }; + } + + // @ts-ignore + function peg$anyExpectation() { + // @ts-ignore + return { type: 'any' }; + } + + // @ts-ignore + function peg$endExpectation() { + // @ts-ignore + return { type: 'end' }; + } + + // @ts-ignore + function peg$otherExpectation(description) { + // @ts-ignore + return { type: 'other', description: description }; + } + + // @ts-ignore + function peg$computePosDetails(pos) { + // @ts-ignore + var details = peg$posDetailsCache[pos]; + // @ts-ignore + var p; + + // @ts-ignore + if (details) { + // @ts-ignore + return details; + // @ts-ignore + } else { + // @ts-ignore + if (pos >= peg$posDetailsCache.length) { + // @ts-ignore + p = peg$posDetailsCache.length - 1; + // @ts-ignore + } else { + // @ts-ignore + p = pos; + // @ts-ignore + while (!peg$posDetailsCache[--p]) {} + } + + // @ts-ignore + details = peg$posDetailsCache[p]; + // @ts-ignore + details = { + // @ts-ignore + line: details.line, + // @ts-ignore + column: details.column, + }; + + // @ts-ignore + while (p < pos) { + // @ts-ignore + if (input.charCodeAt(p) === 10) { + // @ts-ignore + details.line++; + // @ts-ignore + details.column = 1; + // @ts-ignore + } else { + // @ts-ignore + details.column++; + } + + // @ts-ignore + p++; + } + + // @ts-ignore + peg$posDetailsCache[pos] = details; + + // @ts-ignore + return details; + } + } + + // @ts-ignore + function peg$computeLocation(startPos, endPos, offset) { + // @ts-ignore + var startPosDetails = peg$computePosDetails(startPos); + // @ts-ignore + var endPosDetails = peg$computePosDetails(endPos); + + // @ts-ignore + var res = { + // @ts-ignore + source: peg$source, + // @ts-ignore + start: { + // @ts-ignore + offset: startPos, + // @ts-ignore + line: startPosDetails.line, + // @ts-ignore + column: startPosDetails.column, + }, + // @ts-ignore + end: { + // @ts-ignore + offset: endPos, + // @ts-ignore + line: endPosDetails.line, + // @ts-ignore + column: endPosDetails.column, + }, + }; + // @ts-ignore + if (offset && peg$source && typeof peg$source.offset === 'function') { + // @ts-ignore + res.start = peg$source.offset(res.start); + // @ts-ignore + res.end = peg$source.offset(res.end); + } + // @ts-ignore + return res; + } + + // @ts-ignore + function peg$fail(expected) { + // @ts-ignore + if (peg$currPos < peg$maxFailPos) { + return; + } + + // @ts-ignore + if (peg$currPos > peg$maxFailPos) { + // @ts-ignore + peg$maxFailPos = peg$currPos; + // @ts-ignore + peg$maxFailExpected = []; + } + + // @ts-ignore + peg$maxFailExpected.push(expected); + } + + // @ts-ignore + function peg$buildSimpleError(message, location) { + // @ts-ignore + return new peg$SyntaxError(message, null, null, location); + } + + // @ts-ignore + function peg$buildStructuredError(expected, found, location) { + // @ts-ignore + return new peg$SyntaxError( + // @ts-ignore + peg$SyntaxError.buildMessage(expected, found), + // @ts-ignore + expected, + // @ts-ignore + found, + // @ts-ignore + location, + ); + } + + // @ts-ignore + function // @ts-ignore + peg$parseProgram() { + // @ts-ignore + var s0, s1, s2; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = []; + // @ts-ignore + s2 = peg$parseContinuationExpression(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + } + // @ts-ignore + while (s2 !== peg$FAILED) { + // @ts-ignore + s1.push(s2); + // @ts-ignore + s2 = peg$parseContinuationExpression(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + } + } + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s1 = peg$f0(s1); + // @ts-ignore + s0 = s1; + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseContinuationExpression() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseRecordExpression(); + // @ts-ignore if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseApplicationExpression(); -// @ts-ignore + // @ts-ignore + s0 = peg$parseSelectExpression(); + // @ts-ignore if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseFixExpression(); -// @ts-ignore + // @ts-ignore + s0 = peg$parseOffsetExpression(); + // @ts-ignore if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseSwitchExpression(); -// @ts-ignore + // @ts-ignore + s0 = peg$parseApplicationExpression(); + // @ts-ignore if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parsePrimitiveOperationExpression(); - } - } - } - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSelectExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseSELECT(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseInteger(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseValue(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseCOMMA(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - s12 = peg$parse_(); -// @ts-ignore - if (s12 === peg$FAILED) { -// @ts-ignore - s12 = null; - } -// @ts-ignore - s13 = peg$parseIdentifier(); -// @ts-ignore - if (s13 !== peg$FAILED) { -// @ts-ignore - s14 = peg$parse_(); -// @ts-ignore - if (s14 === peg$FAILED) { -// @ts-ignore - s14 = null; + // @ts-ignore + s0 = peg$parseFixExpression(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseSwitchExpression(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parsePrimitiveOperationExpression(); } -// @ts-ignore - s15 = peg$parseCOMMA(); -// @ts-ignore - if (s15 !== peg$FAILED) { -// @ts-ignore - s16 = peg$parse_(); -// @ts-ignore - if (s16 === peg$FAILED) { -// @ts-ignore - s16 = null; + } + } + } + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSelectExpression() { + // @ts-ignore + var s0, + s1, + s2, + s3, + s4, + s5, + s6, + s7, + s8, + s9, + s10, + s11, + s12, + s13, + s14, + s15, + s16, + s17, + s18, + s19; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseSELECT(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseInteger(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseVarStatement(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseCOMMA(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + s12 = peg$parse_(); + // @ts-ignore + if (s12 === peg$FAILED) { + // @ts-ignore + s12 = null; } -// @ts-ignore - s17 = peg$parseContinuationExpression(); -// @ts-ignore - if (s17 !== peg$FAILED) { -// @ts-ignore - s18 = peg$parse_(); -// @ts-ignore - if (s18 === peg$FAILED) { -// @ts-ignore - s18 = null; + // @ts-ignore + s13 = peg$parseIdentifier(); + // @ts-ignore + if (s13 !== peg$FAILED) { + // @ts-ignore + s14 = peg$parse_(); + // @ts-ignore + if (s14 === peg$FAILED) { + // @ts-ignore + s14 = null; } -// @ts-ignore - s19 = peg$parseRPAREN(); -// @ts-ignore - if (s19 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f1(s5, s9, s13, s17); -// @ts-ignore + // @ts-ignore + s15 = peg$parseCOMMA(); + // @ts-ignore + if (s15 !== peg$FAILED) { + // @ts-ignore + s16 = peg$parse_(); + // @ts-ignore + if (s16 === peg$FAILED) { + // @ts-ignore + s16 = null; + } + // @ts-ignore + s17 = peg$parseContinuationExpression(); + // @ts-ignore + if (s17 !== peg$FAILED) { + // @ts-ignore + s18 = peg$parse_(); + // @ts-ignore + if (s18 === peg$FAILED) { + // @ts-ignore + s18 = null; + } + // @ts-ignore + s19 = peg$parseRPAREN(); + // @ts-ignore + if (s19 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f1(s5, s9, s13, s17); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; + + // @ts-ignore + return s0; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - return s0; - } + // @ts-ignore + function // @ts-ignore + peg$parseOffsetExpression() { + // @ts-ignore + var s0, + s1, + s2, + s3, + s4, + s5, + s6, + s7, + s8, + s9, + s10, + s11, + s12, + s13, + s14, + s15, + s16, + s17; -// @ts-ignore - function // @ts-ignore -peg$parseOffsetExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseOFFSET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseInteger(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseOFFSET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; } -// @ts-ignore - s9 = peg$parseValue(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; + // @ts-ignore + s5 = peg$parseInteger(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; } -// @ts-ignore - s11 = peg$parseCOMMA(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - s12 = peg$parse_(); -// @ts-ignore - if (s12 === peg$FAILED) { -// @ts-ignore - s12 = null; + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; } -// @ts-ignore - s13 = peg$parseIdentifier(); -// @ts-ignore - if (s13 !== peg$FAILED) { -// @ts-ignore - s14 = peg$parse_(); -// @ts-ignore - if (s14 === peg$FAILED) { -// @ts-ignore - s14 = null; + // @ts-ignore + s9 = peg$parseValue(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; } -// @ts-ignore - s15 = peg$parseContinuationExpression(); -// @ts-ignore - if (s15 !== peg$FAILED) { -// @ts-ignore - s16 = peg$parse_(); -// @ts-ignore - if (s16 === peg$FAILED) { -// @ts-ignore - s16 = null; + // @ts-ignore + s11 = peg$parseCOMMA(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + s12 = peg$parse_(); + // @ts-ignore + if (s12 === peg$FAILED) { + // @ts-ignore + s12 = null; } -// @ts-ignore - s17 = peg$parseRPAREN(); -// @ts-ignore - if (s17 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f2(s5, s9, s13, s15); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseIdentifierList() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLBRACKET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseIdentifier(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseIdentifier(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } - } -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseIdentifier(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = null; - } -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseRBRACKET(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f3(s3, s5); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseValueList() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLBRACKET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseValue(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseValue(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } - } -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseValue(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = null; - } -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseRBRACKET(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f4(s3, s5); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSwitchExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseSWITCH(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseValue(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseContinuationList(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseRPAREN(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f5(s5, s9); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseApplicationExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseAPP(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseLabelStatement(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = peg$parseVarStatement(); - } -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseValueList(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseRPAREN(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f6(s5, s9); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseFixBinding() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLPAREN(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseIdentifier(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseCOMMA(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseIdentifierList(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseCOMMA(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseContinuationExpression(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - s12 = peg$parse_(); -// @ts-ignore - if (s12 === peg$FAILED) { -// @ts-ignore - s12 = null; - } -// @ts-ignore - s13 = peg$parseRPAREN(); -// @ts-ignore - if (s13 !== peg$FAILED) { -// @ts-ignore - s1 = [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13]; -// @ts-ignore - s0 = s1; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseFixBindingList() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLBRACKET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseFixBinding(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseFixBinding(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } - } -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseFixBinding(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = null; - } -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseRBRACKET(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f7(s3, s5); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseFixExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseFIX(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseFixBindingList(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseContinuationExpression(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseRPAREN(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f8(s5, s9); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseContinuationList() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLBRACKET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseContinuationExpression(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseContinuationExpression(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } - } -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseContinuationExpression(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = null; - } -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseRBRACKET(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f9(s3, s5); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parsePrimitiveOperationExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parsePRIMOP(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parsePrimitiveOperation(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s9 = peg$parseValueList(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; - } -// @ts-ignore - s11 = peg$parseCOMMA(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - s12 = peg$parse_(); -// @ts-ignore - if (s12 === peg$FAILED) { -// @ts-ignore - s12 = null; - } -// @ts-ignore - s13 = peg$parseIdentifierList(); -// @ts-ignore - if (s13 !== peg$FAILED) { -// @ts-ignore - s14 = peg$parse_(); -// @ts-ignore - if (s14 === peg$FAILED) { -// @ts-ignore - s14 = null; - } -// @ts-ignore - s15 = peg$parseCOMMA(); -// @ts-ignore - if (s15 !== peg$FAILED) { -// @ts-ignore - s16 = peg$parse_(); -// @ts-ignore - if (s16 === peg$FAILED) { -// @ts-ignore - s16 = null; - } -// @ts-ignore - s17 = peg$parseContinuationList(); -// @ts-ignore - if (s17 !== peg$FAILED) { -// @ts-ignore - s18 = peg$parse_(); -// @ts-ignore - if (s18 === peg$FAILED) { -// @ts-ignore - s18 = null; + // @ts-ignore + s13 = peg$parseIdentifier(); + // @ts-ignore + if (s13 !== peg$FAILED) { + // @ts-ignore + s14 = peg$parse_(); + // @ts-ignore + if (s14 === peg$FAILED) { + // @ts-ignore + s14 = null; } -// @ts-ignore - s19 = peg$parseRPAREN(); -// @ts-ignore - if (s19 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f10(s5, s9, s13, s17); -// @ts-ignore + // @ts-ignore + s15 = peg$parseContinuationExpression(); + // @ts-ignore + if (s15 !== peg$FAILED) { + // @ts-ignore + s16 = peg$parse_(); + // @ts-ignore + if (s16 === peg$FAILED) { + // @ts-ignore + s16 = null; + } + // @ts-ignore + s17 = peg$parseRPAREN(); + // @ts-ignore + if (s17 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f2(s5, s9, s13, s15); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; + + // @ts-ignore + return s0; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - return s0; - } + // @ts-ignore + function // @ts-ignore + peg$parseIdentifierList() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8; -// @ts-ignore - function // @ts-ignore -peg$parseRecordExpressionTuple() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLPAREN(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseValue(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseCOMMA(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLBRACKET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; } -// @ts-ignore - s7 = peg$parseOffsetStatement(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseIdentifier(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; } -// @ts-ignore - s9 = peg$parseRPAREN(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f11(s3, s7); -// @ts-ignore + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRecordExpressionTupleList() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLBRACKET(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseRecordExpressionTuple(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - s5 = peg$parseRecordExpressionTuple(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; - } -// @ts-ignore - s5 = [s5, s6, s7, s8]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore + // @ts-ignore peg$currPos = s4; -// @ts-ignore + // @ts-ignore s4 = peg$FAILED; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } - } -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseRecordExpressionTuple(); -// @ts-ignore - if (s5 === peg$FAILED) { -// @ts-ignore - s5 = null; - } -// @ts-ignore - s6 = peg$parse_(); -// @ts-ignore - if (s6 === peg$FAILED) { -// @ts-ignore - s6 = null; - } -// @ts-ignore - s7 = peg$parseRBRACKET(); -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f12(s3, s5); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRecordExpression() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseRECORD(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = peg$parseLPAREN(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$parse_(); -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s5 = peg$parseRecordExpressionTupleList(); -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseIdentifier(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + } + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseIdentifier(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = null; + } + // @ts-ignore s6 = peg$parse_(); -// @ts-ignore + // @ts-ignore if (s6 === peg$FAILED) { -// @ts-ignore + // @ts-ignore s6 = null; } -// @ts-ignore - s7 = peg$parseCOMMA(); -// @ts-ignore + // @ts-ignore + s7 = peg$parseRBRACKET(); + // @ts-ignore if (s7 !== peg$FAILED) { -// @ts-ignore - s8 = peg$parse_(); -// @ts-ignore - if (s8 === peg$FAILED) { -// @ts-ignore - s8 = null; + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f3(s3, s5); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseValueList() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLBRACKET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseValue(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; } -// @ts-ignore - s9 = peg$parseIdentifier(); -// @ts-ignore - if (s9 !== peg$FAILED) { -// @ts-ignore - s10 = peg$parse_(); -// @ts-ignore - if (s10 === peg$FAILED) { -// @ts-ignore - s10 = null; + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; } -// @ts-ignore - s11 = peg$parseCOMMA(); -// @ts-ignore - if (s11 !== peg$FAILED) { -// @ts-ignore - s12 = peg$parse_(); -// @ts-ignore - if (s12 === peg$FAILED) { -// @ts-ignore - s12 = null; + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseValue(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; } -// @ts-ignore - s13 = peg$parseContinuationExpression(); -// @ts-ignore - if (s13 !== peg$FAILED) { -// @ts-ignore - s14 = peg$parse_(); -// @ts-ignore - if (s14 === peg$FAILED) { -// @ts-ignore - s14 = null; + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + } + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseValue(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = null; + } + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseRBRACKET(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f4(s3, s5); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSwitchExpression() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseSWITCH(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseValue(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseContinuationList(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; } -// @ts-ignore - s15 = peg$parseRPAREN(); -// @ts-ignore - if (s15 !== peg$FAILED) { -// @ts-ignore + // @ts-ignore + s11 = peg$parseRPAREN(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore peg$savedPos = s0; -// @ts-ignore - s0 = peg$f13(s5, s9, s13); -// @ts-ignore + // @ts-ignore + s0 = peg$f5(s5, s9); + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; + + // @ts-ignore + return s0; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - return s0; - } + // @ts-ignore + function // @ts-ignore + peg$parseApplicationExpression() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; -// @ts-ignore - function // @ts-ignore -peg$parseValue() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = peg$parseVarStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseLabelStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseIntStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseRealStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseBoolStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseStringStatement(); - } + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseAPP(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; } - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseVarStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseVAR(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseIdentifier(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f14(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLabelStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseLABEL(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseIdentifier(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f15(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseIntStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseINT(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseInteger(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f16(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRealStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseREAL(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseReal(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f17(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseBoolStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseBOOL(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseInteger(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f18(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseStringStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseSTRING(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseQuotedString(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f19(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseAccessStatement() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = peg$parseOffsetStatement(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseSelectStatement(); - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseOffsetStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseOFFP(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseInteger(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f20(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSelectStatement() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$parseSELP(); -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$parse_(); -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = peg$parseInteger(); -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f21(s3); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseIdentifier() { -// @ts-ignore - var s0, s1, s2, s3, s4; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$currPos; -// @ts-ignore - s2 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r0.test(s2)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s2 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r1.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r1.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e1); } - } - } -// @ts-ignore - s2 = [s2, s3]; -// @ts-ignore - s1 = s2; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s1; -// @ts-ignore - s1 = peg$FAILED; - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s1 = peg$f22(s1); - } -// @ts-ignore - s0 = s1; - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parsePrimitiveOperation() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = peg$parseArithmeticOperation(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseComparisonOperation(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseBitOperation(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseStoreOperation(); - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseStoreOperation() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = peg$parseSTORE(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseUPDATE(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseMAKEREF(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseMAKEREFUNBOXED(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseUNBOXED_UPDATE(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseBOXED(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseSUBSCRIPT(); + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseLabelStatement(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = peg$parseVarStatement(); + } + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; } - } - } - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseArithmeticOperation() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r2.test(s0)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e2); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c0) { -// @ts-ignore - s0 = peg$c0; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e3); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 37) { -// @ts-ignore - s0 = peg$c1; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e4); } - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseBitOperation() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c2) { -// @ts-ignore - s0 = peg$c2; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e5); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c3) { -// @ts-ignore - s0 = peg$c3; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e6); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r3.test(s0)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e7); } - } - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseComparisonOperation() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c4) { -// @ts-ignore - s0 = peg$c4; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e8); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c5) { -// @ts-ignore - s0 = peg$c5; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e9); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c6) { -// @ts-ignore - s0 = peg$c6; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e10); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c7) { -// @ts-ignore - s0 = peg$c7; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e11); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r4.test(s0)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e12); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c8) { -// @ts-ignore - s0 = peg$c8; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e13); } - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c9) { -// @ts-ignore - s0 = peg$c9; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseValueList(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseRPAREN(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f6(s5, s9); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore } else { -// @ts-ignore + // @ts-ignore + peg$currPos = s0; + // @ts-ignore s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e14); } + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseFixBinding() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLPAREN(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseIdentifier(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseCOMMA(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseIdentifierList(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseCOMMA(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseContinuationExpression(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + s12 = peg$parse_(); + // @ts-ignore + if (s12 === peg$FAILED) { + // @ts-ignore + s12 = null; + } + // @ts-ignore + s13 = peg$parseRPAREN(); + // @ts-ignore + if (s13 !== peg$FAILED) { + // @ts-ignore + s1 = [ + s1, + s2, + s3, + s4, + s5, + s6, + s7, + s8, + s9, + s10, + s11, + s12, + s13, + ]; + // @ts-ignore + s0 = s1; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseFixBindingList() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLBRACKET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseFixBinding(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseFixBinding(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + } + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseFixBinding(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = null; + } + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseRBRACKET(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f7(s3, s5); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseFixExpression() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseFIX(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseFixBindingList(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseContinuationExpression(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseRPAREN(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f8(s5, s9); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseContinuationList() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLBRACKET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseContinuationExpression(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseContinuationExpression(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + } + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseContinuationExpression(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = null; + } + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseRBRACKET(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f9(s3, s5); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parsePrimitiveOperationExpression() { + // @ts-ignore + var s0, + s1, + s2, + s3, + s4, + s5, + s6, + s7, + s8, + s9, + s10, + s11, + s12, + s13, + s14, + s15, + s16, + s17, + s18, + s19; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parsePRIMOP(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parsePrimitiveOperation(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseValueList(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseCOMMA(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + s12 = peg$parse_(); + // @ts-ignore + if (s12 === peg$FAILED) { + // @ts-ignore + s12 = null; + } + // @ts-ignore + s13 = peg$parseIdentifierList(); + // @ts-ignore + if (s13 !== peg$FAILED) { + // @ts-ignore + s14 = peg$parse_(); + // @ts-ignore + if (s14 === peg$FAILED) { + // @ts-ignore + s14 = null; + } + // @ts-ignore + s15 = peg$parseCOMMA(); + // @ts-ignore + if (s15 !== peg$FAILED) { + // @ts-ignore + s16 = peg$parse_(); + // @ts-ignore + if (s16 === peg$FAILED) { + // @ts-ignore + s16 = null; + } + // @ts-ignore + s17 = peg$parseContinuationList(); + // @ts-ignore + if (s17 !== peg$FAILED) { + // @ts-ignore + s18 = peg$parse_(); + // @ts-ignore + if (s18 === peg$FAILED) { + // @ts-ignore + s18 = null; + } + // @ts-ignore + s19 = peg$parseRPAREN(); + // @ts-ignore + if (s19 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f10(s5, s9, s13, s17); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseAccessPath() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseOffsetPath(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseSelectPath(); + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseOffsetPath() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseOFFP(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseInteger(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f11(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSelectPath() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseSELP(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseInteger(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseAccessPath(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseRPAREN(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f12(s5, s9); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRecordExpressionTuple() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLPAREN(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseValue(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseCOMMA(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseAccessPath(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseRPAREN(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f13(s3, s7); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRecordExpressionTupleList() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLBRACKET(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseRecordExpressionTuple(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + s5 = peg$parseRecordExpressionTuple(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s5 = [s5, s6, s7, s8]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + } + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseRecordExpressionTuple(); + // @ts-ignore + if (s5 === peg$FAILED) { + // @ts-ignore + s5 = null; + } + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseRBRACKET(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f14(s3, s5); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRecordExpression() { + // @ts-ignore + var s0, + s1, + s2, + s3, + s4, + s5, + s6, + s7, + s8, + s9, + s10, + s11, + s12, + s13, + s14, + s15; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseRECORD(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = peg$parseLPAREN(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$parse_(); + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s5 = peg$parseRecordExpressionTupleList(); + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = peg$parse_(); + // @ts-ignore + if (s6 === peg$FAILED) { + // @ts-ignore + s6 = null; + } + // @ts-ignore + s7 = peg$parseCOMMA(); + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + s8 = peg$parse_(); + // @ts-ignore + if (s8 === peg$FAILED) { + // @ts-ignore + s8 = null; + } + // @ts-ignore + s9 = peg$parseIdentifier(); + // @ts-ignore + if (s9 !== peg$FAILED) { + // @ts-ignore + s10 = peg$parse_(); + // @ts-ignore + if (s10 === peg$FAILED) { + // @ts-ignore + s10 = null; + } + // @ts-ignore + s11 = peg$parseCOMMA(); + // @ts-ignore + if (s11 !== peg$FAILED) { + // @ts-ignore + s12 = peg$parse_(); + // @ts-ignore + if (s12 === peg$FAILED) { + // @ts-ignore + s12 = null; + } + // @ts-ignore + s13 = peg$parseContinuationExpression(); + // @ts-ignore + if (s13 !== peg$FAILED) { + // @ts-ignore + s14 = peg$parse_(); + // @ts-ignore + if (s14 === peg$FAILED) { + // @ts-ignore + s14 = null; + } + // @ts-ignore + s15 = peg$parseRPAREN(); + // @ts-ignore + if (s15 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f15(s5, s9, s13); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseValue() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseVarStatement(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseLabelStatement(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseIntStatement(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseRealStatement(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseBoolStatement(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseStringStatement(); } } } } } - } - } -// @ts-ignore - return s0; - } + // @ts-ignore + return s0; + } -// @ts-ignore - function // @ts-ignore -peg$parseInteger() { -// @ts-ignore - var s0, s1, s2, s3, s4; + // @ts-ignore + function // @ts-ignore + peg$parseVarStatement() { + // @ts-ignore + var s0, s1, s2, s3; -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$currPos; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 45) { -// @ts-ignore - s2 = peg$c10; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s2 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e15); } - } -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } -// @ts-ignore - if (s4 !== peg$FAILED) { -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } - } -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; - } -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s2 = [s2, s3]; -// @ts-ignore - s1 = s2; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s1; -// @ts-ignore - s1 = peg$FAILED; - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = peg$currPos; -// @ts-ignore - peg$silentFails++; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 46) { -// @ts-ignore - s3 = peg$c11; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e17); } - } -// @ts-ignore - peg$silentFails--; -// @ts-ignore - if (s3 === peg$FAILED) { -// @ts-ignore - s2 = undefined; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s2; -// @ts-ignore - s2 = peg$FAILED; - } -// @ts-ignore - if (s2 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f23(s1); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseQuotedString() { -// @ts-ignore - var s0, s1, s2, s3; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 39) { -// @ts-ignore - s1 = peg$c12; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e18); } - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = []; -// @ts-ignore - s3 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r6.test(s3)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e19); } - } -// @ts-ignore - while (s3 !== peg$FAILED) { -// @ts-ignore - s2.push(s3); -// @ts-ignore - s3 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r6.test(s3)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e19); } - } - } -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 39) { -// @ts-ignore - s3 = peg$c12; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e18); } - } -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f24(s2); -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 34) { -// @ts-ignore - s1 = peg$c13; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e20); } - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - s2 = []; -// @ts-ignore - s3 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r7.test(s3)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e21); } - } -// @ts-ignore - while (s3 !== peg$FAILED) { -// @ts-ignore - s2.push(s3); -// @ts-ignore - s3 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r7.test(s3)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseVAR(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseIdentifier(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f16(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e21); } + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; } - } -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 34) { -// @ts-ignore - s3 = peg$c13; -// @ts-ignore - peg$currPos++; -// @ts-ignore + // @ts-ignore } else { -// @ts-ignore - s3 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e20); } - } -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s0 = peg$f25(s2); -// @ts-ignore - } else { -// @ts-ignore + // @ts-ignore peg$currPos = s0; -// @ts-ignore + // @ts-ignore s0 = peg$FAILED; } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s0; -// @ts-ignore - s0 = peg$FAILED; - } - } -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseReal() { -// @ts-ignore - var s0, s1, s2, s3, s4, s5, s6, s7; - -// @ts-ignore - s0 = peg$currPos; -// @ts-ignore - s1 = peg$currPos; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 45) { -// @ts-ignore - s2 = peg$c10; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s2 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e15); } - } -// @ts-ignore - if (s2 === peg$FAILED) { -// @ts-ignore - s2 = null; - } -// @ts-ignore - s3 = []; -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } -// @ts-ignore - if (s4 !== peg$FAILED) { -// @ts-ignore - while (s4 !== peg$FAILED) { -// @ts-ignore - s3.push(s4); -// @ts-ignore - s4 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s4)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s4 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } + // @ts-ignore + return s0; } -// @ts-ignore - } else { -// @ts-ignore - s3 = peg$FAILED; - } -// @ts-ignore - if (s3 !== peg$FAILED) { -// @ts-ignore - s4 = peg$currPos; -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 46) { -// @ts-ignore - s5 = peg$c11; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s5 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e17); } - } -// @ts-ignore - if (s5 !== peg$FAILED) { -// @ts-ignore - s6 = []; -// @ts-ignore - s7 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s7)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s7 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } -// @ts-ignore - if (s7 !== peg$FAILED) { -// @ts-ignore - while (s7 !== peg$FAILED) { -// @ts-ignore - s6.push(s7); -// @ts-ignore - s7 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s7)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore + + // @ts-ignore + function // @ts-ignore + peg$parseLabelStatement() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseLABEL(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseIdentifier(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f17(s3); + // @ts-ignore } else { -// @ts-ignore - s7 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseIntStatement() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseINT(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseInteger(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f18(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRealStatement() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseREAL(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseReal(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f19(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseBoolStatement() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseBOOL(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseInteger(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f20(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseStringStatement() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$parseSTRING(); + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$parse_(); + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = peg$parseQuotedString(); + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f21(s3); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseIdentifier() { + // @ts-ignore + var s0, s1, s2, s3, s4; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$currPos; + // @ts-ignore + s2 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r0.test(s2)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s2 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e0); + } + } + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r1.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e1); } } -// @ts-ignore + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r1.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + } + // @ts-ignore + s2 = [s2, s3]; + // @ts-ignore + s1 = s2; + // @ts-ignore } else { -// @ts-ignore - s6 = peg$FAILED; - } -// @ts-ignore - if (s6 !== peg$FAILED) { -// @ts-ignore - s5 = [s5, s6]; -// @ts-ignore - s4 = s5; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s4; -// @ts-ignore - s4 = peg$FAILED; - } -// @ts-ignore - if (s4 === peg$FAILED) { -// @ts-ignore - s4 = null; - } -// @ts-ignore - s2 = [s2, s3, s4]; -// @ts-ignore - s1 = s2; -// @ts-ignore - } else { -// @ts-ignore - peg$currPos = s1; -// @ts-ignore - s1 = peg$FAILED; - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - peg$savedPos = s0; -// @ts-ignore - s1 = peg$f26(s1); - } -// @ts-ignore - s0 = s1; - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLiteral() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = peg$parseReal(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseQuotedString(); -// @ts-ignore - if (s0 === peg$FAILED) { -// @ts-ignore - s0 = peg$parseInteger(); - } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseOFFSET() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c14) { -// @ts-ignore - s0 = peg$c14; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e22); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseOFFP() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 4) === peg$c15) { -// @ts-ignore - s0 = peg$c15; -// @ts-ignore - peg$currPos += 4; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e23); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSELP() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 4) === peg$c16) { -// @ts-ignore - s0 = peg$c16; -// @ts-ignore - peg$currPos += 4; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e24); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseVAR() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 3) === peg$c17) { -// @ts-ignore - s0 = peg$c17; -// @ts-ignore - peg$currPos += 3; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e25); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseINT() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 3) === peg$c18) { -// @ts-ignore - s0 = peg$c18; -// @ts-ignore - peg$currPos += 3; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e26); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseREAL() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 4) === peg$c19) { -// @ts-ignore - s0 = peg$c19; -// @ts-ignore - peg$currPos += 4; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e27); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseBOOL() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 4) === peg$c20) { -// @ts-ignore - s0 = peg$c20; -// @ts-ignore - peg$currPos += 4; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e28); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSTRING() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c21) { -// @ts-ignore - s0 = peg$c21; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e29); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseAPP() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 3) === peg$c22) { -// @ts-ignore - s0 = peg$c22; -// @ts-ignore - peg$currPos += 3; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e30); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRECORD() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c23) { -// @ts-ignore - s0 = peg$c23; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e31); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSELECT() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c24) { -// @ts-ignore - s0 = peg$c24; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e32); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseFIX() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 3) === peg$c25) { -// @ts-ignore - s0 = peg$c25; -// @ts-ignore - peg$currPos += 3; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e33); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSWITCH() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c26) { -// @ts-ignore - s0 = peg$c26; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e34); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parsePRIMOP() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c27) { -// @ts-ignore - s0 = peg$c27; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e35); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLABEL() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 5) === peg$c28) { -// @ts-ignore - s0 = peg$c28; -// @ts-ignore - peg$currPos += 5; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e36); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSTORE() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 5) === peg$c29) { -// @ts-ignore - s0 = peg$c29; -// @ts-ignore - peg$currPos += 5; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e37); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseUPDATE() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 6) === peg$c30) { -// @ts-ignore - s0 = peg$c30; -// @ts-ignore - peg$currPos += 6; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e38); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseMAKEREF() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 7) === peg$c31) { -// @ts-ignore - s0 = peg$c31; -// @ts-ignore - peg$currPos += 7; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e39); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseMAKEREFUNBOXED() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 14) === peg$c32) { -// @ts-ignore - s0 = peg$c32; -// @ts-ignore - peg$currPos += 14; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e40); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseUNBOXED_UPDATE() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 13) === peg$c33) { -// @ts-ignore - s0 = peg$c33; -// @ts-ignore - peg$currPos += 13; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e41); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSUBSCRIPT() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 9) === peg$c34) { -// @ts-ignore - s0 = peg$c34; -// @ts-ignore - peg$currPos += 9; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e42); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseBOXED() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.substr(peg$currPos, 5) === peg$c35) { -// @ts-ignore - s0 = peg$c35; -// @ts-ignore - peg$currPos += 5; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e43); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLETTER() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r0.test(s0)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e0); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseSAFE_SYMBOL() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 95) { -// @ts-ignore - s0 = peg$c36; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e44); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseDIGIT() { -// @ts-ignore - var s0; - -// @ts-ignore - s0 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r5.test(s0)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e16); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLBRACKET() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 91) { -// @ts-ignore - s0 = peg$c37; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e45); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRBRACKET() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 93) { -// @ts-ignore - s0 = peg$c38; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e46); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseCOMMA() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 44) { -// @ts-ignore - s0 = peg$c39; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e47); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseEQUALS() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 61) { -// @ts-ignore - s0 = peg$c40; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e48); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseLPAREN() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 40) { -// @ts-ignore - s0 = peg$c41; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e49); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parseRPAREN() { -// @ts-ignore - var s0; - -// @ts-ignore - if (input.charCodeAt(peg$currPos) === 41) { -// @ts-ignore - s0 = peg$c42; -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e50); } - } - -// @ts-ignore - return s0; - } - -// @ts-ignore - function // @ts-ignore -peg$parse_() { -// @ts-ignore - var s0, s1; - -// @ts-ignore - s0 = []; -// @ts-ignore - s1 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r8.test(s1)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore - s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e51); } - } -// @ts-ignore - if (s1 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c43) { -// @ts-ignore - s1 = peg$c43; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e52); } - } - } -// @ts-ignore - if (s1 !== peg$FAILED) { -// @ts-ignore - while (s1 !== peg$FAILED) { -// @ts-ignore - s0.push(s1); -// @ts-ignore - s1 = input.charAt(peg$currPos); -// @ts-ignore - if (peg$r8.test(s1)) { -// @ts-ignore - peg$currPos++; -// @ts-ignore - } else { -// @ts-ignore + // @ts-ignore + peg$currPos = s1; + // @ts-ignore s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e51); } } -// @ts-ignore - if (s1 === peg$FAILED) { -// @ts-ignore - if (input.substr(peg$currPos, 2) === peg$c43) { -// @ts-ignore - s1 = peg$c43; -// @ts-ignore - peg$currPos += 2; -// @ts-ignore - } else { -// @ts-ignore - s1 = peg$FAILED; -// @ts-ignore - if (peg$silentFails === 0) { peg$fail(peg$e52); } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s1 = peg$f22(s1); + } + // @ts-ignore + s0 = s1; + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parsePrimitiveOperation() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseArithmeticOperation(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseComparisonOperation(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseBitOperation(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseStoreOperation(); + } } } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseStoreOperation() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseSTORE(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseUPDATE(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseMAKEREF(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseMAKEREFUNBOXED(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseUNBOXED_UPDATE(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseBOXED(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseSUBSCRIPT(); + } + } + } + } + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseArithmeticOperation() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r2.test(s0)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c0) { + // @ts-ignore + s0 = peg$c0; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e3); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 37) { + // @ts-ignore + s0 = peg$c1; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseBitOperation() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c2) { + // @ts-ignore + s0 = peg$c2; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e5); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c3) { + // @ts-ignore + s0 = peg$c3; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r3.test(s0)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e7); + } + } + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseComparisonOperation() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c4) { + // @ts-ignore + s0 = peg$c4; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c5) { + // @ts-ignore + s0 = peg$c5; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c6) { + // @ts-ignore + s0 = peg$c6; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e10); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c7) { + // @ts-ignore + s0 = peg$c7; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e11); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r4.test(s0)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e12); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c8) { + // @ts-ignore + s0 = peg$c8; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e13); + } + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c9) { + // @ts-ignore + s0 = peg$c9; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e14); + } + } + } + } + } + } + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseInteger() { + // @ts-ignore + var s0, s1, s2, s3, s4; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$currPos; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 45) { + // @ts-ignore + s2 = peg$c10; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s2 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e15); + } + } + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + // @ts-ignore + if (s4 !== peg$FAILED) { + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + } + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + } + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s2 = [s2, s3]; + // @ts-ignore + s1 = s2; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s1; + // @ts-ignore + s1 = peg$FAILED; + } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = peg$currPos; + // @ts-ignore + peg$silentFails++; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 46) { + // @ts-ignore + s3 = peg$c11; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + // @ts-ignore + peg$silentFails--; + // @ts-ignore + if (s3 === peg$FAILED) { + // @ts-ignore + s2 = undefined; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s2; + // @ts-ignore + s2 = peg$FAILED; + } + // @ts-ignore + if (s2 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f23(s1); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseQuotedString() { + // @ts-ignore + var s0, s1, s2, s3; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 39) { + // @ts-ignore + s1 = peg$c12; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = []; + // @ts-ignore + s3 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r6.test(s3)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + // @ts-ignore + while (s3 !== peg$FAILED) { + // @ts-ignore + s2.push(s3); + // @ts-ignore + s3 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r6.test(s3)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + } + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 39) { + // @ts-ignore + s3 = peg$c12; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f24(s2); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 34) { + // @ts-ignore + s1 = peg$c13; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + s2 = []; + // @ts-ignore + s3 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r7.test(s3)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + // @ts-ignore + while (s3 !== peg$FAILED) { + // @ts-ignore + s2.push(s3); + // @ts-ignore + s3 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r7.test(s3)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + } + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 34) { + // @ts-ignore + s3 = peg$c13; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s0 = peg$f25(s2); + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s0; + // @ts-ignore + s0 = peg$FAILED; + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseReal() { + // @ts-ignore + var s0, s1, s2, s3, s4, s5, s6, s7; + + // @ts-ignore + s0 = peg$currPos; + // @ts-ignore + s1 = peg$currPos; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 45) { + // @ts-ignore + s2 = peg$c10; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s2 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e15); + } + } + // @ts-ignore + if (s2 === peg$FAILED) { + // @ts-ignore + s2 = null; + } + // @ts-ignore + s3 = []; + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + // @ts-ignore + if (s4 !== peg$FAILED) { + // @ts-ignore + while (s4 !== peg$FAILED) { + // @ts-ignore + s3.push(s4); + // @ts-ignore + s4 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s4)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s4 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + } + // @ts-ignore + } else { + // @ts-ignore + s3 = peg$FAILED; + } + // @ts-ignore + if (s3 !== peg$FAILED) { + // @ts-ignore + s4 = peg$currPos; + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 46) { + // @ts-ignore + s5 = peg$c11; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s5 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + // @ts-ignore + if (s5 !== peg$FAILED) { + // @ts-ignore + s6 = []; + // @ts-ignore + s7 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s7)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s7 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + // @ts-ignore + if (s7 !== peg$FAILED) { + // @ts-ignore + while (s7 !== peg$FAILED) { + // @ts-ignore + s6.push(s7); + // @ts-ignore + s7 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s7)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s7 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + } + // @ts-ignore + } else { + // @ts-ignore + s6 = peg$FAILED; + } + // @ts-ignore + if (s6 !== peg$FAILED) { + // @ts-ignore + s5 = [s5, s6]; + // @ts-ignore + s4 = s5; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s4; + // @ts-ignore + s4 = peg$FAILED; + } + // @ts-ignore + if (s4 === peg$FAILED) { + // @ts-ignore + s4 = null; + } + // @ts-ignore + s2 = [s2, s3, s4]; + // @ts-ignore + s1 = s2; + // @ts-ignore + } else { + // @ts-ignore + peg$currPos = s1; + // @ts-ignore + s1 = peg$FAILED; + } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + peg$savedPos = s0; + // @ts-ignore + s1 = peg$f26(s1); + } + // @ts-ignore + s0 = s1; + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseLiteral() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = peg$parseReal(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseQuotedString(); + // @ts-ignore + if (s0 === peg$FAILED) { + // @ts-ignore + s0 = peg$parseInteger(); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseOFFSET() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c14) { + // @ts-ignore + s0 = peg$c14; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e22); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseOFFP() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 4) === peg$c15) { + // @ts-ignore + s0 = peg$c15; + // @ts-ignore + peg$currPos += 4; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e23); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSELP() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 4) === peg$c16) { + // @ts-ignore + s0 = peg$c16; + // @ts-ignore + peg$currPos += 4; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e24); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseVAR() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 3) === peg$c17) { + // @ts-ignore + s0 = peg$c17; + // @ts-ignore + peg$currPos += 3; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e25); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseINT() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 3) === peg$c18) { + // @ts-ignore + s0 = peg$c18; + // @ts-ignore + peg$currPos += 3; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e26); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseREAL() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 4) === peg$c19) { + // @ts-ignore + s0 = peg$c19; + // @ts-ignore + peg$currPos += 4; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e27); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseBOOL() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 4) === peg$c20) { + // @ts-ignore + s0 = peg$c20; + // @ts-ignore + peg$currPos += 4; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e28); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSTRING() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c21) { + // @ts-ignore + s0 = peg$c21; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e29); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseAPP() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 3) === peg$c22) { + // @ts-ignore + s0 = peg$c22; + // @ts-ignore + peg$currPos += 3; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e30); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRECORD() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c23) { + // @ts-ignore + s0 = peg$c23; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e31); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSELECT() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c24) { + // @ts-ignore + s0 = peg$c24; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e32); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseFIX() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 3) === peg$c25) { + // @ts-ignore + s0 = peg$c25; + // @ts-ignore + peg$currPos += 3; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e33); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSWITCH() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c26) { + // @ts-ignore + s0 = peg$c26; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e34); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parsePRIMOP() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c27) { + // @ts-ignore + s0 = peg$c27; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e35); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseLABEL() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 5) === peg$c28) { + // @ts-ignore + s0 = peg$c28; + // @ts-ignore + peg$currPos += 5; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e36); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSTORE() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 5) === peg$c29) { + // @ts-ignore + s0 = peg$c29; + // @ts-ignore + peg$currPos += 5; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e37); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseUPDATE() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 6) === peg$c30) { + // @ts-ignore + s0 = peg$c30; + // @ts-ignore + peg$currPos += 6; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e38); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseMAKEREF() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 7) === peg$c31) { + // @ts-ignore + s0 = peg$c31; + // @ts-ignore + peg$currPos += 7; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e39); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseMAKEREFUNBOXED() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 14) === peg$c32) { + // @ts-ignore + s0 = peg$c32; + // @ts-ignore + peg$currPos += 14; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e40); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseUNBOXED_UPDATE() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 13) === peg$c33) { + // @ts-ignore + s0 = peg$c33; + // @ts-ignore + peg$currPos += 13; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e41); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSUBSCRIPT() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 9) === peg$c34) { + // @ts-ignore + s0 = peg$c34; + // @ts-ignore + peg$currPos += 9; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e42); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseBOXED() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.substr(peg$currPos, 5) === peg$c35) { + // @ts-ignore + s0 = peg$c35; + // @ts-ignore + peg$currPos += 5; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e43); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseLETTER() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r0.test(s0)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e0); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseSAFE_SYMBOL() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 95) { + // @ts-ignore + s0 = peg$c36; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e44); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseDIGIT() { + // @ts-ignore + var s0; + + // @ts-ignore + s0 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r5.test(s0)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseLBRACKET() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 91) { + // @ts-ignore + s0 = peg$c37; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e45); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRBRACKET() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 93) { + // @ts-ignore + s0 = peg$c38; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e46); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseCOMMA() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 44) { + // @ts-ignore + s0 = peg$c39; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e47); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseEQUALS() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 61) { + // @ts-ignore + s0 = peg$c40; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e48); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseLPAREN() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 40) { + // @ts-ignore + s0 = peg$c41; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e49); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parseRPAREN() { + // @ts-ignore + var s0; + + // @ts-ignore + if (input.charCodeAt(peg$currPos) === 41) { + // @ts-ignore + s0 = peg$c42; + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e50); + } + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + function // @ts-ignore + peg$parse_() { + // @ts-ignore + var s0, s1; + + // @ts-ignore + s0 = []; + // @ts-ignore + s1 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r8.test(s1)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e51); + } + } + // @ts-ignore + if (s1 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c43) { + // @ts-ignore + s1 = peg$c43; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e52); + } + } + } + // @ts-ignore + if (s1 !== peg$FAILED) { + // @ts-ignore + while (s1 !== peg$FAILED) { + // @ts-ignore + s0.push(s1); + // @ts-ignore + s1 = input.charAt(peg$currPos); + // @ts-ignore + if (peg$r8.test(s1)) { + // @ts-ignore + peg$currPos++; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e51); + } + } + // @ts-ignore + if (s1 === peg$FAILED) { + // @ts-ignore + if (input.substr(peg$currPos, 2) === peg$c43) { + // @ts-ignore + s1 = peg$c43; + // @ts-ignore + peg$currPos += 2; + // @ts-ignore + } else { + // @ts-ignore + s1 = peg$FAILED; + // @ts-ignore + if (peg$silentFails === 0) { + peg$fail(peg$e52); + } + } + } + } + // @ts-ignore + } else { + // @ts-ignore + s0 = peg$FAILED; + } + + // @ts-ignore + return s0; + } + + // @ts-ignore + peg$result = peg$startRuleFunction(); + + // @ts-ignore + if (options.peg$library) { + // @ts-ignore + return /** @type {any} */ { + // @ts-ignore + peg$result, + // @ts-ignore + peg$currPos, + // @ts-ignore + peg$FAILED, + // @ts-ignore + peg$maxFailExpected, + // @ts-ignore + peg$maxFailPos, + }; + } + // @ts-ignore + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + // @ts-ignore + return peg$result; + // @ts-ignore + } else { + // @ts-ignore + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + // @ts-ignore + peg$fail(peg$endExpectation()); + } + + // @ts-ignore + throw peg$buildStructuredError( + // @ts-ignore + peg$maxFailExpected, + // @ts-ignore + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + // @ts-ignore + peg$maxFailPos < input.length + ? // @ts-ignore + peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : // @ts-ignore + peg$computeLocation(peg$maxFailPos, peg$maxFailPos), + ); } -// @ts-ignore - } else { -// @ts-ignore - s0 = peg$FAILED; } -// @ts-ignore - return s0; - } - -// @ts-ignore - peg$result = peg$startRuleFunction(); - -// @ts-ignore - if (options.peg$library) { -// @ts-ignore - return /** @type {any} */ ({ -// @ts-ignore - peg$result, -// @ts-ignore - peg$currPos, -// @ts-ignore - peg$FAILED, -// @ts-ignore - peg$maxFailExpected, -// @ts-ignore - peg$maxFailPos - }); - } -// @ts-ignore - if (peg$result !== peg$FAILED && peg$currPos === input.length) { -// @ts-ignore - return peg$result; -// @ts-ignore - } else { -// @ts-ignore - if (peg$result !== peg$FAILED && peg$currPos < input.length) { -// @ts-ignore - peg$fail(peg$endExpectation()); - } - -// @ts-ignore - throw peg$buildStructuredError( -// @ts-ignore - peg$maxFailExpected, -// @ts-ignore - peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, -// @ts-ignore - peg$maxFailPos < input.length -// @ts-ignore - ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) -// @ts-ignore - : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) - ); - } -} - -// @ts-ignore - return { - StartRules: ["Program"], - SyntaxError: peg$SyntaxError, - parse: peg$parse - }; -})() + // @ts-ignore + return { + StartRules: ['Program'], + SyntaxError: peg$SyntaxError, + parse: peg$parse, + }; + })(); export interface FilePosition { offset: number; @@ -5235,7 +5621,7 @@ export interface FileRange { } export interface LiteralExpectation { - type: "literal"; + type: 'literal'; text: string; ignoreCase: boolean; } @@ -5243,70 +5629,88 @@ export interface LiteralExpectation { export interface ClassParts extends Array {} export interface ClassExpectation { - type: "class"; + type: 'class'; parts: ClassParts; inverted: boolean; ignoreCase: boolean; } export interface AnyExpectation { - type: "any"; + type: 'any'; } export interface EndExpectation { - type: "end"; + type: 'end'; } export interface OtherExpectation { - type: "other"; + type: 'other'; description: string; } -export type Expectation = LiteralExpectation | ClassExpectation | AnyExpectation | EndExpectation | OtherExpectation; +export type Expectation = + | LiteralExpectation + | ClassExpectation + | AnyExpectation + | EndExpectation + | OtherExpectation; declare class _PeggySyntaxError extends Error { - public static buildMessage(expected: Expectation[], found: string | null): string; + public static buildMessage( + expected: Expectation[], + found: string | null, + ): string; public message: string; public expected: Expectation[]; public found: string | null; public location: FileRange; public name: string; - constructor(message: string, expected: Expectation[], found: string | null, location: FileRange); - format(sources: { - source?: any; - text: string; - }[]): string; + constructor( + message: string, + expected: Expectation[], + found: string | null, + location: FileRange, + ); + format( + sources: { + source?: any; + text: string; + }[], + ): string; } export interface TraceEvent { - type: string; - rule: string; - result?: any; - location: FileRange; - } + type: string; + rule: string; + result?: any; + location: FileRange; +} declare class _DefaultTracer { private indentLevel: number; public trace(event: TraceEvent): void; } -peggyParser.SyntaxError.prototype.name = "PeggySyntaxError"; +peggyParser.SyntaxError.prototype.name = 'PeggySyntaxError'; export interface ParseOptions { filename?: string; - startRule?: "Program"; + startRule?: 'Program'; tracer?: any; [key: string]: any; } export type ParseFunction = ( - input: string, - options?: Options - ) => Options extends { startRule: infer StartRule } ? - StartRule extends "Program" ? Program : Program - : Program; + input: string, + options?: Options, +) => Options extends { startRule: infer StartRule } + ? StartRule extends 'Program' + ? Program + : Program + : Program; export const parse: ParseFunction = peggyParser.parse; -export const PeggySyntaxError = peggyParser.SyntaxError as typeof _PeggySyntaxError; +export const PeggySyntaxError = + peggyParser.SyntaxError as typeof _PeggySyntaxError; export type PeggySyntaxError = _PeggySyntaxError; @@ -5322,8 +5726,8 @@ export type ContinuationExpression = | PrimitiveOperationExpression; export type SelectExpression = { select: { - record: Integer; - val: Value; + index: Integer; + record: VarStatement; bind: Identifier; continuation: ContinuationExpression; }; @@ -5357,7 +5761,7 @@ export type FixBinding = [ _ | null, ContinuationExpression, _ | null, - RPAREN + RPAREN, ]; export type FixBindingList = any[]; export type FixExpression = { @@ -5372,7 +5776,10 @@ export type PrimitiveOperationExpression = { continuations: ContinuationList; }; }; -export type RecordExpressionTuple = { value: Value; offset: OffsetStatement }; +export type AccessPath = OffsetPath | SelectPath; +export type OffsetPath = { offset: any }; +export type SelectPath = { select: { index: Integer; accessPath: AccessPath } }; +export type RecordExpressionTuple = { value: Value; accessPath: AccessPath }; export type RecordExpressionTupleList = any[]; export type RecordExpression = { record: { @@ -5394,9 +5801,6 @@ export type IntStatement = Integer; export type RealStatement = Real; export type BoolStatement = { bool: any }; export type StringStatement = QuotedString; -export type AccessStatement = OffsetStatement | SelectStatement; -export type OffsetStatement = Integer; -export type SelectStatement = Integer; export type Identifier = { name: string }; export type PrimitiveOperation = | ArithmeticOperation @@ -5411,49 +5815,49 @@ export type StoreOperation = | UNBOXEDUPDATE | BOXED | SUBSCRIPT; -export type ArithmeticOperation = string | "**" | "%"; -export type BitOperation = ">>" | "<<" | string; +export type ArithmeticOperation = string | '**' | '%'; +export type BitOperation = '>>' | '<<' | string; export type ComparisonOperation = - | "==" - | "<=" - | ">=" - | "!=" + | '==' + | '<=' + | '>=' + | '!=' | string - | "||" - | "&&"; + | '||' + | '&&'; export type Integer = { int: number }; export type QuotedString = string; export type Real = { real: number }; export type Literal = Real | QuotedString | Integer; -export type OFFSET = "OFFSET"; -export type OFFP = "OFFp"; -export type SELP = "SELp"; -export type VAR = "VAR"; -export type INT = "INT"; -export type REAL = "REAL"; -export type BOOL = "BOOL"; -export type STRING = "STRING"; -export type APP = "APP"; -export type RECORD = "RECORD"; -export type SELECT = "SELECT"; -export type FIX = "FIX"; -export type SWITCH = "SWITCH"; -export type PRIMOP = "PRIMOP"; -export type LABEL = "LABEL"; -export type STORE = "store"; -export type UPDATE = "update"; -export type MAKEREF = "makeref"; -export type MAKEREFUNBOXED = "makerefunboxed"; -export type UNBOXEDUPDATE = "unboxedupdate"; -export type SUBSCRIPT = "subscript"; -export type BOXED = "boxed"; +export type OFFSET = 'OFFSET'; +export type OFFP = 'OFFp'; +export type SELP = 'SELp'; +export type VAR = 'VAR'; +export type INT = 'INT'; +export type REAL = 'REAL'; +export type BOOL = 'BOOL'; +export type STRING = 'STRING'; +export type APP = 'APP'; +export type RECORD = 'RECORD'; +export type SELECT = 'SELECT'; +export type FIX = 'FIX'; +export type SWITCH = 'SWITCH'; +export type PRIMOP = 'PRIMOP'; +export type LABEL = 'LABEL'; +export type STORE = 'store'; +export type UPDATE = 'update'; +export type MAKEREF = 'makeref'; +export type MAKEREFUNBOXED = 'makerefunboxed'; +export type UNBOXEDUPDATE = 'unboxedupdate'; +export type SUBSCRIPT = 'subscript'; +export type BOXED = 'boxed'; export type LETTER = string; -export type SAFESYMBOL = "_"; +export type SAFESYMBOL = '_'; export type DIGIT = string; -export type LBRACKET = "["; -export type RBRACKET = "]"; -export type COMMA = ","; -export type EQUALS = "="; -export type LPAREN = "("; -export type RPAREN = ")"; -export type _ = (string | "\r\n")[]; +export type LBRACKET = '['; +export type RBRACKET = ']'; +export type COMMA = ','; +export type EQUALS = '='; +export type LPAREN = '('; +export type RPAREN = ')'; +export type _ = (string | '\r\n')[]; diff --git a/test/programs/record.cps b/test/programs/record.cps index fe82668..5850e03 100644 --- a/test/programs/record.cps +++ b/test/programs/record.cps @@ -1,6 +1,6 @@ RECORD([(INT 1, OFFp 0), (INT 2, OFFp 0)], record, - SELECT(0, VAR one, record, - SELECT(1, VAR two, record, + SELECT(0, VAR record, one, + SELECT(1, VAR record, two, PRIMOP(+, [VAR one, VAR two], [result], []) ) )