// @generated by Peggy 4.0.3.
//
// https://peggyjs.org/



//
// Origami language parser
//
// This generally follows the pattern of the JavaScript expression grammar at
// https://github.com/pegjs/pegjs/blob/master/examples/javascript.pegjs. Like
// that parser, this one uses the ECMAScript grammar terms where relevant.
//
// Generate the parser via `npm build`.
//
// @ts-nocheck
//

import * as ops from "../runtime/ops.js";
import {
  annotate,
  downgradeReference,
  makeArray,
  makeBinaryOperation,
  makeCall,
  makeDeferredArguments,
  makeObject,
  makePipeline,
  makeProperty,
  makeReference,
  makeTemplate,
  makeUnaryOperation
} from "./parserHelpers.js";


function peg$subclass(child, parent) {
  function C() { this.constructor = child; }
  C.prototype = parent.prototype;
  child.prototype = new C();
}

function peg$SyntaxError(message, expected, found, location) {
  var self = Error.call(this, message);
  // istanbul ignore next Check is a necessary evil to support older environments
  if (Object.setPrototypeOf) {
    Object.setPrototypeOf(self, peg$SyntaxError.prototype);
  }
  self.expected = expected;
  self.found = found;
  self.location = location;
  self.name = "SyntaxError";
  return self;
}

peg$subclass(peg$SyntaxError, Error);

function peg$padEnd(str, targetLength, padString) {
  padString = padString || " ";
  if (str.length > targetLength) { return str; }
  targetLength -= str.length;
  padString += padString.repeat(targetLength);
  return str + padString.slice(0, targetLength);
}

peg$SyntaxError.prototype.format = function(sources) {
  var str = "Error: " + this.message;
  if (this.location) {
    var src = null;
    var k;
    for (k = 0; k < sources.length; k++) {
      if (sources[k].source === this.location.source) {
        src = sources[k].text.split(/\r\n|\n|\r/g);
        break;
      }
    }
    var s = this.location.start;
    var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
      ? this.location.source.offset(s)
      : s;
    var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
    if (src) {
      var e = this.location.end;
      var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
      var line = src[s.line - 1];
      var last = s.line === e.line ? e.column : line.length + 1;
      var hatLen = (last - s.column) || 1;
      str += "\n --> " + loc + "\n"
          + filler + " |\n"
          + offset_s.line + " | " + line + "\n"
          + filler + " | " + peg$padEnd("", s.column - 1, ' ')
          + peg$padEnd("", hatLen, "^");
    } else {
      str += "\n at " + loc;
    }
  }
  return str;
};

peg$SyntaxError.buildMessage = function(expected, found) {
  var DESCRIBE_EXPECTATION_FNS = {
    literal: function(expectation) {
      return "\"" + literalEscape(expectation.text) + "\"";
    },

    class: function(expectation) {
      var escapedParts = expectation.parts.map(function(part) {
        return Array.isArray(part)
          ? classEscape(part[0]) + "-" + classEscape(part[1])
          : classEscape(part);
      });

      return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
    },

    any: function() {
      return "any character";
    },

    end: function() {
      return "end of input";
    },

    other: function(expectation) {
      return expectation.description;
    }
  };

  function hex(ch) {
    return ch.charCodeAt(0).toString(16).toUpperCase();
  }

  function literalEscape(s) {
    return s
      .replace(/\\/g, "\\\\")
      .replace(/"/g,  "\\\"")
      .replace(/\0/g, "\\0")
      .replace(/\t/g, "\\t")
      .replace(/\n/g, "\\n")
      .replace(/\r/g, "\\r")
      .replace(/[\x00-\x0F]/g,          function(ch) { return "\\x0" + hex(ch); })
      .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x"  + hex(ch); });
  }

  function classEscape(s) {
    return s
      .replace(/\\/g, "\\\\")
      .replace(/\]/g, "\\]")
      .replace(/\^/g, "\\^")
      .replace(/-/g,  "\\-")
      .replace(/\0/g, "\\0")
      .replace(/\t/g, "\\t")
      .replace(/\n/g, "\\n")
      .replace(/\r/g, "\\r")
      .replace(/[\x00-\x0F]/g,          function(ch) { return "\\x0" + hex(ch); })
      .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return "\\x"  + hex(ch); });
  }

  function describeExpectation(expectation) {
    return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
  }

  function describeExpected(expected) {
    var descriptions = expected.map(describeExpectation);
    var i, j;

    descriptions.sort();

    if (descriptions.length > 0) {
      for (i = 1, j = 1; i < descriptions.length; i++) {
        if (descriptions[i - 1] !== descriptions[i]) {
          descriptions[j] = descriptions[i];
          j++;
        }
      }
      descriptions.length = j;
    }

    switch (descriptions.length) {
      case 1:
        return descriptions[0];

      case 2:
        return descriptions[0] + " or " + descriptions[1];

      default:
        return descriptions.slice(0, -1).join(", ")
          + ", or "
          + descriptions[descriptions.length - 1];
    }
  }

  function describeFound(found) {
    return found ? "\"" + literalEscape(found) + "\"" : "end of input";
  }

  return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
};

