Support `mise.toml` (#415)
98c13a9 · Dino Kovač · 2026-03-09 22:41
Message
{commit_body(@commit)}
Files changed
modified
.gitignore
+1
−0
@@ -1,3 +1,4 @@
| 1 | 1 | /node_modules |
| 2 | 2 | /test/.tool-versions |
| 3 | +/test/mise.toml | |
| 3 | 4 | /dist/package.json |
modified
README.md
+7
−8
@@ -141,23 +141,22 @@ e.g. `${{steps.setup-beam.outputs.erlang-version}}`
| 141 | 141 | |
| 142 | 142 | ### Version file |
| 143 | 143 | |
| 144 | −A version file is specified via input `version-file` (e.g.`.tool-versions`). This | |
| 145 | −allows not having to use YML input for versions, though the action does check (and | |
| 144 | +A version file is specified via input `version-file` (e.g. `.tool-versions` or `mise.toml`). | |
| 145 | +The file type is inferred from the filename: files ending in `.toml` are parsed as | |
| 146 | +[mise](https://mise.jdx.dev/configuration.html#tools-dev-tools) configuration, and all others | |
| 147 | +are parsed as [`.tool-versions`](https://asdf-vm.com/manage/configuration.html) (asdf format). | |
| 148 | +This allows not having to use YML input for versions, though the action does check (and | |
| 146 | 149 | will exit with error) if both inputs are set. |
| 147 | 150 | |
| 148 | 151 | **Note**: if you're using a version file, option `version-type` is checked to be `strict`, |
| 149 | 152 | and will make the action exit with error otherwise. |
| 150 | 153 | |
| 151 | −The following version file formats are supported: | |
| 152 | − | |
| 153 | −- `.tool-versions`, as specified by [asdf: Configuration](https://asdf-vm.com/manage/configuration.html) | |
| 154 | − | |
| 155 | 154 | Supported version elements are the same as the ones defined for the YML portion of the action, |
| 156 | 155 | with the following correspondence. |
| 157 | 156 | |
| 158 | −#### `.tool-versions` format | |
| 157 | +#### `.tool-versions` / `mise.toml` format | |
| 159 | 158 | |
| 160 | −| YML | `.tool-versions` | |
| 159 | +| YML | Version file key | |
| 161 | 160 | |- |- |
| 162 | 161 | | `otp-version` | `erlang` |
| 163 | 162 | | `elixir-version` | `elixir` |
modified
action.yml
+3
−1
@@ -69,7 +69,9 @@ inputs:
| 69 | 69 | required: false |
| 70 | 70 | |
| 71 | 71 | version-file: |
| 72 | − description: a versions file (e.g. as used by `asdf`), which defines inputs | |
| 72 | + description: >- | |
| 73 | + a versions file (e.g. `.tool-versions` as used by `asdf`, or `mise.toml` | |
| 74 | + as used by `mise`), which defines inputs | |
| 73 | 75 | default: '' |
| 74 | 76 | required: false |
| 75 | 77 |
modified
dist/index.js
+4112
−16
@@ -19925,6 +19925,4072 @@ const validRange = (range, options) => {
| 19925 | 19925 | module.exports = validRange |
| 19926 | 19926 | |
| 19927 | 19927 | |
| 19928 | +/***/ }), | |
| 19929 | + | |
| 19930 | +/***/ 2132: | |
| 19931 | +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { | |
| 19932 | + | |
| 19933 | +var parser = __nccwpck_require__(4613); | |
| 19934 | +var compiler = __nccwpck_require__(4763); | |
| 19935 | + | |
| 19936 | +module.exports = { | |
| 19937 | + parse: function(input) { | |
| 19938 | + var nodes = parser.parse(input.toString()); | |
| 19939 | + return compiler.compile(nodes); | |
| 19940 | + } | |
| 19941 | +}; | |
| 19942 | + | |
| 19943 | + | |
| 19944 | +/***/ }), | |
| 19945 | + | |
| 19946 | +/***/ 4763: | |
| 19947 | +/***/ ((module) => { | |
| 19948 | + | |
| 19949 | + | |
| 19950 | +function compile(nodes) { | |
| 19951 | + var assignedPaths = []; | |
| 19952 | + var valueAssignments = []; | |
| 19953 | + var currentPath = ""; | |
| 19954 | + var data = Object.create(null); | |
| 19955 | + var context = data; | |
| 19956 | + var arrayMode = false; | |
| 19957 | + | |
| 19958 | + return reduce(nodes); | |
| 19959 | + | |
| 19960 | + function reduce(nodes) { | |
| 19961 | + var node; | |
| 19962 | + for (var i = 0; i < nodes.length; i++) { | |
| 19963 | + node = nodes[i]; | |
| 19964 | + switch (node.type) { | |
| 19965 | + case "Assign": | |
| 19966 | + assign(node); | |
| 19967 | + break; | |
| 19968 | + case "ObjectPath": | |
| 19969 | + setPath(node); | |
| 19970 | + break; | |
| 19971 | + case "ArrayPath": | |
| 19972 | + addTableArray(node); | |
| 19973 | + break; | |
| 19974 | + } | |
| 19975 | + } | |
| 19976 | + | |
| 19977 | + return data; | |
| 19978 | + } | |
| 19979 | + | |
| 19980 | + function genError(err, line, col) { | |
| 19981 | + var ex = new Error(err); | |
| 19982 | + ex.line = line; | |
| 19983 | + ex.column = col; | |
| 19984 | + throw ex; | |
| 19985 | + } | |
| 19986 | + | |
| 19987 | + function assign(node) { | |
| 19988 | + var key = node.key; | |
| 19989 | + var value = node.value; | |
| 19990 | + var line = node.line; | |
| 19991 | + var column = node.column; | |
| 19992 | + | |
| 19993 | + var fullPath; | |
| 19994 | + if (currentPath) { | |
| 19995 | + fullPath = currentPath + "." + key; | |
| 19996 | + } else { | |
| 19997 | + fullPath = key; | |
| 19998 | + } | |
| 19999 | + if (typeof context[key] !== "undefined") { | |
| 20000 | + genError("Cannot redefine existing key '" + fullPath + "'.", line, column); | |
| 20001 | + } | |
| 20002 | + | |
| 20003 | + context[key] = reduceValueNode(value); | |
| 20004 | + | |
| 20005 | + if (!pathAssigned(fullPath)) { | |
| 20006 | + assignedPaths.push(fullPath); | |
| 20007 | + valueAssignments.push(fullPath); | |
| 20008 | + } | |
| 20009 | + } | |
| 20010 | + | |
| 20011 | + | |
| 20012 | + function pathAssigned(path) { | |
| 20013 | + return assignedPaths.indexOf(path) !== -1; | |
| 20014 | + } | |
| 20015 | + | |
| 20016 | + function reduceValueNode(node) { | |
| 20017 | + if (node.type === "Array") { | |
| 20018 | + return reduceArrayWithTypeChecking(node.value); | |
| 20019 | + } else if (node.type === "InlineTable") { | |
| 20020 | + return reduceInlineTableNode(node.value); | |
| 20021 | + } else { | |
| 20022 | + return node.value; | |
| 20023 | + } | |
| 20024 | + } | |
| 20025 | + | |
| 20026 | + function reduceInlineTableNode(values) { | |
| 20027 | + var obj = Object.create(null); | |
| 20028 | + for (var i = 0; i < values.length; i++) { | |
| 20029 | + var val = values[i]; | |
| 20030 | + if (val.value.type === "InlineTable") { | |
| 20031 | + obj[val.key] = reduceInlineTableNode(val.value.value); | |
| 20032 | + } else if (val.type === "InlineTableValue") { | |
| 20033 | + obj[val.key] = reduceValueNode(val.value); | |
| 20034 | + } | |
| 20035 | + } | |
| 20036 | + | |
| 20037 | + return obj; | |
| 20038 | + } | |
| 20039 | + | |
| 20040 | + function setPath(node) { | |
| 20041 | + var path = node.value; | |
| 20042 | + var quotedPath = path.map(quoteDottedString).join("."); | |
| 20043 | + var line = node.line; | |
| 20044 | + var column = node.column; | |
| 20045 | + | |
| 20046 | + if (pathAssigned(quotedPath)) { | |
| 20047 | + genError("Cannot redefine existing key '" + path + "'.", line, column); | |
| 20048 | + } | |
| 20049 | + assignedPaths.push(quotedPath); | |
| 20050 | + context = deepRef(data, path, Object.create(null), line, column); | |
| 20051 | + currentPath = path; | |
| 20052 | + } | |
| 20053 | + | |
| 20054 | + function addTableArray(node) { | |
| 20055 | + var path = node.value; | |
| 20056 | + var quotedPath = path.map(quoteDottedString).join("."); | |
| 20057 | + var line = node.line; | |
| 20058 | + var column = node.column; | |
| 20059 | + | |
| 20060 | + if (!pathAssigned(quotedPath)) { | |
| 20061 | + assignedPaths.push(quotedPath); | |
| 20062 | + } | |
| 20063 | + assignedPaths = assignedPaths.filter(function(p) { | |
| 20064 | + return p.indexOf(quotedPath) !== 0; | |
| 20065 | + }); | |
| 20066 | + assignedPaths.push(quotedPath); | |
| 20067 | + context = deepRef(data, path, [], line, column); | |
| 20068 | + currentPath = quotedPath; | |
| 20069 | + | |
| 20070 | + if (context instanceof Array) { | |
| 20071 | + var newObj = Object.create(null); | |
| 20072 | + context.push(newObj); | |
| 20073 | + context = newObj; | |
| 20074 | + } else { | |
| 20075 | + genError("Cannot redefine existing key '" + path + "'.", line, column); | |
| 20076 | + } | |
| 20077 | + } | |
| 20078 | + | |
| 20079 | + // Given a path 'a.b.c', create (as necessary) `start.a`, | |
| 20080 | + // `start.a.b`, and `start.a.b.c`, assigning `value` to `start.a.b.c`. | |
| 20081 | + // If `a` or `b` are arrays and have items in them, the last item in the | |
| 20082 | + // array is used as the context for the next sub-path. | |
| 20083 | + function deepRef(start, keys, value, line, column) { | |
| 20084 | + var traversed = []; | |
| 20085 | + var traversedPath = ""; | |
| 20086 | + var path = keys.join("."); | |
| 20087 | + var ctx = start; | |
| 20088 | + | |
| 20089 | + for (var i = 0; i < keys.length; i++) { | |
| 20090 | + var key = keys[i]; | |
| 20091 | + traversed.push(key); | |
| 20092 | + traversedPath = traversed.join("."); | |
| 20093 | + if (typeof ctx[key] === "undefined") { | |
| 20094 | + if (i === keys.length - 1) { | |
| 20095 | + ctx[key] = value; | |
| 20096 | + } else { | |
| 20097 | + ctx[key] = Object.create(null); | |
| 20098 | + } | |
| 20099 | + } else if (i !== keys.length - 1 && valueAssignments.indexOf(traversedPath) > -1) { | |
| 20100 | + // already a non-object value at key, can't be used as part of a new path | |
| 20101 | + genError("Cannot redefine existing key '" + traversedPath + "'.", line, column); | |
| 20102 | + } | |
| 20103 | + | |
| 20104 | + ctx = ctx[key]; | |
| 20105 | + if (ctx instanceof Array && ctx.length && i < keys.length - 1) { | |
| 20106 | + ctx = ctx[ctx.length - 1]; | |
| 20107 | + } | |
| 20108 | + } | |
| 20109 | + | |
| 20110 | + return ctx; | |
| 20111 | + } | |
| 20112 | + | |
| 20113 | + function reduceArrayWithTypeChecking(array) { | |
| 20114 | + // Ensure that all items in the array are of the same type | |
| 20115 | + var firstType = null; | |
| 20116 | + for (var i = 0; i < array.length; i++) { | |
| 20117 | + var node = array[i]; | |
| 20118 | + if (firstType === null) { | |
| 20119 | + firstType = node.type; | |
| 20120 | + } else { | |
| 20121 | + if (node.type !== firstType) { | |
| 20122 | + genError("Cannot add value of type " + node.type + " to array of type " + | |
| 20123 | + firstType + ".", node.line, node.column); | |
| 20124 | + } | |
| 20125 | + } | |
| 20126 | + } | |
| 20127 | + | |
| 20128 | + // Recursively reduce array of nodes into array of the nodes' values | |
| 20129 | + return array.map(reduceValueNode); | |
| 20130 | + } | |
| 20131 | + | |
| 20132 | + function quoteDottedString(str) { | |
| 20133 | + if (str.indexOf(".") > -1) { | |
| 20134 | + return "\"" + str + "\""; | |
| 20135 | + } else { | |
| 20136 | + return str; | |
| 20137 | + } | |
| 20138 | + } | |
| 20139 | +} | |
| 20140 | + | |
| 20141 | +module.exports = { | |
| 20142 | + compile: compile | |
| 20143 | +}; | |
| 20144 | + | |
| 20145 | + | |
| 20146 | +/***/ }), | |
| 20147 | + | |
| 20148 | +/***/ 4613: | |
| 20149 | +/***/ ((module) => { | |
| 20150 | + | |
| 20151 | +module.exports = (function() { | |
| 20152 | + /* | |
| 20153 | + * Generated by PEG.js 0.8.0. | |
| 20154 | + * | |
| 20155 | + * http://pegjs.majda.cz/ | |
| 20156 | + */ | |
| 20157 | + | |
| 20158 | + function peg$subclass(child, parent) { | |
| 20159 | + function ctor() { this.constructor = child; } | |
| 20160 | + ctor.prototype = parent.prototype; | |
| 20161 | + child.prototype = new ctor(); | |
| 20162 | + } | |
| 20163 | + | |
| 20164 | + function SyntaxError(message, expected, found, offset, line, column) { | |
| 20165 | + this.message = message; | |
| 20166 | + this.expected = expected; | |
| 20167 | + this.found = found; | |
| 20168 | + this.offset = offset; | |
| 20169 | + this.line = line; | |
| 20170 | + this.column = column; | |
| 20171 | + | |
| 20172 | + this.name = "SyntaxError"; | |
| 20173 | + } | |
| 20174 | + | |
| 20175 | + peg$subclass(SyntaxError, Error); | |
| 20176 | + | |
| 20177 | + function parse(input) { | |
| 20178 | + var options = arguments.length > 1 ? arguments[1] : {}, | |
| 20179 | + | |
| 20180 | + peg$FAILED = {}, | |
| 20181 | + | |
| 20182 | + peg$startRuleFunctions = { start: peg$parsestart }, | |
| 20183 | + peg$startRuleFunction = peg$parsestart, | |
| 20184 | + | |
| 20185 | + peg$c0 = [], | |
| 20186 | + peg$c1 = function() { return nodes }, | |
| 20187 | + peg$c2 = peg$FAILED, | |
| 20188 | + peg$c3 = "#", | |
| 20189 | + peg$c4 = { type: "literal", value: "#", description: "\"#\"" }, | |
| 20190 | + peg$c5 = void 0, | |
| 20191 | + peg$c6 = { type: "any", description: "any character" }, | |
| 20192 | + peg$c7 = "[", | |
| 20193 | + peg$c8 = { type: "literal", value: "[", description: "\"[\"" }, | |
| 20194 | + peg$c9 = "]", | |
| 20195 | + peg$c10 = { type: "literal", value: "]", description: "\"]\"" }, | |
| 20196 | + peg$c11 = function(name) { addNode(node('ObjectPath', name, line, column)) }, | |
| 20197 | + peg$c12 = function(name) { addNode(node('ArrayPath', name, line, column)) }, | |
| 20198 | + peg$c13 = function(parts, name) { return parts.concat(name) }, | |
| 20199 | + peg$c14 = function(name) { return [name] }, | |
| 20200 | + peg$c15 = function(name) { return name }, | |
| 20201 | + peg$c16 = ".", | |
| 20202 | + peg$c17 = { type: "literal", value: ".", description: "\".\"" }, | |
| 20203 | + peg$c18 = "=", | |
| 20204 | + peg$c19 = { type: "literal", value: "=", description: "\"=\"" }, | |
| 20205 | + peg$c20 = function(key, value) { addNode(node('Assign', value, line, column, key)) }, | |
| 20206 | + peg$c21 = function(chars) { return chars.join('') }, | |
| 20207 | + peg$c22 = function(node) { return node.value }, | |
| 20208 | + peg$c23 = "\"\"\"", | |
| 20209 | + peg$c24 = { type: "literal", value: "\"\"\"", description: "\"\\\"\\\"\\\"\"" }, | |
| 20210 | + peg$c25 = null, | |
| 20211 | + peg$c26 = function(chars) { return node('String', chars.join(''), line, column) }, | |
| 20212 | + peg$c27 = "\"", | |
| 20213 | + peg$c28 = { type: "literal", value: "\"", description: "\"\\\"\"" }, | |
| 20214 | + peg$c29 = "'''", | |
| 20215 | + peg$c30 = { type: "literal", value: "'''", description: "\"'''\"" }, | |
| 20216 | + peg$c31 = "'", | |
| 20217 | + peg$c32 = { type: "literal", value: "'", description: "\"'\"" }, | |
| 20218 | + peg$c33 = function(char) { return char }, | |
| 20219 | + peg$c34 = function(char) { return char}, | |
| 20220 | + peg$c35 = "\\", | |
| 20221 | + peg$c36 = { type: "literal", value: "\\", description: "\"\\\\\"" }, | |
| 20222 | + peg$c37 = function() { return '' }, | |
| 20223 | + peg$c38 = "e", | |
| 20224 | + peg$c39 = { type: "literal", value: "e", description: "\"e\"" }, | |
| 20225 | + peg$c40 = "E", | |
| 20226 | + peg$c41 = { type: "literal", value: "E", description: "\"E\"" }, | |
| 20227 | + peg$c42 = function(left, right) { return node('Float', parseFloat(left + 'e' + right), line, column) }, | |
| 20228 | + peg$c43 = function(text) { return node('Float', parseFloat(text), line, column) }, | |
| 20229 | + peg$c44 = "+", | |
| 20230 | + peg$c45 = { type: "literal", value: "+", description: "\"+\"" }, | |
| 20231 | + peg$c46 = function(digits) { return digits.join('') }, | |
| 20232 | + peg$c47 = "-", | |
| 20233 | + peg$c48 = { type: "literal", value: "-", description: "\"-\"" }, | |
| 20234 | + peg$c49 = function(digits) { return '-' + digits.join('') }, | |
| 20235 | + peg$c50 = function(text) { return node('Integer', parseInt(text, 10), line, column) }, | |
| 20236 | + peg$c51 = "true", | |
| 20237 | + peg$c52 = { type: "literal", value: "true", description: "\"true\"" }, | |
| 20238 | + peg$c53 = function() { return node('Boolean', true, line, column) }, | |
| 20239 | + peg$c54 = "false", | |
| 20240 | + peg$c55 = { type: "literal", value: "false", description: "\"false\"" }, | |
| 20241 | + peg$c56 = function() { return node('Boolean', false, line, column) }, | |
| 20242 | + peg$c57 = function() { return node('Array', [], line, column) }, | |
| 20243 | + peg$c58 = function(value) { return node('Array', value ? [value] : [], line, column) }, | |
| 20244 | + peg$c59 = function(values) { return node('Array', values, line, column) }, | |
| 20245 | + peg$c60 = function(values, value) { return node('Array', values.concat(value), line, column) }, | |
| 20246 | + peg$c61 = function(value) { return value }, | |
| 20247 | + peg$c62 = ",", | |
| 20248 | + peg$c63 = { type: "literal", value: ",", description: "\",\"" }, | |
| 20249 | + peg$c64 = "{", | |
| 20250 | + peg$c65 = { type: "literal", value: "{", description: "\"{\"" }, | |
| 20251 | + peg$c66 = "}", | |
| 20252 | + peg$c67 = { type: "literal", value: "}", description: "\"}\"" }, | |
| 20253 | + peg$c68 = function(values) { return node('InlineTable', values, line, column) }, | |
| 20254 | + peg$c69 = function(key, value) { return node('InlineTableValue', value, line, column, key) }, | |
| 20255 | + peg$c70 = function(digits) { return "." + digits }, | |
| 20256 | + peg$c71 = function(date) { return date.join('') }, | |
| 20257 | + peg$c72 = ":", | |
| 20258 | + peg$c73 = { type: "literal", value: ":", description: "\":\"" }, | |
| 20259 | + peg$c74 = function(time) { return time.join('') }, | |
| 20260 | + peg$c75 = "T", | |
| 20261 | + peg$c76 = { type: "literal", value: "T", description: "\"T\"" }, | |
| 20262 | + peg$c77 = "Z", | |
| 20263 | + peg$c78 = { type: "literal", value: "Z", description: "\"Z\"" }, | |
| 20264 | + peg$c79 = function(date, time) { return node('Date', new Date(date + "T" + time + "Z"), line, column) }, | |
| 20265 | + peg$c80 = function(date, time) { return node('Date', new Date(date + "T" + time), line, column) }, | |
| 20266 | + peg$c81 = /^[ \t]/, | |
| 20267 | + peg$c82 = { type: "class", value: "[ \\t]", description: "[ \\t]" }, | |
| 20268 | + peg$c83 = "\n", | |
| 20269 | + peg$c84 = { type: "literal", value: "\n", description: "\"\\n\"" }, | |
| 20270 | + peg$c85 = "\r", | |
| 20271 | + peg$c86 = { type: "literal", value: "\r", description: "\"\\r\"" }, | |
| 20272 | + peg$c87 = /^[0-9a-f]/i, | |
| 20273 | + peg$c88 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, | |
| 20274 | + peg$c89 = /^[0-9]/, | |
| 20275 | + peg$c90 = { type: "class", value: "[0-9]", description: "[0-9]" }, | |
| 20276 | + peg$c91 = "_", | |
| 20277 | + peg$c92 = { type: "literal", value: "_", description: "\"_\"" }, | |
| 20278 | + peg$c93 = function() { return "" }, | |
| 20279 | + peg$c94 = /^[A-Za-z0-9_\-]/, | |
| 20280 | + peg$c95 = { type: "class", value: "[A-Za-z0-9_\\-]", description: "[A-Za-z0-9_\\-]" }, | |
| 20281 | + peg$c96 = function(d) { return d.join('') }, | |
| 20282 | + peg$c97 = "\\\"", | |
| 20283 | + peg$c98 = { type: "literal", value: "\\\"", description: "\"\\\\\\\"\"" }, | |
| 20284 | + peg$c99 = function() { return '"' }, | |
| 20285 | + peg$c100 = "\\\\", | |
| 20286 | + peg$c101 = { type: "literal", value: "\\\\", description: "\"\\\\\\\\\"" }, | |
| 20287 | + peg$c102 = function() { return '\\' }, | |
| 20288 | + peg$c103 = "\\b", | |
| 20289 | + peg$c104 = { type: "literal", value: "\\b", description: "\"\\\\b\"" }, | |
| 20290 | + peg$c105 = function() { return '\b' }, | |
| 20291 | + peg$c106 = "\\t", | |
| 20292 | + peg$c107 = { type: "literal", value: "\\t", description: "\"\\\\t\"" }, | |
| 20293 | + peg$c108 = function() { return '\t' }, | |
| 20294 | + peg$c109 = "\\n", | |
| 20295 | + peg$c110 = { type: "literal", value: "\\n", description: "\"\\\\n\"" }, | |
| 20296 | + peg$c111 = function() { return '\n' }, | |
| 20297 | + peg$c112 = "\\f", | |
| 20298 | + peg$c113 = { type: "literal", value: "\\f", description: "\"\\\\f\"" }, | |
| 20299 | + peg$c114 = function() { return '\f' }, | |
| 20300 | + peg$c115 = "\\r", | |
| 20301 | + peg$c116 = { type: "literal", value: "\\r", description: "\"\\\\r\"" }, | |
| 20302 | + peg$c117 = function() { return '\r' }, | |
| 20303 | + peg$c118 = "\\U", | |
| 20304 | + peg$c119 = { type: "literal", value: "\\U", description: "\"\\\\U\"" }, | |
| 20305 | + peg$c120 = function(digits) { return convertCodePoint(digits.join('')) }, | |
| 20306 | + peg$c121 = "\\u", | |
| 20307 | + peg$c122 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, | |
| 20308 | + | |
| 20309 | + peg$currPos = 0, | |
| 20310 | + peg$reportedPos = 0, | |
| 20311 | + peg$cachedPos = 0, | |
| 20312 | + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, | |
| 20313 | + peg$maxFailPos = 0, | |
| 20314 | + peg$maxFailExpected = [], | |
| 20315 | + peg$silentFails = 0, | |
| 20316 | + | |
| 20317 | + peg$cache = {}, | |
| 20318 | + peg$result; | |
| 20319 | + | |
| 20320 | + if ("startRule" in options) { | |
| 20321 | + if (!(options.startRule in peg$startRuleFunctions)) { | |
| 20322 | + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); | |
| 20323 | + } | |
| 20324 | + | |
| 20325 | + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; | |
| 20326 | + } | |
| 20327 | + | |
| 20328 | + function text() { | |
| 20329 | + return input.substring(peg$reportedPos, peg$currPos); | |
| 20330 | + } | |
| 20331 | + | |
| 20332 | + function offset() { | |
| 20333 | + return peg$reportedPos; | |
| 20334 | + } | |
| 20335 | + | |
| 20336 | + function line() { | |
| 20337 | + return peg$computePosDetails(peg$reportedPos).line; | |
| 20338 | + } | |
| 20339 | + | |
| 20340 | + function column() { | |
| 20341 | + return peg$computePosDetails(peg$reportedPos).column; | |
| 20342 | + } | |
| 20343 | + | |
| 20344 | + function expected(description) { | |
| 20345 | + throw peg$buildException( | |
| 20346 | + null, | |
| 20347 | + [{ type: "other", description: description }], | |
| 20348 | + peg$reportedPos | |
| 20349 | + ); | |
| 20350 | + } | |
| 20351 | + | |
| 20352 | + function error(message) { | |
| 20353 | + throw peg$buildException(message, null, peg$reportedPos); | |
| 20354 | + } | |
| 20355 | + | |
| 20356 | + function peg$computePosDetails(pos) { | |
| 20357 | + function advance(details, startPos, endPos) { | |
| 20358 | + var p, ch; | |
| 20359 | + | |
| 20360 | + for (p = startPos; p < endPos; p++) { | |
| 20361 | + ch = input.charAt(p); | |
| 20362 | + if (ch === "\n") { | |
| 20363 | + if (!details.seenCR) { details.line++; } | |
| 20364 | + details.column = 1; | |
| 20365 | + details.seenCR = false; | |
| 20366 | + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { | |
| 20367 | + details.line++; | |
| 20368 | + details.column = 1; | |
| 20369 | + details.seenCR = true; | |
| 20370 | + } else { | |
| 20371 | + details.column++; | |
| 20372 | + details.seenCR = false; | |
| 20373 | + } | |
| 20374 | + } | |
| 20375 | + } | |
| 20376 | + | |
| 20377 | + if (peg$cachedPos !== pos) { | |
| 20378 | + if (peg$cachedPos > pos) { | |
| 20379 | + peg$cachedPos = 0; | |
| 20380 | + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; | |
| 20381 | + } | |
| 20382 | + advance(peg$cachedPosDetails, peg$cachedPos, pos); | |
| 20383 | + peg$cachedPos = pos; | |
| 20384 | + } | |
| 20385 | + | |
| 20386 | + return peg$cachedPosDetails; | |
| 20387 | + } | |
| 20388 | + | |
| 20389 | + function peg$fail(expected) { | |
| 20390 | + if (peg$currPos < peg$maxFailPos) { return; } | |
| 20391 | + | |
| 20392 | + if (peg$currPos > peg$maxFailPos) { | |
| 20393 | + peg$maxFailPos = peg$currPos; | |
| 20394 | + peg$maxFailExpected = []; | |
| 20395 | + } | |
| 20396 | + | |
| 20397 | + peg$maxFailExpected.push(expected); | |
| 20398 | + } | |
| 20399 | + | |
| 20400 | + function peg$buildException(message, expected, pos) { | |
| 20401 | + function cleanupExpected(expected) { | |
| 20402 | + var i = 1; | |
| 20403 | + | |
| 20404 | + expected.sort(function(a, b) { | |
| 20405 | + if (a.description < b.description) { | |
| 20406 | + return -1; | |
| 20407 | + } else if (a.description > b.description) { | |
| 20408 | + return 1; | |
| 20409 | + } else { | |
| 20410 | + return 0; | |
| 20411 | + } | |
| 20412 | + }); | |
| 20413 | + | |
| 20414 | + while (i < expected.length) { | |
| 20415 | + if (expected[i - 1] === expected[i]) { | |
| 20416 | + expected.splice(i, 1); | |
| 20417 | + } else { | |
| 20418 | + i++; | |
| 20419 | + } | |
| 20420 | + } | |
| 20421 | + } | |
| 20422 | + | |
| 20423 | + function buildMessage(expected, found) { | |
| 20424 | + function stringEscape(s) { | |
| 20425 | + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } | |
| 20426 | + | |
| 20427 | + return s | |
| 20428 | + .replace(/\\/g, '\\\\') | |
| 20429 | + .replace(/"/g, '\\"') | |
| 20430 | + .replace(/\x08/g, '\\b') | |
| 20431 | + .replace(/\t/g, '\\t') | |
| 20432 | + .replace(/\n/g, '\\n') | |
| 20433 | + .replace(/\f/g, '\\f') | |
| 20434 | + .replace(/\r/g, '\\r') | |
| 20435 | + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) | |
| 20436 | + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) | |
| 20437 | + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) | |
| 20438 | + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); | |
| 20439 | + } | |
| 20440 | + | |
| 20441 | + var expectedDescs = new Array(expected.length), | |
| 20442 | + expectedDesc, foundDesc, i; | |
| 20443 | + | |
| 20444 | + for (i = 0; i < expected.length; i++) { | |
| 20445 | + expectedDescs[i] = expected[i].description; | |
| 20446 | + } | |
| 20447 | + | |
| 20448 | + expectedDesc = expected.length > 1 | |
| 20449 | + ? expectedDescs.slice(0, -1).join(", ") | |
| 20450 | + + " or " | |
| 20451 | + + expectedDescs[expected.length - 1] | |
| 20452 | + : expectedDescs[0]; | |
| 20453 | + | |
| 20454 | + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; | |
| 20455 | + | |
| 20456 | + return "Expected " + expectedDesc + " but " + foundDesc + " found."; | |
| 20457 | + } | |
| 20458 | + | |
| 20459 | + var posDetails = peg$computePosDetails(pos), | |
| 20460 | + found = pos < input.length ? input.charAt(pos) : null; | |
| 20461 | + | |
| 20462 | + if (expected !== null) { | |
| 20463 | + cleanupExpected(expected); | |
| 20464 | + } | |
| 20465 | + | |
| 20466 | + return new SyntaxError( | |
| 20467 | + message !== null ? message : buildMessage(expected, found), | |
| 20468 | + expected, | |
| 20469 | + found, | |
| 20470 | + pos, | |
| 20471 | + posDetails.line, | |
| 20472 | + posDetails.column | |
| 20473 | + ); | |
| 20474 | + } | |
| 20475 | + | |
| 20476 | + function peg$parsestart() { | |
| 20477 | + var s0, s1, s2; | |
| 20478 | + | |
| 20479 | + var key = peg$currPos * 49 + 0, | |
| 20480 | + cached = peg$cache[key]; | |
| 20481 | + | |
| 20482 | + if (cached) { | |
| 20483 | + peg$currPos = cached.nextPos; | |
| 20484 | + return cached.result; | |
| 20485 | + } | |
| 20486 | + | |
| 20487 | + s0 = peg$currPos; | |
| 20488 | + s1 = []; | |
| 20489 | + s2 = peg$parseline(); | |
| 20490 | + while (s2 !== peg$FAILED) { | |
| 20491 | + s1.push(s2); | |
| 20492 | + s2 = peg$parseline(); | |
| 20493 | + } | |
| 20494 | + if (s1 !== peg$FAILED) { | |
| 20495 | + peg$reportedPos = s0; | |
| 20496 | + s1 = peg$c1(); | |
| 20497 | + } | |
| 20498 | + s0 = s1; | |
| 20499 | + | |
| 20500 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20501 | + | |
| 20502 | + return s0; | |
| 20503 | + } | |
| 20504 | + | |
| 20505 | + function peg$parseline() { | |
| 20506 | + var s0, s1, s2, s3, s4, s5, s6; | |
| 20507 | + | |
| 20508 | + var key = peg$currPos * 49 + 1, | |
| 20509 | + cached = peg$cache[key]; | |
| 20510 | + | |
| 20511 | + if (cached) { | |
| 20512 | + peg$currPos = cached.nextPos; | |
| 20513 | + return cached.result; | |
| 20514 | + } | |
| 20515 | + | |
| 20516 | + s0 = peg$currPos; | |
| 20517 | + s1 = []; | |
| 20518 | + s2 = peg$parseS(); | |
| 20519 | + while (s2 !== peg$FAILED) { | |
| 20520 | + s1.push(s2); | |
| 20521 | + s2 = peg$parseS(); | |
| 20522 | + } | |
| 20523 | + if (s1 !== peg$FAILED) { | |
| 20524 | + s2 = peg$parseexpression(); | |
| 20525 | + if (s2 !== peg$FAILED) { | |
| 20526 | + s3 = []; | |
| 20527 | + s4 = peg$parseS(); | |
| 20528 | + while (s4 !== peg$FAILED) { | |
| 20529 | + s3.push(s4); | |
| 20530 | + s4 = peg$parseS(); | |
| 20531 | + } | |
| 20532 | + if (s3 !== peg$FAILED) { | |
| 20533 | + s4 = []; | |
| 20534 | + s5 = peg$parsecomment(); | |
| 20535 | + while (s5 !== peg$FAILED) { | |
| 20536 | + s4.push(s5); | |
| 20537 | + s5 = peg$parsecomment(); | |
| 20538 | + } | |
| 20539 | + if (s4 !== peg$FAILED) { | |
| 20540 | + s5 = []; | |
| 20541 | + s6 = peg$parseNL(); | |
| 20542 | + if (s6 !== peg$FAILED) { | |
| 20543 | + while (s6 !== peg$FAILED) { | |
| 20544 | + s5.push(s6); | |
| 20545 | + s6 = peg$parseNL(); | |
| 20546 | + } | |
| 20547 | + } else { | |
| 20548 | + s5 = peg$c2; | |
| 20549 | + } | |
| 20550 | + if (s5 === peg$FAILED) { | |
| 20551 | + s5 = peg$parseEOF(); | |
| 20552 | + } | |
| 20553 | + if (s5 !== peg$FAILED) { | |
| 20554 | + s1 = [s1, s2, s3, s4, s5]; | |
| 20555 | + s0 = s1; | |
| 20556 | + } else { | |
| 20557 | + peg$currPos = s0; | |
| 20558 | + s0 = peg$c2; | |
| 20559 | + } | |
| 20560 | + } else { | |
| 20561 | + peg$currPos = s0; | |
| 20562 | + s0 = peg$c2; | |
| 20563 | + } | |
| 20564 | + } else { | |
| 20565 | + peg$currPos = s0; | |
| 20566 | + s0 = peg$c2; | |
| 20567 | + } | |
| 20568 | + } else { | |
| 20569 | + peg$currPos = s0; | |
| 20570 | + s0 = peg$c2; | |
| 20571 | + } | |
| 20572 | + } else { | |
| 20573 | + peg$currPos = s0; | |
| 20574 | + s0 = peg$c2; | |
| 20575 | + } | |
| 20576 | + if (s0 === peg$FAILED) { | |
| 20577 | + s0 = peg$currPos; | |
| 20578 | + s1 = []; | |
| 20579 | + s2 = peg$parseS(); | |
| 20580 | + if (s2 !== peg$FAILED) { | |
| 20581 | + while (s2 !== peg$FAILED) { | |
| 20582 | + s1.push(s2); | |
| 20583 | + s2 = peg$parseS(); | |
| 20584 | + } | |
| 20585 | + } else { | |
| 20586 | + s1 = peg$c2; | |
| 20587 | + } | |
| 20588 | + if (s1 !== peg$FAILED) { | |
| 20589 | + s2 = []; | |
| 20590 | + s3 = peg$parseNL(); | |
| 20591 | + if (s3 !== peg$FAILED) { | |
| 20592 | + while (s3 !== peg$FAILED) { | |
| 20593 | + s2.push(s3); | |
| 20594 | + s3 = peg$parseNL(); | |
| 20595 | + } | |
| 20596 | + } else { | |
| 20597 | + s2 = peg$c2; | |
| 20598 | + } | |
| 20599 | + if (s2 === peg$FAILED) { | |
| 20600 | + s2 = peg$parseEOF(); | |
| 20601 | + } | |
| 20602 | + if (s2 !== peg$FAILED) { | |
| 20603 | + s1 = [s1, s2]; | |
| 20604 | + s0 = s1; | |
| 20605 | + } else { | |
| 20606 | + peg$currPos = s0; | |
| 20607 | + s0 = peg$c2; | |
| 20608 | + } | |
| 20609 | + } else { | |
| 20610 | + peg$currPos = s0; | |
| 20611 | + s0 = peg$c2; | |
| 20612 | + } | |
| 20613 | + if (s0 === peg$FAILED) { | |
| 20614 | + s0 = peg$parseNL(); | |
| 20615 | + } | |
| 20616 | + } | |
| 20617 | + | |
| 20618 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20619 | + | |
| 20620 | + return s0; | |
| 20621 | + } | |
| 20622 | + | |
| 20623 | + function peg$parseexpression() { | |
| 20624 | + var s0; | |
| 20625 | + | |
| 20626 | + var key = peg$currPos * 49 + 2, | |
| 20627 | + cached = peg$cache[key]; | |
| 20628 | + | |
| 20629 | + if (cached) { | |
| 20630 | + peg$currPos = cached.nextPos; | |
| 20631 | + return cached.result; | |
| 20632 | + } | |
| 20633 | + | |
| 20634 | + s0 = peg$parsecomment(); | |
| 20635 | + if (s0 === peg$FAILED) { | |
| 20636 | + s0 = peg$parsepath(); | |
| 20637 | + if (s0 === peg$FAILED) { | |
| 20638 | + s0 = peg$parsetablearray(); | |
| 20639 | + if (s0 === peg$FAILED) { | |
| 20640 | + s0 = peg$parseassignment(); | |
| 20641 | + } | |
| 20642 | + } | |
| 20643 | + } | |
| 20644 | + | |
| 20645 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20646 | + | |
| 20647 | + return s0; | |
| 20648 | + } | |
| 20649 | + | |
| 20650 | + function peg$parsecomment() { | |
| 20651 | + var s0, s1, s2, s3, s4, s5; | |
| 20652 | + | |
| 20653 | + var key = peg$currPos * 49 + 3, | |
| 20654 | + cached = peg$cache[key]; | |
| 20655 | + | |
| 20656 | + if (cached) { | |
| 20657 | + peg$currPos = cached.nextPos; | |
| 20658 | + return cached.result; | |
| 20659 | + } | |
| 20660 | + | |
| 20661 | + s0 = peg$currPos; | |
| 20662 | + if (input.charCodeAt(peg$currPos) === 35) { | |
| 20663 | + s1 = peg$c3; | |
| 20664 | + peg$currPos++; | |
| 20665 | + } else { | |
| 20666 | + s1 = peg$FAILED; | |
| 20667 | + if (peg$silentFails === 0) { peg$fail(peg$c4); } | |
| 20668 | + } | |
| 20669 | + if (s1 !== peg$FAILED) { | |
| 20670 | + s2 = []; | |
| 20671 | + s3 = peg$currPos; | |
| 20672 | + s4 = peg$currPos; | |
| 20673 | + peg$silentFails++; | |
| 20674 | + s5 = peg$parseNL(); | |
| 20675 | + if (s5 === peg$FAILED) { | |
| 20676 | + s5 = peg$parseEOF(); | |
| 20677 | + } | |
| 20678 | + peg$silentFails--; | |
| 20679 | + if (s5 === peg$FAILED) { | |
| 20680 | + s4 = peg$c5; | |
| 20681 | + } else { | |
| 20682 | + peg$currPos = s4; | |
| 20683 | + s4 = peg$c2; | |
| 20684 | + } | |
| 20685 | + if (s4 !== peg$FAILED) { | |
| 20686 | + if (input.length > peg$currPos) { | |
| 20687 | + s5 = input.charAt(peg$currPos); | |
| 20688 | + peg$currPos++; | |
| 20689 | + } else { | |
| 20690 | + s5 = peg$FAILED; | |
| 20691 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 20692 | + } | |
| 20693 | + if (s5 !== peg$FAILED) { | |
| 20694 | + s4 = [s4, s5]; | |
| 20695 | + s3 = s4; | |
| 20696 | + } else { | |
| 20697 | + peg$currPos = s3; | |
| 20698 | + s3 = peg$c2; | |
| 20699 | + } | |
| 20700 | + } else { | |
| 20701 | + peg$currPos = s3; | |
| 20702 | + s3 = peg$c2; | |
| 20703 | + } | |
| 20704 | + while (s3 !== peg$FAILED) { | |
| 20705 | + s2.push(s3); | |
| 20706 | + s3 = peg$currPos; | |
| 20707 | + s4 = peg$currPos; | |
| 20708 | + peg$silentFails++; | |
| 20709 | + s5 = peg$parseNL(); | |
| 20710 | + if (s5 === peg$FAILED) { | |
| 20711 | + s5 = peg$parseEOF(); | |
| 20712 | + } | |
| 20713 | + peg$silentFails--; | |
| 20714 | + if (s5 === peg$FAILED) { | |
| 20715 | + s4 = peg$c5; | |
| 20716 | + } else { | |
| 20717 | + peg$currPos = s4; | |
| 20718 | + s4 = peg$c2; | |
| 20719 | + } | |
| 20720 | + if (s4 !== peg$FAILED) { | |
| 20721 | + if (input.length > peg$currPos) { | |
| 20722 | + s5 = input.charAt(peg$currPos); | |
| 20723 | + peg$currPos++; | |
| 20724 | + } else { | |
| 20725 | + s5 = peg$FAILED; | |
| 20726 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 20727 | + } | |
| 20728 | + if (s5 !== peg$FAILED) { | |
| 20729 | + s4 = [s4, s5]; | |
| 20730 | + s3 = s4; | |
| 20731 | + } else { | |
| 20732 | + peg$currPos = s3; | |
| 20733 | + s3 = peg$c2; | |
| 20734 | + } | |
| 20735 | + } else { | |
| 20736 | + peg$currPos = s3; | |
| 20737 | + s3 = peg$c2; | |
| 20738 | + } | |
| 20739 | + } | |
| 20740 | + if (s2 !== peg$FAILED) { | |
| 20741 | + s1 = [s1, s2]; | |
| 20742 | + s0 = s1; | |
| 20743 | + } else { | |
| 20744 | + peg$currPos = s0; | |
| 20745 | + s0 = peg$c2; | |
| 20746 | + } | |
| 20747 | + } else { | |
| 20748 | + peg$currPos = s0; | |
| 20749 | + s0 = peg$c2; | |
| 20750 | + } | |
| 20751 | + | |
| 20752 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20753 | + | |
| 20754 | + return s0; | |
| 20755 | + } | |
| 20756 | + | |
| 20757 | + function peg$parsepath() { | |
| 20758 | + var s0, s1, s2, s3, s4, s5; | |
| 20759 | + | |
| 20760 | + var key = peg$currPos * 49 + 4, | |
| 20761 | + cached = peg$cache[key]; | |
| 20762 | + | |
| 20763 | + if (cached) { | |
| 20764 | + peg$currPos = cached.nextPos; | |
| 20765 | + return cached.result; | |
| 20766 | + } | |
| 20767 | + | |
| 20768 | + s0 = peg$currPos; | |
| 20769 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 20770 | + s1 = peg$c7; | |
| 20771 | + peg$currPos++; | |
| 20772 | + } else { | |
| 20773 | + s1 = peg$FAILED; | |
| 20774 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 20775 | + } | |
| 20776 | + if (s1 !== peg$FAILED) { | |
| 20777 | + s2 = []; | |
| 20778 | + s3 = peg$parseS(); | |
| 20779 | + while (s3 !== peg$FAILED) { | |
| 20780 | + s2.push(s3); | |
| 20781 | + s3 = peg$parseS(); | |
| 20782 | + } | |
| 20783 | + if (s2 !== peg$FAILED) { | |
| 20784 | + s3 = peg$parsetable_key(); | |
| 20785 | + if (s3 !== peg$FAILED) { | |
| 20786 | + s4 = []; | |
| 20787 | + s5 = peg$parseS(); | |
| 20788 | + while (s5 !== peg$FAILED) { | |
| 20789 | + s4.push(s5); | |
| 20790 | + s5 = peg$parseS(); | |
| 20791 | + } | |
| 20792 | + if (s4 !== peg$FAILED) { | |
| 20793 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 20794 | + s5 = peg$c9; | |
| 20795 | + peg$currPos++; | |
| 20796 | + } else { | |
| 20797 | + s5 = peg$FAILED; | |
| 20798 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 20799 | + } | |
| 20800 | + if (s5 !== peg$FAILED) { | |
| 20801 | + peg$reportedPos = s0; | |
| 20802 | + s1 = peg$c11(s3); | |
| 20803 | + s0 = s1; | |
| 20804 | + } else { | |
| 20805 | + peg$currPos = s0; | |
| 20806 | + s0 = peg$c2; | |
| 20807 | + } | |
| 20808 | + } else { | |
| 20809 | + peg$currPos = s0; | |
| 20810 | + s0 = peg$c2; | |
| 20811 | + } | |
| 20812 | + } else { | |
| 20813 | + peg$currPos = s0; | |
| 20814 | + s0 = peg$c2; | |
| 20815 | + } | |
| 20816 | + } else { | |
| 20817 | + peg$currPos = s0; | |
| 20818 | + s0 = peg$c2; | |
| 20819 | + } | |
| 20820 | + } else { | |
| 20821 | + peg$currPos = s0; | |
| 20822 | + s0 = peg$c2; | |
| 20823 | + } | |
| 20824 | + | |
| 20825 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20826 | + | |
| 20827 | + return s0; | |
| 20828 | + } | |
| 20829 | + | |
| 20830 | + function peg$parsetablearray() { | |
| 20831 | + var s0, s1, s2, s3, s4, s5, s6, s7; | |
| 20832 | + | |
| 20833 | + var key = peg$currPos * 49 + 5, | |
| 20834 | + cached = peg$cache[key]; | |
| 20835 | + | |
| 20836 | + if (cached) { | |
| 20837 | + peg$currPos = cached.nextPos; | |
| 20838 | + return cached.result; | |
| 20839 | + } | |
| 20840 | + | |
| 20841 | + s0 = peg$currPos; | |
| 20842 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 20843 | + s1 = peg$c7; | |
| 20844 | + peg$currPos++; | |
| 20845 | + } else { | |
| 20846 | + s1 = peg$FAILED; | |
| 20847 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 20848 | + } | |
| 20849 | + if (s1 !== peg$FAILED) { | |
| 20850 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 20851 | + s2 = peg$c7; | |
| 20852 | + peg$currPos++; | |
| 20853 | + } else { | |
| 20854 | + s2 = peg$FAILED; | |
| 20855 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 20856 | + } | |
| 20857 | + if (s2 !== peg$FAILED) { | |
| 20858 | + s3 = []; | |
| 20859 | + s4 = peg$parseS(); | |
| 20860 | + while (s4 !== peg$FAILED) { | |
| 20861 | + s3.push(s4); | |
| 20862 | + s4 = peg$parseS(); | |
| 20863 | + } | |
| 20864 | + if (s3 !== peg$FAILED) { | |
| 20865 | + s4 = peg$parsetable_key(); | |
| 20866 | + if (s4 !== peg$FAILED) { | |
| 20867 | + s5 = []; | |
| 20868 | + s6 = peg$parseS(); | |
| 20869 | + while (s6 !== peg$FAILED) { | |
| 20870 | + s5.push(s6); | |
| 20871 | + s6 = peg$parseS(); | |
| 20872 | + } | |
| 20873 | + if (s5 !== peg$FAILED) { | |
| 20874 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 20875 | + s6 = peg$c9; | |
| 20876 | + peg$currPos++; | |
| 20877 | + } else { | |
| 20878 | + s6 = peg$FAILED; | |
| 20879 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 20880 | + } | |
| 20881 | + if (s6 !== peg$FAILED) { | |
| 20882 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 20883 | + s7 = peg$c9; | |
| 20884 | + peg$currPos++; | |
| 20885 | + } else { | |
| 20886 | + s7 = peg$FAILED; | |
| 20887 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 20888 | + } | |
| 20889 | + if (s7 !== peg$FAILED) { | |
| 20890 | + peg$reportedPos = s0; | |
| 20891 | + s1 = peg$c12(s4); | |
| 20892 | + s0 = s1; | |
| 20893 | + } else { | |
| 20894 | + peg$currPos = s0; | |
| 20895 | + s0 = peg$c2; | |
| 20896 | + } | |
| 20897 | + } else { | |
| 20898 | + peg$currPos = s0; | |
| 20899 | + s0 = peg$c2; | |
| 20900 | + } | |
| 20901 | + } else { | |
| 20902 | + peg$currPos = s0; | |
| 20903 | + s0 = peg$c2; | |
| 20904 | + } | |
| 20905 | + } else { | |
| 20906 | + peg$currPos = s0; | |
| 20907 | + s0 = peg$c2; | |
| 20908 | + } | |
| 20909 | + } else { | |
| 20910 | + peg$currPos = s0; | |
| 20911 | + s0 = peg$c2; | |
| 20912 | + } | |
| 20913 | + } else { | |
| 20914 | + peg$currPos = s0; | |
| 20915 | + s0 = peg$c2; | |
| 20916 | + } | |
| 20917 | + } else { | |
| 20918 | + peg$currPos = s0; | |
| 20919 | + s0 = peg$c2; | |
| 20920 | + } | |
| 20921 | + | |
| 20922 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20923 | + | |
| 20924 | + return s0; | |
| 20925 | + } | |
| 20926 | + | |
| 20927 | + function peg$parsetable_key() { | |
| 20928 | + var s0, s1, s2; | |
| 20929 | + | |
| 20930 | + var key = peg$currPos * 49 + 6, | |
| 20931 | + cached = peg$cache[key]; | |
| 20932 | + | |
| 20933 | + if (cached) { | |
| 20934 | + peg$currPos = cached.nextPos; | |
| 20935 | + return cached.result; | |
| 20936 | + } | |
| 20937 | + | |
| 20938 | + s0 = peg$currPos; | |
| 20939 | + s1 = []; | |
| 20940 | + s2 = peg$parsedot_ended_table_key_part(); | |
| 20941 | + if (s2 !== peg$FAILED) { | |
| 20942 | + while (s2 !== peg$FAILED) { | |
| 20943 | + s1.push(s2); | |
| 20944 | + s2 = peg$parsedot_ended_table_key_part(); | |
| 20945 | + } | |
| 20946 | + } else { | |
| 20947 | + s1 = peg$c2; | |
| 20948 | + } | |
| 20949 | + if (s1 !== peg$FAILED) { | |
| 20950 | + s2 = peg$parsetable_key_part(); | |
| 20951 | + if (s2 !== peg$FAILED) { | |
| 20952 | + peg$reportedPos = s0; | |
| 20953 | + s1 = peg$c13(s1, s2); | |
| 20954 | + s0 = s1; | |
| 20955 | + } else { | |
| 20956 | + peg$currPos = s0; | |
| 20957 | + s0 = peg$c2; | |
| 20958 | + } | |
| 20959 | + } else { | |
| 20960 | + peg$currPos = s0; | |
| 20961 | + s0 = peg$c2; | |
| 20962 | + } | |
| 20963 | + if (s0 === peg$FAILED) { | |
| 20964 | + s0 = peg$currPos; | |
| 20965 | + s1 = peg$parsetable_key_part(); | |
| 20966 | + if (s1 !== peg$FAILED) { | |
| 20967 | + peg$reportedPos = s0; | |
| 20968 | + s1 = peg$c14(s1); | |
| 20969 | + } | |
| 20970 | + s0 = s1; | |
| 20971 | + } | |
| 20972 | + | |
| 20973 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 20974 | + | |
| 20975 | + return s0; | |
| 20976 | + } | |
| 20977 | + | |
| 20978 | + function peg$parsetable_key_part() { | |
| 20979 | + var s0, s1, s2, s3, s4; | |
| 20980 | + | |
| 20981 | + var key = peg$currPos * 49 + 7, | |
| 20982 | + cached = peg$cache[key]; | |
| 20983 | + | |
| 20984 | + if (cached) { | |
| 20985 | + peg$currPos = cached.nextPos; | |
| 20986 | + return cached.result; | |
| 20987 | + } | |
| 20988 | + | |
| 20989 | + s0 = peg$currPos; | |
| 20990 | + s1 = []; | |
| 20991 | + s2 = peg$parseS(); | |
| 20992 | + while (s2 !== peg$FAILED) { | |
| 20993 | + s1.push(s2); | |
| 20994 | + s2 = peg$parseS(); | |
| 20995 | + } | |
| 20996 | + if (s1 !== peg$FAILED) { | |
| 20997 | + s2 = peg$parsekey(); | |
| 20998 | + if (s2 !== peg$FAILED) { | |
| 20999 | + s3 = []; | |
| 21000 | + s4 = peg$parseS(); | |
| 21001 | + while (s4 !== peg$FAILED) { | |
| 21002 | + s3.push(s4); | |
| 21003 | + s4 = peg$parseS(); | |
| 21004 | + } | |
| 21005 | + if (s3 !== peg$FAILED) { | |
| 21006 | + peg$reportedPos = s0; | |
| 21007 | + s1 = peg$c15(s2); | |
| 21008 | + s0 = s1; | |
| 21009 | + } else { | |
| 21010 | + peg$currPos = s0; | |
| 21011 | + s0 = peg$c2; | |
| 21012 | + } | |
| 21013 | + } else { | |
| 21014 | + peg$currPos = s0; | |
| 21015 | + s0 = peg$c2; | |
| 21016 | + } | |
| 21017 | + } else { | |
| 21018 | + peg$currPos = s0; | |
| 21019 | + s0 = peg$c2; | |
| 21020 | + } | |
| 21021 | + if (s0 === peg$FAILED) { | |
| 21022 | + s0 = peg$currPos; | |
| 21023 | + s1 = []; | |
| 21024 | + s2 = peg$parseS(); | |
| 21025 | + while (s2 !== peg$FAILED) { | |
| 21026 | + s1.push(s2); | |
| 21027 | + s2 = peg$parseS(); | |
| 21028 | + } | |
| 21029 | + if (s1 !== peg$FAILED) { | |
| 21030 | + s2 = peg$parsequoted_key(); | |
| 21031 | + if (s2 !== peg$FAILED) { | |
| 21032 | + s3 = []; | |
| 21033 | + s4 = peg$parseS(); | |
| 21034 | + while (s4 !== peg$FAILED) { | |
| 21035 | + s3.push(s4); | |
| 21036 | + s4 = peg$parseS(); | |
| 21037 | + } | |
| 21038 | + if (s3 !== peg$FAILED) { | |
| 21039 | + peg$reportedPos = s0; | |
| 21040 | + s1 = peg$c15(s2); | |
| 21041 | + s0 = s1; | |
| 21042 | + } else { | |
| 21043 | + peg$currPos = s0; | |
| 21044 | + s0 = peg$c2; | |
| 21045 | + } | |
| 21046 | + } else { | |
| 21047 | + peg$currPos = s0; | |
| 21048 | + s0 = peg$c2; | |
| 21049 | + } | |
| 21050 | + } else { | |
| 21051 | + peg$currPos = s0; | |
| 21052 | + s0 = peg$c2; | |
| 21053 | + } | |
| 21054 | + } | |
| 21055 | + | |
| 21056 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21057 | + | |
| 21058 | + return s0; | |
| 21059 | + } | |
| 21060 | + | |
| 21061 | + function peg$parsedot_ended_table_key_part() { | |
| 21062 | + var s0, s1, s2, s3, s4, s5, s6; | |
| 21063 | + | |
| 21064 | + var key = peg$currPos * 49 + 8, | |
| 21065 | + cached = peg$cache[key]; | |
| 21066 | + | |
| 21067 | + if (cached) { | |
| 21068 | + peg$currPos = cached.nextPos; | |
| 21069 | + return cached.result; | |
| 21070 | + } | |
| 21071 | + | |
| 21072 | + s0 = peg$currPos; | |
| 21073 | + s1 = []; | |
| 21074 | + s2 = peg$parseS(); | |
| 21075 | + while (s2 !== peg$FAILED) { | |
| 21076 | + s1.push(s2); | |
| 21077 | + s2 = peg$parseS(); | |
| 21078 | + } | |
| 21079 | + if (s1 !== peg$FAILED) { | |
| 21080 | + s2 = peg$parsekey(); | |
| 21081 | + if (s2 !== peg$FAILED) { | |
| 21082 | + s3 = []; | |
| 21083 | + s4 = peg$parseS(); | |
| 21084 | + while (s4 !== peg$FAILED) { | |
| 21085 | + s3.push(s4); | |
| 21086 | + s4 = peg$parseS(); | |
| 21087 | + } | |
| 21088 | + if (s3 !== peg$FAILED) { | |
| 21089 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 21090 | + s4 = peg$c16; | |
| 21091 | + peg$currPos++; | |
| 21092 | + } else { | |
| 21093 | + s4 = peg$FAILED; | |
| 21094 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 21095 | + } | |
| 21096 | + if (s4 !== peg$FAILED) { | |
| 21097 | + s5 = []; | |
| 21098 | + s6 = peg$parseS(); | |
| 21099 | + while (s6 !== peg$FAILED) { | |
| 21100 | + s5.push(s6); | |
| 21101 | + s6 = peg$parseS(); | |
| 21102 | + } | |
| 21103 | + if (s5 !== peg$FAILED) { | |
| 21104 | + peg$reportedPos = s0; | |
| 21105 | + s1 = peg$c15(s2); | |
| 21106 | + s0 = s1; | |
| 21107 | + } else { | |
| 21108 | + peg$currPos = s0; | |
| 21109 | + s0 = peg$c2; | |
| 21110 | + } | |
| 21111 | + } else { | |
| 21112 | + peg$currPos = s0; | |
| 21113 | + s0 = peg$c2; | |
| 21114 | + } | |
| 21115 | + } else { | |
| 21116 | + peg$currPos = s0; | |
| 21117 | + s0 = peg$c2; | |
| 21118 | + } | |
| 21119 | + } else { | |
| 21120 | + peg$currPos = s0; | |
| 21121 | + s0 = peg$c2; | |
| 21122 | + } | |
| 21123 | + } else { | |
| 21124 | + peg$currPos = s0; | |
| 21125 | + s0 = peg$c2; | |
| 21126 | + } | |
| 21127 | + if (s0 === peg$FAILED) { | |
| 21128 | + s0 = peg$currPos; | |
| 21129 | + s1 = []; | |
| 21130 | + s2 = peg$parseS(); | |
| 21131 | + while (s2 !== peg$FAILED) { | |
| 21132 | + s1.push(s2); | |
| 21133 | + s2 = peg$parseS(); | |
| 21134 | + } | |
| 21135 | + if (s1 !== peg$FAILED) { | |
| 21136 | + s2 = peg$parsequoted_key(); | |
| 21137 | + if (s2 !== peg$FAILED) { | |
| 21138 | + s3 = []; | |
| 21139 | + s4 = peg$parseS(); | |
| 21140 | + while (s4 !== peg$FAILED) { | |
| 21141 | + s3.push(s4); | |
| 21142 | + s4 = peg$parseS(); | |
| 21143 | + } | |
| 21144 | + if (s3 !== peg$FAILED) { | |
| 21145 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 21146 | + s4 = peg$c16; | |
| 21147 | + peg$currPos++; | |
| 21148 | + } else { | |
| 21149 | + s4 = peg$FAILED; | |
| 21150 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 21151 | + } | |
| 21152 | + if (s4 !== peg$FAILED) { | |
| 21153 | + s5 = []; | |
| 21154 | + s6 = peg$parseS(); | |
| 21155 | + while (s6 !== peg$FAILED) { | |
| 21156 | + s5.push(s6); | |
| 21157 | + s6 = peg$parseS(); | |
| 21158 | + } | |
| 21159 | + if (s5 !== peg$FAILED) { | |
| 21160 | + peg$reportedPos = s0; | |
| 21161 | + s1 = peg$c15(s2); | |
| 21162 | + s0 = s1; | |
| 21163 | + } else { | |
| 21164 | + peg$currPos = s0; | |
| 21165 | + s0 = peg$c2; | |
| 21166 | + } | |
| 21167 | + } else { | |
| 21168 | + peg$currPos = s0; | |
| 21169 | + s0 = peg$c2; | |
| 21170 | + } | |
| 21171 | + } else { | |
| 21172 | + peg$currPos = s0; | |
| 21173 | + s0 = peg$c2; | |
| 21174 | + } | |
| 21175 | + } else { | |
| 21176 | + peg$currPos = s0; | |
| 21177 | + s0 = peg$c2; | |
| 21178 | + } | |
| 21179 | + } else { | |
| 21180 | + peg$currPos = s0; | |
| 21181 | + s0 = peg$c2; | |
| 21182 | + } | |
| 21183 | + } | |
| 21184 | + | |
| 21185 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21186 | + | |
| 21187 | + return s0; | |
| 21188 | + } | |
| 21189 | + | |
| 21190 | + function peg$parseassignment() { | |
| 21191 | + var s0, s1, s2, s3, s4, s5; | |
| 21192 | + | |
| 21193 | + var key = peg$currPos * 49 + 9, | |
| 21194 | + cached = peg$cache[key]; | |
| 21195 | + | |
| 21196 | + if (cached) { | |
| 21197 | + peg$currPos = cached.nextPos; | |
| 21198 | + return cached.result; | |
| 21199 | + } | |
| 21200 | + | |
| 21201 | + s0 = peg$currPos; | |
| 21202 | + s1 = peg$parsekey(); | |
| 21203 | + if (s1 !== peg$FAILED) { | |
| 21204 | + s2 = []; | |
| 21205 | + s3 = peg$parseS(); | |
| 21206 | + while (s3 !== peg$FAILED) { | |
| 21207 | + s2.push(s3); | |
| 21208 | + s3 = peg$parseS(); | |
| 21209 | + } | |
| 21210 | + if (s2 !== peg$FAILED) { | |
| 21211 | + if (input.charCodeAt(peg$currPos) === 61) { | |
| 21212 | + s3 = peg$c18; | |
| 21213 | + peg$currPos++; | |
| 21214 | + } else { | |
| 21215 | + s3 = peg$FAILED; | |
| 21216 | + if (peg$silentFails === 0) { peg$fail(peg$c19); } | |
| 21217 | + } | |
| 21218 | + if (s3 !== peg$FAILED) { | |
| 21219 | + s4 = []; | |
| 21220 | + s5 = peg$parseS(); | |
| 21221 | + while (s5 !== peg$FAILED) { | |
| 21222 | + s4.push(s5); | |
| 21223 | + s5 = peg$parseS(); | |
| 21224 | + } | |
| 21225 | + if (s4 !== peg$FAILED) { | |
| 21226 | + s5 = peg$parsevalue(); | |
| 21227 | + if (s5 !== peg$FAILED) { | |
| 21228 | + peg$reportedPos = s0; | |
| 21229 | + s1 = peg$c20(s1, s5); | |
| 21230 | + s0 = s1; | |
| 21231 | + } else { | |
| 21232 | + peg$currPos = s0; | |
| 21233 | + s0 = peg$c2; | |
| 21234 | + } | |
| 21235 | + } else { | |
| 21236 | + peg$currPos = s0; | |
| 21237 | + s0 = peg$c2; | |
| 21238 | + } | |
| 21239 | + } else { | |
| 21240 | + peg$currPos = s0; | |
| 21241 | + s0 = peg$c2; | |
| 21242 | + } | |
| 21243 | + } else { | |
| 21244 | + peg$currPos = s0; | |
| 21245 | + s0 = peg$c2; | |
| 21246 | + } | |
| 21247 | + } else { | |
| 21248 | + peg$currPos = s0; | |
| 21249 | + s0 = peg$c2; | |
| 21250 | + } | |
| 21251 | + if (s0 === peg$FAILED) { | |
| 21252 | + s0 = peg$currPos; | |
| 21253 | + s1 = peg$parsequoted_key(); | |
| 21254 | + if (s1 !== peg$FAILED) { | |
| 21255 | + s2 = []; | |
| 21256 | + s3 = peg$parseS(); | |
| 21257 | + while (s3 !== peg$FAILED) { | |
| 21258 | + s2.push(s3); | |
| 21259 | + s3 = peg$parseS(); | |
| 21260 | + } | |
| 21261 | + if (s2 !== peg$FAILED) { | |
| 21262 | + if (input.charCodeAt(peg$currPos) === 61) { | |
| 21263 | + s3 = peg$c18; | |
| 21264 | + peg$currPos++; | |
| 21265 | + } else { | |
| 21266 | + s3 = peg$FAILED; | |
| 21267 | + if (peg$silentFails === 0) { peg$fail(peg$c19); } | |
| 21268 | + } | |
| 21269 | + if (s3 !== peg$FAILED) { | |
| 21270 | + s4 = []; | |
| 21271 | + s5 = peg$parseS(); | |
| 21272 | + while (s5 !== peg$FAILED) { | |
| 21273 | + s4.push(s5); | |
| 21274 | + s5 = peg$parseS(); | |
| 21275 | + } | |
| 21276 | + if (s4 !== peg$FAILED) { | |
| 21277 | + s5 = peg$parsevalue(); | |
| 21278 | + if (s5 !== peg$FAILED) { | |
| 21279 | + peg$reportedPos = s0; | |
| 21280 | + s1 = peg$c20(s1, s5); | |
| 21281 | + s0 = s1; | |
| 21282 | + } else { | |
| 21283 | + peg$currPos = s0; | |
| 21284 | + s0 = peg$c2; | |
| 21285 | + } | |
| 21286 | + } else { | |
| 21287 | + peg$currPos = s0; | |
| 21288 | + s0 = peg$c2; | |
| 21289 | + } | |
| 21290 | + } else { | |
| 21291 | + peg$currPos = s0; | |
| 21292 | + s0 = peg$c2; | |
| 21293 | + } | |
| 21294 | + } else { | |
| 21295 | + peg$currPos = s0; | |
| 21296 | + s0 = peg$c2; | |
| 21297 | + } | |
| 21298 | + } else { | |
| 21299 | + peg$currPos = s0; | |
| 21300 | + s0 = peg$c2; | |
| 21301 | + } | |
| 21302 | + } | |
| 21303 | + | |
| 21304 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21305 | + | |
| 21306 | + return s0; | |
| 21307 | + } | |
| 21308 | + | |
| 21309 | + function peg$parsekey() { | |
| 21310 | + var s0, s1, s2; | |
| 21311 | + | |
| 21312 | + var key = peg$currPos * 49 + 10, | |
| 21313 | + cached = peg$cache[key]; | |
| 21314 | + | |
| 21315 | + if (cached) { | |
| 21316 | + peg$currPos = cached.nextPos; | |
| 21317 | + return cached.result; | |
| 21318 | + } | |
| 21319 | + | |
| 21320 | + s0 = peg$currPos; | |
| 21321 | + s1 = []; | |
| 21322 | + s2 = peg$parseASCII_BASIC(); | |
| 21323 | + if (s2 !== peg$FAILED) { | |
| 21324 | + while (s2 !== peg$FAILED) { | |
| 21325 | + s1.push(s2); | |
| 21326 | + s2 = peg$parseASCII_BASIC(); | |
| 21327 | + } | |
| 21328 | + } else { | |
| 21329 | + s1 = peg$c2; | |
| 21330 | + } | |
| 21331 | + if (s1 !== peg$FAILED) { | |
| 21332 | + peg$reportedPos = s0; | |
| 21333 | + s1 = peg$c21(s1); | |
| 21334 | + } | |
| 21335 | + s0 = s1; | |
| 21336 | + | |
| 21337 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21338 | + | |
| 21339 | + return s0; | |
| 21340 | + } | |
| 21341 | + | |
| 21342 | + function peg$parsequoted_key() { | |
| 21343 | + var s0, s1; | |
| 21344 | + | |
| 21345 | + var key = peg$currPos * 49 + 11, | |
| 21346 | + cached = peg$cache[key]; | |
| 21347 | + | |
| 21348 | + if (cached) { | |
| 21349 | + peg$currPos = cached.nextPos; | |
| 21350 | + return cached.result; | |
| 21351 | + } | |
| 21352 | + | |
| 21353 | + s0 = peg$currPos; | |
| 21354 | + s1 = peg$parsedouble_quoted_single_line_string(); | |
| 21355 | + if (s1 !== peg$FAILED) { | |
| 21356 | + peg$reportedPos = s0; | |
| 21357 | + s1 = peg$c22(s1); | |
| 21358 | + } | |
| 21359 | + s0 = s1; | |
| 21360 | + if (s0 === peg$FAILED) { | |
| 21361 | + s0 = peg$currPos; | |
| 21362 | + s1 = peg$parsesingle_quoted_single_line_string(); | |
| 21363 | + if (s1 !== peg$FAILED) { | |
| 21364 | + peg$reportedPos = s0; | |
| 21365 | + s1 = peg$c22(s1); | |
| 21366 | + } | |
| 21367 | + s0 = s1; | |
| 21368 | + } | |
| 21369 | + | |
| 21370 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21371 | + | |
| 21372 | + return s0; | |
| 21373 | + } | |
| 21374 | + | |
| 21375 | + function peg$parsevalue() { | |
| 21376 | + var s0; | |
| 21377 | + | |
| 21378 | + var key = peg$currPos * 49 + 12, | |
| 21379 | + cached = peg$cache[key]; | |
| 21380 | + | |
| 21381 | + if (cached) { | |
| 21382 | + peg$currPos = cached.nextPos; | |
| 21383 | + return cached.result; | |
| 21384 | + } | |
| 21385 | + | |
| 21386 | + s0 = peg$parsestring(); | |
| 21387 | + if (s0 === peg$FAILED) { | |
| 21388 | + s0 = peg$parsedatetime(); | |
| 21389 | + if (s0 === peg$FAILED) { | |
| 21390 | + s0 = peg$parsefloat(); | |
| 21391 | + if (s0 === peg$FAILED) { | |
| 21392 | + s0 = peg$parseinteger(); | |
| 21393 | + if (s0 === peg$FAILED) { | |
| 21394 | + s0 = peg$parseboolean(); | |
| 21395 | + if (s0 === peg$FAILED) { | |
| 21396 | + s0 = peg$parsearray(); | |
| 21397 | + if (s0 === peg$FAILED) { | |
| 21398 | + s0 = peg$parseinline_table(); | |
| 21399 | + } | |
| 21400 | + } | |
| 21401 | + } | |
| 21402 | + } | |
| 21403 | + } | |
| 21404 | + } | |
| 21405 | + | |
| 21406 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21407 | + | |
| 21408 | + return s0; | |
| 21409 | + } | |
| 21410 | + | |
| 21411 | + function peg$parsestring() { | |
| 21412 | + var s0; | |
| 21413 | + | |
| 21414 | + var key = peg$currPos * 49 + 13, | |
| 21415 | + cached = peg$cache[key]; | |
| 21416 | + | |
| 21417 | + if (cached) { | |
| 21418 | + peg$currPos = cached.nextPos; | |
| 21419 | + return cached.result; | |
| 21420 | + } | |
| 21421 | + | |
| 21422 | + s0 = peg$parsedouble_quoted_multiline_string(); | |
| 21423 | + if (s0 === peg$FAILED) { | |
| 21424 | + s0 = peg$parsedouble_quoted_single_line_string(); | |
| 21425 | + if (s0 === peg$FAILED) { | |
| 21426 | + s0 = peg$parsesingle_quoted_multiline_string(); | |
| 21427 | + if (s0 === peg$FAILED) { | |
| 21428 | + s0 = peg$parsesingle_quoted_single_line_string(); | |
| 21429 | + } | |
| 21430 | + } | |
| 21431 | + } | |
| 21432 | + | |
| 21433 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21434 | + | |
| 21435 | + return s0; | |
| 21436 | + } | |
| 21437 | + | |
| 21438 | + function peg$parsedouble_quoted_multiline_string() { | |
| 21439 | + var s0, s1, s2, s3, s4; | |
| 21440 | + | |
| 21441 | + var key = peg$currPos * 49 + 14, | |
| 21442 | + cached = peg$cache[key]; | |
| 21443 | + | |
| 21444 | + if (cached) { | |
| 21445 | + peg$currPos = cached.nextPos; | |
| 21446 | + return cached.result; | |
| 21447 | + } | |
| 21448 | + | |
| 21449 | + s0 = peg$currPos; | |
| 21450 | + if (input.substr(peg$currPos, 3) === peg$c23) { | |
| 21451 | + s1 = peg$c23; | |
| 21452 | + peg$currPos += 3; | |
| 21453 | + } else { | |
| 21454 | + s1 = peg$FAILED; | |
| 21455 | + if (peg$silentFails === 0) { peg$fail(peg$c24); } | |
| 21456 | + } | |
| 21457 | + if (s1 !== peg$FAILED) { | |
| 21458 | + s2 = peg$parseNL(); | |
| 21459 | + if (s2 === peg$FAILED) { | |
| 21460 | + s2 = peg$c25; | |
| 21461 | + } | |
| 21462 | + if (s2 !== peg$FAILED) { | |
| 21463 | + s3 = []; | |
| 21464 | + s4 = peg$parsemultiline_string_char(); | |
| 21465 | + while (s4 !== peg$FAILED) { | |
| 21466 | + s3.push(s4); | |
| 21467 | + s4 = peg$parsemultiline_string_char(); | |
| 21468 | + } | |
| 21469 | + if (s3 !== peg$FAILED) { | |
| 21470 | + if (input.substr(peg$currPos, 3) === peg$c23) { | |
| 21471 | + s4 = peg$c23; | |
| 21472 | + peg$currPos += 3; | |
| 21473 | + } else { | |
| 21474 | + s4 = peg$FAILED; | |
| 21475 | + if (peg$silentFails === 0) { peg$fail(peg$c24); } | |
| 21476 | + } | |
| 21477 | + if (s4 !== peg$FAILED) { | |
| 21478 | + peg$reportedPos = s0; | |
| 21479 | + s1 = peg$c26(s3); | |
| 21480 | + s0 = s1; | |
| 21481 | + } else { | |
| 21482 | + peg$currPos = s0; | |
| 21483 | + s0 = peg$c2; | |
| 21484 | + } | |
| 21485 | + } else { | |
| 21486 | + peg$currPos = s0; | |
| 21487 | + s0 = peg$c2; | |
| 21488 | + } | |
| 21489 | + } else { | |
| 21490 | + peg$currPos = s0; | |
| 21491 | + s0 = peg$c2; | |
| 21492 | + } | |
| 21493 | + } else { | |
| 21494 | + peg$currPos = s0; | |
| 21495 | + s0 = peg$c2; | |
| 21496 | + } | |
| 21497 | + | |
| 21498 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21499 | + | |
| 21500 | + return s0; | |
| 21501 | + } | |
| 21502 | + | |
| 21503 | + function peg$parsedouble_quoted_single_line_string() { | |
| 21504 | + var s0, s1, s2, s3; | |
| 21505 | + | |
| 21506 | + var key = peg$currPos * 49 + 15, | |
| 21507 | + cached = peg$cache[key]; | |
| 21508 | + | |
| 21509 | + if (cached) { | |
| 21510 | + peg$currPos = cached.nextPos; | |
| 21511 | + return cached.result; | |
| 21512 | + } | |
| 21513 | + | |
| 21514 | + s0 = peg$currPos; | |
| 21515 | + if (input.charCodeAt(peg$currPos) === 34) { | |
| 21516 | + s1 = peg$c27; | |
| 21517 | + peg$currPos++; | |
| 21518 | + } else { | |
| 21519 | + s1 = peg$FAILED; | |
| 21520 | + if (peg$silentFails === 0) { peg$fail(peg$c28); } | |
| 21521 | + } | |
| 21522 | + if (s1 !== peg$FAILED) { | |
| 21523 | + s2 = []; | |
| 21524 | + s3 = peg$parsestring_char(); | |
| 21525 | + while (s3 !== peg$FAILED) { | |
| 21526 | + s2.push(s3); | |
| 21527 | + s3 = peg$parsestring_char(); | |
| 21528 | + } | |
| 21529 | + if (s2 !== peg$FAILED) { | |
| 21530 | + if (input.charCodeAt(peg$currPos) === 34) { | |
| 21531 | + s3 = peg$c27; | |
| 21532 | + peg$currPos++; | |
| 21533 | + } else { | |
| 21534 | + s3 = peg$FAILED; | |
| 21535 | + if (peg$silentFails === 0) { peg$fail(peg$c28); } | |
| 21536 | + } | |
| 21537 | + if (s3 !== peg$FAILED) { | |
| 21538 | + peg$reportedPos = s0; | |
| 21539 | + s1 = peg$c26(s2); | |
| 21540 | + s0 = s1; | |
| 21541 | + } else { | |
| 21542 | + peg$currPos = s0; | |
| 21543 | + s0 = peg$c2; | |
| 21544 | + } | |
| 21545 | + } else { | |
| 21546 | + peg$currPos = s0; | |
| 21547 | + s0 = peg$c2; | |
| 21548 | + } | |
| 21549 | + } else { | |
| 21550 | + peg$currPos = s0; | |
| 21551 | + s0 = peg$c2; | |
| 21552 | + } | |
| 21553 | + | |
| 21554 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21555 | + | |
| 21556 | + return s0; | |
| 21557 | + } | |
| 21558 | + | |
| 21559 | + function peg$parsesingle_quoted_multiline_string() { | |
| 21560 | + var s0, s1, s2, s3, s4; | |
| 21561 | + | |
| 21562 | + var key = peg$currPos * 49 + 16, | |
| 21563 | + cached = peg$cache[key]; | |
| 21564 | + | |
| 21565 | + if (cached) { | |
| 21566 | + peg$currPos = cached.nextPos; | |
| 21567 | + return cached.result; | |
| 21568 | + } | |
| 21569 | + | |
| 21570 | + s0 = peg$currPos; | |
| 21571 | + if (input.substr(peg$currPos, 3) === peg$c29) { | |
| 21572 | + s1 = peg$c29; | |
| 21573 | + peg$currPos += 3; | |
| 21574 | + } else { | |
| 21575 | + s1 = peg$FAILED; | |
| 21576 | + if (peg$silentFails === 0) { peg$fail(peg$c30); } | |
| 21577 | + } | |
| 21578 | + if (s1 !== peg$FAILED) { | |
| 21579 | + s2 = peg$parseNL(); | |
| 21580 | + if (s2 === peg$FAILED) { | |
| 21581 | + s2 = peg$c25; | |
| 21582 | + } | |
| 21583 | + if (s2 !== peg$FAILED) { | |
| 21584 | + s3 = []; | |
| 21585 | + s4 = peg$parsemultiline_literal_char(); | |
| 21586 | + while (s4 !== peg$FAILED) { | |
| 21587 | + s3.push(s4); | |
| 21588 | + s4 = peg$parsemultiline_literal_char(); | |
| 21589 | + } | |
| 21590 | + if (s3 !== peg$FAILED) { | |
| 21591 | + if (input.substr(peg$currPos, 3) === peg$c29) { | |
| 21592 | + s4 = peg$c29; | |
| 21593 | + peg$currPos += 3; | |
| 21594 | + } else { | |
| 21595 | + s4 = peg$FAILED; | |
| 21596 | + if (peg$silentFails === 0) { peg$fail(peg$c30); } | |
| 21597 | + } | |
| 21598 | + if (s4 !== peg$FAILED) { | |
| 21599 | + peg$reportedPos = s0; | |
| 21600 | + s1 = peg$c26(s3); | |
| 21601 | + s0 = s1; | |
| 21602 | + } else { | |
| 21603 | + peg$currPos = s0; | |
| 21604 | + s0 = peg$c2; | |
| 21605 | + } | |
| 21606 | + } else { | |
| 21607 | + peg$currPos = s0; | |
| 21608 | + s0 = peg$c2; | |
| 21609 | + } | |
| 21610 | + } else { | |
| 21611 | + peg$currPos = s0; | |
| 21612 | + s0 = peg$c2; | |
| 21613 | + } | |
| 21614 | + } else { | |
| 21615 | + peg$currPos = s0; | |
| 21616 | + s0 = peg$c2; | |
| 21617 | + } | |
| 21618 | + | |
| 21619 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21620 | + | |
| 21621 | + return s0; | |
| 21622 | + } | |
| 21623 | + | |
| 21624 | + function peg$parsesingle_quoted_single_line_string() { | |
| 21625 | + var s0, s1, s2, s3; | |
| 21626 | + | |
| 21627 | + var key = peg$currPos * 49 + 17, | |
| 21628 | + cached = peg$cache[key]; | |
| 21629 | + | |
| 21630 | + if (cached) { | |
| 21631 | + peg$currPos = cached.nextPos; | |
| 21632 | + return cached.result; | |
| 21633 | + } | |
| 21634 | + | |
| 21635 | + s0 = peg$currPos; | |
| 21636 | + if (input.charCodeAt(peg$currPos) === 39) { | |
| 21637 | + s1 = peg$c31; | |
| 21638 | + peg$currPos++; | |
| 21639 | + } else { | |
| 21640 | + s1 = peg$FAILED; | |
| 21641 | + if (peg$silentFails === 0) { peg$fail(peg$c32); } | |
| 21642 | + } | |
| 21643 | + if (s1 !== peg$FAILED) { | |
| 21644 | + s2 = []; | |
| 21645 | + s3 = peg$parseliteral_char(); | |
| 21646 | + while (s3 !== peg$FAILED) { | |
| 21647 | + s2.push(s3); | |
| 21648 | + s3 = peg$parseliteral_char(); | |
| 21649 | + } | |
| 21650 | + if (s2 !== peg$FAILED) { | |
| 21651 | + if (input.charCodeAt(peg$currPos) === 39) { | |
| 21652 | + s3 = peg$c31; | |
| 21653 | + peg$currPos++; | |
| 21654 | + } else { | |
| 21655 | + s3 = peg$FAILED; | |
| 21656 | + if (peg$silentFails === 0) { peg$fail(peg$c32); } | |
| 21657 | + } | |
| 21658 | + if (s3 !== peg$FAILED) { | |
| 21659 | + peg$reportedPos = s0; | |
| 21660 | + s1 = peg$c26(s2); | |
| 21661 | + s0 = s1; | |
| 21662 | + } else { | |
| 21663 | + peg$currPos = s0; | |
| 21664 | + s0 = peg$c2; | |
| 21665 | + } | |
| 21666 | + } else { | |
| 21667 | + peg$currPos = s0; | |
| 21668 | + s0 = peg$c2; | |
| 21669 | + } | |
| 21670 | + } else { | |
| 21671 | + peg$currPos = s0; | |
| 21672 | + s0 = peg$c2; | |
| 21673 | + } | |
| 21674 | + | |
| 21675 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21676 | + | |
| 21677 | + return s0; | |
| 21678 | + } | |
| 21679 | + | |
| 21680 | + function peg$parsestring_char() { | |
| 21681 | + var s0, s1, s2; | |
| 21682 | + | |
| 21683 | + var key = peg$currPos * 49 + 18, | |
| 21684 | + cached = peg$cache[key]; | |
| 21685 | + | |
| 21686 | + if (cached) { | |
| 21687 | + peg$currPos = cached.nextPos; | |
| 21688 | + return cached.result; | |
| 21689 | + } | |
| 21690 | + | |
| 21691 | + s0 = peg$parseESCAPED(); | |
| 21692 | + if (s0 === peg$FAILED) { | |
| 21693 | + s0 = peg$currPos; | |
| 21694 | + s1 = peg$currPos; | |
| 21695 | + peg$silentFails++; | |
| 21696 | + if (input.charCodeAt(peg$currPos) === 34) { | |
| 21697 | + s2 = peg$c27; | |
| 21698 | + peg$currPos++; | |
| 21699 | + } else { | |
| 21700 | + s2 = peg$FAILED; | |
| 21701 | + if (peg$silentFails === 0) { peg$fail(peg$c28); } | |
| 21702 | + } | |
| 21703 | + peg$silentFails--; | |
| 21704 | + if (s2 === peg$FAILED) { | |
| 21705 | + s1 = peg$c5; | |
| 21706 | + } else { | |
| 21707 | + peg$currPos = s1; | |
| 21708 | + s1 = peg$c2; | |
| 21709 | + } | |
| 21710 | + if (s1 !== peg$FAILED) { | |
| 21711 | + if (input.length > peg$currPos) { | |
| 21712 | + s2 = input.charAt(peg$currPos); | |
| 21713 | + peg$currPos++; | |
| 21714 | + } else { | |
| 21715 | + s2 = peg$FAILED; | |
| 21716 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 21717 | + } | |
| 21718 | + if (s2 !== peg$FAILED) { | |
| 21719 | + peg$reportedPos = s0; | |
| 21720 | + s1 = peg$c33(s2); | |
| 21721 | + s0 = s1; | |
| 21722 | + } else { | |
| 21723 | + peg$currPos = s0; | |
| 21724 | + s0 = peg$c2; | |
| 21725 | + } | |
| 21726 | + } else { | |
| 21727 | + peg$currPos = s0; | |
| 21728 | + s0 = peg$c2; | |
| 21729 | + } | |
| 21730 | + } | |
| 21731 | + | |
| 21732 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21733 | + | |
| 21734 | + return s0; | |
| 21735 | + } | |
| 21736 | + | |
| 21737 | + function peg$parseliteral_char() { | |
| 21738 | + var s0, s1, s2; | |
| 21739 | + | |
| 21740 | + var key = peg$currPos * 49 + 19, | |
| 21741 | + cached = peg$cache[key]; | |
| 21742 | + | |
| 21743 | + if (cached) { | |
| 21744 | + peg$currPos = cached.nextPos; | |
| 21745 | + return cached.result; | |
| 21746 | + } | |
| 21747 | + | |
| 21748 | + s0 = peg$currPos; | |
| 21749 | + s1 = peg$currPos; | |
| 21750 | + peg$silentFails++; | |
| 21751 | + if (input.charCodeAt(peg$currPos) === 39) { | |
| 21752 | + s2 = peg$c31; | |
| 21753 | + peg$currPos++; | |
| 21754 | + } else { | |
| 21755 | + s2 = peg$FAILED; | |
| 21756 | + if (peg$silentFails === 0) { peg$fail(peg$c32); } | |
| 21757 | + } | |
| 21758 | + peg$silentFails--; | |
| 21759 | + if (s2 === peg$FAILED) { | |
| 21760 | + s1 = peg$c5; | |
| 21761 | + } else { | |
| 21762 | + peg$currPos = s1; | |
| 21763 | + s1 = peg$c2; | |
| 21764 | + } | |
| 21765 | + if (s1 !== peg$FAILED) { | |
| 21766 | + if (input.length > peg$currPos) { | |
| 21767 | + s2 = input.charAt(peg$currPos); | |
| 21768 | + peg$currPos++; | |
| 21769 | + } else { | |
| 21770 | + s2 = peg$FAILED; | |
| 21771 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 21772 | + } | |
| 21773 | + if (s2 !== peg$FAILED) { | |
| 21774 | + peg$reportedPos = s0; | |
| 21775 | + s1 = peg$c33(s2); | |
| 21776 | + s0 = s1; | |
| 21777 | + } else { | |
| 21778 | + peg$currPos = s0; | |
| 21779 | + s0 = peg$c2; | |
| 21780 | + } | |
| 21781 | + } else { | |
| 21782 | + peg$currPos = s0; | |
| 21783 | + s0 = peg$c2; | |
| 21784 | + } | |
| 21785 | + | |
| 21786 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21787 | + | |
| 21788 | + return s0; | |
| 21789 | + } | |
| 21790 | + | |
| 21791 | + function peg$parsemultiline_string_char() { | |
| 21792 | + var s0, s1, s2; | |
| 21793 | + | |
| 21794 | + var key = peg$currPos * 49 + 20, | |
| 21795 | + cached = peg$cache[key]; | |
| 21796 | + | |
| 21797 | + if (cached) { | |
| 21798 | + peg$currPos = cached.nextPos; | |
| 21799 | + return cached.result; | |
| 21800 | + } | |
| 21801 | + | |
| 21802 | + s0 = peg$parseESCAPED(); | |
| 21803 | + if (s0 === peg$FAILED) { | |
| 21804 | + s0 = peg$parsemultiline_string_delim(); | |
| 21805 | + if (s0 === peg$FAILED) { | |
| 21806 | + s0 = peg$currPos; | |
| 21807 | + s1 = peg$currPos; | |
| 21808 | + peg$silentFails++; | |
| 21809 | + if (input.substr(peg$currPos, 3) === peg$c23) { | |
| 21810 | + s2 = peg$c23; | |
| 21811 | + peg$currPos += 3; | |
| 21812 | + } else { | |
| 21813 | + s2 = peg$FAILED; | |
| 21814 | + if (peg$silentFails === 0) { peg$fail(peg$c24); } | |
| 21815 | + } | |
| 21816 | + peg$silentFails--; | |
| 21817 | + if (s2 === peg$FAILED) { | |
| 21818 | + s1 = peg$c5; | |
| 21819 | + } else { | |
| 21820 | + peg$currPos = s1; | |
| 21821 | + s1 = peg$c2; | |
| 21822 | + } | |
| 21823 | + if (s1 !== peg$FAILED) { | |
| 21824 | + if (input.length > peg$currPos) { | |
| 21825 | + s2 = input.charAt(peg$currPos); | |
| 21826 | + peg$currPos++; | |
| 21827 | + } else { | |
| 21828 | + s2 = peg$FAILED; | |
| 21829 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 21830 | + } | |
| 21831 | + if (s2 !== peg$FAILED) { | |
| 21832 | + peg$reportedPos = s0; | |
| 21833 | + s1 = peg$c34(s2); | |
| 21834 | + s0 = s1; | |
| 21835 | + } else { | |
| 21836 | + peg$currPos = s0; | |
| 21837 | + s0 = peg$c2; | |
| 21838 | + } | |
| 21839 | + } else { | |
| 21840 | + peg$currPos = s0; | |
| 21841 | + s0 = peg$c2; | |
| 21842 | + } | |
| 21843 | + } | |
| 21844 | + } | |
| 21845 | + | |
| 21846 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21847 | + | |
| 21848 | + return s0; | |
| 21849 | + } | |
| 21850 | + | |
| 21851 | + function peg$parsemultiline_string_delim() { | |
| 21852 | + var s0, s1, s2, s3, s4; | |
| 21853 | + | |
| 21854 | + var key = peg$currPos * 49 + 21, | |
| 21855 | + cached = peg$cache[key]; | |
| 21856 | + | |
| 21857 | + if (cached) { | |
| 21858 | + peg$currPos = cached.nextPos; | |
| 21859 | + return cached.result; | |
| 21860 | + } | |
| 21861 | + | |
| 21862 | + s0 = peg$currPos; | |
| 21863 | + if (input.charCodeAt(peg$currPos) === 92) { | |
| 21864 | + s1 = peg$c35; | |
| 21865 | + peg$currPos++; | |
| 21866 | + } else { | |
| 21867 | + s1 = peg$FAILED; | |
| 21868 | + if (peg$silentFails === 0) { peg$fail(peg$c36); } | |
| 21869 | + } | |
| 21870 | + if (s1 !== peg$FAILED) { | |
| 21871 | + s2 = peg$parseNL(); | |
| 21872 | + if (s2 !== peg$FAILED) { | |
| 21873 | + s3 = []; | |
| 21874 | + s4 = peg$parseNLS(); | |
| 21875 | + while (s4 !== peg$FAILED) { | |
| 21876 | + s3.push(s4); | |
| 21877 | + s4 = peg$parseNLS(); | |
| 21878 | + } | |
| 21879 | + if (s3 !== peg$FAILED) { | |
| 21880 | + peg$reportedPos = s0; | |
| 21881 | + s1 = peg$c37(); | |
| 21882 | + s0 = s1; | |
| 21883 | + } else { | |
| 21884 | + peg$currPos = s0; | |
| 21885 | + s0 = peg$c2; | |
| 21886 | + } | |
| 21887 | + } else { | |
| 21888 | + peg$currPos = s0; | |
| 21889 | + s0 = peg$c2; | |
| 21890 | + } | |
| 21891 | + } else { | |
| 21892 | + peg$currPos = s0; | |
| 21893 | + s0 = peg$c2; | |
| 21894 | + } | |
| 21895 | + | |
| 21896 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21897 | + | |
| 21898 | + return s0; | |
| 21899 | + } | |
| 21900 | + | |
| 21901 | + function peg$parsemultiline_literal_char() { | |
| 21902 | + var s0, s1, s2; | |
| 21903 | + | |
| 21904 | + var key = peg$currPos * 49 + 22, | |
| 21905 | + cached = peg$cache[key]; | |
| 21906 | + | |
| 21907 | + if (cached) { | |
| 21908 | + peg$currPos = cached.nextPos; | |
| 21909 | + return cached.result; | |
| 21910 | + } | |
| 21911 | + | |
| 21912 | + s0 = peg$currPos; | |
| 21913 | + s1 = peg$currPos; | |
| 21914 | + peg$silentFails++; | |
| 21915 | + if (input.substr(peg$currPos, 3) === peg$c29) { | |
| 21916 | + s2 = peg$c29; | |
| 21917 | + peg$currPos += 3; | |
| 21918 | + } else { | |
| 21919 | + s2 = peg$FAILED; | |
| 21920 | + if (peg$silentFails === 0) { peg$fail(peg$c30); } | |
| 21921 | + } | |
| 21922 | + peg$silentFails--; | |
| 21923 | + if (s2 === peg$FAILED) { | |
| 21924 | + s1 = peg$c5; | |
| 21925 | + } else { | |
| 21926 | + peg$currPos = s1; | |
| 21927 | + s1 = peg$c2; | |
| 21928 | + } | |
| 21929 | + if (s1 !== peg$FAILED) { | |
| 21930 | + if (input.length > peg$currPos) { | |
| 21931 | + s2 = input.charAt(peg$currPos); | |
| 21932 | + peg$currPos++; | |
| 21933 | + } else { | |
| 21934 | + s2 = peg$FAILED; | |
| 21935 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 21936 | + } | |
| 21937 | + if (s2 !== peg$FAILED) { | |
| 21938 | + peg$reportedPos = s0; | |
| 21939 | + s1 = peg$c33(s2); | |
| 21940 | + s0 = s1; | |
| 21941 | + } else { | |
| 21942 | + peg$currPos = s0; | |
| 21943 | + s0 = peg$c2; | |
| 21944 | + } | |
| 21945 | + } else { | |
| 21946 | + peg$currPos = s0; | |
| 21947 | + s0 = peg$c2; | |
| 21948 | + } | |
| 21949 | + | |
| 21950 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 21951 | + | |
| 21952 | + return s0; | |
| 21953 | + } | |
| 21954 | + | |
| 21955 | + function peg$parsefloat() { | |
| 21956 | + var s0, s1, s2, s3; | |
| 21957 | + | |
| 21958 | + var key = peg$currPos * 49 + 23, | |
| 21959 | + cached = peg$cache[key]; | |
| 21960 | + | |
| 21961 | + if (cached) { | |
| 21962 | + peg$currPos = cached.nextPos; | |
| 21963 | + return cached.result; | |
| 21964 | + } | |
| 21965 | + | |
| 21966 | + s0 = peg$currPos; | |
| 21967 | + s1 = peg$parsefloat_text(); | |
| 21968 | + if (s1 === peg$FAILED) { | |
| 21969 | + s1 = peg$parseinteger_text(); | |
| 21970 | + } | |
| 21971 | + if (s1 !== peg$FAILED) { | |
| 21972 | + if (input.charCodeAt(peg$currPos) === 101) { | |
| 21973 | + s2 = peg$c38; | |
| 21974 | + peg$currPos++; | |
| 21975 | + } else { | |
| 21976 | + s2 = peg$FAILED; | |
| 21977 | + if (peg$silentFails === 0) { peg$fail(peg$c39); } | |
| 21978 | + } | |
| 21979 | + if (s2 === peg$FAILED) { | |
| 21980 | + if (input.charCodeAt(peg$currPos) === 69) { | |
| 21981 | + s2 = peg$c40; | |
| 21982 | + peg$currPos++; | |
| 21983 | + } else { | |
| 21984 | + s2 = peg$FAILED; | |
| 21985 | + if (peg$silentFails === 0) { peg$fail(peg$c41); } | |
| 21986 | + } | |
| 21987 | + } | |
| 21988 | + if (s2 !== peg$FAILED) { | |
| 21989 | + s3 = peg$parseinteger_text(); | |
| 21990 | + if (s3 !== peg$FAILED) { | |
| 21991 | + peg$reportedPos = s0; | |
| 21992 | + s1 = peg$c42(s1, s3); | |
| 21993 | + s0 = s1; | |
| 21994 | + } else { | |
| 21995 | + peg$currPos = s0; | |
| 21996 | + s0 = peg$c2; | |
| 21997 | + } | |
| 21998 | + } else { | |
| 21999 | + peg$currPos = s0; | |
| 22000 | + s0 = peg$c2; | |
| 22001 | + } | |
| 22002 | + } else { | |
| 22003 | + peg$currPos = s0; | |
| 22004 | + s0 = peg$c2; | |
| 22005 | + } | |
| 22006 | + if (s0 === peg$FAILED) { | |
| 22007 | + s0 = peg$currPos; | |
| 22008 | + s1 = peg$parsefloat_text(); | |
| 22009 | + if (s1 !== peg$FAILED) { | |
| 22010 | + peg$reportedPos = s0; | |
| 22011 | + s1 = peg$c43(s1); | |
| 22012 | + } | |
| 22013 | + s0 = s1; | |
| 22014 | + } | |
| 22015 | + | |
| 22016 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22017 | + | |
| 22018 | + return s0; | |
| 22019 | + } | |
| 22020 | + | |
| 22021 | + function peg$parsefloat_text() { | |
| 22022 | + var s0, s1, s2, s3, s4, s5; | |
| 22023 | + | |
| 22024 | + var key = peg$currPos * 49 + 24, | |
| 22025 | + cached = peg$cache[key]; | |
| 22026 | + | |
| 22027 | + if (cached) { | |
| 22028 | + peg$currPos = cached.nextPos; | |
| 22029 | + return cached.result; | |
| 22030 | + } | |
| 22031 | + | |
| 22032 | + s0 = peg$currPos; | |
| 22033 | + if (input.charCodeAt(peg$currPos) === 43) { | |
| 22034 | + s1 = peg$c44; | |
| 22035 | + peg$currPos++; | |
| 22036 | + } else { | |
| 22037 | + s1 = peg$FAILED; | |
| 22038 | + if (peg$silentFails === 0) { peg$fail(peg$c45); } | |
| 22039 | + } | |
| 22040 | + if (s1 === peg$FAILED) { | |
| 22041 | + s1 = peg$c25; | |
| 22042 | + } | |
| 22043 | + if (s1 !== peg$FAILED) { | |
| 22044 | + s2 = peg$currPos; | |
| 22045 | + s3 = peg$parseDIGITS(); | |
| 22046 | + if (s3 !== peg$FAILED) { | |
| 22047 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 22048 | + s4 = peg$c16; | |
| 22049 | + peg$currPos++; | |
| 22050 | + } else { | |
| 22051 | + s4 = peg$FAILED; | |
| 22052 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 22053 | + } | |
| 22054 | + if (s4 !== peg$FAILED) { | |
| 22055 | + s5 = peg$parseDIGITS(); | |
| 22056 | + if (s5 !== peg$FAILED) { | |
| 22057 | + s3 = [s3, s4, s5]; | |
| 22058 | + s2 = s3; | |
| 22059 | + } else { | |
| 22060 | + peg$currPos = s2; | |
| 22061 | + s2 = peg$c2; | |
| 22062 | + } | |
| 22063 | + } else { | |
| 22064 | + peg$currPos = s2; | |
| 22065 | + s2 = peg$c2; | |
| 22066 | + } | |
| 22067 | + } else { | |
| 22068 | + peg$currPos = s2; | |
| 22069 | + s2 = peg$c2; | |
| 22070 | + } | |
| 22071 | + if (s2 !== peg$FAILED) { | |
| 22072 | + peg$reportedPos = s0; | |
| 22073 | + s1 = peg$c46(s2); | |
| 22074 | + s0 = s1; | |
| 22075 | + } else { | |
| 22076 | + peg$currPos = s0; | |
| 22077 | + s0 = peg$c2; | |
| 22078 | + } | |
| 22079 | + } else { | |
| 22080 | + peg$currPos = s0; | |
| 22081 | + s0 = peg$c2; | |
| 22082 | + } | |
| 22083 | + if (s0 === peg$FAILED) { | |
| 22084 | + s0 = peg$currPos; | |
| 22085 | + if (input.charCodeAt(peg$currPos) === 45) { | |
| 22086 | + s1 = peg$c47; | |
| 22087 | + peg$currPos++; | |
| 22088 | + } else { | |
| 22089 | + s1 = peg$FAILED; | |
| 22090 | + if (peg$silentFails === 0) { peg$fail(peg$c48); } | |
| 22091 | + } | |
| 22092 | + if (s1 !== peg$FAILED) { | |
| 22093 | + s2 = peg$currPos; | |
| 22094 | + s3 = peg$parseDIGITS(); | |
| 22095 | + if (s3 !== peg$FAILED) { | |
| 22096 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 22097 | + s4 = peg$c16; | |
| 22098 | + peg$currPos++; | |
| 22099 | + } else { | |
| 22100 | + s4 = peg$FAILED; | |
| 22101 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 22102 | + } | |
| 22103 | + if (s4 !== peg$FAILED) { | |
| 22104 | + s5 = peg$parseDIGITS(); | |
| 22105 | + if (s5 !== peg$FAILED) { | |
| 22106 | + s3 = [s3, s4, s5]; | |
| 22107 | + s2 = s3; | |
| 22108 | + } else { | |
| 22109 | + peg$currPos = s2; | |
| 22110 | + s2 = peg$c2; | |
| 22111 | + } | |
| 22112 | + } else { | |
| 22113 | + peg$currPos = s2; | |
| 22114 | + s2 = peg$c2; | |
| 22115 | + } | |
| 22116 | + } else { | |
| 22117 | + peg$currPos = s2; | |
| 22118 | + s2 = peg$c2; | |
| 22119 | + } | |
| 22120 | + if (s2 !== peg$FAILED) { | |
| 22121 | + peg$reportedPos = s0; | |
| 22122 | + s1 = peg$c49(s2); | |
| 22123 | + s0 = s1; | |
| 22124 | + } else { | |
| 22125 | + peg$currPos = s0; | |
| 22126 | + s0 = peg$c2; | |
| 22127 | + } | |
| 22128 | + } else { | |
| 22129 | + peg$currPos = s0; | |
| 22130 | + s0 = peg$c2; | |
| 22131 | + } | |
| 22132 | + } | |
| 22133 | + | |
| 22134 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22135 | + | |
| 22136 | + return s0; | |
| 22137 | + } | |
| 22138 | + | |
| 22139 | + function peg$parseinteger() { | |
| 22140 | + var s0, s1; | |
| 22141 | + | |
| 22142 | + var key = peg$currPos * 49 + 25, | |
| 22143 | + cached = peg$cache[key]; | |
| 22144 | + | |
| 22145 | + if (cached) { | |
| 22146 | + peg$currPos = cached.nextPos; | |
| 22147 | + return cached.result; | |
| 22148 | + } | |
| 22149 | + | |
| 22150 | + s0 = peg$currPos; | |
| 22151 | + s1 = peg$parseinteger_text(); | |
| 22152 | + if (s1 !== peg$FAILED) { | |
| 22153 | + peg$reportedPos = s0; | |
| 22154 | + s1 = peg$c50(s1); | |
| 22155 | + } | |
| 22156 | + s0 = s1; | |
| 22157 | + | |
| 22158 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22159 | + | |
| 22160 | + return s0; | |
| 22161 | + } | |
| 22162 | + | |
| 22163 | + function peg$parseinteger_text() { | |
| 22164 | + var s0, s1, s2, s3, s4; | |
| 22165 | + | |
| 22166 | + var key = peg$currPos * 49 + 26, | |
| 22167 | + cached = peg$cache[key]; | |
| 22168 | + | |
| 22169 | + if (cached) { | |
| 22170 | + peg$currPos = cached.nextPos; | |
| 22171 | + return cached.result; | |
| 22172 | + } | |
| 22173 | + | |
| 22174 | + s0 = peg$currPos; | |
| 22175 | + if (input.charCodeAt(peg$currPos) === 43) { | |
| 22176 | + s1 = peg$c44; | |
| 22177 | + peg$currPos++; | |
| 22178 | + } else { | |
| 22179 | + s1 = peg$FAILED; | |
| 22180 | + if (peg$silentFails === 0) { peg$fail(peg$c45); } | |
| 22181 | + } | |
| 22182 | + if (s1 === peg$FAILED) { | |
| 22183 | + s1 = peg$c25; | |
| 22184 | + } | |
| 22185 | + if (s1 !== peg$FAILED) { | |
| 22186 | + s2 = []; | |
| 22187 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 22188 | + if (s3 !== peg$FAILED) { | |
| 22189 | + while (s3 !== peg$FAILED) { | |
| 22190 | + s2.push(s3); | |
| 22191 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 22192 | + } | |
| 22193 | + } else { | |
| 22194 | + s2 = peg$c2; | |
| 22195 | + } | |
| 22196 | + if (s2 !== peg$FAILED) { | |
| 22197 | + s3 = peg$currPos; | |
| 22198 | + peg$silentFails++; | |
| 22199 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 22200 | + s4 = peg$c16; | |
| 22201 | + peg$currPos++; | |
| 22202 | + } else { | |
| 22203 | + s4 = peg$FAILED; | |
| 22204 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 22205 | + } | |
| 22206 | + peg$silentFails--; | |
| 22207 | + if (s4 === peg$FAILED) { | |
| 22208 | + s3 = peg$c5; | |
| 22209 | + } else { | |
| 22210 | + peg$currPos = s3; | |
| 22211 | + s3 = peg$c2; | |
| 22212 | + } | |
| 22213 | + if (s3 !== peg$FAILED) { | |
| 22214 | + peg$reportedPos = s0; | |
| 22215 | + s1 = peg$c46(s2); | |
| 22216 | + s0 = s1; | |
| 22217 | + } else { | |
| 22218 | + peg$currPos = s0; | |
| 22219 | + s0 = peg$c2; | |
| 22220 | + } | |
| 22221 | + } else { | |
| 22222 | + peg$currPos = s0; | |
| 22223 | + s0 = peg$c2; | |
| 22224 | + } | |
| 22225 | + } else { | |
| 22226 | + peg$currPos = s0; | |
| 22227 | + s0 = peg$c2; | |
| 22228 | + } | |
| 22229 | + if (s0 === peg$FAILED) { | |
| 22230 | + s0 = peg$currPos; | |
| 22231 | + if (input.charCodeAt(peg$currPos) === 45) { | |
| 22232 | + s1 = peg$c47; | |
| 22233 | + peg$currPos++; | |
| 22234 | + } else { | |
| 22235 | + s1 = peg$FAILED; | |
| 22236 | + if (peg$silentFails === 0) { peg$fail(peg$c48); } | |
| 22237 | + } | |
| 22238 | + if (s1 !== peg$FAILED) { | |
| 22239 | + s2 = []; | |
| 22240 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 22241 | + if (s3 !== peg$FAILED) { | |
| 22242 | + while (s3 !== peg$FAILED) { | |
| 22243 | + s2.push(s3); | |
| 22244 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 22245 | + } | |
| 22246 | + } else { | |
| 22247 | + s2 = peg$c2; | |
| 22248 | + } | |
| 22249 | + if (s2 !== peg$FAILED) { | |
| 22250 | + s3 = peg$currPos; | |
| 22251 | + peg$silentFails++; | |
| 22252 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 22253 | + s4 = peg$c16; | |
| 22254 | + peg$currPos++; | |
| 22255 | + } else { | |
| 22256 | + s4 = peg$FAILED; | |
| 22257 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 22258 | + } | |
| 22259 | + peg$silentFails--; | |
| 22260 | + if (s4 === peg$FAILED) { | |
| 22261 | + s3 = peg$c5; | |
| 22262 | + } else { | |
| 22263 | + peg$currPos = s3; | |
| 22264 | + s3 = peg$c2; | |
| 22265 | + } | |
| 22266 | + if (s3 !== peg$FAILED) { | |
| 22267 | + peg$reportedPos = s0; | |
| 22268 | + s1 = peg$c49(s2); | |
| 22269 | + s0 = s1; | |
| 22270 | + } else { | |
| 22271 | + peg$currPos = s0; | |
| 22272 | + s0 = peg$c2; | |
| 22273 | + } | |
| 22274 | + } else { | |
| 22275 | + peg$currPos = s0; | |
| 22276 | + s0 = peg$c2; | |
| 22277 | + } | |
| 22278 | + } else { | |
| 22279 | + peg$currPos = s0; | |
| 22280 | + s0 = peg$c2; | |
| 22281 | + } | |
| 22282 | + } | |
| 22283 | + | |
| 22284 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22285 | + | |
| 22286 | + return s0; | |
| 22287 | + } | |
| 22288 | + | |
| 22289 | + function peg$parseboolean() { | |
| 22290 | + var s0, s1; | |
| 22291 | + | |
| 22292 | + var key = peg$currPos * 49 + 27, | |
| 22293 | + cached = peg$cache[key]; | |
| 22294 | + | |
| 22295 | + if (cached) { | |
| 22296 | + peg$currPos = cached.nextPos; | |
| 22297 | + return cached.result; | |
| 22298 | + } | |
| 22299 | + | |
| 22300 | + s0 = peg$currPos; | |
| 22301 | + if (input.substr(peg$currPos, 4) === peg$c51) { | |
| 22302 | + s1 = peg$c51; | |
| 22303 | + peg$currPos += 4; | |
| 22304 | + } else { | |
| 22305 | + s1 = peg$FAILED; | |
| 22306 | + if (peg$silentFails === 0) { peg$fail(peg$c52); } | |
| 22307 | + } | |
| 22308 | + if (s1 !== peg$FAILED) { | |
| 22309 | + peg$reportedPos = s0; | |
| 22310 | + s1 = peg$c53(); | |
| 22311 | + } | |
| 22312 | + s0 = s1; | |
| 22313 | + if (s0 === peg$FAILED) { | |
| 22314 | + s0 = peg$currPos; | |
| 22315 | + if (input.substr(peg$currPos, 5) === peg$c54) { | |
| 22316 | + s1 = peg$c54; | |
| 22317 | + peg$currPos += 5; | |
| 22318 | + } else { | |
| 22319 | + s1 = peg$FAILED; | |
| 22320 | + if (peg$silentFails === 0) { peg$fail(peg$c55); } | |
| 22321 | + } | |
| 22322 | + if (s1 !== peg$FAILED) { | |
| 22323 | + peg$reportedPos = s0; | |
| 22324 | + s1 = peg$c56(); | |
| 22325 | + } | |
| 22326 | + s0 = s1; | |
| 22327 | + } | |
| 22328 | + | |
| 22329 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22330 | + | |
| 22331 | + return s0; | |
| 22332 | + } | |
| 22333 | + | |
| 22334 | + function peg$parsearray() { | |
| 22335 | + var s0, s1, s2, s3, s4; | |
| 22336 | + | |
| 22337 | + var key = peg$currPos * 49 + 28, | |
| 22338 | + cached = peg$cache[key]; | |
| 22339 | + | |
| 22340 | + if (cached) { | |
| 22341 | + peg$currPos = cached.nextPos; | |
| 22342 | + return cached.result; | |
| 22343 | + } | |
| 22344 | + | |
| 22345 | + s0 = peg$currPos; | |
| 22346 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 22347 | + s1 = peg$c7; | |
| 22348 | + peg$currPos++; | |
| 22349 | + } else { | |
| 22350 | + s1 = peg$FAILED; | |
| 22351 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 22352 | + } | |
| 22353 | + if (s1 !== peg$FAILED) { | |
| 22354 | + s2 = []; | |
| 22355 | + s3 = peg$parsearray_sep(); | |
| 22356 | + while (s3 !== peg$FAILED) { | |
| 22357 | + s2.push(s3); | |
| 22358 | + s3 = peg$parsearray_sep(); | |
| 22359 | + } | |
| 22360 | + if (s2 !== peg$FAILED) { | |
| 22361 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 22362 | + s3 = peg$c9; | |
| 22363 | + peg$currPos++; | |
| 22364 | + } else { | |
| 22365 | + s3 = peg$FAILED; | |
| 22366 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 22367 | + } | |
| 22368 | + if (s3 !== peg$FAILED) { | |
| 22369 | + peg$reportedPos = s0; | |
| 22370 | + s1 = peg$c57(); | |
| 22371 | + s0 = s1; | |
| 22372 | + } else { | |
| 22373 | + peg$currPos = s0; | |
| 22374 | + s0 = peg$c2; | |
| 22375 | + } | |
| 22376 | + } else { | |
| 22377 | + peg$currPos = s0; | |
| 22378 | + s0 = peg$c2; | |
| 22379 | + } | |
| 22380 | + } else { | |
| 22381 | + peg$currPos = s0; | |
| 22382 | + s0 = peg$c2; | |
| 22383 | + } | |
| 22384 | + if (s0 === peg$FAILED) { | |
| 22385 | + s0 = peg$currPos; | |
| 22386 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 22387 | + s1 = peg$c7; | |
| 22388 | + peg$currPos++; | |
| 22389 | + } else { | |
| 22390 | + s1 = peg$FAILED; | |
| 22391 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 22392 | + } | |
| 22393 | + if (s1 !== peg$FAILED) { | |
| 22394 | + s2 = peg$parsearray_value(); | |
| 22395 | + if (s2 === peg$FAILED) { | |
| 22396 | + s2 = peg$c25; | |
| 22397 | + } | |
| 22398 | + if (s2 !== peg$FAILED) { | |
| 22399 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 22400 | + s3 = peg$c9; | |
| 22401 | + peg$currPos++; | |
| 22402 | + } else { | |
| 22403 | + s3 = peg$FAILED; | |
| 22404 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 22405 | + } | |
| 22406 | + if (s3 !== peg$FAILED) { | |
| 22407 | + peg$reportedPos = s0; | |
| 22408 | + s1 = peg$c58(s2); | |
| 22409 | + s0 = s1; | |
| 22410 | + } else { | |
| 22411 | + peg$currPos = s0; | |
| 22412 | + s0 = peg$c2; | |
| 22413 | + } | |
| 22414 | + } else { | |
| 22415 | + peg$currPos = s0; | |
| 22416 | + s0 = peg$c2; | |
| 22417 | + } | |
| 22418 | + } else { | |
| 22419 | + peg$currPos = s0; | |
| 22420 | + s0 = peg$c2; | |
| 22421 | + } | |
| 22422 | + if (s0 === peg$FAILED) { | |
| 22423 | + s0 = peg$currPos; | |
| 22424 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 22425 | + s1 = peg$c7; | |
| 22426 | + peg$currPos++; | |
| 22427 | + } else { | |
| 22428 | + s1 = peg$FAILED; | |
| 22429 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 22430 | + } | |
| 22431 | + if (s1 !== peg$FAILED) { | |
| 22432 | + s2 = []; | |
| 22433 | + s3 = peg$parsearray_value_list(); | |
| 22434 | + if (s3 !== peg$FAILED) { | |
| 22435 | + while (s3 !== peg$FAILED) { | |
| 22436 | + s2.push(s3); | |
| 22437 | + s3 = peg$parsearray_value_list(); | |
| 22438 | + } | |
| 22439 | + } else { | |
| 22440 | + s2 = peg$c2; | |
| 22441 | + } | |
| 22442 | + if (s2 !== peg$FAILED) { | |
| 22443 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 22444 | + s3 = peg$c9; | |
| 22445 | + peg$currPos++; | |
| 22446 | + } else { | |
| 22447 | + s3 = peg$FAILED; | |
| 22448 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 22449 | + } | |
| 22450 | + if (s3 !== peg$FAILED) { | |
| 22451 | + peg$reportedPos = s0; | |
| 22452 | + s1 = peg$c59(s2); | |
| 22453 | + s0 = s1; | |
| 22454 | + } else { | |
| 22455 | + peg$currPos = s0; | |
| 22456 | + s0 = peg$c2; | |
| 22457 | + } | |
| 22458 | + } else { | |
| 22459 | + peg$currPos = s0; | |
| 22460 | + s0 = peg$c2; | |
| 22461 | + } | |
| 22462 | + } else { | |
| 22463 | + peg$currPos = s0; | |
| 22464 | + s0 = peg$c2; | |
| 22465 | + } | |
| 22466 | + if (s0 === peg$FAILED) { | |
| 22467 | + s0 = peg$currPos; | |
| 22468 | + if (input.charCodeAt(peg$currPos) === 91) { | |
| 22469 | + s1 = peg$c7; | |
| 22470 | + peg$currPos++; | |
| 22471 | + } else { | |
| 22472 | + s1 = peg$FAILED; | |
| 22473 | + if (peg$silentFails === 0) { peg$fail(peg$c8); } | |
| 22474 | + } | |
| 22475 | + if (s1 !== peg$FAILED) { | |
| 22476 | + s2 = []; | |
| 22477 | + s3 = peg$parsearray_value_list(); | |
| 22478 | + if (s3 !== peg$FAILED) { | |
| 22479 | + while (s3 !== peg$FAILED) { | |
| 22480 | + s2.push(s3); | |
| 22481 | + s3 = peg$parsearray_value_list(); | |
| 22482 | + } | |
| 22483 | + } else { | |
| 22484 | + s2 = peg$c2; | |
| 22485 | + } | |
| 22486 | + if (s2 !== peg$FAILED) { | |
| 22487 | + s3 = peg$parsearray_value(); | |
| 22488 | + if (s3 !== peg$FAILED) { | |
| 22489 | + if (input.charCodeAt(peg$currPos) === 93) { | |
| 22490 | + s4 = peg$c9; | |
| 22491 | + peg$currPos++; | |
| 22492 | + } else { | |
| 22493 | + s4 = peg$FAILED; | |
| 22494 | + if (peg$silentFails === 0) { peg$fail(peg$c10); } | |
| 22495 | + } | |
| 22496 | + if (s4 !== peg$FAILED) { | |
| 22497 | + peg$reportedPos = s0; | |
| 22498 | + s1 = peg$c60(s2, s3); | |
| 22499 | + s0 = s1; | |
| 22500 | + } else { | |
| 22501 | + peg$currPos = s0; | |
| 22502 | + s0 = peg$c2; | |
| 22503 | + } | |
| 22504 | + } else { | |
| 22505 | + peg$currPos = s0; | |
| 22506 | + s0 = peg$c2; | |
| 22507 | + } | |
| 22508 | + } else { | |
| 22509 | + peg$currPos = s0; | |
| 22510 | + s0 = peg$c2; | |
| 22511 | + } | |
| 22512 | + } else { | |
| 22513 | + peg$currPos = s0; | |
| 22514 | + s0 = peg$c2; | |
| 22515 | + } | |
| 22516 | + } | |
| 22517 | + } | |
| 22518 | + } | |
| 22519 | + | |
| 22520 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22521 | + | |
| 22522 | + return s0; | |
| 22523 | + } | |
| 22524 | + | |
| 22525 | + function peg$parsearray_value() { | |
| 22526 | + var s0, s1, s2, s3, s4; | |
| 22527 | + | |
| 22528 | + var key = peg$currPos * 49 + 29, | |
| 22529 | + cached = peg$cache[key]; | |
| 22530 | + | |
| 22531 | + if (cached) { | |
| 22532 | + peg$currPos = cached.nextPos; | |
| 22533 | + return cached.result; | |
| 22534 | + } | |
| 22535 | + | |
| 22536 | + s0 = peg$currPos; | |
| 22537 | + s1 = []; | |
| 22538 | + s2 = peg$parsearray_sep(); | |
| 22539 | + while (s2 !== peg$FAILED) { | |
| 22540 | + s1.push(s2); | |
| 22541 | + s2 = peg$parsearray_sep(); | |
| 22542 | + } | |
| 22543 | + if (s1 !== peg$FAILED) { | |
| 22544 | + s2 = peg$parsevalue(); | |
| 22545 | + if (s2 !== peg$FAILED) { | |
| 22546 | + s3 = []; | |
| 22547 | + s4 = peg$parsearray_sep(); | |
| 22548 | + while (s4 !== peg$FAILED) { | |
| 22549 | + s3.push(s4); | |
| 22550 | + s4 = peg$parsearray_sep(); | |
| 22551 | + } | |
| 22552 | + if (s3 !== peg$FAILED) { | |
| 22553 | + peg$reportedPos = s0; | |
| 22554 | + s1 = peg$c61(s2); | |
| 22555 | + s0 = s1; | |
| 22556 | + } else { | |
| 22557 | + peg$currPos = s0; | |
| 22558 | + s0 = peg$c2; | |
| 22559 | + } | |
| 22560 | + } else { | |
| 22561 | + peg$currPos = s0; | |
| 22562 | + s0 = peg$c2; | |
| 22563 | + } | |
| 22564 | + } else { | |
| 22565 | + peg$currPos = s0; | |
| 22566 | + s0 = peg$c2; | |
| 22567 | + } | |
| 22568 | + | |
| 22569 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22570 | + | |
| 22571 | + return s0; | |
| 22572 | + } | |
| 22573 | + | |
| 22574 | + function peg$parsearray_value_list() { | |
| 22575 | + var s0, s1, s2, s3, s4, s5, s6; | |
| 22576 | + | |
| 22577 | + var key = peg$currPos * 49 + 30, | |
| 22578 | + cached = peg$cache[key]; | |
| 22579 | + | |
| 22580 | + if (cached) { | |
| 22581 | + peg$currPos = cached.nextPos; | |
| 22582 | + return cached.result; | |
| 22583 | + } | |
| 22584 | + | |
| 22585 | + s0 = peg$currPos; | |
| 22586 | + s1 = []; | |
| 22587 | + s2 = peg$parsearray_sep(); | |
| 22588 | + while (s2 !== peg$FAILED) { | |
| 22589 | + s1.push(s2); | |
| 22590 | + s2 = peg$parsearray_sep(); | |
| 22591 | + } | |
| 22592 | + if (s1 !== peg$FAILED) { | |
| 22593 | + s2 = peg$parsevalue(); | |
| 22594 | + if (s2 !== peg$FAILED) { | |
| 22595 | + s3 = []; | |
| 22596 | + s4 = peg$parsearray_sep(); | |
| 22597 | + while (s4 !== peg$FAILED) { | |
| 22598 | + s3.push(s4); | |
| 22599 | + s4 = peg$parsearray_sep(); | |
| 22600 | + } | |
| 22601 | + if (s3 !== peg$FAILED) { | |
| 22602 | + if (input.charCodeAt(peg$currPos) === 44) { | |
| 22603 | + s4 = peg$c62; | |
| 22604 | + peg$currPos++; | |
| 22605 | + } else { | |
| 22606 | + s4 = peg$FAILED; | |
| 22607 | + if (peg$silentFails === 0) { peg$fail(peg$c63); } | |
| 22608 | + } | |
| 22609 | + if (s4 !== peg$FAILED) { | |
| 22610 | + s5 = []; | |
| 22611 | + s6 = peg$parsearray_sep(); | |
| 22612 | + while (s6 !== peg$FAILED) { | |
| 22613 | + s5.push(s6); | |
| 22614 | + s6 = peg$parsearray_sep(); | |
| 22615 | + } | |
| 22616 | + if (s5 !== peg$FAILED) { | |
| 22617 | + peg$reportedPos = s0; | |
| 22618 | + s1 = peg$c61(s2); | |
| 22619 | + s0 = s1; | |
| 22620 | + } else { | |
| 22621 | + peg$currPos = s0; | |
| 22622 | + s0 = peg$c2; | |
| 22623 | + } | |
| 22624 | + } else { | |
| 22625 | + peg$currPos = s0; | |
| 22626 | + s0 = peg$c2; | |
| 22627 | + } | |
| 22628 | + } else { | |
| 22629 | + peg$currPos = s0; | |
| 22630 | + s0 = peg$c2; | |
| 22631 | + } | |
| 22632 | + } else { | |
| 22633 | + peg$currPos = s0; | |
| 22634 | + s0 = peg$c2; | |
| 22635 | + } | |
| 22636 | + } else { | |
| 22637 | + peg$currPos = s0; | |
| 22638 | + s0 = peg$c2; | |
| 22639 | + } | |
| 22640 | + | |
| 22641 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22642 | + | |
| 22643 | + return s0; | |
| 22644 | + } | |
| 22645 | + | |
| 22646 | + function peg$parsearray_sep() { | |
| 22647 | + var s0; | |
| 22648 | + | |
| 22649 | + var key = peg$currPos * 49 + 31, | |
| 22650 | + cached = peg$cache[key]; | |
| 22651 | + | |
| 22652 | + if (cached) { | |
| 22653 | + peg$currPos = cached.nextPos; | |
| 22654 | + return cached.result; | |
| 22655 | + } | |
| 22656 | + | |
| 22657 | + s0 = peg$parseS(); | |
| 22658 | + if (s0 === peg$FAILED) { | |
| 22659 | + s0 = peg$parseNL(); | |
| 22660 | + if (s0 === peg$FAILED) { | |
| 22661 | + s0 = peg$parsecomment(); | |
| 22662 | + } | |
| 22663 | + } | |
| 22664 | + | |
| 22665 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22666 | + | |
| 22667 | + return s0; | |
| 22668 | + } | |
| 22669 | + | |
| 22670 | + function peg$parseinline_table() { | |
| 22671 | + var s0, s1, s2, s3, s4, s5; | |
| 22672 | + | |
| 22673 | + var key = peg$currPos * 49 + 32, | |
| 22674 | + cached = peg$cache[key]; | |
| 22675 | + | |
| 22676 | + if (cached) { | |
| 22677 | + peg$currPos = cached.nextPos; | |
| 22678 | + return cached.result; | |
| 22679 | + } | |
| 22680 | + | |
| 22681 | + s0 = peg$currPos; | |
| 22682 | + if (input.charCodeAt(peg$currPos) === 123) { | |
| 22683 | + s1 = peg$c64; | |
| 22684 | + peg$currPos++; | |
| 22685 | + } else { | |
| 22686 | + s1 = peg$FAILED; | |
| 22687 | + if (peg$silentFails === 0) { peg$fail(peg$c65); } | |
| 22688 | + } | |
| 22689 | + if (s1 !== peg$FAILED) { | |
| 22690 | + s2 = []; | |
| 22691 | + s3 = peg$parseS(); | |
| 22692 | + while (s3 !== peg$FAILED) { | |
| 22693 | + s2.push(s3); | |
| 22694 | + s3 = peg$parseS(); | |
| 22695 | + } | |
| 22696 | + if (s2 !== peg$FAILED) { | |
| 22697 | + s3 = []; | |
| 22698 | + s4 = peg$parseinline_table_assignment(); | |
| 22699 | + while (s4 !== peg$FAILED) { | |
| 22700 | + s3.push(s4); | |
| 22701 | + s4 = peg$parseinline_table_assignment(); | |
| 22702 | + } | |
| 22703 | + if (s3 !== peg$FAILED) { | |
| 22704 | + s4 = []; | |
| 22705 | + s5 = peg$parseS(); | |
| 22706 | + while (s5 !== peg$FAILED) { | |
| 22707 | + s4.push(s5); | |
| 22708 | + s5 = peg$parseS(); | |
| 22709 | + } | |
| 22710 | + if (s4 !== peg$FAILED) { | |
| 22711 | + if (input.charCodeAt(peg$currPos) === 125) { | |
| 22712 | + s5 = peg$c66; | |
| 22713 | + peg$currPos++; | |
| 22714 | + } else { | |
| 22715 | + s5 = peg$FAILED; | |
| 22716 | + if (peg$silentFails === 0) { peg$fail(peg$c67); } | |
| 22717 | + } | |
| 22718 | + if (s5 !== peg$FAILED) { | |
| 22719 | + peg$reportedPos = s0; | |
| 22720 | + s1 = peg$c68(s3); | |
| 22721 | + s0 = s1; | |
| 22722 | + } else { | |
| 22723 | + peg$currPos = s0; | |
| 22724 | + s0 = peg$c2; | |
| 22725 | + } | |
| 22726 | + } else { | |
| 22727 | + peg$currPos = s0; | |
| 22728 | + s0 = peg$c2; | |
| 22729 | + } | |
| 22730 | + } else { | |
| 22731 | + peg$currPos = s0; | |
| 22732 | + s0 = peg$c2; | |
| 22733 | + } | |
| 22734 | + } else { | |
| 22735 | + peg$currPos = s0; | |
| 22736 | + s0 = peg$c2; | |
| 22737 | + } | |
| 22738 | + } else { | |
| 22739 | + peg$currPos = s0; | |
| 22740 | + s0 = peg$c2; | |
| 22741 | + } | |
| 22742 | + | |
| 22743 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22744 | + | |
| 22745 | + return s0; | |
| 22746 | + } | |
| 22747 | + | |
| 22748 | + function peg$parseinline_table_assignment() { | |
| 22749 | + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | |
| 22750 | + | |
| 22751 | + var key = peg$currPos * 49 + 33, | |
| 22752 | + cached = peg$cache[key]; | |
| 22753 | + | |
| 22754 | + if (cached) { | |
| 22755 | + peg$currPos = cached.nextPos; | |
| 22756 | + return cached.result; | |
| 22757 | + } | |
| 22758 | + | |
| 22759 | + s0 = peg$currPos; | |
| 22760 | + s1 = []; | |
| 22761 | + s2 = peg$parseS(); | |
| 22762 | + while (s2 !== peg$FAILED) { | |
| 22763 | + s1.push(s2); | |
| 22764 | + s2 = peg$parseS(); | |
| 22765 | + } | |
| 22766 | + if (s1 !== peg$FAILED) { | |
| 22767 | + s2 = peg$parsekey(); | |
| 22768 | + if (s2 !== peg$FAILED) { | |
| 22769 | + s3 = []; | |
| 22770 | + s4 = peg$parseS(); | |
| 22771 | + while (s4 !== peg$FAILED) { | |
| 22772 | + s3.push(s4); | |
| 22773 | + s4 = peg$parseS(); | |
| 22774 | + } | |
| 22775 | + if (s3 !== peg$FAILED) { | |
| 22776 | + if (input.charCodeAt(peg$currPos) === 61) { | |
| 22777 | + s4 = peg$c18; | |
| 22778 | + peg$currPos++; | |
| 22779 | + } else { | |
| 22780 | + s4 = peg$FAILED; | |
| 22781 | + if (peg$silentFails === 0) { peg$fail(peg$c19); } | |
| 22782 | + } | |
| 22783 | + if (s4 !== peg$FAILED) { | |
| 22784 | + s5 = []; | |
| 22785 | + s6 = peg$parseS(); | |
| 22786 | + while (s6 !== peg$FAILED) { | |
| 22787 | + s5.push(s6); | |
| 22788 | + s6 = peg$parseS(); | |
| 22789 | + } | |
| 22790 | + if (s5 !== peg$FAILED) { | |
| 22791 | + s6 = peg$parsevalue(); | |
| 22792 | + if (s6 !== peg$FAILED) { | |
| 22793 | + s7 = []; | |
| 22794 | + s8 = peg$parseS(); | |
| 22795 | + while (s8 !== peg$FAILED) { | |
| 22796 | + s7.push(s8); | |
| 22797 | + s8 = peg$parseS(); | |
| 22798 | + } | |
| 22799 | + if (s7 !== peg$FAILED) { | |
| 22800 | + if (input.charCodeAt(peg$currPos) === 44) { | |
| 22801 | + s8 = peg$c62; | |
| 22802 | + peg$currPos++; | |
| 22803 | + } else { | |
| 22804 | + s8 = peg$FAILED; | |
| 22805 | + if (peg$silentFails === 0) { peg$fail(peg$c63); } | |
| 22806 | + } | |
| 22807 | + if (s8 !== peg$FAILED) { | |
| 22808 | + s9 = []; | |
| 22809 | + s10 = peg$parseS(); | |
| 22810 | + while (s10 !== peg$FAILED) { | |
| 22811 | + s9.push(s10); | |
| 22812 | + s10 = peg$parseS(); | |
| 22813 | + } | |
| 22814 | + if (s9 !== peg$FAILED) { | |
| 22815 | + peg$reportedPos = s0; | |
| 22816 | + s1 = peg$c69(s2, s6); | |
| 22817 | + s0 = s1; | |
| 22818 | + } else { | |
| 22819 | + peg$currPos = s0; | |
| 22820 | + s0 = peg$c2; | |
| 22821 | + } | |
| 22822 | + } else { | |
| 22823 | + peg$currPos = s0; | |
| 22824 | + s0 = peg$c2; | |
| 22825 | + } | |
| 22826 | + } else { | |
| 22827 | + peg$currPos = s0; | |
| 22828 | + s0 = peg$c2; | |
| 22829 | + } | |
| 22830 | + } else { | |
| 22831 | + peg$currPos = s0; | |
| 22832 | + s0 = peg$c2; | |
| 22833 | + } | |
| 22834 | + } else { | |
| 22835 | + peg$currPos = s0; | |
| 22836 | + s0 = peg$c2; | |
| 22837 | + } | |
| 22838 | + } else { | |
| 22839 | + peg$currPos = s0; | |
| 22840 | + s0 = peg$c2; | |
| 22841 | + } | |
| 22842 | + } else { | |
| 22843 | + peg$currPos = s0; | |
| 22844 | + s0 = peg$c2; | |
| 22845 | + } | |
| 22846 | + } else { | |
| 22847 | + peg$currPos = s0; | |
| 22848 | + s0 = peg$c2; | |
| 22849 | + } | |
| 22850 | + } else { | |
| 22851 | + peg$currPos = s0; | |
| 22852 | + s0 = peg$c2; | |
| 22853 | + } | |
| 22854 | + if (s0 === peg$FAILED) { | |
| 22855 | + s0 = peg$currPos; | |
| 22856 | + s1 = []; | |
| 22857 | + s2 = peg$parseS(); | |
| 22858 | + while (s2 !== peg$FAILED) { | |
| 22859 | + s1.push(s2); | |
| 22860 | + s2 = peg$parseS(); | |
| 22861 | + } | |
| 22862 | + if (s1 !== peg$FAILED) { | |
| 22863 | + s2 = peg$parsekey(); | |
| 22864 | + if (s2 !== peg$FAILED) { | |
| 22865 | + s3 = []; | |
| 22866 | + s4 = peg$parseS(); | |
| 22867 | + while (s4 !== peg$FAILED) { | |
| 22868 | + s3.push(s4); | |
| 22869 | + s4 = peg$parseS(); | |
| 22870 | + } | |
| 22871 | + if (s3 !== peg$FAILED) { | |
| 22872 | + if (input.charCodeAt(peg$currPos) === 61) { | |
| 22873 | + s4 = peg$c18; | |
| 22874 | + peg$currPos++; | |
| 22875 | + } else { | |
| 22876 | + s4 = peg$FAILED; | |
| 22877 | + if (peg$silentFails === 0) { peg$fail(peg$c19); } | |
| 22878 | + } | |
| 22879 | + if (s4 !== peg$FAILED) { | |
| 22880 | + s5 = []; | |
| 22881 | + s6 = peg$parseS(); | |
| 22882 | + while (s6 !== peg$FAILED) { | |
| 22883 | + s5.push(s6); | |
| 22884 | + s6 = peg$parseS(); | |
| 22885 | + } | |
| 22886 | + if (s5 !== peg$FAILED) { | |
| 22887 | + s6 = peg$parsevalue(); | |
| 22888 | + if (s6 !== peg$FAILED) { | |
| 22889 | + peg$reportedPos = s0; | |
| 22890 | + s1 = peg$c69(s2, s6); | |
| 22891 | + s0 = s1; | |
| 22892 | + } else { | |
| 22893 | + peg$currPos = s0; | |
| 22894 | + s0 = peg$c2; | |
| 22895 | + } | |
| 22896 | + } else { | |
| 22897 | + peg$currPos = s0; | |
| 22898 | + s0 = peg$c2; | |
| 22899 | + } | |
| 22900 | + } else { | |
| 22901 | + peg$currPos = s0; | |
| 22902 | + s0 = peg$c2; | |
| 22903 | + } | |
| 22904 | + } else { | |
| 22905 | + peg$currPos = s0; | |
| 22906 | + s0 = peg$c2; | |
| 22907 | + } | |
| 22908 | + } else { | |
| 22909 | + peg$currPos = s0; | |
| 22910 | + s0 = peg$c2; | |
| 22911 | + } | |
| 22912 | + } else { | |
| 22913 | + peg$currPos = s0; | |
| 22914 | + s0 = peg$c2; | |
| 22915 | + } | |
| 22916 | + } | |
| 22917 | + | |
| 22918 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22919 | + | |
| 22920 | + return s0; | |
| 22921 | + } | |
| 22922 | + | |
| 22923 | + function peg$parsesecfragment() { | |
| 22924 | + var s0, s1, s2; | |
| 22925 | + | |
| 22926 | + var key = peg$currPos * 49 + 34, | |
| 22927 | + cached = peg$cache[key]; | |
| 22928 | + | |
| 22929 | + if (cached) { | |
| 22930 | + peg$currPos = cached.nextPos; | |
| 22931 | + return cached.result; | |
| 22932 | + } | |
| 22933 | + | |
| 22934 | + s0 = peg$currPos; | |
| 22935 | + if (input.charCodeAt(peg$currPos) === 46) { | |
| 22936 | + s1 = peg$c16; | |
| 22937 | + peg$currPos++; | |
| 22938 | + } else { | |
| 22939 | + s1 = peg$FAILED; | |
| 22940 | + if (peg$silentFails === 0) { peg$fail(peg$c17); } | |
| 22941 | + } | |
| 22942 | + if (s1 !== peg$FAILED) { | |
| 22943 | + s2 = peg$parseDIGITS(); | |
| 22944 | + if (s2 !== peg$FAILED) { | |
| 22945 | + peg$reportedPos = s0; | |
| 22946 | + s1 = peg$c70(s2); | |
| 22947 | + s0 = s1; | |
| 22948 | + } else { | |
| 22949 | + peg$currPos = s0; | |
| 22950 | + s0 = peg$c2; | |
| 22951 | + } | |
| 22952 | + } else { | |
| 22953 | + peg$currPos = s0; | |
| 22954 | + s0 = peg$c2; | |
| 22955 | + } | |
| 22956 | + | |
| 22957 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 22958 | + | |
| 22959 | + return s0; | |
| 22960 | + } | |
| 22961 | + | |
| 22962 | + function peg$parsedate() { | |
| 22963 | + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; | |
| 22964 | + | |
| 22965 | + var key = peg$currPos * 49 + 35, | |
| 22966 | + cached = peg$cache[key]; | |
| 22967 | + | |
| 22968 | + if (cached) { | |
| 22969 | + peg$currPos = cached.nextPos; | |
| 22970 | + return cached.result; | |
| 22971 | + } | |
| 22972 | + | |
| 22973 | + s0 = peg$currPos; | |
| 22974 | + s1 = peg$currPos; | |
| 22975 | + s2 = peg$parseDIGIT_OR_UNDER(); | |
| 22976 | + if (s2 !== peg$FAILED) { | |
| 22977 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 22978 | + if (s3 !== peg$FAILED) { | |
| 22979 | + s4 = peg$parseDIGIT_OR_UNDER(); | |
| 22980 | + if (s4 !== peg$FAILED) { | |
| 22981 | + s5 = peg$parseDIGIT_OR_UNDER(); | |
| 22982 | + if (s5 !== peg$FAILED) { | |
| 22983 | + if (input.charCodeAt(peg$currPos) === 45) { | |
| 22984 | + s6 = peg$c47; | |
| 22985 | + peg$currPos++; | |
| 22986 | + } else { | |
| 22987 | + s6 = peg$FAILED; | |
| 22988 | + if (peg$silentFails === 0) { peg$fail(peg$c48); } | |
| 22989 | + } | |
| 22990 | + if (s6 !== peg$FAILED) { | |
| 22991 | + s7 = peg$parseDIGIT_OR_UNDER(); | |
| 22992 | + if (s7 !== peg$FAILED) { | |
| 22993 | + s8 = peg$parseDIGIT_OR_UNDER(); | |
| 22994 | + if (s8 !== peg$FAILED) { | |
| 22995 | + if (input.charCodeAt(peg$currPos) === 45) { | |
| 22996 | + s9 = peg$c47; | |
| 22997 | + peg$currPos++; | |
| 22998 | + } else { | |
| 22999 | + s9 = peg$FAILED; | |
| 23000 | + if (peg$silentFails === 0) { peg$fail(peg$c48); } | |
| 23001 | + } | |
| 23002 | + if (s9 !== peg$FAILED) { | |
| 23003 | + s10 = peg$parseDIGIT_OR_UNDER(); | |
| 23004 | + if (s10 !== peg$FAILED) { | |
| 23005 | + s11 = peg$parseDIGIT_OR_UNDER(); | |
| 23006 | + if (s11 !== peg$FAILED) { | |
| 23007 | + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11]; | |
| 23008 | + s1 = s2; | |
| 23009 | + } else { | |
| 23010 | + peg$currPos = s1; | |
| 23011 | + s1 = peg$c2; | |
| 23012 | + } | |
| 23013 | + } else { | |
| 23014 | + peg$currPos = s1; | |
| 23015 | + s1 = peg$c2; | |
| 23016 | + } | |
| 23017 | + } else { | |
| 23018 | + peg$currPos = s1; | |
| 23019 | + s1 = peg$c2; | |
| 23020 | + } | |
| 23021 | + } else { | |
| 23022 | + peg$currPos = s1; | |
| 23023 | + s1 = peg$c2; | |
| 23024 | + } | |
| 23025 | + } else { | |
| 23026 | + peg$currPos = s1; | |
| 23027 | + s1 = peg$c2; | |
| 23028 | + } | |
| 23029 | + } else { | |
| 23030 | + peg$currPos = s1; | |
| 23031 | + s1 = peg$c2; | |
| 23032 | + } | |
| 23033 | + } else { | |
| 23034 | + peg$currPos = s1; | |
| 23035 | + s1 = peg$c2; | |
| 23036 | + } | |
| 23037 | + } else { | |
| 23038 | + peg$currPos = s1; | |
| 23039 | + s1 = peg$c2; | |
| 23040 | + } | |
| 23041 | + } else { | |
| 23042 | + peg$currPos = s1; | |
| 23043 | + s1 = peg$c2; | |
| 23044 | + } | |
| 23045 | + } else { | |
| 23046 | + peg$currPos = s1; | |
| 23047 | + s1 = peg$c2; | |
| 23048 | + } | |
| 23049 | + if (s1 !== peg$FAILED) { | |
| 23050 | + peg$reportedPos = s0; | |
| 23051 | + s1 = peg$c71(s1); | |
| 23052 | + } | |
| 23053 | + s0 = s1; | |
| 23054 | + | |
| 23055 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23056 | + | |
| 23057 | + return s0; | |
| 23058 | + } | |
| 23059 | + | |
| 23060 | + function peg$parsetime() { | |
| 23061 | + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | |
| 23062 | + | |
| 23063 | + var key = peg$currPos * 49 + 36, | |
| 23064 | + cached = peg$cache[key]; | |
| 23065 | + | |
| 23066 | + if (cached) { | |
| 23067 | + peg$currPos = cached.nextPos; | |
| 23068 | + return cached.result; | |
| 23069 | + } | |
| 23070 | + | |
| 23071 | + s0 = peg$currPos; | |
| 23072 | + s1 = peg$currPos; | |
| 23073 | + s2 = peg$parseDIGIT_OR_UNDER(); | |
| 23074 | + if (s2 !== peg$FAILED) { | |
| 23075 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 23076 | + if (s3 !== peg$FAILED) { | |
| 23077 | + if (input.charCodeAt(peg$currPos) === 58) { | |
| 23078 | + s4 = peg$c72; | |
| 23079 | + peg$currPos++; | |
| 23080 | + } else { | |
| 23081 | + s4 = peg$FAILED; | |
| 23082 | + if (peg$silentFails === 0) { peg$fail(peg$c73); } | |
| 23083 | + } | |
| 23084 | + if (s4 !== peg$FAILED) { | |
| 23085 | + s5 = peg$parseDIGIT_OR_UNDER(); | |
| 23086 | + if (s5 !== peg$FAILED) { | |
| 23087 | + s6 = peg$parseDIGIT_OR_UNDER(); | |
| 23088 | + if (s6 !== peg$FAILED) { | |
| 23089 | + if (input.charCodeAt(peg$currPos) === 58) { | |
| 23090 | + s7 = peg$c72; | |
| 23091 | + peg$currPos++; | |
| 23092 | + } else { | |
| 23093 | + s7 = peg$FAILED; | |
| 23094 | + if (peg$silentFails === 0) { peg$fail(peg$c73); } | |
| 23095 | + } | |
| 23096 | + if (s7 !== peg$FAILED) { | |
| 23097 | + s8 = peg$parseDIGIT_OR_UNDER(); | |
| 23098 | + if (s8 !== peg$FAILED) { | |
| 23099 | + s9 = peg$parseDIGIT_OR_UNDER(); | |
| 23100 | + if (s9 !== peg$FAILED) { | |
| 23101 | + s10 = peg$parsesecfragment(); | |
| 23102 | + if (s10 === peg$FAILED) { | |
| 23103 | + s10 = peg$c25; | |
| 23104 | + } | |
| 23105 | + if (s10 !== peg$FAILED) { | |
| 23106 | + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10]; | |
| 23107 | + s1 = s2; | |
| 23108 | + } else { | |
| 23109 | + peg$currPos = s1; | |
| 23110 | + s1 = peg$c2; | |
| 23111 | + } | |
| 23112 | + } else { | |
| 23113 | + peg$currPos = s1; | |
| 23114 | + s1 = peg$c2; | |
| 23115 | + } | |
| 23116 | + } else { | |
| 23117 | + peg$currPos = s1; | |
| 23118 | + s1 = peg$c2; | |
| 23119 | + } | |
| 23120 | + } else { | |
| 23121 | + peg$currPos = s1; | |
| 23122 | + s1 = peg$c2; | |
| 23123 | + } | |
| 23124 | + } else { | |
| 23125 | + peg$currPos = s1; | |
| 23126 | + s1 = peg$c2; | |
| 23127 | + } | |
| 23128 | + } else { | |
| 23129 | + peg$currPos = s1; | |
| 23130 | + s1 = peg$c2; | |
| 23131 | + } | |
| 23132 | + } else { | |
| 23133 | + peg$currPos = s1; | |
| 23134 | + s1 = peg$c2; | |
| 23135 | + } | |
| 23136 | + } else { | |
| 23137 | + peg$currPos = s1; | |
| 23138 | + s1 = peg$c2; | |
| 23139 | + } | |
| 23140 | + } else { | |
| 23141 | + peg$currPos = s1; | |
| 23142 | + s1 = peg$c2; | |
| 23143 | + } | |
| 23144 | + if (s1 !== peg$FAILED) { | |
| 23145 | + peg$reportedPos = s0; | |
| 23146 | + s1 = peg$c74(s1); | |
| 23147 | + } | |
| 23148 | + s0 = s1; | |
| 23149 | + | |
| 23150 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23151 | + | |
| 23152 | + return s0; | |
| 23153 | + } | |
| 23154 | + | |
| 23155 | + function peg$parsetime_with_offset() { | |
| 23156 | + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16; | |
| 23157 | + | |
| 23158 | + var key = peg$currPos * 49 + 37, | |
| 23159 | + cached = peg$cache[key]; | |
| 23160 | + | |
| 23161 | + if (cached) { | |
| 23162 | + peg$currPos = cached.nextPos; | |
| 23163 | + return cached.result; | |
| 23164 | + } | |
| 23165 | + | |
| 23166 | + s0 = peg$currPos; | |
| 23167 | + s1 = peg$currPos; | |
| 23168 | + s2 = peg$parseDIGIT_OR_UNDER(); | |
| 23169 | + if (s2 !== peg$FAILED) { | |
| 23170 | + s3 = peg$parseDIGIT_OR_UNDER(); | |
| 23171 | + if (s3 !== peg$FAILED) { | |
| 23172 | + if (input.charCodeAt(peg$currPos) === 58) { | |
| 23173 | + s4 = peg$c72; | |
| 23174 | + peg$currPos++; | |
| 23175 | + } else { | |
| 23176 | + s4 = peg$FAILED; | |
| 23177 | + if (peg$silentFails === 0) { peg$fail(peg$c73); } | |
| 23178 | + } | |
| 23179 | + if (s4 !== peg$FAILED) { | |
| 23180 | + s5 = peg$parseDIGIT_OR_UNDER(); | |
| 23181 | + if (s5 !== peg$FAILED) { | |
| 23182 | + s6 = peg$parseDIGIT_OR_UNDER(); | |
| 23183 | + if (s6 !== peg$FAILED) { | |
| 23184 | + if (input.charCodeAt(peg$currPos) === 58) { | |
| 23185 | + s7 = peg$c72; | |
| 23186 | + peg$currPos++; | |
| 23187 | + } else { | |
| 23188 | + s7 = peg$FAILED; | |
| 23189 | + if (peg$silentFails === 0) { peg$fail(peg$c73); } | |
| 23190 | + } | |
| 23191 | + if (s7 !== peg$FAILED) { | |
| 23192 | + s8 = peg$parseDIGIT_OR_UNDER(); | |
| 23193 | + if (s8 !== peg$FAILED) { | |
| 23194 | + s9 = peg$parseDIGIT_OR_UNDER(); | |
| 23195 | + if (s9 !== peg$FAILED) { | |
| 23196 | + s10 = peg$parsesecfragment(); | |
| 23197 | + if (s10 === peg$FAILED) { | |
| 23198 | + s10 = peg$c25; | |
| 23199 | + } | |
| 23200 | + if (s10 !== peg$FAILED) { | |
| 23201 | + if (input.charCodeAt(peg$currPos) === 45) { | |
| 23202 | + s11 = peg$c47; | |
| 23203 | + peg$currPos++; | |
| 23204 | + } else { | |
| 23205 | + s11 = peg$FAILED; | |
| 23206 | + if (peg$silentFails === 0) { peg$fail(peg$c48); } | |
| 23207 | + } | |
| 23208 | + if (s11 === peg$FAILED) { | |
| 23209 | + if (input.charCodeAt(peg$currPos) === 43) { | |
| 23210 | + s11 = peg$c44; | |
| 23211 | + peg$currPos++; | |
| 23212 | + } else { | |
| 23213 | + s11 = peg$FAILED; | |
| 23214 | + if (peg$silentFails === 0) { peg$fail(peg$c45); } | |
| 23215 | + } | |
| 23216 | + } | |
| 23217 | + if (s11 !== peg$FAILED) { | |
| 23218 | + s12 = peg$parseDIGIT_OR_UNDER(); | |
| 23219 | + if (s12 !== peg$FAILED) { | |
| 23220 | + s13 = peg$parseDIGIT_OR_UNDER(); | |
| 23221 | + if (s13 !== peg$FAILED) { | |
| 23222 | + if (input.charCodeAt(peg$currPos) === 58) { | |
| 23223 | + s14 = peg$c72; | |
| 23224 | + peg$currPos++; | |
| 23225 | + } else { | |
| 23226 | + s14 = peg$FAILED; | |
| 23227 | + if (peg$silentFails === 0) { peg$fail(peg$c73); } | |
| 23228 | + } | |
| 23229 | + if (s14 !== peg$FAILED) { | |
| 23230 | + s15 = peg$parseDIGIT_OR_UNDER(); | |
| 23231 | + if (s15 !== peg$FAILED) { | |
| 23232 | + s16 = peg$parseDIGIT_OR_UNDER(); | |
| 23233 | + if (s16 !== peg$FAILED) { | |
| 23234 | + s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16]; | |
| 23235 | + s1 = s2; | |
| 23236 | + } else { | |
| 23237 | + peg$currPos = s1; | |
| 23238 | + s1 = peg$c2; | |
| 23239 | + } | |
| 23240 | + } else { | |
| 23241 | + peg$currPos = s1; | |
| 23242 | + s1 = peg$c2; | |
| 23243 | + } | |
| 23244 | + } else { | |
| 23245 | + peg$currPos = s1; | |
| 23246 | + s1 = peg$c2; | |
| 23247 | + } | |
| 23248 | + } else { | |
| 23249 | + peg$currPos = s1; | |
| 23250 | + s1 = peg$c2; | |
| 23251 | + } | |
| 23252 | + } else { | |
| 23253 | + peg$currPos = s1; | |
| 23254 | + s1 = peg$c2; | |
| 23255 | + } | |
| 23256 | + } else { | |
| 23257 | + peg$currPos = s1; | |
| 23258 | + s1 = peg$c2; | |
| 23259 | + } | |
| 23260 | + } else { | |
| 23261 | + peg$currPos = s1; | |
| 23262 | + s1 = peg$c2; | |
| 23263 | + } | |
| 23264 | + } else { | |
| 23265 | + peg$currPos = s1; | |
| 23266 | + s1 = peg$c2; | |
| 23267 | + } | |
| 23268 | + } else { | |
| 23269 | + peg$currPos = s1; | |
| 23270 | + s1 = peg$c2; | |
| 23271 | + } | |
| 23272 | + } else { | |
| 23273 | + peg$currPos = s1; | |
| 23274 | + s1 = peg$c2; | |
| 23275 | + } | |
| 23276 | + } else { | |
| 23277 | + peg$currPos = s1; | |
| 23278 | + s1 = peg$c2; | |
| 23279 | + } | |
| 23280 | + } else { | |
| 23281 | + peg$currPos = s1; | |
| 23282 | + s1 = peg$c2; | |
| 23283 | + } | |
| 23284 | + } else { | |
| 23285 | + peg$currPos = s1; | |
| 23286 | + s1 = peg$c2; | |
| 23287 | + } | |
| 23288 | + } else { | |
| 23289 | + peg$currPos = s1; | |
| 23290 | + s1 = peg$c2; | |
| 23291 | + } | |
| 23292 | + } else { | |
| 23293 | + peg$currPos = s1; | |
| 23294 | + s1 = peg$c2; | |
| 23295 | + } | |
| 23296 | + if (s1 !== peg$FAILED) { | |
| 23297 | + peg$reportedPos = s0; | |
| 23298 | + s1 = peg$c74(s1); | |
| 23299 | + } | |
| 23300 | + s0 = s1; | |
| 23301 | + | |
| 23302 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23303 | + | |
| 23304 | + return s0; | |
| 23305 | + } | |
| 23306 | + | |
| 23307 | + function peg$parsedatetime() { | |
| 23308 | + var s0, s1, s2, s3, s4; | |
| 23309 | + | |
| 23310 | + var key = peg$currPos * 49 + 38, | |
| 23311 | + cached = peg$cache[key]; | |
| 23312 | + | |
| 23313 | + if (cached) { | |
| 23314 | + peg$currPos = cached.nextPos; | |
| 23315 | + return cached.result; | |
| 23316 | + } | |
| 23317 | + | |
| 23318 | + s0 = peg$currPos; | |
| 23319 | + s1 = peg$parsedate(); | |
| 23320 | + if (s1 !== peg$FAILED) { | |
| 23321 | + if (input.charCodeAt(peg$currPos) === 84) { | |
| 23322 | + s2 = peg$c75; | |
| 23323 | + peg$currPos++; | |
| 23324 | + } else { | |
| 23325 | + s2 = peg$FAILED; | |
| 23326 | + if (peg$silentFails === 0) { peg$fail(peg$c76); } | |
| 23327 | + } | |
| 23328 | + if (s2 !== peg$FAILED) { | |
| 23329 | + s3 = peg$parsetime(); | |
| 23330 | + if (s3 !== peg$FAILED) { | |
| 23331 | + if (input.charCodeAt(peg$currPos) === 90) { | |
| 23332 | + s4 = peg$c77; | |
| 23333 | + peg$currPos++; | |
| 23334 | + } else { | |
| 23335 | + s4 = peg$FAILED; | |
| 23336 | + if (peg$silentFails === 0) { peg$fail(peg$c78); } | |
| 23337 | + } | |
| 23338 | + if (s4 !== peg$FAILED) { | |
| 23339 | + peg$reportedPos = s0; | |
| 23340 | + s1 = peg$c79(s1, s3); | |
| 23341 | + s0 = s1; | |
| 23342 | + } else { | |
| 23343 | + peg$currPos = s0; | |
| 23344 | + s0 = peg$c2; | |
| 23345 | + } | |
| 23346 | + } else { | |
| 23347 | + peg$currPos = s0; | |
| 23348 | + s0 = peg$c2; | |
| 23349 | + } | |
| 23350 | + } else { | |
| 23351 | + peg$currPos = s0; | |
| 23352 | + s0 = peg$c2; | |
| 23353 | + } | |
| 23354 | + } else { | |
| 23355 | + peg$currPos = s0; | |
| 23356 | + s0 = peg$c2; | |
| 23357 | + } | |
| 23358 | + if (s0 === peg$FAILED) { | |
| 23359 | + s0 = peg$currPos; | |
| 23360 | + s1 = peg$parsedate(); | |
| 23361 | + if (s1 !== peg$FAILED) { | |
| 23362 | + if (input.charCodeAt(peg$currPos) === 84) { | |
| 23363 | + s2 = peg$c75; | |
| 23364 | + peg$currPos++; | |
| 23365 | + } else { | |
| 23366 | + s2 = peg$FAILED; | |
| 23367 | + if (peg$silentFails === 0) { peg$fail(peg$c76); } | |
| 23368 | + } | |
| 23369 | + if (s2 !== peg$FAILED) { | |
| 23370 | + s3 = peg$parsetime_with_offset(); | |
| 23371 | + if (s3 !== peg$FAILED) { | |
| 23372 | + peg$reportedPos = s0; | |
| 23373 | + s1 = peg$c80(s1, s3); | |
| 23374 | + s0 = s1; | |
| 23375 | + } else { | |
| 23376 | + peg$currPos = s0; | |
| 23377 | + s0 = peg$c2; | |
| 23378 | + } | |
| 23379 | + } else { | |
| 23380 | + peg$currPos = s0; | |
| 23381 | + s0 = peg$c2; | |
| 23382 | + } | |
| 23383 | + } else { | |
| 23384 | + peg$currPos = s0; | |
| 23385 | + s0 = peg$c2; | |
| 23386 | + } | |
| 23387 | + } | |
| 23388 | + | |
| 23389 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23390 | + | |
| 23391 | + return s0; | |
| 23392 | + } | |
| 23393 | + | |
| 23394 | + function peg$parseS() { | |
| 23395 | + var s0; | |
| 23396 | + | |
| 23397 | + var key = peg$currPos * 49 + 39, | |
| 23398 | + cached = peg$cache[key]; | |
| 23399 | + | |
| 23400 | + if (cached) { | |
| 23401 | + peg$currPos = cached.nextPos; | |
| 23402 | + return cached.result; | |
| 23403 | + } | |
| 23404 | + | |
| 23405 | + if (peg$c81.test(input.charAt(peg$currPos))) { | |
| 23406 | + s0 = input.charAt(peg$currPos); | |
| 23407 | + peg$currPos++; | |
| 23408 | + } else { | |
| 23409 | + s0 = peg$FAILED; | |
| 23410 | + if (peg$silentFails === 0) { peg$fail(peg$c82); } | |
| 23411 | + } | |
| 23412 | + | |
| 23413 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23414 | + | |
| 23415 | + return s0; | |
| 23416 | + } | |
| 23417 | + | |
| 23418 | + function peg$parseNL() { | |
| 23419 | + var s0, s1, s2; | |
| 23420 | + | |
| 23421 | + var key = peg$currPos * 49 + 40, | |
| 23422 | + cached = peg$cache[key]; | |
| 23423 | + | |
| 23424 | + if (cached) { | |
| 23425 | + peg$currPos = cached.nextPos; | |
| 23426 | + return cached.result; | |
| 23427 | + } | |
| 23428 | + | |
| 23429 | + if (input.charCodeAt(peg$currPos) === 10) { | |
| 23430 | + s0 = peg$c83; | |
| 23431 | + peg$currPos++; | |
| 23432 | + } else { | |
| 23433 | + s0 = peg$FAILED; | |
| 23434 | + if (peg$silentFails === 0) { peg$fail(peg$c84); } | |
| 23435 | + } | |
| 23436 | + if (s0 === peg$FAILED) { | |
| 23437 | + s0 = peg$currPos; | |
| 23438 | + if (input.charCodeAt(peg$currPos) === 13) { | |
| 23439 | + s1 = peg$c85; | |
| 23440 | + peg$currPos++; | |
| 23441 | + } else { | |
| 23442 | + s1 = peg$FAILED; | |
| 23443 | + if (peg$silentFails === 0) { peg$fail(peg$c86); } | |
| 23444 | + } | |
| 23445 | + if (s1 !== peg$FAILED) { | |
| 23446 | + if (input.charCodeAt(peg$currPos) === 10) { | |
| 23447 | + s2 = peg$c83; | |
| 23448 | + peg$currPos++; | |
| 23449 | + } else { | |
| 23450 | + s2 = peg$FAILED; | |
| 23451 | + if (peg$silentFails === 0) { peg$fail(peg$c84); } | |
| 23452 | + } | |
| 23453 | + if (s2 !== peg$FAILED) { | |
| 23454 | + s1 = [s1, s2]; | |
| 23455 | + s0 = s1; | |
| 23456 | + } else { | |
| 23457 | + peg$currPos = s0; | |
| 23458 | + s0 = peg$c2; | |
| 23459 | + } | |
| 23460 | + } else { | |
| 23461 | + peg$currPos = s0; | |
| 23462 | + s0 = peg$c2; | |
| 23463 | + } | |
| 23464 | + } | |
| 23465 | + | |
| 23466 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23467 | + | |
| 23468 | + return s0; | |
| 23469 | + } | |
| 23470 | + | |
| 23471 | + function peg$parseNLS() { | |
| 23472 | + var s0; | |
| 23473 | + | |
| 23474 | + var key = peg$currPos * 49 + 41, | |
| 23475 | + cached = peg$cache[key]; | |
| 23476 | + | |
| 23477 | + if (cached) { | |
| 23478 | + peg$currPos = cached.nextPos; | |
| 23479 | + return cached.result; | |
| 23480 | + } | |
| 23481 | + | |
| 23482 | + s0 = peg$parseNL(); | |
| 23483 | + if (s0 === peg$FAILED) { | |
| 23484 | + s0 = peg$parseS(); | |
| 23485 | + } | |
| 23486 | + | |
| 23487 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23488 | + | |
| 23489 | + return s0; | |
| 23490 | + } | |
| 23491 | + | |
| 23492 | + function peg$parseEOF() { | |
| 23493 | + var s0, s1; | |
| 23494 | + | |
| 23495 | + var key = peg$currPos * 49 + 42, | |
| 23496 | + cached = peg$cache[key]; | |
| 23497 | + | |
| 23498 | + if (cached) { | |
| 23499 | + peg$currPos = cached.nextPos; | |
| 23500 | + return cached.result; | |
| 23501 | + } | |
| 23502 | + | |
| 23503 | + s0 = peg$currPos; | |
| 23504 | + peg$silentFails++; | |
| 23505 | + if (input.length > peg$currPos) { | |
| 23506 | + s1 = input.charAt(peg$currPos); | |
| 23507 | + peg$currPos++; | |
| 23508 | + } else { | |
| 23509 | + s1 = peg$FAILED; | |
| 23510 | + if (peg$silentFails === 0) { peg$fail(peg$c6); } | |
| 23511 | + } | |
| 23512 | + peg$silentFails--; | |
| 23513 | + if (s1 === peg$FAILED) { | |
| 23514 | + s0 = peg$c5; | |
| 23515 | + } else { | |
| 23516 | + peg$currPos = s0; | |
| 23517 | + s0 = peg$c2; | |
| 23518 | + } | |
| 23519 | + | |
| 23520 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23521 | + | |
| 23522 | + return s0; | |
| 23523 | + } | |
| 23524 | + | |
| 23525 | + function peg$parseHEX() { | |
| 23526 | + var s0; | |
| 23527 | + | |
| 23528 | + var key = peg$currPos * 49 + 43, | |
| 23529 | + cached = peg$cache[key]; | |
| 23530 | + | |
| 23531 | + if (cached) { | |
| 23532 | + peg$currPos = cached.nextPos; | |
| 23533 | + return cached.result; | |
| 23534 | + } | |
| 23535 | + | |
| 23536 | + if (peg$c87.test(input.charAt(peg$currPos))) { | |
| 23537 | + s0 = input.charAt(peg$currPos); | |
| 23538 | + peg$currPos++; | |
| 23539 | + } else { | |
| 23540 | + s0 = peg$FAILED; | |
| 23541 | + if (peg$silentFails === 0) { peg$fail(peg$c88); } | |
| 23542 | + } | |
| 23543 | + | |
| 23544 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23545 | + | |
| 23546 | + return s0; | |
| 23547 | + } | |
| 23548 | + | |
| 23549 | + function peg$parseDIGIT_OR_UNDER() { | |
| 23550 | + var s0, s1; | |
| 23551 | + | |
| 23552 | + var key = peg$currPos * 49 + 44, | |
| 23553 | + cached = peg$cache[key]; | |
| 23554 | + | |
| 23555 | + if (cached) { | |
| 23556 | + peg$currPos = cached.nextPos; | |
| 23557 | + return cached.result; | |
| 23558 | + } | |
| 23559 | + | |
| 23560 | + if (peg$c89.test(input.charAt(peg$currPos))) { | |
| 23561 | + s0 = input.charAt(peg$currPos); | |
| 23562 | + peg$currPos++; | |
| 23563 | + } else { | |
| 23564 | + s0 = peg$FAILED; | |
| 23565 | + if (peg$silentFails === 0) { peg$fail(peg$c90); } | |
| 23566 | + } | |
| 23567 | + if (s0 === peg$FAILED) { | |
| 23568 | + s0 = peg$currPos; | |
| 23569 | + if (input.charCodeAt(peg$currPos) === 95) { | |
| 23570 | + s1 = peg$c91; | |
| 23571 | + peg$currPos++; | |
| 23572 | + } else { | |
| 23573 | + s1 = peg$FAILED; | |
| 23574 | + if (peg$silentFails === 0) { peg$fail(peg$c92); } | |
| 23575 | + } | |
| 23576 | + if (s1 !== peg$FAILED) { | |
| 23577 | + peg$reportedPos = s0; | |
| 23578 | + s1 = peg$c93(); | |
| 23579 | + } | |
| 23580 | + s0 = s1; | |
| 23581 | + } | |
| 23582 | + | |
| 23583 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23584 | + | |
| 23585 | + return s0; | |
| 23586 | + } | |
| 23587 | + | |
| 23588 | + function peg$parseASCII_BASIC() { | |
| 23589 | + var s0; | |
| 23590 | + | |
| 23591 | + var key = peg$currPos * 49 + 45, | |
| 23592 | + cached = peg$cache[key]; | |
| 23593 | + | |
| 23594 | + if (cached) { | |
| 23595 | + peg$currPos = cached.nextPos; | |
| 23596 | + return cached.result; | |
| 23597 | + } | |
| 23598 | + | |
| 23599 | + if (peg$c94.test(input.charAt(peg$currPos))) { | |
| 23600 | + s0 = input.charAt(peg$currPos); | |
| 23601 | + peg$currPos++; | |
| 23602 | + } else { | |
| 23603 | + s0 = peg$FAILED; | |
| 23604 | + if (peg$silentFails === 0) { peg$fail(peg$c95); } | |
| 23605 | + } | |
| 23606 | + | |
| 23607 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23608 | + | |
| 23609 | + return s0; | |
| 23610 | + } | |
| 23611 | + | |
| 23612 | + function peg$parseDIGITS() { | |
| 23613 | + var s0, s1, s2; | |
| 23614 | + | |
| 23615 | + var key = peg$currPos * 49 + 46, | |
| 23616 | + cached = peg$cache[key]; | |
| 23617 | + | |
| 23618 | + if (cached) { | |
| 23619 | + peg$currPos = cached.nextPos; | |
| 23620 | + return cached.result; | |
| 23621 | + } | |
| 23622 | + | |
| 23623 | + s0 = peg$currPos; | |
| 23624 | + s1 = []; | |
| 23625 | + s2 = peg$parseDIGIT_OR_UNDER(); | |
| 23626 | + if (s2 !== peg$FAILED) { | |
| 23627 | + while (s2 !== peg$FAILED) { | |
| 23628 | + s1.push(s2); | |
| 23629 | + s2 = peg$parseDIGIT_OR_UNDER(); | |
| 23630 | + } | |
| 23631 | + } else { | |
| 23632 | + s1 = peg$c2; | |
| 23633 | + } | |
| 23634 | + if (s1 !== peg$FAILED) { | |
| 23635 | + peg$reportedPos = s0; | |
| 23636 | + s1 = peg$c96(s1); | |
| 23637 | + } | |
| 23638 | + s0 = s1; | |
| 23639 | + | |
| 23640 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23641 | + | |
| 23642 | + return s0; | |
| 23643 | + } | |
| 23644 | + | |
| 23645 | + function peg$parseESCAPED() { | |
| 23646 | + var s0, s1; | |
| 23647 | + | |
| 23648 | + var key = peg$currPos * 49 + 47, | |
| 23649 | + cached = peg$cache[key]; | |
| 23650 | + | |
| 23651 | + if (cached) { | |
| 23652 | + peg$currPos = cached.nextPos; | |
| 23653 | + return cached.result; | |
| 23654 | + } | |
| 23655 | + | |
| 23656 | + s0 = peg$currPos; | |
| 23657 | + if (input.substr(peg$currPos, 2) === peg$c97) { | |
| 23658 | + s1 = peg$c97; | |
| 23659 | + peg$currPos += 2; | |
| 23660 | + } else { | |
| 23661 | + s1 = peg$FAILED; | |
| 23662 | + if (peg$silentFails === 0) { peg$fail(peg$c98); } | |
| 23663 | + } | |
| 23664 | + if (s1 !== peg$FAILED) { | |
| 23665 | + peg$reportedPos = s0; | |
| 23666 | + s1 = peg$c99(); | |
| 23667 | + } | |
| 23668 | + s0 = s1; | |
| 23669 | + if (s0 === peg$FAILED) { | |
| 23670 | + s0 = peg$currPos; | |
| 23671 | + if (input.substr(peg$currPos, 2) === peg$c100) { | |
| 23672 | + s1 = peg$c100; | |
| 23673 | + peg$currPos += 2; | |
| 23674 | + } else { | |
| 23675 | + s1 = peg$FAILED; | |
| 23676 | + if (peg$silentFails === 0) { peg$fail(peg$c101); } | |
| 23677 | + } | |
| 23678 | + if (s1 !== peg$FAILED) { | |
| 23679 | + peg$reportedPos = s0; | |
| 23680 | + s1 = peg$c102(); | |
| 23681 | + } | |
| 23682 | + s0 = s1; | |
| 23683 | + if (s0 === peg$FAILED) { | |
| 23684 | + s0 = peg$currPos; | |
| 23685 | + if (input.substr(peg$currPos, 2) === peg$c103) { | |
| 23686 | + s1 = peg$c103; | |
| 23687 | + peg$currPos += 2; | |
| 23688 | + } else { | |
| 23689 | + s1 = peg$FAILED; | |
| 23690 | + if (peg$silentFails === 0) { peg$fail(peg$c104); } | |
| 23691 | + } | |
| 23692 | + if (s1 !== peg$FAILED) { | |
| 23693 | + peg$reportedPos = s0; | |
| 23694 | + s1 = peg$c105(); | |
| 23695 | + } | |
| 23696 | + s0 = s1; | |
| 23697 | + if (s0 === peg$FAILED) { | |
| 23698 | + s0 = peg$currPos; | |
| 23699 | + if (input.substr(peg$currPos, 2) === peg$c106) { | |
| 23700 | + s1 = peg$c106; | |
| 23701 | + peg$currPos += 2; | |
| 23702 | + } else { | |
| 23703 | + s1 = peg$FAILED; | |
| 23704 | + if (peg$silentFails === 0) { peg$fail(peg$c107); } | |
| 23705 | + } | |
| 23706 | + if (s1 !== peg$FAILED) { | |
| 23707 | + peg$reportedPos = s0; | |
| 23708 | + s1 = peg$c108(); | |
| 23709 | + } | |
| 23710 | + s0 = s1; | |
| 23711 | + if (s0 === peg$FAILED) { | |
| 23712 | + s0 = peg$currPos; | |
| 23713 | + if (input.substr(peg$currPos, 2) === peg$c109) { | |
| 23714 | + s1 = peg$c109; | |
| 23715 | + peg$currPos += 2; | |
| 23716 | + } else { | |
| 23717 | + s1 = peg$FAILED; | |
| 23718 | + if (peg$silentFails === 0) { peg$fail(peg$c110); } | |
| 23719 | + } | |
| 23720 | + if (s1 !== peg$FAILED) { | |
| 23721 | + peg$reportedPos = s0; | |
| 23722 | + s1 = peg$c111(); | |
| 23723 | + } | |
| 23724 | + s0 = s1; | |
| 23725 | + if (s0 === peg$FAILED) { | |
| 23726 | + s0 = peg$currPos; | |
| 23727 | + if (input.substr(peg$currPos, 2) === peg$c112) { | |
| 23728 | + s1 = peg$c112; | |
| 23729 | + peg$currPos += 2; | |
| 23730 | + } else { | |
| 23731 | + s1 = peg$FAILED; | |
| 23732 | + if (peg$silentFails === 0) { peg$fail(peg$c113); } | |
| 23733 | + } | |
| 23734 | + if (s1 !== peg$FAILED) { | |
| 23735 | + peg$reportedPos = s0; | |
| 23736 | + s1 = peg$c114(); | |
| 23737 | + } | |
| 23738 | + s0 = s1; | |
| 23739 | + if (s0 === peg$FAILED) { | |
| 23740 | + s0 = peg$currPos; | |
| 23741 | + if (input.substr(peg$currPos, 2) === peg$c115) { | |
| 23742 | + s1 = peg$c115; | |
| 23743 | + peg$currPos += 2; | |
| 23744 | + } else { | |
| 23745 | + s1 = peg$FAILED; | |
| 23746 | + if (peg$silentFails === 0) { peg$fail(peg$c116); } | |
| 23747 | + } | |
| 23748 | + if (s1 !== peg$FAILED) { | |
| 23749 | + peg$reportedPos = s0; | |
| 23750 | + s1 = peg$c117(); | |
| 23751 | + } | |
| 23752 | + s0 = s1; | |
| 23753 | + if (s0 === peg$FAILED) { | |
| 23754 | + s0 = peg$parseESCAPED_UNICODE(); | |
| 23755 | + } | |
| 23756 | + } | |
| 23757 | + } | |
| 23758 | + } | |
| 23759 | + } | |
| 23760 | + } | |
| 23761 | + } | |
| 23762 | + | |
| 23763 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23764 | + | |
| 23765 | + return s0; | |
| 23766 | + } | |
| 23767 | + | |
| 23768 | + function peg$parseESCAPED_UNICODE() { | |
| 23769 | + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; | |
| 23770 | + | |
| 23771 | + var key = peg$currPos * 49 + 48, | |
| 23772 | + cached = peg$cache[key]; | |
| 23773 | + | |
| 23774 | + if (cached) { | |
| 23775 | + peg$currPos = cached.nextPos; | |
| 23776 | + return cached.result; | |
| 23777 | + } | |
| 23778 | + | |
| 23779 | + s0 = peg$currPos; | |
| 23780 | + if (input.substr(peg$currPos, 2) === peg$c118) { | |
| 23781 | + s1 = peg$c118; | |
| 23782 | + peg$currPos += 2; | |
| 23783 | + } else { | |
| 23784 | + s1 = peg$FAILED; | |
| 23785 | + if (peg$silentFails === 0) { peg$fail(peg$c119); } | |
| 23786 | + } | |
| 23787 | + if (s1 !== peg$FAILED) { | |
| 23788 | + s2 = peg$currPos; | |
| 23789 | + s3 = peg$parseHEX(); | |
| 23790 | + if (s3 !== peg$FAILED) { | |
| 23791 | + s4 = peg$parseHEX(); | |
| 23792 | + if (s4 !== peg$FAILED) { | |
| 23793 | + s5 = peg$parseHEX(); | |
| 23794 | + if (s5 !== peg$FAILED) { | |
| 23795 | + s6 = peg$parseHEX(); | |
| 23796 | + if (s6 !== peg$FAILED) { | |
| 23797 | + s7 = peg$parseHEX(); | |
| 23798 | + if (s7 !== peg$FAILED) { | |
| 23799 | + s8 = peg$parseHEX(); | |
| 23800 | + if (s8 !== peg$FAILED) { | |
| 23801 | + s9 = peg$parseHEX(); | |
| 23802 | + if (s9 !== peg$FAILED) { | |
| 23803 | + s10 = peg$parseHEX(); | |
| 23804 | + if (s10 !== peg$FAILED) { | |
| 23805 | + s3 = [s3, s4, s5, s6, s7, s8, s9, s10]; | |
| 23806 | + s2 = s3; | |
| 23807 | + } else { | |
| 23808 | + peg$currPos = s2; | |
| 23809 | + s2 = peg$c2; | |
| 23810 | + } | |
| 23811 | + } else { | |
| 23812 | + peg$currPos = s2; | |
| 23813 | + s2 = peg$c2; | |
| 23814 | + } | |
| 23815 | + } else { | |
| 23816 | + peg$currPos = s2; | |
| 23817 | + s2 = peg$c2; | |
| 23818 | + } | |
| 23819 | + } else { | |
| 23820 | + peg$currPos = s2; | |
| 23821 | + s2 = peg$c2; | |
| 23822 | + } | |
| 23823 | + } else { | |
| 23824 | + peg$currPos = s2; | |
| 23825 | + s2 = peg$c2; | |
| 23826 | + } | |
| 23827 | + } else { | |
| 23828 | + peg$currPos = s2; | |
| 23829 | + s2 = peg$c2; | |
| 23830 | + } | |
| 23831 | + } else { | |
| 23832 | + peg$currPos = s2; | |
| 23833 | + s2 = peg$c2; | |
| 23834 | + } | |
| 23835 | + } else { | |
| 23836 | + peg$currPos = s2; | |
| 23837 | + s2 = peg$c2; | |
| 23838 | + } | |
| 23839 | + if (s2 !== peg$FAILED) { | |
| 23840 | + peg$reportedPos = s0; | |
| 23841 | + s1 = peg$c120(s2); | |
| 23842 | + s0 = s1; | |
| 23843 | + } else { | |
| 23844 | + peg$currPos = s0; | |
| 23845 | + s0 = peg$c2; | |
| 23846 | + } | |
| 23847 | + } else { | |
| 23848 | + peg$currPos = s0; | |
| 23849 | + s0 = peg$c2; | |
| 23850 | + } | |
| 23851 | + if (s0 === peg$FAILED) { | |
| 23852 | + s0 = peg$currPos; | |
| 23853 | + if (input.substr(peg$currPos, 2) === peg$c121) { | |
| 23854 | + s1 = peg$c121; | |
| 23855 | + peg$currPos += 2; | |
| 23856 | + } else { | |
| 23857 | + s1 = peg$FAILED; | |
| 23858 | + if (peg$silentFails === 0) { peg$fail(peg$c122); } | |
| 23859 | + } | |
| 23860 | + if (s1 !== peg$FAILED) { | |
| 23861 | + s2 = peg$currPos; | |
| 23862 | + s3 = peg$parseHEX(); | |
| 23863 | + if (s3 !== peg$FAILED) { | |
| 23864 | + s4 = peg$parseHEX(); | |
| 23865 | + if (s4 !== peg$FAILED) { | |
| 23866 | + s5 = peg$parseHEX(); | |
| 23867 | + if (s5 !== peg$FAILED) { | |
| 23868 | + s6 = peg$parseHEX(); | |
| 23869 | + if (s6 !== peg$FAILED) { | |
| 23870 | + s3 = [s3, s4, s5, s6]; | |
| 23871 | + s2 = s3; | |
| 23872 | + } else { | |
| 23873 | + peg$currPos = s2; | |
| 23874 | + s2 = peg$c2; | |
| 23875 | + } | |
| 23876 | + } else { | |
| 23877 | + peg$currPos = s2; | |
| 23878 | + s2 = peg$c2; | |
| 23879 | + } | |
| 23880 | + } else { | |
| 23881 | + peg$currPos = s2; | |
| 23882 | + s2 = peg$c2; | |
| 23883 | + } | |
| 23884 | + } else { | |
| 23885 | + peg$currPos = s2; | |
| 23886 | + s2 = peg$c2; | |
| 23887 | + } | |
| 23888 | + if (s2 !== peg$FAILED) { | |
| 23889 | + peg$reportedPos = s0; | |
| 23890 | + s1 = peg$c120(s2); | |
| 23891 | + s0 = s1; | |
| 23892 | + } else { | |
| 23893 | + peg$currPos = s0; | |
| 23894 | + s0 = peg$c2; | |
| 23895 | + } | |
| 23896 | + } else { | |
| 23897 | + peg$currPos = s0; | |
| 23898 | + s0 = peg$c2; | |
| 23899 | + } | |
| 23900 | + } | |
| 23901 | + | |
| 23902 | + peg$cache[key] = { nextPos: peg$currPos, result: s0 }; | |
| 23903 | + | |
| 23904 | + return s0; | |
| 23905 | + } | |
| 23906 | + | |
| 23907 | + | |
| 23908 | + var nodes = []; | |
| 23909 | + | |
| 23910 | + function genError(err, line, col) { | |
| 23911 | + var ex = new Error(err); | |
| 23912 | + ex.line = line; | |
| 23913 | + ex.column = col; | |
| 23914 | + throw ex; | |
| 23915 | + } | |
| 23916 | + | |
| 23917 | + function addNode(node) { | |
| 23918 | + nodes.push(node); | |
| 23919 | + } | |
| 23920 | + | |
| 23921 | + function node(type, value, line, column, key) { | |
| 23922 | + var obj = { type: type, value: value, line: line(), column: column() }; | |
| 23923 | + if (key) obj.key = key; | |
| 23924 | + return obj; | |
| 23925 | + } | |
| 23926 | + | |
| 23927 | + function convertCodePoint(str, line, col) { | |
| 23928 | + var num = parseInt("0x" + str); | |
| 23929 | + | |
| 23930 | + if ( | |
| 23931 | + !isFinite(num) || | |
| 23932 | + Math.floor(num) != num || | |
| 23933 | + num < 0 || | |
| 23934 | + num > 0x10FFFF || | |
| 23935 | + (num > 0xD7FF && num < 0xE000) | |
| 23936 | + ) { | |
| 23937 | + genError("Invalid Unicode escape code: " + str, line, col); | |
| 23938 | + } else { | |
| 23939 | + return fromCodePoint(num); | |
| 23940 | + } | |
| 23941 | + } | |
| 23942 | + | |
| 23943 | + function fromCodePoint() { | |
| 23944 | + var MAX_SIZE = 0x4000; | |
| 23945 | + var codeUnits = []; | |
| 23946 | + var highSurrogate; | |
| 23947 | + var lowSurrogate; | |
| 23948 | + var index = -1; | |
| 23949 | + var length = arguments.length; | |
| 23950 | + if (!length) { | |
| 23951 | + return ''; | |
| 23952 | + } | |
| 23953 | + var result = ''; | |
| 23954 | + while (++index < length) { | |
| 23955 | + var codePoint = Number(arguments[index]); | |
| 23956 | + if (codePoint <= 0xFFFF) { // BMP code point | |
| 23957 | + codeUnits.push(codePoint); | |
| 23958 | + } else { // Astral code point; split in surrogate halves | |
| 23959 | + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae | |
| 23960 | + codePoint -= 0x10000; | |
| 23961 | + highSurrogate = (codePoint >> 10) + 0xD800; | |
| 23962 | + lowSurrogate = (codePoint % 0x400) + 0xDC00; | |
| 23963 | + codeUnits.push(highSurrogate, lowSurrogate); | |
| 23964 | + } | |
| 23965 | + if (index + 1 == length || codeUnits.length > MAX_SIZE) { | |
| 23966 | + result += String.fromCharCode.apply(null, codeUnits); | |
| 23967 | + codeUnits.length = 0; | |
| 23968 | + } | |
| 23969 | + } | |
| 23970 | + return result; | |
| 23971 | + } | |
| 23972 | + | |
| 23973 | + | |
| 23974 | + peg$result = peg$startRuleFunction(); | |
| 23975 | + | |
| 23976 | + if (peg$result !== peg$FAILED && peg$currPos === input.length) { | |
| 23977 | + return peg$result; | |
| 23978 | + } else { | |
| 23979 | + if (peg$result !== peg$FAILED && peg$currPos < input.length) { | |
| 23980 | + peg$fail({ type: "end", description: "end of input" }); | |
| 23981 | + } | |
| 23982 | + | |
| 23983 | + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); | |
| 23984 | + } | |
| 23985 | + } | |
| 23986 | + | |
| 23987 | + return { | |
| 23988 | + SyntaxError: SyntaxError, | |
| 23989 | + parse: parse | |
| 23990 | + }; | |
| 23991 | +})(); | |
| 23992 | + | |
| 23993 | + | |
| 19928 | 23994 | /***/ }), |
| 19929 | 23995 | |
| 19930 | 23996 | /***/ 770: |
@@ -53437,6 +57503,8 @@ const parse = function (data, opts = {}) {
| 53437 | 57503 | |
| 53438 | 57504 | // EXTERNAL MODULE: ./node_modules/lodash/lodash.js |
| 53439 | 57505 | var lodash = __nccwpck_require__(2356); |
| 57506 | +// EXTERNAL MODULE: ./node_modules/toml/index.js | |
| 57507 | +var toml = __nccwpck_require__(2132); | |
| 53440 | 57508 | ;// CONCATENATED MODULE: ./src/setup-beam.js |
| 53441 | 57509 | |
| 53442 | 57510 |
@@ -53449,9 +57517,11 @@ var lodash = __nccwpck_require__(2356);
| 53449 | 57517 | |
| 53450 | 57518 | |
| 53451 | 57519 | |
| 57520 | + | |
| 53452 | 57521 | const setup_beam_dirname = external_node_path_namespaceObject.dirname((0,external_node_url_.fileURLToPath)(import.meta.url)) |
| 53453 | 57522 | |
| 53454 | 57523 | const MAX_HTTP_RETRIES = 3 |
| 57524 | +const APPS = ['erlang', 'elixir', 'gleam', 'rebar'] | |
| 53455 | 57525 | |
| 53456 | 57526 | if (process.env.NODE_ENV !== 'test') { |
| 53457 | 57527 | main().catch((err) => { |
@@ -54241,28 +58311,14 @@ alongside ${alternativeName}=${alternativeValue} \
| 54241 | 58311 | return input |
| 54242 | 58312 | } |
| 54243 | 58313 | |
| 54244 | −function parseVersionFile(versionFilePath0) { | |
| 54245 | − const versionFilePath = external_node_path_namespaceObject.resolve( | |
| 54246 | − process.env.GITHUB_WORKSPACE, | |
| 54247 | − versionFilePath0, | |
| 54248 | − ) | |
| 54249 | − if (!external_node_fs_namespaceObject.existsSync(versionFilePath)) { | |
| 54250 | − throw new Error( | |
| 54251 | − `The specified version file, ${versionFilePath0}, does not exist`, | |
| 54252 | − ) | |
| 54253 | − } | |
| 54254 | − | |
| 54255 | − startGroup(`Parsing version file at ${versionFilePath0}`) | |
| 58314 | +function parseToolVersionsFile(versionFilePath) { | |
| 54256 | 58315 | const appVersions = new Map() |
| 54257 | 58316 | const versions = external_node_fs_namespaceObject.readFileSync(versionFilePath, 'utf8') |
| 54258 | − // For the time being we parse .tool-versions | |
| 54259 | − // If we ever start parsing something else, this should | |
| 54260 | − // become default in a new option named e.g. version-file-type | |
| 54261 | 58317 | versions.split(/\r?\n/).forEach((line) => { |
| 54262 | 58318 | const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/) |
| 54263 | 58319 | if (appVersion) { |
| 54264 | 58320 | const app = appVersion[1] |
| 54265 | − if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) { | |
| 58321 | + if (APPS.includes(app)) { | |
| 54266 | 58322 | const [, , , version] = appVersion |
| 54267 | 58323 | info(`Consuming ${app} at version ${version}`) |
| 54268 | 58324 | appVersions.set(app, version) |
@@ -54279,6 +58335,46 @@ function parseVersionFile(versionFilePath0) {
| 54279 | 58335 | return appVersions |
| 54280 | 58336 | } |
| 54281 | 58337 | |
| 58338 | +function parseMiseTomlFile(versionFilePath) { | |
| 58339 | + const appVersions = new Map() | |
| 58340 | + const miseToml = external_node_fs_namespaceObject.readFileSync(versionFilePath, 'utf8') | |
| 58341 | + const miseTomlParsed = toml.parse(miseToml) | |
| 58342 | + for (const app in miseTomlParsed.tools) { | |
| 58343 | + if (APPS.includes(app)) { | |
| 58344 | + const appVersion = miseTomlParsed.tools[app] | |
| 58345 | + const version = | |
| 58346 | + typeof appVersion == 'object' ? appVersion.version : appVersion | |
| 58347 | + | |
| 58348 | + info(`Consuming ${app} at version ${version}`) | |
| 58349 | + appVersions.set(app, version) | |
| 58350 | + } | |
| 58351 | + } | |
| 58352 | + | |
| 58353 | + return appVersions | |
| 58354 | +} | |
| 58355 | + | |
| 58356 | +function parseVersionFile(versionFilePath0) { | |
| 58357 | + const versionFilePath = external_node_path_namespaceObject.resolve( | |
| 58358 | + process.env.GITHUB_WORKSPACE, | |
| 58359 | + versionFilePath0, | |
| 58360 | + ) | |
| 58361 | + if (!external_node_fs_namespaceObject.existsSync(versionFilePath)) { | |
| 58362 | + throw new Error( | |
| 58363 | + `The specified version file, ${versionFilePath0}, does not exist`, | |
| 58364 | + ) | |
| 58365 | + } | |
| 58366 | + | |
| 58367 | + if (versionFilePath0.endsWith('.toml')) { | |
| 58368 | + startGroup( | |
| 58369 | + `Parsing ${external_node_path_namespaceObject.basename(versionFilePath0)} file at ${versionFilePath0}`, | |
| 58370 | + ) | |
| 58371 | + return parseMiseTomlFile(versionFilePath) | |
| 58372 | + } | |
| 58373 | + | |
| 58374 | + startGroup(`Parsing .tool-versions file at ${versionFilePath0}`) | |
| 58375 | + return parseToolVersionsFile(versionFilePath) | |
| 58376 | +} | |
| 58377 | + | |
| 54282 | 58378 | function debugLog(groupName, message) { |
| 54283 | 58379 | const group = `Debugging for ${groupName}` |
| 54284 | 58380 | core_debug( |
modified
package-lock.json
+8
−1
@@ -12,7 +12,8 @@
| 12 | 12 | "@actions/tool-cache": "4.0.0", |
| 13 | 13 | "csv-parse": "6.1.0", |
| 14 | 14 | "lodash": "4.17.23", |
| 15 | − "semver": "7.7.4" | |
| 15 | + "semver": "7.7.4", | |
| 16 | + "toml": "3.0.0" | |
| 16 | 17 | }, |
| 17 | 18 | "devDependencies": { |
| 18 | 19 | "@eslint/js": "10.0.1", |
@@ -3530,6 +3531,12 @@
| 3530 | 3531 | "url": "https://github.com/sponsors/Borewit" |
| 3531 | 3532 | } |
| 3532 | 3533 | }, |
| 3534 | + "node_modules/toml": { | |
| 3535 | + "version": "3.0.0", | |
| 3536 | + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", | |
| 3537 | + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", | |
| 3538 | + "license": "MIT" | |
| 3539 | + }, | |
| 3533 | 3540 | "node_modules/tslib": { |
| 3534 | 3541 | "version": "2.8.1", |
| 3535 | 3542 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", |
modified
package.json
+2
−1
@@ -22,7 +22,8 @@
| 22 | 22 | "@actions/tool-cache": "4.0.0", |
| 23 | 23 | "csv-parse": "6.1.0", |
| 24 | 24 | "lodash": "4.17.23", |
| 25 | − "semver": "7.7.4" | |
| 25 | + "semver": "7.7.4", | |
| 26 | + "toml": "3.0.0" | |
| 26 | 27 | }, |
| 27 | 28 | "devDependencies": { |
| 28 | 29 | "@eslint/js": "10.0.1", |
modified
src/setup-beam.js
+44
−16
@@ -8,10 +8,12 @@ import * as tc from '@actions/tool-cache'
| 8 | 8 | import * as semver from 'semver' |
| 9 | 9 | import * as csv from 'csv-parse/sync' |
| 10 | 10 | import _ from 'lodash' |
| 11 | +import toml from 'toml' | |
| 11 | 12 | |
| 12 | 13 | const __dirname = path.dirname(fileURLToPath(import.meta.url)) |
| 13 | 14 | |
| 14 | 15 | const MAX_HTTP_RETRIES = 3 |
| 16 | +const APPS = ['erlang', 'elixir', 'gleam', 'rebar'] | |
| 15 | 17 | |
| 16 | 18 | if (process.env.NODE_ENV !== 'test') { |
| 17 | 19 | main().catch((err) => { |
@@ -802,28 +804,14 @@ alongside ${alternativeName}=${alternativeValue} \
| 802 | 804 | return input |
| 803 | 805 | } |
| 804 | 806 | |
| 805 | −function parseVersionFile(versionFilePath0) { | |
| 806 | − const versionFilePath = path.resolve( | |
| 807 | − process.env.GITHUB_WORKSPACE, | |
| 808 | − versionFilePath0, | |
| 809 | − ) | |
| 810 | − if (!fs.existsSync(versionFilePath)) { | |
| 811 | − throw new Error( | |
| 812 | − `The specified version file, ${versionFilePath0}, does not exist`, | |
| 813 | − ) | |
| 814 | − } | |
| 815 | − | |
| 816 | − core.startGroup(`Parsing version file at ${versionFilePath0}`) | |
| 807 | +function parseToolVersionsFile(versionFilePath) { | |
| 817 | 808 | const appVersions = new Map() |
| 818 | 809 | const versions = fs.readFileSync(versionFilePath, 'utf8') |
| 819 | − // For the time being we parse .tool-versions | |
| 820 | − // If we ever start parsing something else, this should | |
| 821 | − // become default in a new option named e.g. version-file-type | |
| 822 | 810 | versions.split(/\r?\n/).forEach((line) => { |
| 823 | 811 | const appVersion = line.match(/^([^ ]+)[ ]+(ref:v?)?([^ #]+)/) |
| 824 | 812 | if (appVersion) { |
| 825 | 813 | const app = appVersion[1] |
| 826 | − if (['erlang', 'elixir', 'gleam', 'rebar'].includes(app)) { | |
| 814 | + if (APPS.includes(app)) { | |
| 827 | 815 | const [, , , version] = appVersion |
| 828 | 816 | core.info(`Consuming ${app} at version ${version}`) |
| 829 | 817 | appVersions.set(app, version) |
@@ -840,6 +828,46 @@ function parseVersionFile(versionFilePath0) {
| 840 | 828 | return appVersions |
| 841 | 829 | } |
| 842 | 830 | |
| 831 | +function parseMiseTomlFile(versionFilePath) { | |
| 832 | + const appVersions = new Map() | |
| 833 | + const miseToml = fs.readFileSync(versionFilePath, 'utf8') | |
| 834 | + const miseTomlParsed = toml.parse(miseToml) | |
| 835 | + for (const app in miseTomlParsed.tools) { | |
| 836 | + if (APPS.includes(app)) { | |
| 837 | + const appVersion = miseTomlParsed.tools[app] | |
| 838 | + const version = | |
| 839 | + typeof appVersion == 'object' ? appVersion.version : appVersion | |
| 840 | + | |
| 841 | + core.info(`Consuming ${app} at version ${version}`) | |
| 842 | + appVersions.set(app, version) | |
| 843 | + } | |
| 844 | + } | |
| 845 | + | |
| 846 | + return appVersions | |
| 847 | +} | |
| 848 | + | |
| 849 | +function parseVersionFile(versionFilePath0) { | |
| 850 | + const versionFilePath = path.resolve( | |
| 851 | + process.env.GITHUB_WORKSPACE, | |
| 852 | + versionFilePath0, | |
| 853 | + ) | |
| 854 | + if (!fs.existsSync(versionFilePath)) { | |
| 855 | + throw new Error( | |
| 856 | + `The specified version file, ${versionFilePath0}, does not exist`, | |
| 857 | + ) | |
| 858 | + } | |
| 859 | + | |
| 860 | + if (versionFilePath0.endsWith('.toml')) { | |
| 861 | + core.startGroup( | |
| 862 | + `Parsing ${path.basename(versionFilePath0)} file at ${versionFilePath0}`, | |
| 863 | + ) | |
| 864 | + return parseMiseTomlFile(versionFilePath) | |
| 865 | + } | |
| 866 | + | |
| 867 | + core.startGroup(`Parsing .tool-versions file at ${versionFilePath0}`) | |
| 868 | + return parseToolVersionsFile(versionFilePath) | |
| 869 | +} | |
| 870 | + | |
| 843 | 871 | function debugLog(groupName, message) { |
| 844 | 872 | const group = `Debugging for ${groupName}` |
| 845 | 873 | core.debug( |
modified
test/setup-beam.test.js
+50
−1
@@ -969,7 +969,7 @@ describe('.getVersionFromSpec(_)', () => {
| 969 | 969 | }) |
| 970 | 970 | }) |
| 971 | 971 | |
| 972 | −describe('version file', () => { | |
| 972 | +describe('.tool-versions file', () => { | |
| 973 | 973 | const otpVersion = unsimulateInput('otp-version') |
| 974 | 974 | const elixirVersion = unsimulateInput('elixir-version') |
| 975 | 975 | const gleamVersion = unsimulateInput('gleam-version') |
@@ -1018,6 +1018,55 @@ gleam ${gleam} \n`
| 1018 | 1018 | simulateInput('gleam-version', gleamVersion) |
| 1019 | 1019 | }) |
| 1020 | 1020 | |
| 1021 | +describe('mise.toml file', () => { | |
| 1022 | + const otpVersion = unsimulateInput('otp-version') | |
| 1023 | + const elixirVersion = unsimulateInput('elixir-version') | |
| 1024 | + const gleamVersion = unsimulateInput('gleam-version') | |
| 1025 | + | |
| 1026 | + it('is parsed correctly', async () => { | |
| 1027 | + const erlang = '27.3.4.1' | |
| 1028 | + const elixir = '1.18.4' | |
| 1029 | + const gleam = '1.9.1' | |
| 1030 | + let miseToml = `[tools] | |
| 1031 | +"erlang" = "${erlang}" | |
| 1032 | +elixir = { version = "${elixir}", postinstall="mix deps.get" } # comment, with space and ref: | |
| 1033 | +"not-gleam" = 0.23 # not picked up | |
| 1034 | +"gleam" = "${gleam}" \n` | |
| 1035 | + const filename = 'test/mise.toml' | |
| 1036 | + if (process.platform === 'win32') { | |
| 1037 | + // Force \r\n to test in Windows | |
| 1038 | + miseToml = miseToml.replace(/\n/g, '\r\n') | |
| 1039 | + } | |
| 1040 | + fs.writeFileSync(filename, miseToml) | |
| 1041 | + process.env.GITHUB_WORKSPACE = '' | |
| 1042 | + const appVersions = setupBeam.parseVersionFile(filename) | |
| 1043 | + assert.strictEqual(appVersions.get('erlang'), erlang) | |
| 1044 | + assert.strictEqual(appVersions.get('elixir'), elixir) | |
| 1045 | + | |
| 1046 | + const absoluteFilename = path.join(os.tmpdir(), 'mise.toml') | |
| 1047 | + fs.writeFileSync(absoluteFilename, miseToml) | |
| 1048 | + | |
| 1049 | + process.env.GITHUB_WORKSPACE = process.cwd() | |
| 1050 | + const absoluteAppVersions = setupBeam.parseVersionFile(absoluteFilename) | |
| 1051 | + assert.strictEqual(absoluteAppVersions.get('erlang'), erlang) | |
| 1052 | + assert.strictEqual(absoluteAppVersions.get('elixir'), elixir) | |
| 1053 | + | |
| 1054 | + assert.ok(async () => { | |
| 1055 | + await setupBeam.install('otp', { toolVersion: erlang }) | |
| 1056 | + }) | |
| 1057 | + assert.ok(async () => { | |
| 1058 | + await setupBeam.install('elixir', { toolVersion: elixir }) | |
| 1059 | + }) | |
| 1060 | + assert.ok(async () => { | |
| 1061 | + await setupBeam.install('gleam', { toolVersion: gleam }) | |
| 1062 | + }) | |
| 1063 | + }) | |
| 1064 | + | |
| 1065 | + simulateInput('otp-version', otpVersion) | |
| 1066 | + simulateInput('elixir-version', elixirVersion) | |
| 1067 | + simulateInput('gleam-version', gleamVersion) | |
| 1068 | +}) | |
| 1069 | + | |
| 1021 | 1070 | describe('.get(_)', () => { |
| 1022 | 1071 | it('retries as expected', async () => { |
| 1023 | 1072 | let attempt = 0 |
Parents: 0f13bcf