diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 863e5e3..3e18ef0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: run: | set -euo pipefail latest_version="$(jq -r '.version' package.json)" - count_expected=12 + count_expected=13 count_actual="$(grep -c "setup-pixi@v$latest_version" README.md || true)" if [ "$count_actual" -ne "$count_expected" ]; then echo "::error file=README.md::Expected $count_expected mentions of \`setup-pixi@v$latest_version\` in README.md, but found $count_actual." diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b31ca51..f3b3372 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -693,6 +693,17 @@ jobs: cache-write: false cache-key: test-cache-${{ github.sha }}-${{ github.run_attempt }}- # check the action logs to see if the cache write was skipped + + pyproject: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Move pixi files + run: mv test/pyproject-manifest/* . + - uses: ./ + - run: test -f .pixi/envs/default/bin/python + - run: pixi run test custom-pyproject-manifest-path: strategy: diff --git a/.gitignore b/.gitignore index 4ecb7a9..fafd4dc 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,6 @@ Thumbs.db # Ignore built ts files __tests__/runner/* lib/**/* + +# Ignore jetbrains files +.idea diff --git a/README.md b/README.md index 8bc2ec2..2113d9d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m ## Usage ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: pixi-version: v0.19.1 cache: true @@ -34,7 +34,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m > [!WARNING] > Since pixi is not yet stable, the API of this action may change between minor versions. -> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.5.2`) to avoid breaking changes. +> Please pin the versions of this action to a specific version (i.e., `prefix-dev/setup-pixi@v0.6.0`) to avoid breaking changes. > You can automatically update the version of this action by using [Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot). > > Put the following in your `.github/dependabot.yml` file to enable Dependabot for your GitHub Actions: @@ -73,7 +73,7 @@ In order to not exceed the [10 GB cache size limit](https://docs.github.com/en/a This can be done by setting the `cache-write` argument. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: cache: true cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} @@ -118,7 +118,7 @@ test: environment: [py311, py312] steps: - uses: actions/checkout@v4 - - uses: prefix-dev/setup-pixi@v0.5.2 + - uses: prefix-dev/setup-pixi@v0.6.0 with: environments: ${{ matrix.environment }} ``` @@ -128,7 +128,7 @@ test: The following example will install both the `py311` and the `py312` environment on the runner. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: # separated by spaces environments: >- @@ -163,7 +163,7 @@ Specify the token using the `auth-token` input argument. This form of authentication (bearer token in the request headers) is mainly used at [prefix.dev](https://prefix.dev). ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} @@ -175,7 +175,7 @@ Specify the username and password using the `auth-username` and `auth-password` This form of authentication (HTTP Basic Auth) is used in some enterprise environments with [artifactory](https://jfrog.com/artifactory) for example. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: auth-host: custom-artifactory.com auth-username: ${{ secrets.PIXI_USERNAME }} @@ -188,7 +188,7 @@ Specify the conda-token using the `conda-token` input argument. This form of authentication (token is encoded in URL: `https://my-quetz-instance.com/t//get/custom-channel`) is used at [anaconda.org](https://anaconda.org) or with [quetz instances](https://github.com/mamba-org/quetz). ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: auth-host: anaconda.org # or my-quetz-instance.com conda-token: ${{ secrets.CONDA_TOKEN }} @@ -234,7 +234,7 @@ You can specify whether `setup-pixi` should run `pixi install --frozen` or `pixi See the [official documentation](https://prefix.dev/docs/pixi/cli#install) for more information about the `--frozen` and `--locked` flags. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: locked: true # or @@ -253,7 +253,7 @@ The first one is the debug logging of the action itself. This can be enabled by running the action with the `RUNNER_DEBUG` environment variable set to `true`. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 env: RUNNER_DEBUG: true ``` @@ -271,7 +271,7 @@ The second type is the debug logging of the pixi executable. This can be specified by setting the `log-level` input. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: # one of `q`, `default`, `v`, `vv`, or `vvv`. log-level: vvv @@ -297,7 +297,7 @@ If nothing is specified, `post-cleanup` will default to `true`. On self-hosted runners, you also might want to alter the default pixi install location to a temporary location. You can use `pixi-bin-path: ${{ runner.temp }}/bin/pixi` to do this. ```yml -- uses: prefix-dev/setup-pixi@v0.5.2 +- uses: prefix-dev/setup-pixi@v0.6.0 with: post-cleanup: true # ${{ runner.temp }}\Scripts\pixi.exe on Windows @@ -307,6 +307,17 @@ On self-hosted runners, you also might want to alter the default pixi install lo You can also use a preinstalled local version of pixi on the runner by not setting any of the `pixi-version`, `pixi-url` or `pixi-bin-path` inputs. This action will then try to find a local version of pixi in the runner's PATH. +### Using the `pyproject.toml` as a manifest file for pixi. + +`setup-pixi` will automatically pick up the `pyproject.toml` if it contains a `[tool.pixi.project]` section and no `pixi.toml`. +This can be overwritten by setting the `manifest-path` input argument. + +```yml +- uses: prefix-dev/setup-pixi@v0.6.0 + with: + manifest-path: pyproject.toml +``` + ## More examples If you want to see more examples, you can take a look at the [GitHub Workflows of this repository](.github/workflows/test.yml). @@ -314,6 +325,6 @@ If you want to see more examples, you can take a look at the [GitHub Workflows o ## Local Development 1. Clone this repository. -1. Run `pnpm install` inside the repository (if you don't have [`pnpm`](https://github.com/pnpm/pnpm) installed, you can install it with `npm install -g pnpm` or `brew install pnpm`). -1. Run `pnpm dev` for live transpilation of the TypeScript source code. -1. To test the action, you can run [`act`](https://github.com/nektos/act) (inside docker) or use :sparkles: CI driven development :sparkles:. +2. Run `pnpm install` inside the repository (if you don't have [`pnpm`](https://github.com/pnpm/pnpm) installed, you can install it with `pixi global install pnpm`). +3. Run `pnpm dev` for live transpilation of the TypeScript source code. +4. To test the action, you can run [`act`](https://github.com/nektos/act) (inside docker) or use :sparkles: CI driven development :sparkles:. diff --git a/dist/index.js b/dist/index.js index 259b0be..efffe35 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2196,10 +2196,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } exports2.error = error2; - function warning2(message, properties = {}) { + function warning3(message, properties = {}) { command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning2; + exports2.warning = warning3; function notice(message, properties = {}) { command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } @@ -2837,8 +2837,8 @@ var require_semver = __commonJS({ } } var i; - exports2.parse = parse3; - function parse3(version3, options2) { + exports2.parse = parse4; + function parse4(version3, options2) { if (!options2 || typeof options2 !== "object") { options2 = { loose: !!options2, @@ -2866,12 +2866,12 @@ var require_semver = __commonJS({ } exports2.valid = valid; function valid(version3, options2) { - var v = parse3(version3, options2); + var v = parse4(version3, options2); return v ? v.version : null; } exports2.clean = clean; function clean(version3, options2) { - var s = parse3(version3.trim().replace(/^[=v]+/, ""), options2); + var s = parse4(version3.trim().replace(/^[=v]+/, ""), options2); return s ? s.version : null; } exports2.SemVer = SemVer; @@ -3103,8 +3103,8 @@ var require_semver = __commonJS({ if (eq(version1, version22)) { return null; } else { - var v12 = parse3(version1); - var v2 = parse3(version22); + var v12 = parse4(version1); + var v2 = parse4(version22); var prefix2 = ""; if (v12.prerelease.length || v2.prerelease.length) { prefix2 = "pre"; @@ -3808,7 +3808,7 @@ var require_semver = __commonJS({ } exports2.prerelease = prerelease; function prerelease(version3, options2) { - var parsed = parse3(version3, options2); + var parsed = parse4(version3, options2); return parsed && parsed.prerelease.length ? parsed.prerelease : null; } exports2.intersects = intersects; @@ -3845,7 +3845,7 @@ var require_semver = __commonJS({ if (match === null) { return null; } - return parse3(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options2); + return parse4(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options2); } } }); @@ -5323,6 +5323,3753 @@ var require_tool_cache = __commonJS({ } }); +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js +var require_parser = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js"(exports2, module2) { + "use strict"; + module2.exports = function() { + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + this.name = "SyntaxError"; + } + peg$subclass(SyntaxError, Error); + function parse4(input) { + var options2 = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = [], peg$c1 = function() { + return nodes; + }, peg$c2 = peg$FAILED, peg$c3 = "#", peg$c4 = { type: "literal", value: "#", description: '"#"' }, peg$c5 = void 0, peg$c6 = { type: "any", description: "any character" }, peg$c7 = "[", peg$c8 = { type: "literal", value: "[", description: '"["' }, peg$c9 = "]", peg$c10 = { type: "literal", value: "]", description: '"]"' }, peg$c11 = function(name) { + addNode(node("ObjectPath", name, line, column)); + }, peg$c12 = function(name) { + addNode(node("ArrayPath", name, line, column)); + }, peg$c13 = function(parts, name) { + return parts.concat(name); + }, peg$c14 = function(name) { + return [name]; + }, peg$c15 = function(name) { + return name; + }, peg$c16 = ".", peg$c17 = { type: "literal", value: ".", description: '"."' }, peg$c18 = "=", peg$c19 = { type: "literal", value: "=", description: '"="' }, peg$c20 = function(key, value) { + addNode(node("Assign", value, line, column, key)); + }, peg$c21 = function(chars) { + return chars.join(""); + }, peg$c22 = function(node2) { + return node2.value; + }, peg$c23 = '"""', peg$c24 = { type: "literal", value: '"""', description: '"\\"\\"\\""' }, peg$c25 = null, peg$c26 = function(chars) { + return node("String", chars.join(""), line, column); + }, peg$c27 = '"', peg$c28 = { type: "literal", value: '"', description: '"\\""' }, peg$c29 = "'''", peg$c30 = { type: "literal", value: "'''", description: `"'''"` }, peg$c31 = "'", peg$c32 = { type: "literal", value: "'", description: `"'"` }, peg$c33 = function(char) { + return char; + }, peg$c34 = function(char) { + return char; + }, peg$c35 = "\\", peg$c36 = { type: "literal", value: "\\", description: '"\\\\"' }, peg$c37 = function() { + return ""; + }, peg$c38 = "e", peg$c39 = { type: "literal", value: "e", description: '"e"' }, peg$c40 = "E", peg$c41 = { type: "literal", value: "E", description: '"E"' }, peg$c42 = function(left, right) { + return node("Float", parseFloat(left + "e" + right), line, column); + }, peg$c43 = function(text2) { + return node("Float", parseFloat(text2), line, column); + }, peg$c44 = "+", peg$c45 = { type: "literal", value: "+", description: '"+"' }, peg$c46 = function(digits) { + return digits.join(""); + }, peg$c47 = "-", peg$c48 = { type: "literal", value: "-", description: '"-"' }, peg$c49 = function(digits) { + return "-" + digits.join(""); + }, peg$c50 = function(text2) { + return node("Integer", parseInt(text2, 10), line, column); + }, peg$c51 = "true", peg$c52 = { type: "literal", value: "true", description: '"true"' }, peg$c53 = function() { + return node("Boolean", true, line, column); + }, peg$c54 = "false", peg$c55 = { type: "literal", value: "false", description: '"false"' }, peg$c56 = function() { + return node("Boolean", false, line, column); + }, peg$c57 = function() { + return node("Array", [], line, column); + }, peg$c58 = function(value) { + return node("Array", value ? [value] : [], line, column); + }, peg$c59 = function(values) { + return node("Array", values, line, column); + }, peg$c60 = function(values, value) { + return node("Array", values.concat(value), line, column); + }, peg$c61 = function(value) { + return value; + }, peg$c62 = ",", peg$c63 = { type: "literal", value: ",", description: '","' }, peg$c64 = "{", peg$c65 = { type: "literal", value: "{", description: '"{"' }, peg$c66 = "}", peg$c67 = { type: "literal", value: "}", description: '"}"' }, peg$c68 = function(values) { + return node("InlineTable", values, line, column); + }, peg$c69 = function(key, value) { + return node("InlineTableValue", value, line, column, key); + }, peg$c70 = function(digits) { + return "." + digits; + }, peg$c71 = function(date) { + return date.join(""); + }, peg$c72 = ":", peg$c73 = { type: "literal", value: ":", description: '":"' }, peg$c74 = function(time) { + return time.join(""); + }, peg$c75 = "T", peg$c76 = { type: "literal", value: "T", description: '"T"' }, peg$c77 = "Z", peg$c78 = { type: "literal", value: "Z", description: '"Z"' }, peg$c79 = function(date, time) { + return node("Date", /* @__PURE__ */ new Date(date + "T" + time + "Z"), line, column); + }, peg$c80 = function(date, time) { + return node("Date", /* @__PURE__ */ new Date(date + "T" + time), line, column); + }, peg$c81 = /^[ \t]/, peg$c82 = { type: "class", value: "[ \\t]", description: "[ \\t]" }, peg$c83 = "\n", peg$c84 = { type: "literal", value: "\n", description: '"\\n"' }, peg$c85 = "\r", peg$c86 = { type: "literal", value: "\r", description: '"\\r"' }, peg$c87 = /^[0-9a-f]/i, peg$c88 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, peg$c89 = /^[0-9]/, peg$c90 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c91 = "_", peg$c92 = { type: "literal", value: "_", description: '"_"' }, peg$c93 = function() { + return ""; + }, peg$c94 = /^[A-Za-z0-9_\-]/, peg$c95 = { type: "class", value: "[A-Za-z0-9_\\-]", description: "[A-Za-z0-9_\\-]" }, peg$c96 = function(d) { + return d.join(""); + }, peg$c97 = '\\"', peg$c98 = { type: "literal", value: '\\"', description: '"\\\\\\""' }, peg$c99 = function() { + return '"'; + }, peg$c100 = "\\\\", peg$c101 = { type: "literal", value: "\\\\", description: '"\\\\\\\\"' }, peg$c102 = function() { + return "\\"; + }, peg$c103 = "\\b", peg$c104 = { type: "literal", value: "\\b", description: '"\\\\b"' }, peg$c105 = function() { + return "\b"; + }, peg$c106 = "\\t", peg$c107 = { type: "literal", value: "\\t", description: '"\\\\t"' }, peg$c108 = function() { + return " "; + }, peg$c109 = "\\n", peg$c110 = { type: "literal", value: "\\n", description: '"\\\\n"' }, peg$c111 = function() { + return "\n"; + }, peg$c112 = "\\f", peg$c113 = { type: "literal", value: "\\f", description: '"\\\\f"' }, peg$c114 = function() { + return "\f"; + }, peg$c115 = "\\r", peg$c116 = { type: "literal", value: "\\r", description: '"\\\\r"' }, peg$c117 = function() { + return "\r"; + }, peg$c118 = "\\U", peg$c119 = { type: "literal", value: "\\U", description: '"\\\\U"' }, peg$c120 = function(digits) { + return convertCodePoint(digits.join("")); + }, peg$c121 = "\\u", peg$c122 = { type: "literal", value: "\\u", description: '"\\\\u"' }, peg$currPos = 0, peg$reportedPos = 0, peg$cachedPos = 0, peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$cache = {}, peg$result; + if ("startRule" in options2) { + if (!(options2.startRule in peg$startRuleFunctions)) { + throw new Error(`Can't start parsing from rule "` + options2.startRule + '".'); + } + peg$startRuleFunction = peg$startRuleFunctions[options2.startRule]; + } + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + function offset() { + return peg$reportedPos; + } + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description }], + peg$reportedPos + ); + } + function error2(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { + details.line++; + } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + return peg$cachedPosDetails; + } + function peg$fail(expected2) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected2); + } + function peg$buildException(message, expected2, pos) { + function cleanupExpected(expected3) { + var i = 1; + expected3.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + while (i < expected3.length) { + if (expected3[i - 1] === expected3[i]) { + expected3.splice(i, 1); + } else { + i++; + } + } + } + function buildMessage(expected3, found2) { + function stringEscape(s) { + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { + return "\\x" + hex(ch); + }).replace(/[\u0180-\u0FFF]/g, function(ch) { + return "\\u0" + hex(ch); + }).replace(/[\u1080-\uFFFF]/g, function(ch) { + return "\\u" + hex(ch); + }); + } + var expectedDescs = new Array(expected3.length), expectedDesc, foundDesc, i; + for (i = 0; i < expected3.length; i++) { + expectedDescs[i] = expected3[i].description; + } + expectedDesc = expected3.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected3.length - 1] : expectedDescs[0]; + foundDesc = found2 ? '"' + stringEscape(found2) + '"' : "end of input"; + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; + if (expected2 !== null) { + cleanupExpected(expected2); + } + return new SyntaxError( + message !== null ? message : buildMessage(expected2, found), + expected2, + found, + pos, + posDetails.line, + posDetails.column + ); + } + function peg$parsestart() { + var s0, s1, s2; + var key = peg$currPos * 49 + 0, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseline(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseline(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseline() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 1, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parseexpression(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsecomment(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsecomment(); + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseNL(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseNL(); + } + } else { + s5 = peg$c2; + } + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + if (s5 !== peg$FAILED) { + s1 = [s1, s2, s3, s4, s5]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseNL(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseNL(); + } + } else { + s2 = peg$c2; + } + if (s2 === peg$FAILED) { + s2 = peg$parseEOF(); + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$parseNL(); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseexpression() { + var s0; + var key = peg$currPos * 49 + 2, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsecomment(); + if (s0 === peg$FAILED) { + s0 = peg$parsepath(); + if (s0 === peg$FAILED) { + s0 = peg$parsetablearray(); + if (s0 === peg$FAILED) { + s0 = peg$parseassignment(); + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsecomment() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 3, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c4); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$currPos; + peg$silentFails++; + s5 = peg$parseNL(); + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + peg$silentFails--; + if (s5 === peg$FAILED) { + s4 = peg$c5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + 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$c6); + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$currPos; + peg$silentFails++; + s5 = peg$parseNL(); + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + peg$silentFails--; + if (s5 === peg$FAILED) { + s4 = peg$c5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + 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$c6); + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 4, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetable_key(); + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c9; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c11(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetablearray() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 49 + 5, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + s4 = peg$parsetable_key(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c9; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s7 = peg$c9; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c12(s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetable_key() { + var s0, s1, s2; + var key = peg$currPos * 49 + 6, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsedot_ended_table_key_part(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsedot_ended_table_key_part(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s2 = peg$parsetable_key_part(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsetable_key_part(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c14(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetable_key_part() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 7, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsequoted_key(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedot_ended_table_key_part() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 8, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsequoted_key(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseassignment() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 9, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c18; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + s5 = peg$parsevalue(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c20(s1, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsequoted_key(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c18; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + s5 = peg$parsevalue(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c20(s1, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsekey() { + var s0, s1, s2; + var key = peg$currPos * 49 + 10, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseASCII_BASIC(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseASCII_BASIC(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c21(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsequoted_key() { + var s0, s1; + var key = peg$currPos * 49 + 11, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsedouble_quoted_single_line_string(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c22(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsesingle_quoted_single_line_string(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c22(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsevalue() { + var s0; + var key = peg$currPos * 49 + 12, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsestring(); + if (s0 === peg$FAILED) { + s0 = peg$parsedatetime(); + if (s0 === peg$FAILED) { + s0 = peg$parsefloat(); + if (s0 === peg$FAILED) { + s0 = peg$parseinteger(); + if (s0 === peg$FAILED) { + s0 = peg$parseboolean(); + if (s0 === peg$FAILED) { + s0 = peg$parsearray(); + if (s0 === peg$FAILED) { + s0 = peg$parseinline_table(); + } + } + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsestring() { + var s0; + var key = peg$currPos * 49 + 13, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsedouble_quoted_multiline_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsedouble_quoted_single_line_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsesingle_quoted_multiline_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsesingle_quoted_single_line_string(); + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedouble_quoted_multiline_string() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 14, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c23) { + s1 = peg$c23; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsemultiline_string_char(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsemultiline_string_char(); + } + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 3) === peg$c23) { + s4 = peg$c23; + peg$currPos += 3; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedouble_quoted_single_line_string() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 15, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c27; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsestring_char(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsestring_char(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c27; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesingle_quoted_multiline_string() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 16, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c29) { + s1 = peg$c29; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsemultiline_literal_char(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsemultiline_literal_char(); + } + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 3) === peg$c29) { + s4 = peg$c29; + peg$currPos += 3; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesingle_quoted_single_line_string() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 17, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseliteral_char(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseliteral_char(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c31; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsestring_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 18, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseESCAPED(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c27; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseliteral_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 19, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c31; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_string_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 20, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseESCAPED(); + if (s0 === peg$FAILED) { + s0 = peg$parsemultiline_string_delim(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c23) { + s2 = peg$c23; + peg$currPos += 3; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c34(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_string_delim() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 21, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c35; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c36); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseNLS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseNLS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c37(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_literal_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 22, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c29) { + s2 = peg$c29; + peg$currPos += 3; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsefloat() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 23, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsefloat_text(); + if (s1 === peg$FAILED) { + s1 = peg$parseinteger_text(); + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 101) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c39); + } + } + if (s2 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 69) { + s2 = peg$c40; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c41); + } + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parseinteger_text(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsefloat_text(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsefloat_text() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 24, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 43) { + s1 = peg$c44; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + if (s1 === peg$FAILED) { + s1 = peg$c25; + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseDIGITS(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGITS(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s1 = peg$c47; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseDIGITS(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGITS(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c49(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinteger() { + var s0, s1; + var key = peg$currPos * 49 + 25, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseinteger_text(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinteger_text() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 26, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 43) { + s1 = peg$c44; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + if (s1 === peg$FAILED) { + s1 = peg$c25; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = peg$c5; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s1 = peg$c47; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = peg$c5; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c49(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseboolean() { + var s0, s1; + var key = peg$currPos * 49 + 27, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 4) === peg$c51) { + s1 = peg$c51; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c52); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c53(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c54) { + s1 = peg$c54; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c55); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c56(); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 28, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_sep(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_sep(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c57(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsearray_value(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_value_list(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_value_list(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_value_list(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_value_list(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$parsearray_value(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s4 = peg$c9; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c60(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_value() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 29, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsearray_sep(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsearray_sep(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsevalue(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsearray_sep(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsearray_sep(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_value_list() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 30, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsearray_sep(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsearray_sep(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsevalue(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsearray_sep(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsearray_sep(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c62; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c63); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parsearray_sep(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsearray_sep(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_sep() { + var s0; + var key = peg$currPos * 49 + 31, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseS(); + if (s0 === peg$FAILED) { + s0 = peg$parseNL(); + if (s0 === peg$FAILED) { + s0 = peg$parsecomment(); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinline_table() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 32, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c64; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c65); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseinline_table_assignment(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseinline_table_assignment(); + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c66; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c67); + } + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c68(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinline_table_assignment() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 33, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c18; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parsevalue(); + if (s6 !== peg$FAILED) { + s7 = []; + s8 = peg$parseS(); + while (s8 !== peg$FAILED) { + s7.push(s8); + s8 = peg$parseS(); + } + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s8 = peg$c62; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c63); + } + } + if (s8 !== peg$FAILED) { + s9 = []; + s10 = peg$parseS(); + while (s10 !== peg$FAILED) { + s9.push(s10); + s10 = peg$parseS(); + } + if (s9 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c69(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c18; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parsevalue(); + if (s6 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c69(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesecfragment() { + var s0, s1, s2; + var key = peg$currPos * 49 + 34, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c16; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseDIGITS(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c70(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedate() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; + var key = peg$currPos * 49 + 35, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + s4 = peg$parseDIGIT_OR_UNDER(); + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s6 = peg$c47; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s6 !== peg$FAILED) { + s7 = peg$parseDIGIT_OR_UNDER(); + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s9 = peg$c47; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s9 !== peg$FAILED) { + s10 = peg$parseDIGIT_OR_UNDER(); + if (s10 !== peg$FAILED) { + s11 = peg$parseDIGIT_OR_UNDER(); + if (s11 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetime() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 36, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c72; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + s6 = peg$parseDIGIT_OR_UNDER(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s7 = peg$c72; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + s9 = peg$parseDIGIT_OR_UNDER(); + if (s9 !== peg$FAILED) { + s10 = peg$parsesecfragment(); + if (s10 === peg$FAILED) { + s10 = peg$c25; + } + if (s10 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetime_with_offset() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16; + var key = peg$currPos * 49 + 37, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c72; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + s6 = peg$parseDIGIT_OR_UNDER(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s7 = peg$c72; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + s9 = peg$parseDIGIT_OR_UNDER(); + if (s9 !== peg$FAILED) { + s10 = peg$parsesecfragment(); + if (s10 === peg$FAILED) { + s10 = peg$c25; + } + if (s10 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s11 = peg$c47; + peg$currPos++; + } else { + s11 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s11 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s11 = peg$c44; + peg$currPos++; + } else { + s11 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + } + if (s11 !== peg$FAILED) { + s12 = peg$parseDIGIT_OR_UNDER(); + if (s12 !== peg$FAILED) { + s13 = peg$parseDIGIT_OR_UNDER(); + if (s13 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s14 = peg$c72; + peg$currPos++; + } else { + s14 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s14 !== peg$FAILED) { + s15 = peg$parseDIGIT_OR_UNDER(); + if (s15 !== peg$FAILED) { + s16 = peg$parseDIGIT_OR_UNDER(); + if (s16 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedatetime() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 38, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsedate(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 84) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c76); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetime(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 90) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c78); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c79(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsedate(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 84) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c76); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetime_with_offset(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c80(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseS() { + var s0; + var key = peg$currPos * 49 + 39, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c81.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c82); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseNL() { + var s0, s1, s2; + var key = peg$currPos * 49 + 40, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c83; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c84); + } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c85; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c86); + } + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c84); + } + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseNLS() { + var s0; + var key = peg$currPos * 49 + 41, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseNL(); + if (s0 === peg$FAILED) { + s0 = peg$parseS(); + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseEOF() { + var s0, s1; + var key = peg$currPos * 49 + 42, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + peg$silentFails++; + if (input.length > peg$currPos) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c6); + } + } + peg$silentFails--; + if (s1 === peg$FAILED) { + s0 = peg$c5; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseHEX() { + var s0; + var key = peg$currPos * 49 + 43, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c87.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c88); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseDIGIT_OR_UNDER() { + var s0, s1; + var key = peg$currPos * 49 + 44, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c89.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c90); + } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 95) { + s1 = peg$c91; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c92); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c93(); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseASCII_BASIC() { + var s0; + var key = peg$currPos * 49 + 45, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c94.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c95); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseDIGITS() { + var s0, s1, s2; + var key = peg$currPos * 49 + 46, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c96(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseESCAPED() { + var s0, s1; + var key = peg$currPos * 49 + 47, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c97) { + s1 = peg$c97; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c98); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c99(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c100) { + s1 = peg$c100; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c101); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c102(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c103) { + s1 = peg$c103; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c104); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c105(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c106) { + s1 = peg$c106; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c107); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c108(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c109) { + s1 = peg$c109; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c110); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c111(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c112) { + s1 = peg$c112; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c113); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c114(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c116); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c117(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$parseESCAPED_UNICODE(); + } + } + } + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseESCAPED_UNICODE() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 48, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c118) { + s1 = peg$c118; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c119); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseHEX(); + if (s3 !== peg$FAILED) { + s4 = peg$parseHEX(); + if (s4 !== peg$FAILED) { + s5 = peg$parseHEX(); + if (s5 !== peg$FAILED) { + s6 = peg$parseHEX(); + if (s6 !== peg$FAILED) { + s7 = peg$parseHEX(); + if (s7 !== peg$FAILED) { + s8 = peg$parseHEX(); + if (s8 !== peg$FAILED) { + s9 = peg$parseHEX(); + if (s9 !== peg$FAILED) { + s10 = peg$parseHEX(); + if (s10 !== peg$FAILED) { + s3 = [s3, s4, s5, s6, s7, s8, s9, s10]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c120(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c121) { + s1 = peg$c121; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c122); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseHEX(); + if (s3 !== peg$FAILED) { + s4 = peg$parseHEX(); + if (s4 !== peg$FAILED) { + s5 = peg$parseHEX(); + if (s5 !== peg$FAILED) { + s6 = peg$parseHEX(); + if (s6 !== peg$FAILED) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c120(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + var nodes = []; + function genError(err, line2, col) { + var ex = new Error(err); + ex.line = line2; + ex.column = col; + throw ex; + } + function addNode(node2) { + nodes.push(node2); + } + function node(type3, value, line2, column2, key) { + var obj = { type: type3, value, line: line2(), column: column2() }; + if (key) + obj.key = key; + return obj; + } + function convertCodePoint(str, line2, col) { + var num = parseInt("0x" + str); + if (!isFinite(num) || Math.floor(num) != num || num < 0 || num > 1114111 || num > 55295 && num < 57344) { + genError("Invalid Unicode escape code: " + str, line2, col); + } else { + return fromCodePoint(num); + } + } + function fromCodePoint() { + var MAX_SIZE = 16384; + var codeUnits = []; + var highSurrogate; + var lowSurrogate; + var index = -1; + var length = arguments.length; + if (!length) { + return ""; + } + var result = ""; + while (++index < length) { + var codePoint = Number(arguments[index]); + if (codePoint <= 65535) { + codeUnits.push(codePoint); + } else { + codePoint -= 65536; + highSurrogate = (codePoint >> 10) + 55296; + lowSurrogate = codePoint % 1024 + 56320; + codeUnits.push(highSurrogate, lowSurrogate); + } + if (index + 1 == length || codeUnits.length > MAX_SIZE) { + result += String.fromCharCode.apply(null, codeUnits); + codeUnits.length = 0; + } + } + return result; + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } + return { + SyntaxError, + parse: parse4 + }; + }(); + } +}); + +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js +var require_compiler = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js"(exports2, module2) { + "use strict"; + function compile(nodes) { + var assignedPaths = []; + var valueAssignments = []; + var currentPath = ""; + var data = /* @__PURE__ */ Object.create(null); + var context3 = data; + var arrayMode = false; + return reduce(nodes); + function reduce(nodes2) { + var node; + for (var i = 0; i < nodes2.length; i++) { + node = nodes2[i]; + switch (node.type) { + case "Assign": + assign(node); + break; + case "ObjectPath": + setPath(node); + break; + case "ArrayPath": + addTableArray(node); + break; + } + } + return data; + } + function genError(err, line, col) { + var ex = new Error(err); + ex.line = line; + ex.column = col; + throw ex; + } + function assign(node) { + var key = node.key; + var value = node.value; + var line = node.line; + var column = node.column; + var fullPath; + if (currentPath) { + fullPath = currentPath + "." + key; + } else { + fullPath = key; + } + if (typeof context3[key] !== "undefined") { + genError("Cannot redefine existing key '" + fullPath + "'.", line, column); + } + context3[key] = reduceValueNode(value); + if (!pathAssigned(fullPath)) { + assignedPaths.push(fullPath); + valueAssignments.push(fullPath); + } + } + function pathAssigned(path4) { + return assignedPaths.indexOf(path4) !== -1; + } + function reduceValueNode(node) { + if (node.type === "Array") { + return reduceArrayWithTypeChecking(node.value); + } else if (node.type === "InlineTable") { + return reduceInlineTableNode(node.value); + } else { + return node.value; + } + } + function reduceInlineTableNode(values) { + var obj = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < values.length; i++) { + var val = values[i]; + if (val.value.type === "InlineTable") { + obj[val.key] = reduceInlineTableNode(val.value.value); + } else if (val.type === "InlineTableValue") { + obj[val.key] = reduceValueNode(val.value); + } + } + return obj; + } + function setPath(node) { + var path4 = node.value; + var quotedPath = path4.map(quoteDottedString).join("."); + var line = node.line; + var column = node.column; + if (pathAssigned(quotedPath)) { + genError("Cannot redefine existing key '" + path4 + "'.", line, column); + } + assignedPaths.push(quotedPath); + context3 = deepRef(data, path4, /* @__PURE__ */ Object.create(null), line, column); + currentPath = path4; + } + function addTableArray(node) { + var path4 = node.value; + var quotedPath = path4.map(quoteDottedString).join("."); + var line = node.line; + var column = node.column; + if (!pathAssigned(quotedPath)) { + assignedPaths.push(quotedPath); + } + assignedPaths = assignedPaths.filter(function(p) { + return p.indexOf(quotedPath) !== 0; + }); + assignedPaths.push(quotedPath); + context3 = deepRef(data, path4, [], line, column); + currentPath = quotedPath; + if (context3 instanceof Array) { + var newObj = /* @__PURE__ */ Object.create(null); + context3.push(newObj); + context3 = newObj; + } else { + genError("Cannot redefine existing key '" + path4 + "'.", line, column); + } + } + function deepRef(start, keys, value, line, column) { + var traversed = []; + var traversedPath = ""; + var path4 = keys.join("."); + var ctx = start; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + traversed.push(key); + traversedPath = traversed.join("."); + if (typeof ctx[key] === "undefined") { + if (i === keys.length - 1) { + ctx[key] = value; + } else { + ctx[key] = /* @__PURE__ */ Object.create(null); + } + } else if (i !== keys.length - 1 && valueAssignments.indexOf(traversedPath) > -1) { + genError("Cannot redefine existing key '" + traversedPath + "'.", line, column); + } + ctx = ctx[key]; + if (ctx instanceof Array && ctx.length && i < keys.length - 1) { + ctx = ctx[ctx.length - 1]; + } + } + return ctx; + } + function reduceArrayWithTypeChecking(array) { + var firstType = null; + for (var i = 0; i < array.length; i++) { + var node = array[i]; + if (firstType === null) { + firstType = node.type; + } else { + if (node.type !== firstType) { + genError("Cannot add value of type " + node.type + " to array of type " + firstType + ".", node.line, node.column); + } + } + } + return array.map(reduceValueNode); + } + function quoteDottedString(str) { + if (str.indexOf(".") > -1) { + return '"' + str + '"'; + } else { + return str; + } + } + } + module2.exports = { + compile + }; + } +}); + +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js +var require_toml = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js"(exports2, module2) { + "use strict"; + var parser = require_parser(); + var compiler = require_compiler(); + module2.exports = { + parse: function(input) { + var nodes = parser.parse(input.toString()); + return compiler.compile(nodes); + } + }; + } +}); + // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js var require_posix = __commonJS({ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js"(exports2) { @@ -6304,9 +10051,9 @@ var require_minimatch = __commonJS({ throw new TypeError("pattern is too long"); } }; - Minimatch.prototype.parse = parse3; + Minimatch.prototype.parse = parse4; var SUBPARSE = {}; - function parse3(pattern, isSub) { + function parse4(pattern, isSub) { assertValidPattern(pattern); var options2 = this.options; if (pattern === "**") { @@ -45914,7 +49661,7 @@ var require_processors = __commonJS({ }); // node_modules/.pnpm/xml2js@0.5.0/node_modules/xml2js/lib/parser.js -var require_parser = __commonJS({ +var require_parser2 = __commonJS({ "node_modules/.pnpm/xml2js@0.5.0/node_modules/xml2js/lib/parser.js"(exports2) { "use strict"; (function() { @@ -46322,7 +50069,7 @@ var require_xml2js = __commonJS({ }, hasProp = {}.hasOwnProperty; defaults = require_defaults(); builder = require_builder(); - parser = require_parser(); + parser = require_parser2(); processors = require_processors(); exports2.defaults = defaults.defaults; exports2.processors = processors; @@ -46465,7 +50212,7 @@ function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, op includeRoot: (_b2 = options2.includeRoot) !== null && _b2 !== void 0 ? _b2 : false, xmlCharKey: (_c2 = options2.xmlCharKey) !== null && _c2 !== void 0 ? _c2 : XML_CHARKEY }; - return parse2(jsonContentTypes, xmlContentTypes, response, updatedOptions).then((parsedResponse) => { + return parse3(jsonContentTypes, xmlContentTypes, response, updatedOptions).then((parsedResponse) => { if (!shouldDeserializeResponse(parsedResponse)) { return parsedResponse; } @@ -46556,7 +50303,7 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { } return { error: error2, shouldReturnResponse: false }; } -function parse2(jsonContentTypes, xmlContentTypes, operationResponse, opts) { +function parse3(jsonContentTypes, xmlContentTypes, operationResponse, opts) { var _a2; const errorHandler = (err) => { const msg = `Error "${err}" occurred while parsing the response body - ${operationResponse.bodyAsText}.`; @@ -78743,6 +82490,7 @@ function untildify(pathWithTilde) { } // src/options.ts +var import_toml = __toESM(require_toml()); var import_which = __toESM(require_lib2()); var logLevelSchema = enumType(["q", "default", "v", "vv", "vvv"]); var PATHS = { @@ -78840,7 +82588,25 @@ var inferOptions = (inputs) => { inputs.pixiBinPath ); const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default"); - const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml"; + let manifestPath = "pixi.toml"; + if (inputs.manifestPath) { + manifestPath = import_path.default.resolve(untildify(inputs.manifestPath)); + } else { + if ((0, import_fs.existsSync)("pixi.toml")) { + manifestPath = "pixi.toml"; + } else if ((0, import_fs.existsSync)("pyproject.toml")) { + const fileContent = (0, import_fs.readFileSync)("pyproject.toml", "utf-8"); + const parsedContent = (0, import_toml.parse)(fileContent); + if (parsedContent.tool && parsedContent.tool.pixi) { + core.debug("The tool.pixi table found so using pyproject.toml as manifest file."); + manifestPath = "pyproject.toml"; + } + } else { + if (runInstall) { + core.warning("Could not find any manifest file. Defaulting to pixi.toml."); + } + } + } const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), "pixi.lock"); const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile); core.debug(`lockFileAvailable: ${lockFileAvailable}`); diff --git a/dist/post.js b/dist/post.js index fa92fb8..2e02ad9 100644 --- a/dist/post.js +++ b/dist/post.js @@ -2169,10 +2169,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); command_1.issueCommand("error", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } exports2.error = error; - function warning(message, properties = {}) { + function warning2(message, properties = {}) { command_1.issueCommand("warning", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning; + exports2.warning = warning2; function notice(message, properties = {}) { command_1.issueCommand("notice", utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message); } @@ -2241,6 +2241,3753 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } }); +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js +var require_parser = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/parser.js"(exports2, module2) { + "use strict"; + module2.exports = function() { + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + this.name = "SyntaxError"; + } + peg$subclass(SyntaxError, Error); + function parse3(input) { + var options2 = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = [], peg$c1 = function() { + return nodes; + }, peg$c2 = peg$FAILED, peg$c3 = "#", peg$c4 = { type: "literal", value: "#", description: '"#"' }, peg$c5 = void 0, peg$c6 = { type: "any", description: "any character" }, peg$c7 = "[", peg$c8 = { type: "literal", value: "[", description: '"["' }, peg$c9 = "]", peg$c10 = { type: "literal", value: "]", description: '"]"' }, peg$c11 = function(name) { + addNode(node("ObjectPath", name, line, column)); + }, peg$c12 = function(name) { + addNode(node("ArrayPath", name, line, column)); + }, peg$c13 = function(parts, name) { + return parts.concat(name); + }, peg$c14 = function(name) { + return [name]; + }, peg$c15 = function(name) { + return name; + }, peg$c16 = ".", peg$c17 = { type: "literal", value: ".", description: '"."' }, peg$c18 = "=", peg$c19 = { type: "literal", value: "=", description: '"="' }, peg$c20 = function(key, value) { + addNode(node("Assign", value, line, column, key)); + }, peg$c21 = function(chars) { + return chars.join(""); + }, peg$c22 = function(node2) { + return node2.value; + }, peg$c23 = '"""', peg$c24 = { type: "literal", value: '"""', description: '"\\"\\"\\""' }, peg$c25 = null, peg$c26 = function(chars) { + return node("String", chars.join(""), line, column); + }, peg$c27 = '"', peg$c28 = { type: "literal", value: '"', description: '"\\""' }, peg$c29 = "'''", peg$c30 = { type: "literal", value: "'''", description: `"'''"` }, peg$c31 = "'", peg$c32 = { type: "literal", value: "'", description: `"'"` }, peg$c33 = function(char) { + return char; + }, peg$c34 = function(char) { + return char; + }, peg$c35 = "\\", peg$c36 = { type: "literal", value: "\\", description: '"\\\\"' }, peg$c37 = function() { + return ""; + }, peg$c38 = "e", peg$c39 = { type: "literal", value: "e", description: '"e"' }, peg$c40 = "E", peg$c41 = { type: "literal", value: "E", description: '"E"' }, peg$c42 = function(left, right) { + return node("Float", parseFloat(left + "e" + right), line, column); + }, peg$c43 = function(text2) { + return node("Float", parseFloat(text2), line, column); + }, peg$c44 = "+", peg$c45 = { type: "literal", value: "+", description: '"+"' }, peg$c46 = function(digits) { + return digits.join(""); + }, peg$c47 = "-", peg$c48 = { type: "literal", value: "-", description: '"-"' }, peg$c49 = function(digits) { + return "-" + digits.join(""); + }, peg$c50 = function(text2) { + return node("Integer", parseInt(text2, 10), line, column); + }, peg$c51 = "true", peg$c52 = { type: "literal", value: "true", description: '"true"' }, peg$c53 = function() { + return node("Boolean", true, line, column); + }, peg$c54 = "false", peg$c55 = { type: "literal", value: "false", description: '"false"' }, peg$c56 = function() { + return node("Boolean", false, line, column); + }, peg$c57 = function() { + return node("Array", [], line, column); + }, peg$c58 = function(value) { + return node("Array", value ? [value] : [], line, column); + }, peg$c59 = function(values) { + return node("Array", values, line, column); + }, peg$c60 = function(values, value) { + return node("Array", values.concat(value), line, column); + }, peg$c61 = function(value) { + return value; + }, peg$c62 = ",", peg$c63 = { type: "literal", value: ",", description: '","' }, peg$c64 = "{", peg$c65 = { type: "literal", value: "{", description: '"{"' }, peg$c66 = "}", peg$c67 = { type: "literal", value: "}", description: '"}"' }, peg$c68 = function(values) { + return node("InlineTable", values, line, column); + }, peg$c69 = function(key, value) { + return node("InlineTableValue", value, line, column, key); + }, peg$c70 = function(digits) { + return "." + digits; + }, peg$c71 = function(date) { + return date.join(""); + }, peg$c72 = ":", peg$c73 = { type: "literal", value: ":", description: '":"' }, peg$c74 = function(time) { + return time.join(""); + }, peg$c75 = "T", peg$c76 = { type: "literal", value: "T", description: '"T"' }, peg$c77 = "Z", peg$c78 = { type: "literal", value: "Z", description: '"Z"' }, peg$c79 = function(date, time) { + return node("Date", /* @__PURE__ */ new Date(date + "T" + time + "Z"), line, column); + }, peg$c80 = function(date, time) { + return node("Date", /* @__PURE__ */ new Date(date + "T" + time), line, column); + }, peg$c81 = /^[ \t]/, peg$c82 = { type: "class", value: "[ \\t]", description: "[ \\t]" }, peg$c83 = "\n", peg$c84 = { type: "literal", value: "\n", description: '"\\n"' }, peg$c85 = "\r", peg$c86 = { type: "literal", value: "\r", description: '"\\r"' }, peg$c87 = /^[0-9a-f]/i, peg$c88 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, peg$c89 = /^[0-9]/, peg$c90 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c91 = "_", peg$c92 = { type: "literal", value: "_", description: '"_"' }, peg$c93 = function() { + return ""; + }, peg$c94 = /^[A-Za-z0-9_\-]/, peg$c95 = { type: "class", value: "[A-Za-z0-9_\\-]", description: "[A-Za-z0-9_\\-]" }, peg$c96 = function(d) { + return d.join(""); + }, peg$c97 = '\\"', peg$c98 = { type: "literal", value: '\\"', description: '"\\\\\\""' }, peg$c99 = function() { + return '"'; + }, peg$c100 = "\\\\", peg$c101 = { type: "literal", value: "\\\\", description: '"\\\\\\\\"' }, peg$c102 = function() { + return "\\"; + }, peg$c103 = "\\b", peg$c104 = { type: "literal", value: "\\b", description: '"\\\\b"' }, peg$c105 = function() { + return "\b"; + }, peg$c106 = "\\t", peg$c107 = { type: "literal", value: "\\t", description: '"\\\\t"' }, peg$c108 = function() { + return " "; + }, peg$c109 = "\\n", peg$c110 = { type: "literal", value: "\\n", description: '"\\\\n"' }, peg$c111 = function() { + return "\n"; + }, peg$c112 = "\\f", peg$c113 = { type: "literal", value: "\\f", description: '"\\\\f"' }, peg$c114 = function() { + return "\f"; + }, peg$c115 = "\\r", peg$c116 = { type: "literal", value: "\\r", description: '"\\\\r"' }, peg$c117 = function() { + return "\r"; + }, peg$c118 = "\\U", peg$c119 = { type: "literal", value: "\\U", description: '"\\\\U"' }, peg$c120 = function(digits) { + return convertCodePoint(digits.join("")); + }, peg$c121 = "\\u", peg$c122 = { type: "literal", value: "\\u", description: '"\\\\u"' }, peg$currPos = 0, peg$reportedPos = 0, peg$cachedPos = 0, peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$cache = {}, peg$result; + if ("startRule" in options2) { + if (!(options2.startRule in peg$startRuleFunctions)) { + throw new Error(`Can't start parsing from rule "` + options2.startRule + '".'); + } + peg$startRuleFunction = peg$startRuleFunctions[options2.startRule]; + } + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + function offset() { + return peg$reportedPos; + } + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description }], + peg$reportedPos + ); + } + function error(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { + details.line++; + } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + return peg$cachedPosDetails; + } + function peg$fail(expected2) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected2); + } + function peg$buildException(message, expected2, pos) { + function cleanupExpected(expected3) { + var i = 1; + expected3.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + while (i < expected3.length) { + if (expected3[i - 1] === expected3[i]) { + expected3.splice(i, 1); + } else { + i++; + } + } + } + function buildMessage(expected3, found2) { + function stringEscape(s) { + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { + return "\\x" + hex(ch); + }).replace(/[\u0180-\u0FFF]/g, function(ch) { + return "\\u0" + hex(ch); + }).replace(/[\u1080-\uFFFF]/g, function(ch) { + return "\\u" + hex(ch); + }); + } + var expectedDescs = new Array(expected3.length), expectedDesc, foundDesc, i; + for (i = 0; i < expected3.length; i++) { + expectedDescs[i] = expected3[i].description; + } + expectedDesc = expected3.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected3.length - 1] : expectedDescs[0]; + foundDesc = found2 ? '"' + stringEscape(found2) + '"' : "end of input"; + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; + if (expected2 !== null) { + cleanupExpected(expected2); + } + return new SyntaxError( + message !== null ? message : buildMessage(expected2, found), + expected2, + found, + pos, + posDetails.line, + posDetails.column + ); + } + function peg$parsestart() { + var s0, s1, s2; + var key = peg$currPos * 49 + 0, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseline(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseline(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseline() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 1, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parseexpression(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsecomment(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsecomment(); + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseNL(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseNL(); + } + } else { + s5 = peg$c2; + } + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + if (s5 !== peg$FAILED) { + s1 = [s1, s2, s3, s4, s5]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseNL(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseNL(); + } + } else { + s2 = peg$c2; + } + if (s2 === peg$FAILED) { + s2 = peg$parseEOF(); + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$parseNL(); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseexpression() { + var s0; + var key = peg$currPos * 49 + 2, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsecomment(); + if (s0 === peg$FAILED) { + s0 = peg$parsepath(); + if (s0 === peg$FAILED) { + s0 = peg$parsetablearray(); + if (s0 === peg$FAILED) { + s0 = peg$parseassignment(); + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsecomment() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 3, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c4); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$currPos; + s4 = peg$currPos; + peg$silentFails++; + s5 = peg$parseNL(); + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + peg$silentFails--; + if (s5 === peg$FAILED) { + s4 = peg$c5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + 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$c6); + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$currPos; + peg$silentFails++; + s5 = peg$parseNL(); + if (s5 === peg$FAILED) { + s5 = peg$parseEOF(); + } + peg$silentFails--; + if (s5 === peg$FAILED) { + s4 = peg$c5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + 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$c6); + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsepath() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 4, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetable_key(); + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s5 = peg$c9; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c11(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetablearray() { + var s0, s1, s2, s3, s4, s5, s6, s7; + var key = peg$currPos * 49 + 5, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c7; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + s4 = peg$parsetable_key(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c9; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s7 = peg$c9; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c12(s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetable_key() { + var s0, s1, s2; + var key = peg$currPos * 49 + 6, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsedot_ended_table_key_part(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsedot_ended_table_key_part(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + s2 = peg$parsetable_key_part(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsetable_key_part(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c14(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetable_key_part() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 7, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsequoted_key(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedot_ended_table_key_part() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 8, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsequoted_key(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c15(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseassignment() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 9, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsekey(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c18; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + s5 = peg$parsevalue(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c20(s1, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsequoted_key(); + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s3 = peg$c18; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + s5 = peg$parsevalue(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c20(s1, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsekey() { + var s0, s1, s2; + var key = peg$currPos * 49 + 10, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseASCII_BASIC(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseASCII_BASIC(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c21(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsequoted_key() { + var s0, s1; + var key = peg$currPos * 49 + 11, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsedouble_quoted_single_line_string(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c22(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsesingle_quoted_single_line_string(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c22(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsevalue() { + var s0; + var key = peg$currPos * 49 + 12, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsestring(); + if (s0 === peg$FAILED) { + s0 = peg$parsedatetime(); + if (s0 === peg$FAILED) { + s0 = peg$parsefloat(); + if (s0 === peg$FAILED) { + s0 = peg$parseinteger(); + if (s0 === peg$FAILED) { + s0 = peg$parseboolean(); + if (s0 === peg$FAILED) { + s0 = peg$parsearray(); + if (s0 === peg$FAILED) { + s0 = peg$parseinline_table(); + } + } + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsestring() { + var s0; + var key = peg$currPos * 49 + 13, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parsedouble_quoted_multiline_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsedouble_quoted_single_line_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsesingle_quoted_multiline_string(); + if (s0 === peg$FAILED) { + s0 = peg$parsesingle_quoted_single_line_string(); + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedouble_quoted_multiline_string() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 14, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c23) { + s1 = peg$c23; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsemultiline_string_char(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsemultiline_string_char(); + } + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 3) === peg$c23) { + s4 = peg$c23; + peg$currPos += 3; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedouble_quoted_single_line_string() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 15, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c27; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsestring_char(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsestring_char(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c27; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesingle_quoted_multiline_string() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 16, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c29) { + s1 = peg$c29; + peg$currPos += 3; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsemultiline_literal_char(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsemultiline_literal_char(); + } + if (s3 !== peg$FAILED) { + if (input.substr(peg$currPos, 3) === peg$c29) { + s4 = peg$c29; + peg$currPos += 3; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesingle_quoted_single_line_string() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 17, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseliteral_char(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseliteral_char(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c31; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsestring_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 18, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseESCAPED(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c27; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c28); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseliteral_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 19, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c31; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c32); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_string_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 20, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseESCAPED(); + if (s0 === peg$FAILED) { + s0 = peg$parsemultiline_string_delim(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c23) { + s2 = peg$c23; + peg$currPos += 3; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c24); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c34(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_string_delim() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 21, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c35; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c36); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseNL(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseNLS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseNLS(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c37(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsemultiline_literal_char() { + var s0, s1, s2; + var key = peg$currPos * 49 + 22, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.substr(peg$currPos, 3) === peg$c29) { + s2 = peg$c29; + peg$currPos += 3; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c30); + } + } + peg$silentFails--; + if (s2 === peg$FAILED) { + s1 = peg$c5; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + 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$c6); + } + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsefloat() { + var s0, s1, s2, s3; + var key = peg$currPos * 49 + 23, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsefloat_text(); + if (s1 === peg$FAILED) { + s1 = peg$parseinteger_text(); + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 101) { + s2 = peg$c38; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c39); + } + } + if (s2 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 69) { + s2 = peg$c40; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c41); + } + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parseinteger_text(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c42(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsefloat_text(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c43(s1); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsefloat_text() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 24, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 43) { + s1 = peg$c44; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + if (s1 === peg$FAILED) { + s1 = peg$c25; + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseDIGITS(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGITS(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s1 = peg$c47; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseDIGITS(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGITS(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c49(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinteger() { + var s0, s1; + var key = peg$currPos * 49 + 25, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parseinteger_text(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinteger_text() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 26, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 43) { + s1 = peg$c44; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + if (s1 === peg$FAILED) { + s1 = peg$c25; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = peg$c5; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c46(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + s1 = peg$c47; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 46) { + s4 = peg$c16; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + peg$silentFails--; + if (s4 === peg$FAILED) { + s3 = peg$c5; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c49(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseboolean() { + var s0, s1; + var key = peg$currPos * 49 + 27, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 4) === peg$c51) { + s1 = peg$c51; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c52); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c53(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c54) { + s1 = peg$c54; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c55); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c56(); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 28, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_sep(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_sep(); + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c57(); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsearray_value(); + if (s2 === peg$FAILED) { + s2 = peg$c25; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c58(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_value_list(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_value_list(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s3 = peg$c9; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c59(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c7; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c8); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsearray_value_list(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsearray_value_list(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + s3 = peg$parsearray_value(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s4 = peg$c9; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c60(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_value() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 29, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsearray_sep(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsearray_sep(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsevalue(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsearray_sep(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsearray_sep(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_value_list() { + var s0, s1, s2, s3, s4, s5, s6; + var key = peg$currPos * 49 + 30, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parsearray_sep(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsearray_sep(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsevalue(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsearray_sep(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsearray_sep(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c62; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c63); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parsearray_sep(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parsearray_sep(); + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c61(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsearray_sep() { + var s0; + var key = peg$currPos * 49 + 31, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseS(); + if (s0 === peg$FAILED) { + s0 = peg$parseNL(); + if (s0 === peg$FAILED) { + s0 = peg$parsecomment(); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinline_table() { + var s0, s1, s2, s3, s4, s5; + var key = peg$currPos * 49 + 32, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c64; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c65); + } + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parseS(); + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parseS(); + } + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseinline_table_assignment(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseinline_table_assignment(); + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parseS(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parseS(); + } + if (s4 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s5 = peg$c66; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c67); + } + } + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c68(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseinline_table_assignment() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 33, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c18; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parsevalue(); + if (s6 !== peg$FAILED) { + s7 = []; + s8 = peg$parseS(); + while (s8 !== peg$FAILED) { + s7.push(s8); + s8 = peg$parseS(); + } + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s8 = peg$c62; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c63); + } + } + if (s8 !== peg$FAILED) { + s9 = []; + s10 = peg$parseS(); + while (s10 !== peg$FAILED) { + s9.push(s10); + s10 = peg$parseS(); + } + if (s9 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c69(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + s2 = peg$parseS(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseS(); + } + if (s1 !== peg$FAILED) { + s2 = peg$parsekey(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseS(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseS(); + } + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 61) { + s4 = peg$c18; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseS(); + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseS(); + } + if (s5 !== peg$FAILED) { + s6 = peg$parsevalue(); + if (s6 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c69(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsesecfragment() { + var s0, s1, s2; + var key = peg$currPos * 49 + 34, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c16; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c17); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parseDIGITS(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c70(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedate() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; + var key = peg$currPos * 49 + 35, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + s4 = peg$parseDIGIT_OR_UNDER(); + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s6 = peg$c47; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s6 !== peg$FAILED) { + s7 = peg$parseDIGIT_OR_UNDER(); + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s9 = peg$c47; + peg$currPos++; + } else { + s9 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s9 !== peg$FAILED) { + s10 = peg$parseDIGIT_OR_UNDER(); + if (s10 !== peg$FAILED) { + s11 = peg$parseDIGIT_OR_UNDER(); + if (s11 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c71(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetime() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 36, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c72; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + s6 = peg$parseDIGIT_OR_UNDER(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s7 = peg$c72; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + s9 = peg$parseDIGIT_OR_UNDER(); + if (s9 !== peg$FAILED) { + s10 = peg$parsesecfragment(); + if (s10 === peg$FAILED) { + s10 = peg$c25; + } + if (s10 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsetime_with_offset() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16; + var key = peg$currPos * 49 + 37, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + s3 = peg$parseDIGIT_OR_UNDER(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c72; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s4 !== peg$FAILED) { + s5 = peg$parseDIGIT_OR_UNDER(); + if (s5 !== peg$FAILED) { + s6 = peg$parseDIGIT_OR_UNDER(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s7 = peg$c72; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s7 !== peg$FAILED) { + s8 = peg$parseDIGIT_OR_UNDER(); + if (s8 !== peg$FAILED) { + s9 = peg$parseDIGIT_OR_UNDER(); + if (s9 !== peg$FAILED) { + s10 = peg$parsesecfragment(); + if (s10 === peg$FAILED) { + s10 = peg$c25; + } + if (s10 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 45) { + s11 = peg$c47; + peg$currPos++; + } else { + s11 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c48); + } + } + if (s11 === peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 43) { + s11 = peg$c44; + peg$currPos++; + } else { + s11 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + } + if (s11 !== peg$FAILED) { + s12 = peg$parseDIGIT_OR_UNDER(); + if (s12 !== peg$FAILED) { + s13 = peg$parseDIGIT_OR_UNDER(); + if (s13 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s14 = peg$c72; + peg$currPos++; + } else { + s14 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c73); + } + } + if (s14 !== peg$FAILED) { + s15 = peg$parseDIGIT_OR_UNDER(); + if (s15 !== peg$FAILED) { + s16 = peg$parseDIGIT_OR_UNDER(); + if (s16 !== peg$FAILED) { + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + } else { + peg$currPos = s1; + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c74(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parsedatetime() { + var s0, s1, s2, s3, s4; + var key = peg$currPos * 49 + 38, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = peg$parsedate(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 84) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c76); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetime(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 90) { + s4 = peg$c77; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c78); + } + } + if (s4 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c79(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsedate(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 84) { + s2 = peg$c75; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c76); + } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsetime_with_offset(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c80(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseS() { + var s0; + var key = peg$currPos * 49 + 39, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c81.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c82); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseNL() { + var s0, s1, s2; + var key = peg$currPos * 49 + 40, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c83; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c84); + } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c85; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c86); + } + } + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 10) { + s2 = peg$c83; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c84); + } + } + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseNLS() { + var s0; + var key = peg$currPos * 49 + 41, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$parseNL(); + if (s0 === peg$FAILED) { + s0 = peg$parseS(); + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseEOF() { + var s0, s1; + var key = peg$currPos * 49 + 42, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + peg$silentFails++; + if (input.length > peg$currPos) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c6); + } + } + peg$silentFails--; + if (s1 === peg$FAILED) { + s0 = peg$c5; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseHEX() { + var s0; + var key = peg$currPos * 49 + 43, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c87.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c88); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseDIGIT_OR_UNDER() { + var s0, s1; + var key = peg$currPos * 49 + 44, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c89.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c90); + } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 95) { + s1 = peg$c91; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c92); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c93(); + } + s0 = s1; + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseASCII_BASIC() { + var s0; + var key = peg$currPos * 49 + 45, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + if (peg$c94.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c95); + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseDIGITS() { + var s0, s1, s2; + var key = peg$currPos * 49 + 46, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + s1 = []; + s2 = peg$parseDIGIT_OR_UNDER(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseDIGIT_OR_UNDER(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c96(s1); + } + s0 = s1; + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseESCAPED() { + var s0, s1; + var key = peg$currPos * 49 + 47, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c97) { + s1 = peg$c97; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c98); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c99(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c100) { + s1 = peg$c100; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c101); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c102(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c103) { + s1 = peg$c103; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c104); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c105(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c106) { + s1 = peg$c106; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c107); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c108(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c109) { + s1 = peg$c109; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c110); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c111(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c112) { + s1 = peg$c112; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c113); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c114(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c115) { + s1 = peg$c115; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c116); + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c117(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$parseESCAPED_UNICODE(); + } + } + } + } + } + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + function peg$parseESCAPED_UNICODE() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + var key = peg$currPos * 49 + 48, cached = peg$cache[key]; + if (cached) { + peg$currPos = cached.nextPos; + return cached.result; + } + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c118) { + s1 = peg$c118; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c119); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseHEX(); + if (s3 !== peg$FAILED) { + s4 = peg$parseHEX(); + if (s4 !== peg$FAILED) { + s5 = peg$parseHEX(); + if (s5 !== peg$FAILED) { + s6 = peg$parseHEX(); + if (s6 !== peg$FAILED) { + s7 = peg$parseHEX(); + if (s7 !== peg$FAILED) { + s8 = peg$parseHEX(); + if (s8 !== peg$FAILED) { + s9 = peg$parseHEX(); + if (s9 !== peg$FAILED) { + s10 = peg$parseHEX(); + if (s10 !== peg$FAILED) { + s3 = [s3, s4, s5, s6, s7, s8, s9, s10]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c120(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c121) { + s1 = peg$c121; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$c122); + } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$parseHEX(); + if (s3 !== peg$FAILED) { + s4 = peg$parseHEX(); + if (s4 !== peg$FAILED) { + s5 = peg$parseHEX(); + if (s5 !== peg$FAILED) { + s6 = peg$parseHEX(); + if (s6 !== peg$FAILED) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + } else { + peg$currPos = s2; + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c120(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; + return s0; + } + var nodes = []; + function genError(err, line2, col) { + var ex = new Error(err); + ex.line = line2; + ex.column = col; + throw ex; + } + function addNode(node2) { + nodes.push(node2); + } + function node(type, value, line2, column2, key) { + var obj = { type, value, line: line2(), column: column2() }; + if (key) + obj.key = key; + return obj; + } + function convertCodePoint(str, line2, col) { + var num = parseInt("0x" + str); + if (!isFinite(num) || Math.floor(num) != num || num < 0 || num > 1114111 || num > 55295 && num < 57344) { + genError("Invalid Unicode escape code: " + str, line2, col); + } else { + return fromCodePoint(num); + } + } + function fromCodePoint() { + var MAX_SIZE = 16384; + var codeUnits = []; + var highSurrogate; + var lowSurrogate; + var index = -1; + var length = arguments.length; + if (!length) { + return ""; + } + var result = ""; + while (++index < length) { + var codePoint = Number(arguments[index]); + if (codePoint <= 65535) { + codeUnits.push(codePoint); + } else { + codePoint -= 65536; + highSurrogate = (codePoint >> 10) + 55296; + lowSurrogate = codePoint % 1024 + 56320; + codeUnits.push(highSurrogate, lowSurrogate); + } + if (index + 1 == length || codeUnits.length > MAX_SIZE) { + result += String.fromCharCode.apply(null, codeUnits); + codeUnits.length = 0; + } + } + return result; + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } + return { + SyntaxError, + parse: parse3 + }; + }(); + } +}); + +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js +var require_compiler = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/lib/compiler.js"(exports2, module2) { + "use strict"; + function compile(nodes) { + var assignedPaths = []; + var valueAssignments = []; + var currentPath = ""; + var data = /* @__PURE__ */ Object.create(null); + var context = data; + var arrayMode = false; + return reduce(nodes); + function reduce(nodes2) { + var node; + for (var i = 0; i < nodes2.length; i++) { + node = nodes2[i]; + switch (node.type) { + case "Assign": + assign(node); + break; + case "ObjectPath": + setPath(node); + break; + case "ArrayPath": + addTableArray(node); + break; + } + } + return data; + } + function genError(err, line, col) { + var ex = new Error(err); + ex.line = line; + ex.column = col; + throw ex; + } + function assign(node) { + var key = node.key; + var value = node.value; + var line = node.line; + var column = node.column; + var fullPath; + if (currentPath) { + fullPath = currentPath + "." + key; + } else { + fullPath = key; + } + if (typeof context[key] !== "undefined") { + genError("Cannot redefine existing key '" + fullPath + "'.", line, column); + } + context[key] = reduceValueNode(value); + if (!pathAssigned(fullPath)) { + assignedPaths.push(fullPath); + valueAssignments.push(fullPath); + } + } + function pathAssigned(path3) { + return assignedPaths.indexOf(path3) !== -1; + } + function reduceValueNode(node) { + if (node.type === "Array") { + return reduceArrayWithTypeChecking(node.value); + } else if (node.type === "InlineTable") { + return reduceInlineTableNode(node.value); + } else { + return node.value; + } + } + function reduceInlineTableNode(values) { + var obj = /* @__PURE__ */ Object.create(null); + for (var i = 0; i < values.length; i++) { + var val = values[i]; + if (val.value.type === "InlineTable") { + obj[val.key] = reduceInlineTableNode(val.value.value); + } else if (val.type === "InlineTableValue") { + obj[val.key] = reduceValueNode(val.value); + } + } + return obj; + } + function setPath(node) { + var path3 = node.value; + var quotedPath = path3.map(quoteDottedString).join("."); + var line = node.line; + var column = node.column; + if (pathAssigned(quotedPath)) { + genError("Cannot redefine existing key '" + path3 + "'.", line, column); + } + assignedPaths.push(quotedPath); + context = deepRef(data, path3, /* @__PURE__ */ Object.create(null), line, column); + currentPath = path3; + } + function addTableArray(node) { + var path3 = node.value; + var quotedPath = path3.map(quoteDottedString).join("."); + var line = node.line; + var column = node.column; + if (!pathAssigned(quotedPath)) { + assignedPaths.push(quotedPath); + } + assignedPaths = assignedPaths.filter(function(p) { + return p.indexOf(quotedPath) !== 0; + }); + assignedPaths.push(quotedPath); + context = deepRef(data, path3, [], line, column); + currentPath = quotedPath; + if (context instanceof Array) { + var newObj = /* @__PURE__ */ Object.create(null); + context.push(newObj); + context = newObj; + } else { + genError("Cannot redefine existing key '" + path3 + "'.", line, column); + } + } + function deepRef(start, keys, value, line, column) { + var traversed = []; + var traversedPath = ""; + var path3 = keys.join("."); + var ctx = start; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + traversed.push(key); + traversedPath = traversed.join("."); + if (typeof ctx[key] === "undefined") { + if (i === keys.length - 1) { + ctx[key] = value; + } else { + ctx[key] = /* @__PURE__ */ Object.create(null); + } + } else if (i !== keys.length - 1 && valueAssignments.indexOf(traversedPath) > -1) { + genError("Cannot redefine existing key '" + traversedPath + "'.", line, column); + } + ctx = ctx[key]; + if (ctx instanceof Array && ctx.length && i < keys.length - 1) { + ctx = ctx[ctx.length - 1]; + } + } + return ctx; + } + function reduceArrayWithTypeChecking(array) { + var firstType = null; + for (var i = 0; i < array.length; i++) { + var node = array[i]; + if (firstType === null) { + firstType = node.type; + } else { + if (node.type !== firstType) { + genError("Cannot add value of type " + node.type + " to array of type " + firstType + ".", node.line, node.column); + } + } + } + return array.map(reduceValueNode); + } + function quoteDottedString(str) { + if (str.indexOf(".") > -1) { + return '"' + str + '"'; + } else { + return str; + } + } + } + module2.exports = { + compile + }; + } +}); + +// node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js +var require_toml = __commonJS({ + "node_modules/.pnpm/toml@3.0.0/node_modules/toml/index.js"(exports2, module2) { + "use strict"; + var parser = require_parser(); + var compiler = require_compiler(); + module2.exports = { + parse: function(input) { + var nodes = parser.parse(input.toString()); + return compiler.compile(nodes); + } + }; + } +}); + // node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js var require_posix = __commonJS({ "node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/posix.js"(exports2) { @@ -6102,6 +9849,7 @@ function untildify(pathWithTilde) { } // src/options.ts +var import_toml = __toESM(require_toml()); var import_which = __toESM(require_lib2()); var logLevelSchema = enumType(["q", "default", "v", "vv", "vvv"]); var PATHS = { @@ -6199,7 +9947,25 @@ var inferOptions = (inputs) => { inputs.pixiBinPath ); const logLevel = inputs.logLevel ?? (core.isDebug() ? "vv" : "default"); - const manifestPath = inputs.manifestPath ? import_path.default.resolve(untildify(inputs.manifestPath)) : "pixi.toml"; + let manifestPath = "pixi.toml"; + if (inputs.manifestPath) { + manifestPath = import_path.default.resolve(untildify(inputs.manifestPath)); + } else { + if ((0, import_fs.existsSync)("pixi.toml")) { + manifestPath = "pixi.toml"; + } else if ((0, import_fs.existsSync)("pyproject.toml")) { + const fileContent = (0, import_fs.readFileSync)("pyproject.toml", "utf-8"); + const parsedContent = (0, import_toml.parse)(fileContent); + if (parsedContent.tool && parsedContent.tool.pixi) { + core.debug("The tool.pixi table found so using pyproject.toml as manifest file."); + manifestPath = "pyproject.toml"; + } + } else { + if (runInstall) { + core.warning("Could not find any manifest file. Defaulting to pixi.toml."); + } + } + } const pixiLockFile = import_path.default.join(import_path.default.dirname(manifestPath), "pixi.lock"); const lockFileAvailable = (0, import_fs.existsSync)(pixiLockFile); core.debug(`lockFileAvailable: ${lockFileAvailable}`); diff --git a/package.json b/package.json index 38a5253..57b695b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-pixi", - "version": "0.5.2", + "version": "0.6.0", "private": true, "description": "Action to set up the pixi package manager.", "scripts": { @@ -26,6 +26,7 @@ "@actions/exec": "^1.1.1", "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.1", + "toml": "^3.0.0", "untildify": "^5.0.0", "which": "^4.0.0", "zod": "^3.22.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85f699f..141bcda 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ dependencies: '@actions/tool-cache': specifier: ^2.0.1 version: 2.0.1 + toml: + specifier: ^3.0.0 + version: 3.0.0 untildify: specifier: ^5.0.0 version: 5.0.0 @@ -2797,6 +2800,10 @@ packages: is-number: 7.0.0 dev: true + /toml@3.0.0: + resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} + dev: false + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: false diff --git a/src/options.ts b/src/options.ts index 8658520..68b6ede 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,10 +1,11 @@ import path from 'path' import os from 'os' import { exit } from 'process' -import { existsSync } from 'fs' +import { existsSync, readFileSync } from 'fs' import * as core from '@actions/core' import * as z from 'zod' import untildify from 'untildify' +import { parse } from 'toml' import which from 'which' type Inputs = Readonly<{ @@ -194,7 +195,27 @@ const inferOptions = (inputs: Inputs): Options => { inputs.pixiBinPath ) const logLevel = inputs.logLevel ?? (core.isDebug() ? 'vv' : 'default') - const manifestPath = inputs.manifestPath ? path.resolve(untildify(inputs.manifestPath)) : 'pixi.toml' + // infer manifest path from inputs or default to pixi.toml or pyproject.toml depending on what is present in the repo. + let manifestPath = 'pixi.toml' // default + if (inputs.manifestPath) { + manifestPath = path.resolve(untildify(inputs.manifestPath)) + } else { + if (existsSync('pixi.toml')) { + manifestPath = 'pixi.toml' + } else if (existsSync('pyproject.toml')) { + const fileContent = readFileSync('pyproject.toml', 'utf-8') + const parsedContent = parse(fileContent) + // only use pyproject.toml if [tool.pixi] is present + if (parsedContent.tool && parsedContent.tool.pixi) { + core.debug('The tool.pixi table found so using pyproject.toml as manifest file.') + manifestPath = 'pyproject.toml' + } + } else { + if (runInstall) { + core.warning('Could not find any manifest file. Defaulting to pixi.toml.') + } + } + } const pixiLockFile = path.join(path.dirname(manifestPath), 'pixi.lock') const lockFileAvailable = existsSync(pixiLockFile) core.debug(`lockFileAvailable: ${lockFileAvailable}`) diff --git a/test/pyproject-manifest/pyproject.toml b/test/pyproject-manifest/pyproject.toml index e55b4a5..9f3c029 100644 --- a/test/pyproject-manifest/pyproject.toml +++ b/test/pyproject-manifest/pyproject.toml @@ -17,3 +17,6 @@ platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"] [tool.pixi.pypi-dependencies] boltons = "*" + +[tool.pixi.tasks] +test = "echo 'Running tests...'" diff --git a/tsup.config.js b/tsup.config.js index 08a10c0..549813a 100644 --- a/tsup.config.js +++ b/tsup.config.js @@ -19,6 +19,7 @@ export default defineConfig({ '@actions/io', '@actions/tool-cache', 'untildify', + 'toml', 'which', 'zod' ]