function peg$parse(input, options) {
  options = options !== undefined ? options : {};

  var peg$FAILED = {};
  var peg$source = options.grammarSource;

  var peg$startRuleFunctions = { __: peg$parse__, additiveExpression: peg$parseadditiveExpression, additiveOperator: peg$parseadditiveOperator, arguments: peg$parsearguments, arrayLiteral: peg$parsearrayLiteral, arrayEntries: peg$parsearrayEntries, arrayEntry: peg$parsearrayEntry, arrowFunction: peg$parsearrowFunction, bitwiseAndExpression: peg$parsebitwiseAndExpression, bitwiseAndOperator: peg$parsebitwiseAndOperator, bitwiseOrExpression: peg$parsebitwiseOrExpression, bitwiseOrOperator: peg$parsebitwiseOrOperator, bitwiseXorExpression: peg$parsebitwiseXorExpression, bitwiseXorOperator: peg$parsebitwiseXorOperator, callExpression: peg$parsecallExpression, closingBrace: peg$parseclosingBrace, closingBracket: peg$parseclosingBracket, closingParenthesis: peg$parseclosingParenthesis, commaExpression: peg$parsecommaExpression, comment: peg$parsecomment, conditionalExpression: peg$parseconditionalExpression, digits: peg$parsedigits, doubleArrow: peg$parsedoubleArrow, doubleQuoteString: peg$parsedoubleQuoteString, doubleQuoteStringChar: peg$parsedoubleQuoteStringChar, ellipsis: peg$parseellipsis, equalityExpression: peg$parseequalityExpression, equalityOperator: peg$parseequalityOperator, escapedChar: peg$parseescapedChar, exponentiationExpression: peg$parseexponentiationExpression, expression: peg$parseexpression, floatLiteral: peg$parsefloatLiteral, group: peg$parsegroup, guillemetString: peg$parseguillemetString, guillemetStringChar: peg$parseguillemetStringChar, homeDirectory: peg$parsehomeDirectory, host: peg$parsehost, identifier: peg$parseidentifier, identifierChar: peg$parseidentifierChar, identifierList: peg$parseidentifierList, implicitParenthesesCallExpression: peg$parseimplicitParenthesesCallExpression, implicitParensthesesArguments: peg$parseimplicitParensthesesArguments, inlineSpace: peg$parseinlineSpace, integerLiteral: peg$parseintegerLiteral, list: peg$parselist, literal: peg$parseliteral, logicalAndExpression: peg$parselogicalAndExpression, logicalOrExpression: peg$parselogicalOrExpression, multiLineComment: peg$parsemultiLineComment, multiplicativeExpression: peg$parsemultiplicativeExpression, multiplicativeOperator: peg$parsemultiplicativeOperator, namespace: peg$parsenamespace, newLine: peg$parsenewLine, numericLiteral: peg$parsenumericLiteral, nullishCoalescingExpression: peg$parsenullishCoalescingExpression, objectLiteral: peg$parseobjectLiteral, objectEntries: peg$parseobjectEntries, objectEntry: peg$parseobjectEntry, objectGetter: peg$parseobjectGetter, objectHiddenKey: peg$parseobjectHiddenKey, objectKey: peg$parseobjectKey, objectProperty: peg$parseobjectProperty, objectShorthandProperty: peg$parseobjectShorthandProperty, objectPublicKey: peg$parseobjectPublicKey, parenthesesArguments: peg$parseparenthesesArguments, path: peg$parsepath, pathArguments: peg$parsepathArguments, pathKey: peg$parsepathKey, pathSegment: peg$parsepathSegment, pathSegmentChar: peg$parsepathSegmentChar, pipelineExpression: peg$parsepipelineExpression, primary: peg$parseprimary, program: peg$parseprogram, protocolExpression: peg$parseprotocolExpression, qualifiedReference: peg$parsequalifiedReference, reference: peg$parsereference, relationalExpression: peg$parserelationalExpression, relationalOperator: peg$parserelationalOperator, rootDirectory: peg$parserootDirectory, scopeReference: peg$parsescopeReference, separator: peg$parseseparator, slashFollows: peg$parseslashFollows, shebang: peg$parseshebang, shiftExpression: peg$parseshiftExpression, shiftOperator: peg$parseshiftOperator, shorthandFunction: peg$parseshorthandFunction, singleArrow: peg$parsesingleArrow, singleLineComment: peg$parsesingleLineComment, singleQuoteString: peg$parsesingleQuoteString, singleQuoteStringChar: peg$parsesingleQuoteStringChar, spread: peg$parsespread, stringLiteral: peg$parsestringLiteral, templateDocument: peg$parsetemplateDocument, templateDocumentChar: peg$parsetemplateDocumentChar, templateDocumentContents: peg$parsetemplateDocumentContents, templateDocumentText: peg$parsetemplateDocumentText, templateLiteral: peg$parsetemplateLiteral, templateLiteralChar: peg$parsetemplateLiteralChar, templateLiteralContents: peg$parsetemplateLiteralContents, templateLiteralText: peg$parsetemplateLiteralText, templateSubstitution: peg$parsetemplateSubstitution, textChar: peg$parsetextChar, unaryExpression: peg$parseunaryExpression, unaryOperator: peg$parseunaryOperator, whitespaceWithNewLine: peg$parsewhitespaceWithNewLine };
  var peg$startRuleFunction = peg$parse__;

  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 = "\u21D2";
  var peg$c12 = "=>";
  var peg$c13 = "\"";
  var peg$c14 = "...";
  var peg$c15 = "\u2026";
  var peg$c16 = "===";
  var peg$c17 = "!==";
  var peg$c18 = "==";
  var peg$c19 = "!=";
  var peg$c20 = "\\0";
  var peg$c21 = "\\b";
  var peg$c22 = "\\f";
  var peg$c23 = "\\n";
  var peg$c24 = "\\r";
  var peg$c25 = "\\t";
  var peg$c26 = "\\v";
  var peg$c27 = "\\";
  var peg$c28 = "**";
  var peg$c29 = ".";
  var peg$c30 = "\xAB";
  var peg$c31 = "\xBB";
  var peg$c32 = "~";
  var peg$c33 = "-";
  var peg$c34 = ">";
  var peg$c35 = "&&";
  var peg$c36 = "||";
  var peg$c37 = "/*";
  var peg$c38 = "*/";
  var peg$c39 = "@";
  var peg$c40 = "\n";
  var peg$c41 = "\r\n";
  var peg$c42 = "\r";
  var peg$c43 = "??";
  var peg$c44 = "{";
  var peg$c45 = "=";
  var peg$c46 = "/";
  var peg$c47 = "//";
  var peg$c48 = "<=";
  var peg$c49 = "<";
  var peg$c50 = ">=";
  var peg$c51 = "#!";
  var peg$c52 = "<<";
  var peg$c53 = ">>>";
  var peg$c54 = ">>";
  var peg$c55 = "\u2192";
  var peg$c56 = "->";
  var peg$c57 = "'";
  var peg$c58 = "${";
  var peg$c59 = "`";

  var peg$r0 = /^[+\-]/;
  var peg$r1 = /^[0-9]/;
  var peg$r2 = /^[^(){}[\]<>?!|\-=,\/:`"'\xAB\xBB\\\u2192\u21D2\u2026 \t\n\r]/;
  var peg$r3 = /^[ \t]/;
  var peg$r4 = /^[%*\/]/;
  var peg$r5 = /^[A-Za-z]/;
  var peg$r6 = /^[^(){}[\],:\/\\ \t\n\r]/;
  var peg$r7 = /^[^\n\r]/;
  var peg$r8 = /^[!+\-~]/;

  var peg$e0 = peg$classExpectation(["+", "-"], false, false);
  var peg$e1 = peg$otherExpectation("function arguments");
  var peg$e2 = peg$otherExpectation("array");
  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$literalExpectation("&", false);
  var peg$e8 = peg$literalExpectation("|", false);
  var peg$e9 = peg$literalExpectation("^", false);
  var peg$e10 = peg$otherExpectation("function call");
  var peg$e11 = peg$literalExpectation("}", false);
  var peg$e12 = peg$anyExpectation();
  var peg$e13 = peg$literalExpectation(",", false);
  var peg$e14 = peg$otherExpectation("comment");
  var peg$e15 = peg$literalExpectation("?", false);
  var peg$e16 = peg$literalExpectation(":", false);
  var peg$e17 = peg$classExpectation([["0", "9"]], false, false);
  var peg$e18 = peg$literalExpectation("\u21D2", false);
  var peg$e19 = peg$literalExpectation("=>", false);
  var peg$e20 = peg$otherExpectation("double quote string");
  var peg$e21 = peg$literalExpectation("\"", false);
  var peg$e22 = peg$literalExpectation("...", false);
  var peg$e23 = peg$literalExpectation("\u2026", false);
  var peg$e24 = peg$literalExpectation("===", false);
  var peg$e25 = peg$literalExpectation("!==", false);
  var peg$e26 = peg$literalExpectation("==", false);
  var peg$e27 = peg$literalExpectation("!=", false);
  var peg$e28 = peg$otherExpectation("backslash-escaped character");
  var peg$e29 = peg$literalExpectation("\\0", false);
  var peg$e30 = peg$literalExpectation("\\b", false);
  var peg$e31 = peg$literalExpectation("\\f", false);
  var peg$e32 = peg$literalExpectation("\\n", false);
  var peg$e33 = peg$literalExpectation("\\r", false);
  var peg$e34 = peg$literalExpectation("\\t", false);
  var peg$e35 = peg$literalExpectation("\\v", false);
  var peg$e36 = peg$literalExpectation("\\", false);
  var peg$e37 = peg$literalExpectation("**", false);
  var peg$e38 = peg$otherExpectation("floating-point number");
  var peg$e39 = peg$literalExpectation(".", false);
  var peg$e40 = peg$otherExpectation("parenthetical group");
  var peg$e41 = peg$otherExpectation("guillemet string");
  var peg$e42 = peg$literalExpectation("\xAB", false);
  var peg$e43 = peg$literalExpectation("\xBB", false);
  var peg$e44 = peg$literalExpectation("~", false);
  var peg$e45 = peg$otherExpectation("HTTP/HTTPS host");
  var peg$e46 = peg$otherExpectation("identifier");
  var peg$e47 = peg$classExpectation(["(", ")", "{", "}", "[", "]", "<", ">", "?", "!", "|", "-", "=", ",", "/", ":", "`", "\"", "'", "\xAB", "\xBB", "\\", "\u2192", "\u21D2", "\u2026", " ", "\t", "\n", "\r"], true, false);
  var peg$e48 = peg$literalExpectation("-", false);
  var peg$e49 = peg$literalExpectation(">", false);
  var peg$e50 = peg$otherExpectation("function call with implicit parentheses");
  var peg$e51 = peg$classExpectation([" ", "\t"], false, false);
  var peg$e52 = peg$otherExpectation("integer");
  var peg$e53 = peg$otherExpectation("list");
  var peg$e54 = peg$literalExpectation("&&", false);
  var peg$e55 = peg$literalExpectation("||", false);
  var peg$e56 = peg$literalExpectation("/*", false);
  var peg$e57 = peg$literalExpectation("*/", false);
  var peg$e58 = peg$classExpectation(["%", "*", "/"], false, false);
  var peg$e59 = peg$literalExpectation("@", false);
  var peg$e60 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false);
  var peg$e61 = peg$literalExpectation("\n", false);
  var peg$e62 = peg$literalExpectation("\r\n", false);
  var peg$e63 = peg$literalExpectation("\r", false);
  var peg$e64 = peg$otherExpectation("number");
  var peg$e65 = peg$literalExpectation("??", false);
  var peg$e66 = peg$otherExpectation("object literal");
  var peg$e67 = peg$literalExpectation("{", false);
  var peg$e68 = peg$otherExpectation("object getter");
  var peg$e69 = peg$literalExpectation("=", false);
  var peg$e70 = peg$otherExpectation("object key");
  var peg$e71 = peg$otherExpectation("object property");
  var peg$e72 = peg$otherExpectation("object identifier");
  var peg$e73 = peg$literalExpectation("/", false);
  var peg$e74 = peg$otherExpectation("function arguments in parentheses");
  var peg$e75 = peg$otherExpectation("slash-separated path");
  var peg$e76 = peg$classExpectation(["(", ")", "{", "}", "[", "]", ",", ":", "/", "\\", " ", "\t", "\n", "\r"], true, false);
  var peg$e77 = peg$otherExpectation("Origami program");
  var peg$e78 = peg$literalExpectation("//", false);
  var peg$e79 = peg$literalExpectation("<=", false);
  var peg$e80 = peg$literalExpectation("<", false);
  var peg$e81 = peg$literalExpectation(">=", false);
  var peg$e82 = peg$otherExpectation("scope reference");
  var peg$e83 = peg$literalExpectation("#!", false);
  var peg$e84 = peg$classExpectation(["\n", "\r"], true, false);
  var peg$e85 = peg$literalExpectation("<<", false);
  var peg$e86 = peg$literalExpectation(">>>", false);
  var peg$e87 = peg$literalExpectation(">>", false);
  var peg$e88 = peg$otherExpectation("lambda function");
  var peg$e89 = peg$literalExpectation("\u2192", false);
  var peg$e90 = peg$literalExpectation("->", false);
  var peg$e91 = peg$otherExpectation("single quote string");
  var peg$e92 = peg$literalExpectation("'", false);
  var peg$e93 = peg$otherExpectation("string");
  var peg$e94 = peg$otherExpectation("template");
  var peg$e95 = peg$literalExpectation("${", false);
  var peg$e96 = peg$otherExpectation("template text");
  var peg$e97 = peg$otherExpectation("template literal");
  var peg$e98 = peg$literalExpectation("`", false);
  var peg$e99 = peg$otherExpectation("template substitution");
  var peg$e100 = peg$classExpectation(["!", "+", "-", "~"], false, false);

  var peg$f0 = function() {
    return null;
  };
  var peg$f1 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f2 = function(entries) {
      return annotate(makeArray(entries ?? []), location());
    };
  var peg$f3 = function(entries) {
      return annotate(entries, location());
    };
  var peg$f4 = function() {
      return annotate([ops.literal, undefined], location());
    };
  var peg$f5 = function(parameters, pipeline) {
      return annotate([ops.lambda, parameters ?? [], pipeline], location());
    };
  var peg$f6 = function(identifier, pipeline) {
      return annotate([ops.lambda, [identifier], pipeline], location());
    };
  var peg$f7 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f8 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f9 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f10 = function(head, tail) {
      return annotate(tail.reduce(makeCall, head), location());
    };
  var peg$f11 = function() {
      error("Expected right curly brace");
    };
  var peg$f12 = function() {
      error("Expected right bracket");
    };
  var peg$f13 = function() {
      error("Expected right parenthesis");
    };
  var peg$f14 = function(list) {
      return list.length === 1
        ? list[0]
        : annotate([ops.comma, ...list], location());
    };
  var peg$f15 = function(condition, truthy, falsy) {
      return annotate([
        ops.conditional,
        downgradeReference(condition),
        [ops.lambda, [], downgradeReference(truthy)],
        [ops.lambda, [], downgradeReference(falsy)]
      ], location());
    };
  var peg$f16 = function(chars) {
    return annotate([ops.literal, chars.join("")], location());
  };
  var peg$f17 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f18 = function() { return "\0"; };
  var peg$f19 = function() { return "\b"; };
  var peg$f20 = function() { return "\f"; };
  var peg$f21 = function() { return "\n"; };
  var peg$f22 = function() { return "\r"; };
  var peg$f23 = function() { return "\t"; };
  var peg$f24 = function() { return "\v"; };
  var peg$f25 = function(left, right) {
      return annotate([ops.exponentiation, left, right], location());
    };
  var peg$f26 = function() {
      return annotate([ops.literal, parseFloat(text())], location());
    };
  var peg$f27 = function(expression) {
      return annotate(downgradeReference(expression), location());
    };
  var peg$f28 = function(chars) {
    return annotate([ops.literal, chars.join("")], location());
  };
  var peg$f29 = function() {
      return annotate([ops.homeDirectory], location());
    };
  var peg$f30 = function(identifier, port, slashFollows) {
    const portText = port ? `:${port[1]}` : "";
    const slashText = slashFollows ? "/" : "";
    const hostText = identifier + portText + slashText;
    return annotate([ops.literal, hostText], location());
  };
  var peg$f31 = function(chars) { return chars.join(""); };
  var peg$f32 = function(list) {
      return annotate(list, location());
    };
  var peg$f33 = function(head, args) {
      return args ? makeCall(head, args) : head;
    };
  var peg$f34 = function(values) {
      return annotate(values, location());
    };
  var peg$f35 = function() {
      return annotate([ops.literal, parseInt(text())], location());
    };
  var peg$f36 = function(values) {
      return annotate(values, location());
    };
  var peg$f37 = function(head, tail) {
      return tail.length === 0
        ? head
        : annotate(
          [ops.logicalAnd, downgradeReference(head), ...makeDeferredArguments(tail)],
          location()
        );
    };
  var peg$f38 = function(head, tail) {
      return tail.length === 0
        ? head
        : annotate(
          [ops.logicalOr, downgradeReference(head), ...makeDeferredArguments(tail)],
          location()
        );
    };
  var peg$f39 = function() { return null; };
  var peg$f40 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f41 = function(at, chars) {
    return annotate([ops.builtin, (at ?? "") + chars.join("") + ":"], location());
  };
  var peg$f42 = function(head, tail) {
      return tail.length === 0
        ? head
        : annotate(
          [ops.nullishCoalescing, downgradeReference(head), ...makeDeferredArguments(tail)],
          location()
        );
    };
  var peg$f43 = function(entries) {
      return annotate(makeObject(entries ?? [], ops.object), location());
    };
  var peg$f44 = function(entries) {
      return annotate(entries, location());
    };
  var peg$f45 = function(key, pipeline) {
      return annotate(
        makeProperty(key, annotate([ops.getter, pipeline], location())),
        location()
      );
    };
  var peg$f46 = function(hiddenKey) { return hiddenKey.join(""); };
  var peg$f47 = function(key, pipeline) {
      return annotate(makeProperty(key, pipeline), location());
    };
  var peg$f48 = function(key) {
      return annotate([key, [ops.inherited, key]], location());
    };
  var peg$f49 = function(identifier, slash) {
    return identifier + (slash ?? "");
  };
  var peg$f50 = function(string) {
    // Remove `ops.literal` from the string code
    return string[1];
  };
  var peg$f51 = function(list) {
      return annotate(list ?? [undefined], location());
    };
  var peg$f52 = function(segments) {
      // Drop empty segments that represent consecutive or final slashes
      segments = segments.filter(segment => segment);
      return annotate(segments, location());
    };
  var peg$f53 = function(path) {
      return annotate([ops.traverse, ...path], location());
    };
  var peg$f54 = function(chars, slashFollows) {
    // Append a trailing slash if one follows (but don't consume it)
    const key = chars.join("") + (slashFollows ? "/" : "");
    return annotate([ops.literal, key], location());
  };
  var peg$f55 = function(head, tail) {
      return annotate(
        tail.reduce(makePipeline, downgradeReference(head)),
        location()
      );
    };
  var peg$f56 = function(fn, host, path) {
      const keys = annotate([host, ...(path ?? [])], location());
      return annotate(makeCall(fn, keys), location());
    };
  var peg$f57 = function(fn, reference) {
      const literal = annotate([ops.literal, reference[1]], reference.location);
      return annotate(makeCall(fn, [literal]), location());
    };
  var peg$f58 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f59 = function(key) {
      return annotate([ops.rootDirectory, key], location());
    };
  var peg$f60 = function() {
      return annotate([ops.rootDirectory], location());
    };
  var peg$f61 = function(identifier, slashFollows) {
      const id = identifier + (slashFollows ? "/" : "");
      return annotate(makeReference(id), location());
    };
  var peg$f62 = function() {
      return true;
    };
  var peg$f63 = function() { return null; };
  var peg$f64 = function(head, tail) {
      return annotate(tail.reduce(makeBinaryOperation, head), location());
    };
  var peg$f65 = function(definition) {
      return annotate([ops.lambda, ["_"], definition], location());
    };
  var peg$f66 = function() { return null; };
  var peg$f67 = function(chars) {
    return annotate([ops.literal, chars.join("")], location());
  };
  var peg$f68 = function(value) {
      return annotate([ops.spread, value], location());
    };
  var peg$f69 = function(contents) {
      return annotate([ops.lambda, ["_"], contents], location());
    };
  var peg$f70 = function(head, tail) {
      return annotate(makeTemplate(ops.template, head, tail), location());
    };
  var peg$f71 = function(chars) {
      return chars.join("");
    };
  var peg$f72 = function(contents) {
      return annotate(makeTemplate(ops.template, contents[0], contents[1]), location());
    };
  var peg$f73 = function(chars) {
      return chars.join("");
    };
  var peg$f74 = function(expression) {
      return annotate(expression, location());
    };
  var peg$f75 = function(operator, expression) {
      return annotate(makeUnaryOperation(operator, expression), location());
    };
  var peg$currPos = options.peg$currPos | 0;
  var peg$savedPos = peg$currPos;
  var peg$posDetailsCache = [{ line: 1, column: 1 }];
  var peg$maxFailPos = peg$currPos;
  var peg$maxFailExpected = options.peg$maxFailExpected || [];
  var peg$silentFails = options.peg$silentFails | 0;

  var peg$result;

  if (options.startRule) {
    if (!(options.startRule in peg$startRuleFunctions)) {
      throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
    }

    peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
  }

  function text() {
    return input.substring(peg$savedPos, peg$currPos);
  }

  function offset() {
    return peg$savedPos;
  }

  function range() {
    return {
      source: peg$source,
      start: peg$savedPos,
      end: peg$currPos
    };
  }

  function location() {
    return peg$computeLocation(peg$savedPos, peg$currPos);
  }

  function expected(description, location) {
    location = location !== undefined
      ? location
      : peg$computeLocation(peg$savedPos, peg$currPos);

    throw peg$buildStructuredError(
      [peg$otherExpectation(description)],
      input.substring(peg$savedPos, peg$currPos),
      location
    );
  }

  function error(message, location) {
    location = location !== undefined
      ? location
      : peg$computeLocation(peg$savedPos, peg$currPos);

    throw peg$buildSimpleError(message, location);
  }

  function peg$literalExpectation(text, ignoreCase) {
    return { type: "literal", text: text, ignoreCase: ignoreCase };
  }

  function peg$classExpectation(parts, inverted, ignoreCase) {
    return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
  }

  function peg$anyExpectation() {
    return { type: "any" };
  }

  function peg$endExpectation() {
    return { type: "end" };
  }

  function peg$otherExpectation(description) {
    return { type: "other", description: description };
  }

  function peg$computePosDetails(pos) {
    var details = peg$posDetailsCache[pos];
    var p;

    if (details) {
      return details;
    } else {
      if (pos >= peg$posDetailsCache.length) {
        p = peg$posDetailsCache.length - 1;
      } else {
        p = pos;
        while (!peg$posDetailsCache[--p]) {}
      }

      details = peg$posDetailsCache[p];
      details = {
        line: details.line,
        column: details.column
      };

      while (p < pos) {
        if (input.charCodeAt(p) === 10) {
          details.line++;
          details.column = 1;
        } else {
          details.column++;
        }

        p++;
      }

      peg$posDetailsCache[pos] = details;

      return details;
    }
  }

  function peg$computeLocation(startPos, endPos, offset) {
    var startPosDetails = peg$computePosDetails(startPos);
    var endPosDetails = peg$computePosDetails(endPos);

    var res = {
      source: peg$source,
      start: {
        offset: startPos,
        line: startPosDetails.line,
        column: startPosDetails.column
      },
      end: {
        offset: endPos,
        line: endPosDetails.line,
        column: endPosDetails.column
      }
    };
    if (offset && peg$source && (typeof peg$source.offset === "function")) {
      res.start = peg$source.offset(res.start);
      res.end = peg$source.offset(res.end);
    }
    return res;
  }

  function peg$fail(expected) {
    if (peg$currPos < peg$maxFailPos) { return; }

    if (peg$currPos > peg$maxFailPos) {
      peg$maxFailPos = peg$currPos;
      peg$maxFailExpected = [];
    }

    peg$maxFailExpected.push(expected);
  }

  function peg$buildSimpleError(message, location) {
    return new peg$SyntaxError(message, null, null, location);
  }

  function peg$buildStructuredError(expected, found, location) {
    return new peg$SyntaxError(
      peg$SyntaxError.buildMessage(expected, found),
      expected,
      found,
      location
    );
  }

  function peg$parse__() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parseinlineSpace();
    if (s2 === peg$FAILED) {
      s2 = peg$parsenewLine();
      if (s2 === peg$FAILED) {
        s2 = peg$parsecomment();
      }
    }
    while (s2 !== peg$FAILED) {
      s1.push(s2);
      s2 = peg$parseinlineSpace();
      if (s2 === peg$FAILED) {
        s2 = peg$parsenewLine();
        if (s2 === peg$FAILED) {
          s2 = peg$parsecomment();
        }
      }
    }
    peg$savedPos = s0;
    s1 = peg$f0();
    s0 = s1;

    return s0;
  }

  function peg$parseadditiveExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parsemultiplicativeExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parseadditiveOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsemultiplicativeExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parseadditiveOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parsemultiplicativeExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f1(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseadditiveOperator() {
    var s0;

    s0 = input.charAt(peg$currPos);
    if (peg$r0.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e0); }
    }

    return s0;
  }

  function peg$parsearguments() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$parseparenthesesArguments();
    if (s0 === peg$FAILED) {
      s0 = peg$parsepathArguments();
      if (s0 === peg$FAILED) {
        s0 = peg$parsetemplateLiteral();
      }
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e1); }
    }

    return s0;
  }

  function peg$parsearrayLiteral() {
    var s0, s1, s2, s3, s4, s5;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 91) {
      s1 = peg$c0;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e3); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parsearrayEntries();
      if (s3 === peg$FAILED) {
        s3 = null;
      }
      s4 = peg$parse__();
      s5 = peg$parseclosingBracket();
      if (s5 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f2(s3);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e2); }
    }

    return s0;
  }

  function peg$parsearrayEntries() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parsearrayEntry();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parseseparator();
      if (s4 !== peg$FAILED) {
        s4 = peg$parsearrayEntry();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseseparator();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f3(s1);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsearrayEntry() {
    var s0, s1, s2, s3;

    s0 = peg$parsespread();
    if (s0 === peg$FAILED) {
      s0 = peg$parsepipelineExpression();
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parse__();
        s2 = peg$currPos;
        peg$silentFails++;
        if (input.charCodeAt(peg$currPos) === 93) {
          s3 = peg$c1;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e4); }
        }
        peg$silentFails--;
        if (s3 === peg$FAILED) {
          s2 = undefined;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f4();
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      }
    }

    return s0;
  }

  function peg$parsearrowFunction() {
    var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 40) {
      s1 = peg$c2;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e5); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parseidentifierList();
      if (s3 === peg$FAILED) {
        s3 = null;
      }
      s4 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 41) {
        s5 = peg$c3;
        peg$currPos++;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e6); }
      }
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsedoubleArrow();
        if (s7 !== peg$FAILED) {
          s8 = peg$parse__();
          s9 = peg$parsepipelineExpression();
          if (s9 !== peg$FAILED) {
            peg$savedPos = s0;
            s0 = peg$f5(s3, s9);
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      s1 = peg$parseidentifier();
      if (s1 !== peg$FAILED) {
        s2 = peg$parse__();
        s3 = peg$parsedoubleArrow();
        if (s3 !== peg$FAILED) {
          s4 = peg$parse__();
          s5 = peg$parsepipelineExpression();
          if (s5 !== peg$FAILED) {
            peg$savedPos = s0;
            s0 = peg$f6(s1, s5);
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$parseconditionalExpression();
      }
    }

    return s0;
  }

  function peg$parsebitwiseAndExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parseequalityExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parsebitwiseAndOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parseequalityExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parsebitwiseAndOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parseequalityExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f7(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsebitwiseAndOperator() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 38) {
      s1 = peg$c4;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e7); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$currPos;
      peg$silentFails++;
      if (input.charCodeAt(peg$currPos) === 38) {
        s3 = peg$c4;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e7); }
      }
      peg$silentFails--;
      if (s3 === peg$FAILED) {
        s2 = undefined;
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 !== peg$FAILED) {
        s0 = s1;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsebitwiseOrExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parsebitwiseXorExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parsebitwiseOrOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsebitwiseXorExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parsebitwiseOrOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parsebitwiseXorExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f8(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsebitwiseOrOperator() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 124) {
      s1 = peg$c5;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e8); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$currPos;
      peg$silentFails++;
      if (input.charCodeAt(peg$currPos) === 124) {
        s3 = peg$c5;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e8); }
      }
      peg$silentFails--;
      if (s3 === peg$FAILED) {
        s2 = undefined;
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 !== peg$FAILED) {
        s0 = s1;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsebitwiseXorExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parsebitwiseAndExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parsebitwiseXorOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsebitwiseAndExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parsebitwiseXorOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parsebitwiseAndExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f9(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsebitwiseXorOperator() {
    var s0;

    if (input.charCodeAt(peg$currPos) === 94) {
      s0 = peg$c6;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e9); }
    }

    return s0;
  }

  function peg$parsecallExpression() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseprotocolExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$parsearguments();
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$parsearguments();
      }
      peg$savedPos = s0;
      s0 = peg$f10(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e10); }
    }

    return s0;
  }

  function peg$parseclosingBrace() {
    var s0, s1;

    if (input.charCodeAt(peg$currPos) === 125) {
      s0 = peg$c7;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e11); }
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.length > peg$currPos) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e12); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      peg$savedPos = s0;
      s1 = peg$f11();
      s0 = s1;
    }

    return s0;
  }

  function peg$parseclosingBracket() {
    var s0, s1;

    if (input.charCodeAt(peg$currPos) === 93) {
      s0 = peg$c1;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e4); }
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.length > peg$currPos) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e12); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      peg$savedPos = s0;
      s1 = peg$f12();
      s0 = s1;
    }

    return s0;
  }

  function peg$parseclosingParenthesis() {
    var s0, s1;

    if (input.charCodeAt(peg$currPos) === 41) {
      s0 = peg$c3;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e6); }
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.length > peg$currPos) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e12); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      peg$savedPos = s0;
      s1 = peg$f13();
      s0 = s1;
    }

    return s0;
  }

  function peg$parsecommaExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parsepipelineExpression();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$currPos;
      s5 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 44) {
        s6 = peg$c8;
        peg$currPos++;
      } else {
        s6 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e13); }
      }
      if (s6 !== peg$FAILED) {
        s7 = peg$parse__();
        s5 = [s5, s6, s7];
        s4 = s5;
      } else {
        peg$currPos = s4;
        s4 = peg$FAILED;
      }
      if (s4 !== peg$FAILED) {
        s4 = peg$parsepipelineExpression();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f14(s1);
    }
    s0 = s1;

    return s0;
  }

  function peg$parsecomment() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$parsemultiLineComment();
    if (s0 === peg$FAILED) {
      s0 = peg$parsesingleLineComment();
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e14); }
    }

    return s0;
  }

  function peg$parseconditionalExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;

    s0 = peg$currPos;
    s1 = peg$parselogicalOrExpression();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 63) {
        s3 = peg$c9;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e15); }
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parse__();
        s5 = peg$parsepipelineExpression();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          if (input.charCodeAt(peg$currPos) === 58) {
            s7 = peg$c10;
            peg$currPos++;
          } else {
            s7 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$e16); }
          }
          if (s7 !== peg$FAILED) {
            s8 = peg$parse__();
            s9 = peg$parsepipelineExpression();
            if (s9 !== peg$FAILED) {
              peg$savedPos = s0;
              s0 = peg$f15(s1, s5, s9);
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parselogicalOrExpression();
    }

    return s0;
  }

  function peg$parsedigits() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = [];
    s2 = input.charAt(peg$currPos);
    if (peg$r1.test(s2)) {
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e17); }
    }
    if (s2 !== peg$FAILED) {
      while (s2 !== peg$FAILED) {
        s1.push(s2);
        s2 = input.charAt(peg$currPos);
        if (peg$r1.test(s2)) {
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e17); }
        }
      }
    } else {
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s0 = s1;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsedoubleArrow() {
    var s0;

    if (input.charCodeAt(peg$currPos) === 8658) {
      s0 = peg$c11;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e18); }
    }
    if (s0 === peg$FAILED) {
      if (input.substr(peg$currPos, 2) === peg$c12) {
        s0 = peg$c12;
        peg$currPos += 2;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e19); }
      }
    }

    return s0;
  }

  function peg$parsedoubleQuoteString() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 34) {
      s1 = peg$c13;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e21); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$parsedoubleQuoteStringChar();
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$parsedoubleQuoteStringChar();
      }
      if (input.charCodeAt(peg$currPos) === 34) {
        s3 = peg$c13;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e21); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f16(s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e20); }
    }

    return s0;
  }

  function peg$parsedoubleQuoteStringChar() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.charCodeAt(peg$currPos) === 34) {
      s2 = peg$c13;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e21); }
    }
    if (s2 === peg$FAILED) {
      s2 = peg$parsenewLine();
    }
    peg$silentFails--;
    if (s2 === peg$FAILED) {
      s1 = undefined;
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetextChar();
      if (s2 !== peg$FAILED) {
        s0 = s2;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseellipsis() {
    var s0;

    if (input.substr(peg$currPos, 3) === peg$c14) {
      s0 = peg$c14;
      peg$currPos += 3;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e22); }
    }
    if (s0 === peg$FAILED) {
      if (input.charCodeAt(peg$currPos) === 8230) {
        s0 = peg$c15;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e23); }
      }
    }

    return s0;
  }

  function peg$parseequalityExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parserelationalExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parseequalityOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parserelationalExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parseequalityOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parserelationalExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f17(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseequalityOperator() {
    var s0;

    if (input.substr(peg$currPos, 3) === peg$c16) {
      s0 = peg$c16;
      peg$currPos += 3;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e24); }
    }
    if (s0 === peg$FAILED) {
      if (input.substr(peg$currPos, 3) === peg$c17) {
        s0 = peg$c17;
        peg$currPos += 3;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e25); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 2) === peg$c18) {
          s0 = peg$c18;
          peg$currPos += 2;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e26); }
        }
        if (s0 === peg$FAILED) {
          if (input.substr(peg$currPos, 2) === peg$c19) {
            s0 = peg$c19;
            peg$currPos += 2;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$e27); }
          }
        }
      }
    }

    return s0;
  }

  function peg$parseescapedChar() {
    var s0, s1, s2;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.substr(peg$currPos, 2) === peg$c20) {
      s1 = peg$c20;
      peg$currPos += 2;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e29); }
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f18();
    }
    s0 = s1;
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.substr(peg$currPos, 2) === peg$c21) {
        s1 = peg$c21;
        peg$currPos += 2;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e30); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$f19();
      }
      s0 = s1;
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 2) === peg$c22) {
          s1 = peg$c22;
          peg$currPos += 2;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e31); }
        }
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$f20();
        }
        s0 = s1;
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 2) === peg$c23) {
            s1 = peg$c23;
            peg$currPos += 2;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$e32); }
          }
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$f21();
          }
          s0 = s1;
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.substr(peg$currPos, 2) === peg$c24) {
              s1 = peg$c24;
              peg$currPos += 2;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$e33); }
            }
            if (s1 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$f22();
            }
            s0 = s1;
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.substr(peg$currPos, 2) === peg$c25) {
                s1 = peg$c25;
                peg$currPos += 2;
              } else {
                s1 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$e34); }
              }
              if (s1 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$f23();
              }
              s0 = s1;
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.substr(peg$currPos, 2) === peg$c26) {
                  s1 = peg$c26;
                  peg$currPos += 2;
                } else {
                  s1 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$e35); }
                }
                if (s1 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$f24();
                }
                s0 = s1;
                if (s0 === peg$FAILED) {
                  s0 = peg$currPos;
                  if (input.charCodeAt(peg$currPos) === 92) {
                    s1 = peg$c27;
                    peg$currPos++;
                  } else {
                    s1 = peg$FAILED;
                    if (peg$silentFails === 0) { peg$fail(peg$e36); }
                  }
                  if (s1 !== peg$FAILED) {
                    if (input.length > peg$currPos) {
                      s2 = input.charAt(peg$currPos);
                      peg$currPos++;
                    } else {
                      s2 = peg$FAILED;
                      if (peg$silentFails === 0) { peg$fail(peg$e12); }
                    }
                    if (s2 !== peg$FAILED) {
                      s0 = s2;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                }
              }
            }
          }
        }
      }
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e28); }
    }

    return s0;
  }

  function peg$parseexponentiationExpression() {
    var s0, s1, s2, s3, s4, s5;

    s0 = peg$currPos;
    s1 = peg$parseunaryExpression();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      if (input.substr(peg$currPos, 2) === peg$c28) {
        s3 = peg$c28;
        peg$currPos += 2;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e37); }
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parse__();
        s5 = peg$parseexponentiationExpression();
        if (s5 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f25(s1, s5);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parseunaryExpression();
    }

    return s0;
  }

  function peg$parseexpression() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    s1 = peg$parse__();
    s2 = peg$parsecommaExpression();
    if (s2 !== peg$FAILED) {
      s3 = peg$parse__();
      s0 = s2;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsefloatLiteral() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parsedigits();
    if (s1 === peg$FAILED) {
      s1 = null;
    }
    if (input.charCodeAt(peg$currPos) === 46) {
      s2 = peg$c29;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e39); }
    }
    if (s2 !== peg$FAILED) {
      s3 = peg$parsedigits();
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f26();
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e38); }
    }

    return s0;
  }

  function peg$parsegroup() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 40) {
      s1 = peg$c2;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e5); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseexpression();
      if (s2 !== peg$FAILED) {
        s3 = peg$parseclosingParenthesis();
        if (s3 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f27(s2);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e40); }
    }

    return s0;
  }

  function peg$parseguillemetString() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 171) {
      s1 = peg$c30;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e42); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$parseguillemetStringChar();
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$parseguillemetStringChar();
      }
      if (input.charCodeAt(peg$currPos) === 187) {
        s3 = peg$c31;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e43); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f28(s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e41); }
    }

    return s0;
  }

  function peg$parseguillemetStringChar() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.charCodeAt(peg$currPos) === 187) {
      s2 = peg$c31;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e43); }
    }
    if (s2 === peg$FAILED) {
      s2 = peg$parsenewLine();
    }
    peg$silentFails--;
    if (s2 === peg$FAILED) {
      s1 = undefined;
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetextChar();
      if (s2 !== peg$FAILED) {
        s0 = s2;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsehomeDirectory() {
    var s0, s1;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 126) {
      s1 = peg$c32;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e44); }
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f29();
    }
    s0 = s1;

    return s0;
  }

  function peg$parsehost() {
    var s0, s1, s2, s3, s4;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseidentifier();
    if (s1 !== peg$FAILED) {
      s2 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 58) {
        s3 = peg$c10;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e16); }
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parseintegerLiteral();
        if (s4 !== peg$FAILED) {
          s2 = s4;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      s3 = peg$parseslashFollows();
      if (s3 === peg$FAILED) {
        s3 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f30(s1, s2, s3);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e45); }
    }

    return s0;
  }

  function peg$parseidentifier() {
    var s0, s1, s2;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parseidentifierChar();
    if (s2 !== peg$FAILED) {
      while (s2 !== peg$FAILED) {
        s1.push(s2);
        s2 = peg$parseidentifierChar();
      }
    } else {
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f31(s1);
    }
    s0 = s1;
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e46); }
    }

    return s0;
  }

  function peg$parseidentifierChar() {
    var s0, s1, s2, s3;

    s0 = input.charAt(peg$currPos);
    if (peg$r2.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e47); }
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 45) {
        s1 = peg$c33;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e48); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        peg$silentFails++;
        if (input.charCodeAt(peg$currPos) === 62) {
          s3 = peg$c34;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e49); }
        }
        peg$silentFails--;
        if (s3 === peg$FAILED) {
          s2 = undefined;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$parseescapedChar();
      }
    }

    return s0;
  }

  function peg$parseidentifierList() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parseidentifier();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parseseparator();
      if (s4 !== peg$FAILED) {
        s4 = peg$parseidentifier();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseseparator();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f32(s1);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseimplicitParenthesesCallExpression() {
    var s0, s1, s2, s3, s4;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parsearrowFunction();
    if (s1 !== peg$FAILED) {
      s2 = peg$currPos;
      s3 = [];
      s4 = peg$parseinlineSpace();
      if (s4 !== peg$FAILED) {
        while (s4 !== peg$FAILED) {
          s3.push(s4);
          s4 = peg$parseinlineSpace();
        }
      } else {
        s3 = peg$FAILED;
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parseimplicitParensthesesArguments();
        if (s4 !== peg$FAILED) {
          s2 = s4;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f33(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e50); }
    }

    return s0;
  }

  function peg$parseimplicitParensthesesArguments() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parseshorthandFunction();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parseseparator();
      if (s4 !== peg$FAILED) {
        s4 = peg$parseshorthandFunction();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseseparator();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f34(s1);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseinlineSpace() {
    var s0;

    s0 = input.charAt(peg$currPos);
    if (peg$r3.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e51); }
    }

    return s0;
  }

  function peg$parseintegerLiteral() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parsedigits();
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f35();
    }
    s0 = s1;
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e52); }
    }

    return s0;
  }

  function peg$parselist() {
    var s0, s1, s2, s3, s4;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parsepipelineExpression();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parseseparator();
      if (s4 !== peg$FAILED) {
        s4 = peg$parsepipelineExpression();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseseparator();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f36(s1);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e53); }
    }

    return s0;
  }

  function peg$parseliteral() {
    var s0;

    s0 = peg$parsenumericLiteral();
    if (s0 === peg$FAILED) {
      s0 = peg$parsestringLiteral();
    }

    return s0;
  }

  function peg$parselogicalAndExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parsebitwiseOrExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      if (input.substr(peg$currPos, 2) === peg$c35) {
        s5 = peg$c35;
        peg$currPos += 2;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e54); }
      }
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsebitwiseOrExpression();
        if (s7 !== peg$FAILED) {
          s3 = s7;
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        if (input.substr(peg$currPos, 2) === peg$c35) {
          s5 = peg$c35;
          peg$currPos += 2;
        } else {
          s5 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e54); }
        }
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parsebitwiseOrExpression();
          if (s7 !== peg$FAILED) {
            s3 = s7;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f37(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parselogicalOrExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parsenullishCoalescingExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      if (input.substr(peg$currPos, 2) === peg$c36) {
        s5 = peg$c36;
        peg$currPos += 2;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e55); }
      }
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parsenullishCoalescingExpression();
        if (s7 !== peg$FAILED) {
          s3 = s7;
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        if (input.substr(peg$currPos, 2) === peg$c36) {
          s5 = peg$c36;
          peg$currPos += 2;
        } else {
          s5 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e55); }
        }
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parsenullishCoalescingExpression();
          if (s7 !== peg$FAILED) {
            s3 = s7;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f38(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsemultiLineComment() {
    var s0, s1, s2, s3, s4, s5;

    s0 = peg$currPos;
    if (input.substr(peg$currPos, 2) === peg$c37) {
      s1 = peg$c37;
      peg$currPos += 2;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e56); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$currPos;
      peg$silentFails++;
      if (input.substr(peg$currPos, 2) === peg$c38) {
        s5 = peg$c38;
        peg$currPos += 2;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e57); }
      }
      peg$silentFails--;
      if (s5 === peg$FAILED) {
        s4 = undefined;
      } else {
        peg$currPos = s4;
        s4 = peg$FAILED;
      }
      if (s4 !== peg$FAILED) {
        if (input.length > peg$currPos) {
          s5 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s5 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e12); }
        }
        if (s5 !== peg$FAILED) {
          s4 = [s4, s5];
          s3 = s4;
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$currPos;
        peg$silentFails++;
        if (input.substr(peg$currPos, 2) === peg$c38) {
          s5 = peg$c38;
          peg$currPos += 2;
        } else {
          s5 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e57); }
        }
        peg$silentFails--;
        if (s5 === peg$FAILED) {
          s4 = undefined;
        } else {
          peg$currPos = s4;
          s4 = peg$FAILED;
        }
        if (s4 !== peg$FAILED) {
          if (input.length > peg$currPos) {
            s5 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$e12); }
          }
          if (s5 !== peg$FAILED) {
            s4 = [s4, s5];
            s3 = s4;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      if (input.substr(peg$currPos, 2) === peg$c38) {
        s3 = peg$c38;
        peg$currPos += 2;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e57); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f39();
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsemultiplicativeExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parseexponentiationExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parsemultiplicativeOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parseexponentiationExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parsemultiplicativeOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parseexponentiationExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f40(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsemultiplicativeOperator() {
    var s0;

    s0 = input.charAt(peg$currPos);
    if (peg$r4.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e58); }
    }

    return s0;
  }

  function peg$parsenamespace() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 64) {
      s1 = peg$c39;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e59); }
    }
    if (s1 === peg$FAILED) {
      s1 = null;
    }
    s2 = [];
    s3 = input.charAt(peg$currPos);
    if (peg$r5.test(s3)) {
      peg$currPos++;
    } else {
      s3 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e60); }
    }
    if (s3 !== peg$FAILED) {
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = input.charAt(peg$currPos);
        if (peg$r5.test(s3)) {
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e60); }
        }
      }
    } else {
      s2 = peg$FAILED;
    }
    if (s2 !== peg$FAILED) {
      if (input.charCodeAt(peg$currPos) === 58) {
        s3 = peg$c10;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e16); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f41(s1, s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsenewLine() {
    var s0;

    if (input.charCodeAt(peg$currPos) === 10) {
      s0 = peg$c40;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e61); }
    }
    if (s0 === peg$FAILED) {
      if (input.substr(peg$currPos, 2) === peg$c41) {
        s0 = peg$c41;
        peg$currPos += 2;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e62); }
      }
      if (s0 === peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 13) {
          s0 = peg$c42;
          peg$currPos++;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e63); }
        }
      }
    }

    return s0;
  }

  function peg$parsenumericLiteral() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$parsefloatLiteral();
    if (s0 === peg$FAILED) {
      s0 = peg$parseintegerLiteral();
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e64); }
    }

    return s0;
  }

  function peg$parsenullishCoalescingExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parselogicalAndExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      if (input.substr(peg$currPos, 2) === peg$c43) {
        s5 = peg$c43;
        peg$currPos += 2;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e65); }
      }
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parselogicalAndExpression();
        if (s7 !== peg$FAILED) {
          s3 = s7;
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        if (input.substr(peg$currPos, 2) === peg$c43) {
          s5 = peg$c43;
          peg$currPos += 2;
        } else {
          s5 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e65); }
        }
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parselogicalAndExpression();
          if (s7 !== peg$FAILED) {
            s3 = s7;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f42(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseobjectLiteral() {
    var s0, s1, s2, s3, s4, s5;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 123) {
      s1 = peg$c44;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e67); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parseobjectEntries();
      if (s3 === peg$FAILED) {
        s3 = null;
      }
      s4 = peg$parse__();
      s5 = peg$parseclosingBrace();
      if (s5 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f43(s3);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e66); }
    }

    return s0;
  }

  function peg$parseobjectEntries() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parseobjectEntry();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parseseparator();
      if (s4 !== peg$FAILED) {
        s4 = peg$parseobjectEntry();
        if (s4 === peg$FAILED) {
          peg$currPos = s3;
          s3 = peg$FAILED;
        } else {
          s3 = s4;
        }
      } else {
        s3 = s4;
      }
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseseparator();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f44(s1);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseobjectEntry() {
    var s0;

    s0 = peg$parsespread();
    if (s0 === peg$FAILED) {
      s0 = peg$parseobjectProperty();
      if (s0 === peg$FAILED) {
        s0 = peg$parseobjectGetter();
        if (s0 === peg$FAILED) {
          s0 = peg$parseobjectShorthandProperty();
        }
      }
    }

    return s0;
  }

  function peg$parseobjectGetter() {
    var s0, s1, s2, s3, s4, s5;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseobjectKey();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 61) {
        s3 = peg$c45;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e69); }
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parse__();
        s5 = peg$parsepipelineExpression();
        if (s5 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f45(s1, s5);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e68); }
    }

    return s0;
  }

  function peg$parseobjectHiddenKey() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 40) {
      s2 = peg$c2;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e5); }
    }
    if (s2 !== peg$FAILED) {
      s3 = peg$parseobjectPublicKey();
      if (s3 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 41) {
          s4 = peg$c3;
          peg$currPos++;
        } else {
          s4 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e6); }
        }
        if (s4 !== peg$FAILED) {
          s2 = [s2, s3, s4];
          s1 = s2;
        } else {
          peg$currPos = s1;
          s1 = peg$FAILED;
        }
      } else {
        peg$currPos = s1;
        s1 = peg$FAILED;
      }
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f46(s1);
    }
    s0 = s1;

    return s0;
  }

  function peg$parseobjectKey() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$parseobjectHiddenKey();
    if (s0 === peg$FAILED) {
      s0 = peg$parseobjectPublicKey();
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e70); }
    }

    return s0;
  }

  function peg$parseobjectProperty() {
    var s0, s1, s2, s3, s4, s5;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseobjectKey();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 58) {
        s3 = peg$c10;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e16); }
      }
      if (s3 !== peg$FAILED) {
        s4 = peg$parse__();
        s5 = peg$parsepipelineExpression();
        if (s5 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f47(s1, s5);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e71); }
    }

    return s0;
  }

  function peg$parseobjectShorthandProperty() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseobjectPublicKey();
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f48(s1);
    }
    s0 = s1;
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e72); }
    }

    return s0;
  }

  function peg$parseobjectPublicKey() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$parseidentifier();
    if (s1 !== peg$FAILED) {
      if (input.charCodeAt(peg$currPos) === 47) {
        s2 = peg$c46;
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e73); }
      }
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f49(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      s1 = peg$parsestringLiteral();
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$f50(s1);
      }
      s0 = s1;
    }

    return s0;
  }

  function peg$parseparenthesesArguments() {
    var s0, s1, s2, s3, s4, s5;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 40) {
      s1 = peg$c2;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e5); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parselist();
      if (s3 === peg$FAILED) {
        s3 = null;
      }
      s4 = peg$parse__();
      if (input.charCodeAt(peg$currPos) === 41) {
        s5 = peg$c3;
        peg$currPos++;
      } else {
        s5 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e6); }
      }
      if (s5 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f51(s3);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e74); }
    }

    return s0;
  }

  function peg$parsepath() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$currPos;
    s2 = [];
    s3 = peg$parsepathSegment();
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$parsepathSegment();
    }
    if (s2.length < 1) {
      peg$currPos = s1;
      s1 = peg$FAILED;
    } else {
      s1 = s2;
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f52(s1);
    }
    s0 = s1;
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e75); }
    }

    return s0;
  }

  function peg$parsepathArguments() {
    var s0, s1;

    s0 = peg$currPos;
    s1 = peg$parsepath();
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f53(s1);
    }
    s0 = s1;

    return s0;
  }

  function peg$parsepathKey() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parsepathSegmentChar();
    if (s2 !== peg$FAILED) {
      while (s2 !== peg$FAILED) {
        s1.push(s2);
        s2 = peg$parsepathSegmentChar();
      }
    } else {
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseslashFollows();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f54(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsepathSegment() {
    var s0, s1, s2;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 47) {
      s1 = peg$c46;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e73); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsepathKey();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      s0 = s2;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsepathSegmentChar() {
    var s0;

    s0 = input.charAt(peg$currPos);
    if (peg$r6.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e76); }
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parseescapedChar();
    }

    return s0;
  }

  function peg$parsepipelineExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parseshorthandFunction();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parsesingleArrow();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parseshorthandFunction();
        if (s7 !== peg$FAILED) {
          s3 = s7;
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parsesingleArrow();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parseshorthandFunction();
          if (s7 !== peg$FAILED) {
            s3 = s7;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f55(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseprimary() {
    var s0;

    s0 = peg$parseliteral();
    if (s0 === peg$FAILED) {
      s0 = peg$parsearrayLiteral();
      if (s0 === peg$FAILED) {
        s0 = peg$parseobjectLiteral();
        if (s0 === peg$FAILED) {
          s0 = peg$parsegroup();
          if (s0 === peg$FAILED) {
            s0 = peg$parsetemplateLiteral();
            if (s0 === peg$FAILED) {
              s0 = peg$parsereference();
            }
          }
        }
      }
    }

    return s0;
  }

  function peg$parseprogram() {
    var s0, s1, s2;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseshebang();
    if (s1 === peg$FAILED) {
      s1 = null;
    }
    s2 = peg$parseexpression();
    if (s2 !== peg$FAILED) {
      s0 = s2;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e77); }
    }

    return s0;
  }

  function peg$parseprotocolExpression() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = peg$parsenamespace();
    if (s1 !== peg$FAILED) {
      if (input.substr(peg$currPos, 2) === peg$c47) {
        s2 = peg$c47;
        peg$currPos += 2;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e78); }
      }
      if (s2 !== peg$FAILED) {
        s3 = peg$parsehost();
        if (s3 !== peg$FAILED) {
          s4 = peg$parsepath();
          if (s4 === peg$FAILED) {
            s4 = null;
          }
          peg$savedPos = s0;
          s0 = peg$f56(s1, s3, s4);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parseprimary();
    }

    return s0;
  }

  function peg$parsequalifiedReference() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$parsenamespace();
    if (s1 !== peg$FAILED) {
      s2 = peg$parsescopeReference();
      if (s2 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f57(s1, s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsereference() {
    var s0;

    s0 = peg$parserootDirectory();
    if (s0 === peg$FAILED) {
      s0 = peg$parsehomeDirectory();
      if (s0 === peg$FAILED) {
        s0 = peg$parsequalifiedReference();
        if (s0 === peg$FAILED) {
          s0 = peg$parsenamespace();
          if (s0 === peg$FAILED) {
            s0 = peg$parsescopeReference();
          }
        }
      }
    }

    return s0;
  }

  function peg$parserelationalExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parseshiftExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parserelationalOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parseshiftExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parserelationalOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parseshiftExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f58(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parserelationalOperator() {
    var s0;

    if (input.substr(peg$currPos, 2) === peg$c48) {
      s0 = peg$c48;
      peg$currPos += 2;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e79); }
    }
    if (s0 === peg$FAILED) {
      if (input.charCodeAt(peg$currPos) === 60) {
        s0 = peg$c49;
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e80); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 2) === peg$c50) {
          s0 = peg$c50;
          peg$currPos += 2;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e81); }
        }
        if (s0 === peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 62) {
            s0 = peg$c34;
            peg$currPos++;
          } else {
            s0 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$e49); }
          }
        }
      }
    }

    return s0;
  }

  function peg$parserootDirectory() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 47) {
      s1 = peg$c46;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e73); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsepathKey();
      if (s2 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f59(s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 47) {
        s1 = peg$c46;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e73); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$currPos;
        peg$silentFails++;
        if (input.charCodeAt(peg$currPos) === 47) {
          s3 = peg$c46;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e73); }
        }
        peg$silentFails--;
        if (s3 === peg$FAILED) {
          s2 = undefined;
        } else {
          peg$currPos = s2;
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f60();
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    }

    return s0;
  }

  function peg$parsescopeReference() {
    var s0, s1, s2;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parseidentifier();
    if (s1 !== peg$FAILED) {
      s2 = peg$parseslashFollows();
      if (s2 === peg$FAILED) {
        s2 = null;
      }
      peg$savedPos = s0;
      s0 = peg$f61(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e82); }
    }

    return s0;
  }

  function peg$parseseparator() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    s1 = peg$parse__();
    if (input.charCodeAt(peg$currPos) === 44) {
      s2 = peg$c8;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e13); }
    }
    if (s2 !== peg$FAILED) {
      s3 = peg$parse__();
      s1 = [s1, s2, s3];
      s0 = s1;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parsewhitespaceWithNewLine();
    }

    return s0;
  }

  function peg$parseslashFollows() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.charCodeAt(peg$currPos) === 47) {
      s2 = peg$c46;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e73); }
    }
    peg$silentFails--;
    if (s2 !== peg$FAILED) {
      peg$currPos = s1;
      s1 = undefined;
    } else {
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      peg$savedPos = s0;
      s1 = peg$f62();
    }
    s0 = s1;

    return s0;
  }

  function peg$parseshebang() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.substr(peg$currPos, 2) === peg$c51) {
      s1 = peg$c51;
      peg$currPos += 2;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e83); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = input.charAt(peg$currPos);
      if (peg$r7.test(s3)) {
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e84); }
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = input.charAt(peg$currPos);
        if (peg$r7.test(s3)) {
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e84); }
        }
      }
      peg$savedPos = s0;
      s0 = peg$f63();
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseshiftExpression() {
    var s0, s1, s2, s3, s4, s5, s6, s7;

    s0 = peg$currPos;
    s1 = peg$parseadditiveExpression();
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$currPos;
      s4 = peg$parse__();
      s5 = peg$parseshiftOperator();
      if (s5 !== peg$FAILED) {
        s6 = peg$parse__();
        s7 = peg$parseadditiveExpression();
        if (s7 !== peg$FAILED) {
          s3 = [ s5, s7 ];
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$currPos;
        s4 = peg$parse__();
        s5 = peg$parseshiftOperator();
        if (s5 !== peg$FAILED) {
          s6 = peg$parse__();
          s7 = peg$parseadditiveExpression();
          if (s7 !== peg$FAILED) {
            s3 = [ s5, s7 ];
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
      }
      peg$savedPos = s0;
      s0 = peg$f64(s1, s2);
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parseshiftOperator() {
    var s0;

    if (input.substr(peg$currPos, 2) === peg$c52) {
      s0 = peg$c52;
      peg$currPos += 2;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e85); }
    }
    if (s0 === peg$FAILED) {
      if (input.substr(peg$currPos, 3) === peg$c53) {
        s0 = peg$c53;
        peg$currPos += 3;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e86); }
      }
      if (s0 === peg$FAILED) {
        if (input.substr(peg$currPos, 2) === peg$c54) {
          s0 = peg$c54;
          peg$currPos += 2;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e87); }
        }
      }
    }

    return s0;
  }

  function peg$parseshorthandFunction() {
    var s0, s1, s2, s3, s4;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 61) {
      s1 = peg$c45;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e69); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$currPos;
      peg$silentFails++;
      if (input.charCodeAt(peg$currPos) === 61) {
        s3 = peg$c45;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e69); }
      }
      peg$silentFails--;
      if (s3 === peg$FAILED) {
        s2 = undefined;
      } else {
        peg$currPos = s2;
        s2 = peg$FAILED;
      }
      if (s2 !== peg$FAILED) {
        s3 = peg$parse__();
        s4 = peg$parseimplicitParenthesesCallExpression();
        if (s4 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f65(s4);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parseimplicitParenthesesCallExpression();
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e88); }
    }

    return s0;
  }

  function peg$parsesingleArrow() {
    var s0;

    if (input.charCodeAt(peg$currPos) === 8594) {
      s0 = peg$c55;
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e89); }
    }
    if (s0 === peg$FAILED) {
      if (input.substr(peg$currPos, 2) === peg$c56) {
        s0 = peg$c56;
        peg$currPos += 2;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e90); }
      }
    }

    return s0;
  }

  function peg$parsesingleLineComment() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    if (input.substr(peg$currPos, 2) === peg$c47) {
      s1 = peg$c47;
      peg$currPos += 2;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e78); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = input.charAt(peg$currPos);
      if (peg$r7.test(s3)) {
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e84); }
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = input.charAt(peg$currPos);
        if (peg$r7.test(s3)) {
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e84); }
        }
      }
      peg$savedPos = s0;
      s0 = peg$f66();
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsesingleQuoteString() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 39) {
      s1 = peg$c57;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e92); }
    }
    if (s1 !== peg$FAILED) {
      s2 = [];
      s3 = peg$parsesingleQuoteStringChar();
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        s3 = peg$parsesingleQuoteStringChar();
      }
      if (input.charCodeAt(peg$currPos) === 39) {
        s3 = peg$c57;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e92); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f67(s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e91); }
    }

    return s0;
  }

  function peg$parsesingleQuoteStringChar() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.charCodeAt(peg$currPos) === 39) {
      s2 = peg$c57;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e92); }
    }
    if (s2 === peg$FAILED) {
      s2 = peg$parsenewLine();
    }
    peg$silentFails--;
    if (s2 === peg$FAILED) {
      s1 = undefined;
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetextChar();
      if (s2 !== peg$FAILED) {
        s0 = s2;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsespread() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    s1 = peg$parseellipsis();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parseconditionalExpression();
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f68(s3);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsestringLiteral() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$parsedoubleQuoteString();
    if (s0 === peg$FAILED) {
      s0 = peg$parsesingleQuoteString();
      if (s0 === peg$FAILED) {
        s0 = peg$parseguillemetString();
      }
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e93); }
    }

    return s0;
  }

  function peg$parsetemplateDocument() {
    var s0, s1;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = peg$parsetemplateDocumentContents();
    peg$savedPos = s0;
    s1 = peg$f69(s1);
    s0 = s1;
    peg$silentFails--;
    s1 = peg$FAILED;
    if (peg$silentFails === 0) { peg$fail(peg$e94); }

    return s0;
  }

  function peg$parsetemplateDocumentChar() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.substr(peg$currPos, 2) === peg$c58) {
      s2 = peg$c58;
      peg$currPos += 2;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e95); }
    }
    peg$silentFails--;
    if (s2 === peg$FAILED) {
      s1 = undefined;
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetextChar();
      if (s2 !== peg$FAILED) {
        s0 = s2;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsetemplateDocumentContents() {
    var s0, s1, s2, s3, s4, s5;

    s0 = peg$currPos;
    s1 = peg$parsetemplateDocumentText();
    s2 = [];
    s3 = peg$currPos;
    s4 = peg$parsetemplateSubstitution();
    if (s4 !== peg$FAILED) {
      s5 = peg$parsetemplateDocumentText();
      s4 = [s4, s5];
      s3 = s4;
    } else {
      peg$currPos = s3;
      s3 = peg$FAILED;
    }
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parsetemplateSubstitution();
      if (s4 !== peg$FAILED) {
        s5 = peg$parsetemplateDocumentText();
        s4 = [s4, s5];
        s3 = s4;
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
    }
    peg$savedPos = s0;
    s0 = peg$f70(s1, s2);

    return s0;
  }

  function peg$parsetemplateDocumentText() {
    var s0, s1, s2;

    peg$silentFails++;
    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parsetemplateDocumentChar();
    while (s2 !== peg$FAILED) {
      s1.push(s2);
      s2 = peg$parsetemplateDocumentChar();
    }
    peg$savedPos = s0;
    s1 = peg$f71(s1);
    s0 = s1;
    peg$silentFails--;
    s1 = peg$FAILED;
    if (peg$silentFails === 0) { peg$fail(peg$e96); }

    return s0;
  }

  function peg$parsetemplateLiteral() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.charCodeAt(peg$currPos) === 96) {
      s1 = peg$c59;
      peg$currPos++;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e98); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetemplateLiteralContents();
      if (input.charCodeAt(peg$currPos) === 96) {
        s3 = peg$c59;
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e98); }
      }
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f72(s2);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e97); }
    }

    return s0;
  }

  function peg$parsetemplateLiteralChar() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = peg$currPos;
    peg$silentFails++;
    if (input.charCodeAt(peg$currPos) === 96) {
      s2 = peg$c59;
      peg$currPos++;
    } else {
      s2 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e98); }
    }
    if (s2 === peg$FAILED) {
      if (input.substr(peg$currPos, 2) === peg$c58) {
        s2 = peg$c58;
        peg$currPos += 2;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e95); }
      }
    }
    peg$silentFails--;
    if (s2 === peg$FAILED) {
      s1 = undefined;
    } else {
      peg$currPos = s1;
      s1 = peg$FAILED;
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parsetextChar();
      if (s2 !== peg$FAILED) {
        s0 = s2;
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  function peg$parsetemplateLiteralContents() {
    var s0, s1, s2, s3, s4, s5;

    s0 = peg$currPos;
    s1 = peg$parsetemplateLiteralText();
    s2 = [];
    s3 = peg$currPos;
    s4 = peg$parsetemplateSubstitution();
    if (s4 !== peg$FAILED) {
      s5 = peg$parsetemplateLiteralText();
      s4 = [s4, s5];
      s3 = s4;
    } else {
      peg$currPos = s3;
      s3 = peg$FAILED;
    }
    while (s3 !== peg$FAILED) {
      s2.push(s3);
      s3 = peg$currPos;
      s4 = peg$parsetemplateSubstitution();
      if (s4 !== peg$FAILED) {
        s5 = peg$parsetemplateLiteralText();
        s4 = [s4, s5];
        s3 = s4;
      } else {
        peg$currPos = s3;
        s3 = peg$FAILED;
      }
    }
    s1 = [s1, s2];
    s0 = s1;

    return s0;
  }

  function peg$parsetemplateLiteralText() {
    var s0, s1, s2;

    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parsetemplateLiteralChar();
    while (s2 !== peg$FAILED) {
      s1.push(s2);
      s2 = peg$parsetemplateLiteralChar();
    }
    peg$savedPos = s0;
    s1 = peg$f73(s1);
    s0 = s1;

    return s0;
  }

  function peg$parsetemplateSubstitution() {
    var s0, s1, s2, s3;

    peg$silentFails++;
    s0 = peg$currPos;
    if (input.substr(peg$currPos, 2) === peg$c58) {
      s1 = peg$c58;
      peg$currPos += 2;
    } else {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e95); }
    }
    if (s1 !== peg$FAILED) {
      s2 = peg$parseexpression();
      if (s2 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 125) {
          s3 = peg$c7;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$e11); }
        }
        if (s3 !== peg$FAILED) {
          peg$savedPos = s0;
          s0 = peg$f74(s2);
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    peg$silentFails--;
    if (s0 === peg$FAILED) {
      s1 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e99); }
    }

    return s0;
  }

  function peg$parsetextChar() {
    var s0;

    s0 = peg$parseescapedChar();
    if (s0 === peg$FAILED) {
      if (input.length > peg$currPos) {
        s0 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s0 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$e12); }
      }
    }

    return s0;
  }

  function peg$parseunaryExpression() {
    var s0, s1, s2, s3;

    s0 = peg$currPos;
    s1 = peg$parseunaryOperator();
    if (s1 !== peg$FAILED) {
      s2 = peg$parse__();
      s3 = peg$parseunaryExpression();
      if (s3 !== peg$FAILED) {
        peg$savedPos = s0;
        s0 = peg$f75(s1, s3);
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }
    if (s0 === peg$FAILED) {
      s0 = peg$parsecallExpression();
    }

    return s0;
  }

  function peg$parseunaryOperator() {
    var s0;

    s0 = input.charAt(peg$currPos);
    if (peg$r8.test(s0)) {
      peg$currPos++;
    } else {
      s0 = peg$FAILED;
      if (peg$silentFails === 0) { peg$fail(peg$e100); }
    }

    return s0;
  }

  function peg$parsewhitespaceWithNewLine() {
    var s0, s1, s2, s3, s4;

    s0 = peg$currPos;
    s1 = [];
    s2 = peg$parseinlineSpace();
    while (s2 !== peg$FAILED) {
      s1.push(s2);
      s2 = peg$parseinlineSpace();
    }
    s2 = peg$parsecomment();
    if (s2 === peg$FAILED) {
      s2 = null;
    }
    s3 = peg$parsenewLine();
    if (s3 !== peg$FAILED) {
      s4 = peg$parse__();
      s1 = [s1, s2, s3, s4];
      s0 = s1;
    } else {
      peg$currPos = s0;
      s0 = peg$FAILED;
    }

    return s0;
  }

  peg$result = peg$startRuleFunction();

  if (options.peg$library) {
    return /** @type {any} */ ({
      peg$result,
      peg$currPos,
      peg$FAILED,
      peg$maxFailExpected,
      peg$maxFailPos
    });
  }
  if (peg$result !== peg$FAILED && peg$currPos === input.length) {
    return peg$result;
  } else {
    if (peg$result !== peg$FAILED && peg$currPos < input.length) {
      peg$fail(peg$endExpectation());
    }

    throw peg$buildStructuredError(
      peg$maxFailExpected,
      peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
      peg$maxFailPos < input.length
        ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
        : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
    );
  }
}

