create-effex-app
Version:
Create a new Effex app with a single command
1,501 lines (1,498 loc) • 1.65 MB
JavaScript
#!/usr/bin/env node
import { createRequire } from "node:module";
var __create = Object.create;
var __getProtoOf = Object.getPrototypeOf;
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __toESM = (mod, isNodeMode, target) => {
target = mod != null ? __create(__getProtoOf(mod)) : {};
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
for (let key of __getOwnPropNames(mod))
if (!__hasOwnProp.call(to, key))
__defProp(to, key, {
get: () => mod[key],
enumerable: true
});
return to;
};
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: (newValue) => all[name] = () => newValue
});
};
var __require = /* @__PURE__ */ createRequire(import.meta.url);
// ../../node_modules/.bun/ini@4.1.3/node_modules/ini/lib/ini.js
var require_ini = __commonJS((exports, module) => {
var { hasOwnProperty } = Object.prototype;
var encode5 = (obj, opt = {}) => {
if (typeof opt === "string") {
opt = { section: opt };
}
opt.align = opt.align === true;
opt.newline = opt.newline === true;
opt.sort = opt.sort === true;
opt.whitespace = opt.whitespace === true || opt.align === true;
opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
opt.bracketedArray = opt.bracketedArray !== false;
const eol = opt.platform === "win32" ? `\r
` : `
`;
const separator = opt.whitespace ? " = " : "=";
const children2 = [];
const keys5 = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
let padToChars = 0;
if (opt.align) {
padToChars = safe(keys5.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a, b) => safe(a).length >= safe(b).length ? a : b)).length;
}
let out = "";
const arraySuffix = opt.bracketedArray ? "[]" : "";
for (const k of keys5) {
const val = obj[k];
if (val && Array.isArray(val)) {
for (const item of val) {
out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
}
} else if (val && typeof val === "object") {
children2.push(k);
} else {
out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
}
}
if (opt.section && out.length) {
out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
}
for (const k of children2) {
const nk = splitSections(k, ".").join("\\.");
const section = (opt.section ? opt.section + "." : "") + nk;
const child = encode5(obj[k], {
...opt,
section
});
if (out.length && child.length) {
out += eol;
}
out += child;
}
return out;
};
function splitSections(str, separator) {
var lastMatchIndex = 0;
var lastSeparatorIndex = 0;
var nextIndex = 0;
var sections = [];
do {
nextIndex = str.indexOf(separator, lastMatchIndex);
if (nextIndex !== -1) {
lastMatchIndex = nextIndex + separator.length;
if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
continue;
}
sections.push(str.slice(lastSeparatorIndex, nextIndex));
lastSeparatorIndex = nextIndex + separator.length;
}
} while (nextIndex !== -1);
sections.push(str.slice(lastSeparatorIndex));
return sections;
}
var decode7 = (str, opt = {}) => {
opt.bracketedArray = opt.bracketedArray !== false;
const out = Object.create(null);
let p = out;
let section = null;
const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
const lines = str.split(/[\r\n]+/g);
const duplicates = {};
for (const line of lines) {
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
continue;
}
const match16 = line.match(re);
if (!match16) {
continue;
}
if (match16[1] !== undefined) {
section = unsafe(match16[1]);
if (section === "__proto__") {
p = Object.create(null);
continue;
}
p = out[section] = out[section] || Object.create(null);
continue;
}
const keyRaw = unsafe(match16[2]);
let isArray2;
if (opt.bracketedArray) {
isArray2 = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
} else {
duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
isArray2 = duplicates[keyRaw] > 1;
}
const key = isArray2 && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
if (key === "__proto__") {
continue;
}
const valueRaw = match16[3] ? unsafe(match16[4]) : true;
const value3 = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
if (isArray2) {
if (!hasOwnProperty.call(p, key)) {
p[key] = [];
} else if (!Array.isArray(p[key])) {
p[key] = [p[key]];
}
}
if (Array.isArray(p[key])) {
p[key].push(value3);
} else {
p[key] = value3;
}
}
const remove7 = [];
for (const k of Object.keys(out)) {
if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
continue;
}
const parts2 = splitSections(k, ".");
p = out;
const l = parts2.pop();
const nl = l.replace(/\\\./g, ".");
for (const part of parts2) {
if (part === "__proto__") {
continue;
}
if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
p[part] = Object.create(null);
}
p = p[part];
}
if (p === out && nl === l) {
continue;
}
p[nl] = out[k];
remove7.push(k);
}
for (const del of remove7) {
delete out[del];
}
return out;
};
var isQuoted = (val) => {
return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
};
var safe = (val) => {
if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
return JSON.stringify(val);
}
return val.split(";").join("\\;").split("#").join("\\#");
};
var unsafe = (val) => {
val = (val || "").trim();
if (isQuoted(val)) {
if (val.charAt(0) === "'") {
val = val.slice(1, -1);
}
try {
val = JSON.parse(val);
} catch {}
} else {
let esc = false;
let unesc = "";
for (let i = 0, l = val.length;i < l; i++) {
const c = val.charAt(i);
if (esc) {
if ("\\;#".indexOf(c) !== -1) {
unesc += c;
} else {
unesc += "\\" + c;
}
esc = false;
} else if (";#".indexOf(c) !== -1) {
break;
} else if (c === "\\") {
esc = true;
} else {
unesc += c;
}
}
if (esc) {
unesc += "\\";
}
return unesc.trim();
}
return val;
};
module.exports = {
parse: decode7,
decode: decode7,
stringify: encode5,
encode: encode5,
safe,
unsafe
};
});
// ../../node_modules/.bun/toml@3.0.0/node_modules/toml/lib/parser.js
var require_parser = __commonJS((exports, module) => {
module.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 parse2(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 = undefined, 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(parts2, name) {
return parts2.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, value3) {
addNode(node("Assign", value3, 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(left3, right3) {
return node("Float", parseFloat(left3 + "e" + right3), 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(value3) {
return node("Array", value3 ? [value3] : [], line, column);
}, peg$c59 = function(values4) {
return node("Array", values4, line, column);
}, peg$c60 = function(values4, value3) {
return node("Array", values4.concat(value3), line, column);
}, peg$c61 = function(value3) {
return value3;
}, 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(values4) {
return node("InlineTable", values4, line, column);
}, peg$c69 = function(key, value3) {
return node("InlineTableValue", value3, line, column, key);
}, peg$c70 = function(digits) {
return "." + digits;
}, peg$c71 = function(date2) {
return date2.join("");
}, peg$c72 = ":", peg$c73 = { type: "literal", value: ":", description: '":"' }, peg$c74 = function(time3) {
return time3.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(date2, time3) {
return node("Date", new Date(date2 + "T" + time3 + "Z"), line, column);
}, peg$c80 = function(date2, time3) {
return node("Date", new Date(date2 + "T" + time3), line, column);
}, peg$c81 = /^[ \t]/, peg$c82 = { type: "class", value: "[ \\t]", description: "[ \\t]" }, peg$c83 = `
`, peg$c84 = { type: "literal", value: `
`, 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 "\t";
}, peg$c109 = "\\n", peg$c110 = { type: "literal", value: "\\n", description: '"\\\\n"' }, peg$c111 = function() {
return `
`;
}, 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 error3(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 === `
`) {
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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.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, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.result;
}
s0 = peg$currPos;
if (input.substr(peg$currPos, 3) === peg$c23) {
s1 = peg$c23;
peg$currPos += 3;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) {
peg$fail(peg$c24);
}
}
if (s1 !== peg$FAILED) {
s2 = peg$parseNL();
if (s2 === peg$FAILED) {
s2 = peg$c25;
}
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parsemultiline_string_char();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parsemultiline_string_char();
}
if (s3 !== peg$FAILED) {
if (input.substr(peg$currPos, 3) === peg$c23) {
s4 = peg$c23;
peg$currPos += 3;
} else {
s4 = peg$FAILED;
if (peg$silentFails === 0) {
peg$fail(peg$c24);
}
}
if (s4 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c26(s3);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c2;
}
} else {
peg$currPos = s0;
s0 = peg$c2;
}
} else {
peg$currPos = s0;
s0 = peg$c2;
}
} else {
peg$currPos = s0;
s0 = peg$c2;
}
peg$cache[key] = { nextPos: peg$currPos, result: s0 };
return s0;
}
function peg$parsedouble_quoted_single_line_string() {
var s0, s1, s2, s3;
var key = peg$currPos * 49 + 15, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.result;
}
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 34) {
s1 = peg$c27;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) {
peg$fail(peg$c28);
}
}
if (s1 !== peg$FAILED) {
s2 = [];
s3 = peg$parsestring_char();
while (s3 !== peg$FAILED) {
s2.push(s3);
s3 = peg$parsestring_char();
}
if (s2 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 34) {
s3 = peg$c27;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) {
peg$fail(peg$c28);
}
}
if (s3 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c26(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c2;
}
} else {
peg$currPos = s0;
s0 = peg$c2;
}
} else {
peg$currPos = s0;
s0 = peg$c2;
}
peg$cache[key] = { nextPos: peg$currPos, result: s0 };
return s0;
}
function peg$parsesingle_quoted_multiline_string() {
var s0, s1, s2, s3, s4;
var key = peg$currPos * 49 + 16, cached4 = peg$cache[key];
if (cached4) {
peg$currPos = cached4.nextPos;
return cached4.result;
}
s0 = peg$currPos;
if (input.substr(peg$currPos, 3) === peg$c29) {
s1 = peg$c29;
peg$currPos += 3;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) {
peg$fail(peg$c30);
}
}
if (s1 !== peg$FAILED) {
s2 = peg$parseNL();
if (s2 === peg$FAILED) {
s2 = peg$c25;
}
if (s2 !== peg$FAILED) {
s3 = [];
s4 = peg$parsemultiline_literal_char();
while (s4 !== peg$FAILED) {
s3.push(s4);
s4 = peg$parsemultiline_literal_char();
}
if (s3 !== peg$FAILED) {
if (input.substr(peg$currPos, 3) === peg$c29) {
s4 = peg$c29;