UNPKG

@yaegassy/coc-pylsp

Version:

pylsp (python-lsp-server) extension for coc.nvim

1,411 lines (1,408 loc) 367 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var __accessCheck = (obj, member, msg) => { if (!member.has(obj)) throw TypeError("Cannot " + msg); }; var __privateGet = (obj, member, getter) => { __accessCheck(obj, member, "read from private field"); return getter ? getter.call(obj) : member.get(obj); }; var __privateAdd = (obj, member, value) => { if (member.has(obj)) throw TypeError("Cannot add the same private member more than once"); member instanceof WeakSet ? member.add(obj) : member.set(obj, value); }; var __privateSet = (obj, member, value, setter) => { __accessCheck(obj, member, "write to private field"); setter ? setter.call(obj, value) : member.set(obj, value); return value; }; var __privateMethod = (obj, member, method) => { __accessCheck(obj, member, "access private method"); return method; }; // node_modules/balanced-match/index.js var require_balanced_match = __commonJS({ "node_modules/balanced-match/index.js"(exports, module2) { "use strict"; module2.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { if (a === b) { return [ai, bi]; } begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [begs.pop(), bi]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [left, right]; } } return result; } } }); // node_modules/glob/node_modules/brace-expansion/index.js var require_brace_expansion = __commonJS({ "node_modules/glob/node_modules/brace-expansion/index.js"(exports, module2) { var balanced = require_balanced_match(); module2.exports = expandTop; var escSlash = "\0SLASH" + Math.random() + "\0"; var escOpen = "\0OPEN" + Math.random() + "\0"; var escClose = "\0CLOSE" + Math.random() + "\0"; var escComma = "\0COMMA" + Math.random() + "\0"; var escPeriod = "\0PERIOD" + Math.random() + "\0"; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } function parseCommaParts(str) { if (!str) return [""]; var parts = []; var m = balanced("{", "}", str); if (!m) return str.split(","); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(","); p[p.length - 1] += "{" + body + "}"; var postParts = parseCommaParts(post); if (post.length) { p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; if (str.substr(0, 2) === "{}") { str = "\\{\\}" + str.substr(2); } return expand2(escapeBraces(str), true).map(unescapeBraces); } function embrace(str) { return "{" + str + "}"; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand2(str, isTop) { var expansions = []; var m = balanced("{", "}", str); if (!m) return [str]; var pre = m.pre; var post = m.post.length ? expand2(m.post, false) : [""]; if (/\$$/.test(m.pre)) { for (var k = 0; k < post.length; k++) { var expansion = pre + "{" + m.body + "}" + post[k]; expansions.push(expansion); } } else { var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(",") >= 0; if (!isSequence && !isOptions) { if (m.post.match(/,.*\}/)) { str = m.pre + "{" + m.body + escClose + m.post; return expand2(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { n = expand2(n[0], false).map(embrace); if (n.length === 1) { return post.map(function(p) { return m.pre + n[0] + p; }); } } } var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length); var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === "\\") c = ""; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join("0"); if (i < 0) c = "-" + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = []; for (var j = 0; j < n.length; j++) { N.push.apply(N, expand2(n[j], false)); } } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } } return expansions; } } }); // node_modules/toml/lib/parser.js var require_parser = __commonJS({ "node_modules/toml/lib/parser.js"(exports, module2) { module2.exports = function() { function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function SyntaxError(message, expected, found, offset, line, column) { this.message = message; this.expected = expected; this.found = found; this.offset = offset; this.line = line; this.column = column; this.name = "SyntaxError"; } peg$subclass(SyntaxError, Error); function parse6(input) { var options = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = [], peg$c1 = function() { return nodes; }, peg$c2 = peg$FAILED, peg$c3 = "#", peg$c4 = { type: "literal", value: "#", description: '"#"' }, peg$c5 = void 0, peg$c6 = { type: "any", description: "any character" }, peg$c7 = "[", peg$c8 = { type: "literal", value: "[", description: '"["' }, peg$c9 = "]", peg$c10 = { type: "literal", value: "]", description: '"]"' }, peg$c11 = function(name) { addNode(node("ObjectPath", name, line, column)); }, peg$c12 = function(name) { addNode(node("ArrayPath", name, line, column)); }, peg$c13 = function(parts, name) { return parts.concat(name); }, peg$c14 = function(name) { return [name]; }, peg$c15 = function(name) { return name; }, peg$c16 = ".", peg$c17 = { type: "literal", value: ".", description: '"."' }, peg$c18 = "=", peg$c19 = { type: "literal", value: "=", description: '"="' }, peg$c20 = function(key, value) { addNode(node("Assign", value, line, column, key)); }, peg$c21 = function(chars) { return chars.join(""); }, peg$c22 = function(node2) { return node2.value; }, peg$c23 = '"""', peg$c24 = { type: "literal", value: '"""', description: '"\\"\\"\\""' }, peg$c25 = null, peg$c26 = function(chars) { return node("String", chars.join(""), line, column); }, peg$c27 = '"', peg$c28 = { type: "literal", value: '"', description: '"\\""' }, peg$c29 = "'''", peg$c30 = { type: "literal", value: "'''", description: `"'''"` }, peg$c31 = "'", peg$c32 = { type: "literal", value: "'", description: `"'"` }, peg$c33 = function(char) { return char; }, peg$c34 = function(char) { return char; }, peg$c35 = "\\", peg$c36 = { type: "literal", value: "\\", description: '"\\\\"' }, peg$c37 = function() { return ""; }, peg$c38 = "e", peg$c39 = { type: "literal", value: "e", description: '"e"' }, peg$c40 = "E", peg$c41 = { type: "literal", value: "E", description: '"E"' }, peg$c42 = function(left, right) { return node("Float", parseFloat(left + "e" + right), line, column); }, peg$c43 = function(text2) { return node("Float", parseFloat(text2), line, column); }, peg$c44 = "+", peg$c45 = { type: "literal", value: "+", description: '"+"' }, peg$c46 = function(digits) { return digits.join(""); }, peg$c47 = "-", peg$c48 = { type: "literal", value: "-", description: '"-"' }, peg$c49 = function(digits) { return "-" + digits.join(""); }, peg$c50 = function(text2) { return node("Integer", parseInt(text2, 10), line, column); }, peg$c51 = "true", peg$c52 = { type: "literal", value: "true", description: '"true"' }, peg$c53 = function() { return node("Boolean", true, line, column); }, peg$c54 = "false", peg$c55 = { type: "literal", value: "false", description: '"false"' }, peg$c56 = function() { return node("Boolean", false, line, column); }, peg$c57 = function() { return node("Array", [], line, column); }, peg$c58 = function(value) { return node("Array", value ? [value] : [], line, column); }, peg$c59 = function(values) { return node("Array", values, line, column); }, peg$c60 = function(values, value) { return node("Array", values.concat(value), line, column); }, peg$c61 = function(value) { return value; }, peg$c62 = ",", peg$c63 = { type: "literal", value: ",", description: '","' }, peg$c64 = "{", peg$c65 = { type: "literal", value: "{", description: '"{"' }, peg$c66 = "}", peg$c67 = { type: "literal", value: "}", description: '"}"' }, peg$c68 = function(values) { return node("InlineTable", values, line, column); }, peg$c69 = function(key, value) { return node("InlineTableValue", value, line, column, key); }, peg$c70 = function(digits) { return "." + digits; }, peg$c71 = function(date) { return date.join(""); }, peg$c72 = ":", peg$c73 = { type: "literal", value: ":", description: '":"' }, peg$c74 = function(time) { return time.join(""); }, peg$c75 = "T", peg$c76 = { type: "literal", value: "T", description: '"T"' }, peg$c77 = "Z", peg$c78 = { type: "literal", value: "Z", description: '"Z"' }, peg$c79 = function(date, time) { return node("Date", new Date(date + "T" + time + "Z"), line, column); }, peg$c80 = function(date, time) { return node("Date", new Date(date + "T" + time), line, column); }, peg$c81 = /^[ \t]/, peg$c82 = { type: "class", value: "[ \\t]", description: "[ \\t]" }, peg$c83 = "\n", peg$c84 = { type: "literal", value: "\n", description: '"\\n"' }, peg$c85 = "\r", peg$c86 = { type: "literal", value: "\r", description: '"\\r"' }, peg$c87 = /^[0-9a-f]/i, peg$c88 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, peg$c89 = /^[0-9]/, peg$c90 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c91 = "_", peg$c92 = { type: "literal", value: "_", description: '"_"' }, peg$c93 = function() { return ""; }, peg$c94 = /^[A-Za-z0-9_\-]/, peg$c95 = { type: "class", value: "[A-Za-z0-9_\\-]", description: "[A-Za-z0-9_\\-]" }, peg$c96 = function(d) { return d.join(""); }, peg$c97 = '\\"', peg$c98 = { type: "literal", value: '\\"', description: '"\\\\\\""' }, peg$c99 = function() { return '"'; }, peg$c100 = "\\\\", peg$c101 = { type: "literal", value: "\\\\", description: '"\\\\\\\\"' }, peg$c102 = function() { return "\\"; }, peg$c103 = "\\b", peg$c104 = { type: "literal", value: "\\b", description: '"\\\\b"' }, peg$c105 = function() { return "\b"; }, peg$c106 = "\\t", peg$c107 = { type: "literal", value: "\\t", description: '"\\\\t"' }, peg$c108 = function() { return " "; }, peg$c109 = "\\n", peg$c110 = { type: "literal", value: "\\n", description: '"\\\\n"' }, peg$c111 = function() { return "\n"; }, peg$c112 = "\\f", peg$c113 = { type: "literal", value: "\\f", description: '"\\\\f"' }, peg$c114 = function() { return "\f"; }, peg$c115 = "\\r", peg$c116 = { type: "literal", value: "\\r", description: '"\\\\r"' }, peg$c117 = function() { return "\r"; }, peg$c118 = "\\U", peg$c119 = { type: "literal", value: "\\U", description: '"\\\\U"' }, peg$c120 = function(digits) { return convertCodePoint(digits.join("")); }, peg$c121 = "\\u", peg$c122 = { type: "literal", value: "\\u", description: '"\\\\u"' }, peg$currPos = 0, peg$reportedPos = 0, peg$cachedPos = 0, peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$cache = {}, peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { throw new Error(`Can't start parsing from rule "` + options.startRule + '".'); } peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } function text() { return input.substring(peg$reportedPos, peg$currPos); } function offset() { return peg$reportedPos; } function line() { return peg$computePosDetails(peg$reportedPos).line; } function column() { return peg$computePosDetails(peg$reportedPos).column; } function expected(description) { throw peg$buildException( null, [{ type: "other", description }], peg$reportedPos ); } function error(message) { throw peg$buildException(message, null, peg$reportedPos); } function peg$computePosDetails(pos) { function advance(details, startPos, endPos) { var p, ch; for (p = startPos; p < endPos; p++) { ch = input.charAt(p); if (ch === "\n") { if (!details.seenCR) { details.line++; } details.column = 1; details.seenCR = false; } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { details.line++; details.column = 1; details.seenCR = true; } else { details.column++; details.seenCR = false; } } } if (peg$cachedPos !== pos) { if (peg$cachedPos > pos) { peg$cachedPos = 0; peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; } advance(peg$cachedPosDetails, peg$cachedPos, pos); peg$cachedPos = pos; } return peg$cachedPosDetails; } function peg$fail(expected2) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected2); } function peg$buildException(message, expected2, pos) { function cleanupExpected(expected3) { var i = 1; expected3.sort(function(a, b) { if (a.description < b.description) { return -1; } else if (a.description > b.description) { return 1; } else { return 0; } }); while (i < expected3.length) { if (expected3[i - 1] === expected3[i]) { expected3.splice(i, 1); } else { i++; } } } function buildMessage(expected3, found2) { function stringEscape(s) { function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return "\\x0" + hex(ch); }).replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return "\\x" + hex(ch); }).replace(/[\u0180-\u0FFF]/g, function(ch) { return "\\u0" + hex(ch); }).replace(/[\u1080-\uFFFF]/g, function(ch) { return "\\u" + hex(ch); }); } var expectedDescs = new Array(expected3.length), expectedDesc, foundDesc, i; for (i = 0; i < expected3.length; i++) { expectedDescs[i] = expected3[i].description; } expectedDesc = expected3.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected3.length - 1] : expectedDescs[0]; foundDesc = found2 ? '"' + stringEscape(found2) + '"' : "end of input"; return "Expected " + expectedDesc + " but " + foundDesc + " found."; } var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; if (expected2 !== null) { cleanupExpected(expected2); } return new SyntaxError( message !== null ? message : buildMessage(expected2, found), expected2, found, pos, posDetails.line, posDetails.column ); } function peg$parsestart() { var s0, s1, s2; var key = peg$currPos * 49 + 0, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseline(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseline(); } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c1(); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseline() { var s0, s1, s2, s3, s4, s5, s6; var key = peg$currPos * 49 + 1, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parseexpression(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parsecomment(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parsecomment(); } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseNL(); if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseNL(); } } else { s5 = peg$c2; } if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } if (s5 !== peg$FAILED) { s1 = [s1, s2, s3, s4, s5]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseNL(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseNL(); } } else { s2 = peg$c2; } if (s2 === peg$FAILED) { s2 = peg$parseEOF(); } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$parseNL(); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseexpression() { var s0; var key = peg$currPos * 49 + 2, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsecomment(); if (s0 === peg$FAILED) { s0 = peg$parsepath(); if (s0 === peg$FAILED) { s0 = peg$parsetablearray(); if (s0 === peg$FAILED) { s0 = peg$parseassignment(); } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsecomment() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 3, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { s1 = peg$c3; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseNL(); if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c5; } else { peg$currPos = s4; s4 = peg$c2; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c2; } } else { peg$currPos = s3; s3 = peg$c2; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseNL(); if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c5; } else { peg$currPos = s4; s4 = peg$c2; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c2; } } else { peg$currPos = s3; s3 = peg$c2; } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsepath() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 4, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { s3 = peg$parsetable_key(); if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c9; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c11(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetablearray() { var s0, s1, s2, s3, s4, s5, s6, s7; var key = peg$currPos * 49 + 5, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 91) { s2 = peg$c7; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { s4 = peg$parsetable_key(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s6 = peg$c9; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s7 = peg$c9; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c12(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetable_key() { var s0, s1, s2; var key = peg$currPos * 49 + 6, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parsedot_ended_table_key_part(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsedot_ended_table_key_part(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parsetable_key_part(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c13(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsetable_key_part(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c14(s1); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetable_key_part() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 7, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsequoted_key(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedot_ended_table_key_part() { var s0, s1, s2, s3, s4, s5, s6; var key = peg$currPos * 49 + 8, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsequoted_key(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseassignment() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 9, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsekey(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { s5 = peg$parsevalue(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsequoted_key(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { s5 = peg$parsevalue(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsekey() { var s0, s1, s2; var key = peg$currPos * 49 + 10, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseASCII_BASIC(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseASCII_BASIC(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c21(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsequoted_key() { var s0, s1; var key = peg$currPos * 49 + 11, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsedouble_quoted_single_line_string(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c22(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsesingle_quoted_single_line_string(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c22(s1); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsevalue() { var s0; var key = peg$currPos * 49 + 12, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsestring(); if (s0 === peg$FAILED) { s0 = peg$parsedatetime(); if (s0 === peg$FAILED) { s0 = peg$parsefloat(); if (s0 === peg$FAILED) { s0 = peg$parseinteger(); if (s0 === peg$FAILED) { s0 = peg$parseboolean(); if (s0 === peg$FAILED) { s0 = peg$parsearray(); if (s0 === peg$FAILED) { s0 = peg$parseinline_table(); } } } } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsestring() { var s0; var key = peg$currPos * 49 + 13, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsedouble_quoted_multiline_string(); if (s0 === peg$FAILED) { s0 = peg$parsedouble_quoted_single_line_string(); if (s0 === peg$FAILED) { s0 = peg$parsesingle_quoted_multiline_string(); if (s0 === peg$FAILED) { s0 = peg$parsesingle_quoted_single_line_string(); } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedouble_quoted_multiline_string() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 14, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c23) { s1 = peg$c23; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } if (s1 !== peg$FAILED) { s2 = peg$par