const peg$allowedStartRules = [
  "__",
  "additiveExpression",
  "additiveOperator",
  "arguments",
  "arrayLiteral",
  "arrayEntries",
  "arrayEntry",
  "arrowFunction",
  "bitwiseAndExpression",
  "bitwiseAndOperator",
  "bitwiseOrExpression",
  "bitwiseOrOperator",
  "bitwiseXorExpression",
  "bitwiseXorOperator",
  "callExpression",
  "closingBrace",
  "closingBracket",
  "closingParenthesis",
  "commaExpression",
  "comment",
  "conditionalExpression",
  "digits",
  "doubleArrow",
  "doubleQuoteString",
  "doubleQuoteStringChar",
  "ellipsis",
  "equalityExpression",
  "equalityOperator",
  "escapedChar",
  "exponentiationExpression",
  "expression",
  "floatLiteral",
  "group",
  "guillemetString",
  "guillemetStringChar",
  "homeDirectory",
  "host",
  "identifier",
  "identifierChar",
  "identifierList",
  "implicitParenthesesCallExpression",
  "implicitParensthesesArguments",
  "inlineSpace",
  "integerLiteral",
  "list",
  "literal",
  "logicalAndExpression",
  "logicalOrExpression",
  "multiLineComment",
  "multiplicativeExpression",
  "multiplicativeOperator",
  "namespace",
  "newLine",
  "numericLiteral",
  "nullishCoalescingExpression",
  "objectLiteral",
  "objectEntries",
  "objectEntry",
  "objectGetter",
  "objectHiddenKey",
  "objectKey",
  "objectProperty",
  "objectShorthandProperty",
  "objectPublicKey",
  "parenthesesArguments",
  "path",
  "pathArguments",
  "pathKey",
  "pathSegment",
  "pathSegmentChar",
  "pipelineExpression",
  "primary",
  "program",
  "protocolExpression",
  "qualifiedReference",
  "reference",
  "relationalExpression",
  "relationalOperator",
  "rootDirectory",
  "scopeReference",
  "separator",
  "slashFollows",
  "shebang",
  "shiftExpression",
  "shiftOperator",
  "shorthandFunction",
  "singleArrow",
  "singleLineComment",
  "singleQuoteString",
  "singleQuoteStringChar",
  "spread",
  "stringLiteral",
  "templateDocument",
  "templateDocumentChar",
  "templateDocumentContents",
  "templateDocumentText",
  "templateLiteral",
  "templateLiteralChar",
  "templateLiteralContents",
  "templateLiteralText",
  "templateSubstitution",
  "textChar",
  "unaryExpression",
  "unaryOperator",
  "whitespaceWithNewLine"
];

export {
  peg$allowedStartRules as StartRules,
  peg$SyntaxError as SyntaxError,
  peg$parse as parse
};
