/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ /* 0 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.activate = void 0; const vscode_1 = __webpack_require__(1); const definitionProvider_1 = __webpack_require__(2); const completionItemProvider_1 = __webpack_require__(9); const utils_1 = __webpack_require__(11); function activate(context) { return __awaiter(this, void 0, void 0, function* () { const snippetProvider = new utils_1.SnippetProvider(context.extensionUri); const definitions = new definitionProvider_1.TemplatePathProvider(); context.subscriptions.push(vscode_1.languages.registerDefinitionProvider(definitions.selector, definitions)); const djangoPythonSnippets = new completionItemProvider_1.DjangoPythonCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoPythonSnippets.selector, djangoPythonSnippets)); const djangoAdminSnippets = new completionItemProvider_1.DjangoAdminCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoAdminSnippets.selector, djangoAdminSnippets)); const djangoFormSnippets = new completionItemProvider_1.DjangoFormCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoFormSnippets.selector, djangoFormSnippets)); const djangoManagerSnippets = new completionItemProvider_1.DjangoManagerCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoManagerSnippets.selector, djangoManagerSnippets)); const djangoMigrationSnippets = new completionItemProvider_1.DjangoMigrationCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoMigrationSnippets.selector, djangoMigrationSnippets)); const djangoModelSnippets = new completionItemProvider_1.DjangoModelCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoModelSnippets.selector, djangoModelSnippets)); const djangoViewSnippets = new completionItemProvider_1.DjangoViewCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoViewSnippets.selector, djangoViewSnippets)); const djangoTemplatetagsSnippets = new completionItemProvider_1.DjangoTemplatetagsCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoTemplatetagsSnippets.selector, djangoTemplatetagsSnippets)); const djangoUrlSnippets = new completionItemProvider_1.DjangoUrlCompletionItemProvider(snippetProvider); context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider(djangoUrlSnippets.selector, djangoUrlSnippets)); (0, utils_1.postInitHook)(); }); } exports.activate = activate; /***/ }), /* 1 */ /***/ ((module) => { "use strict"; module.exports = require("vscode"); /***/ }), /* 2 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TemplatePathProvider = void 0; const path_1 = __webpack_require__(3); const vscode_1 = __webpack_require__(1); const constants_1 = __webpack_require__(8); let regex = (regexes) => new RegExp(regexes.map(re => re.source).join('')); const quote = /(?:\'|\")/; const path_re = /([\w/\-]+\.[\w]+)/; const rel_path_re = /((?:(?:\.\/|(?:\.\.\/)+))[\w/\-]+\.[\w]+)/; const PATH_RE = regex([quote, path_re, quote]); const RELATIVE_PATH_RE = regex([quote, rel_path_re, quote]); const BEGIN_OF_FILE = new vscode_1.Position(0, 0); let cache = {}; class TemplatePathProvider { constructor() { this.selector = [constants_1.DJANGO_HTML_SELECTOR, constants_1.PYTHON_SELECTOR]; } static getTemplate(document, position, token) { let path; let search; let line = document.lineAt(position.line).text; let match = line.match(PATH_RE); let relative_match = line.match(RELATIVE_PATH_RE); if (relative_match) { path = relative_match[1]; search = vscode_1.workspace.asRelativePath((0, path_1.resolve)((0, path_1.dirname)(document.uri.path), path)); } else if (match) { path = match[1]; search = `**/templates/${path}`; } else { return Promise.resolve(null); } let pos = position.character; let cursorOverPath = pos > line.indexOf(path) && pos < line.indexOf(path) + path.length; let uri; if (search in cache) { uri = Promise.resolve(cache[search]); } else { uri = vscode_1.workspace.findFiles(search, '', 1, token).then(results => { let result = results.length ? results[0] : null; if (result) cache[search] = result; return result; }); } if (cursorOverPath) { return uri; } else { return Promise.resolve(null); } } provideDefinition(document, position, token) { return TemplatePathProvider.getTemplate(document, position, token).then(template => { if (!template) return null; return new vscode_1.Location(template, BEGIN_OF_FILE); }); } } exports.TemplatePathProvider = TemplatePathProvider; /***/ }), /* 3 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(4); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var isWindows = process.platform === 'win32'; var util = __webpack_require__(5); // resolves . and .. elements in a path array with directory names there // must be no slashes or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { var res = []; for (var i = 0; i < parts.length; i++) { var p = parts[i]; // ignore empty parts if (!p || p === '.') continue; if (p === '..') { if (res.length && res[res.length - 1] !== '..') { res.pop(); } else if (allowAboveRoot) { res.push('..'); } } else { res.push(p); } } return res; } // returns an array with empty elements removed from either end of the input // array or the original array if no elements need to be removed function trimArray(arr) { var lastIndex = arr.length - 1; var start = 0; for (; start <= lastIndex; start++) { if (arr[start]) break; } var end = lastIndex; for (; end >= 0; end--) { if (arr[end]) break; } if (start === 0 && end === lastIndex) return arr; if (start > end) return []; return arr.slice(start, end + 1); } // Regex to split a windows path into three parts: [*, device, slash, // tail] windows-only var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; // Regex to split the tail part of the above into [*, dir, basename, ext] var splitTailRe = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; var win32 = {}; // Function to split a filename into [root, dir, basename, ext] function win32SplitPath(filename) { // Separate device+slash from tail var result = splitDeviceRe.exec(filename), device = (result[1] || '') + (result[2] || ''), tail = result[3] || ''; // Split the tail into dir, basename and extension var result2 = splitTailRe.exec(tail), dir = result2[1], basename = result2[2], ext = result2[3]; return [device, dir, basename, ext]; } function win32StatPath(path) { var result = splitDeviceRe.exec(path), device = result[1] || '', isUnc = !!device && device[1] !== ':'; return { device: device, isUnc: isUnc, isAbsolute: isUnc || !!result[2], // UNC paths are always absolute tail: result[3] }; } function normalizeUNCRoot(device) { return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); } // path.resolve([from ...], to) win32.resolve = function() { var resolvedDevice = '', resolvedTail = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1; i--) { var path; if (i >= 0) { path = arguments[i]; } else if (!resolvedDevice) { path = process.cwd(); } else { // Windows has the concept of drive-specific current working // directories. If we've resolved a drive letter but not yet an // absolute path, get cwd for that drive. We're sure the device is not // an unc path at this points, because unc paths are always absolute. path = process.env['=' + resolvedDevice]; // Verify that a drive-local cwd was found and that it actually points // to our drive. If not, default to the drive's root. if (!path || path.substr(0, 3).toLowerCase() !== resolvedDevice.toLowerCase() + '\\') { path = resolvedDevice + '\\'; } } // Skip empty and invalid entries if (!util.isString(path)) { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } var result = win32StatPath(path), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail; if (device && resolvedDevice && device.toLowerCase() !== resolvedDevice.toLowerCase()) { // This path points to another device so it is not applicable continue; } if (!resolvedDevice) { resolvedDevice = device; } if (!resolvedAbsolute) { resolvedTail = tail + '\\' + resolvedTail; resolvedAbsolute = isAbsolute; } if (resolvedDevice && resolvedAbsolute) { break; } } // Convert slashes to backslashes when `resolvedDevice` points to an UNC // root. Also squash multiple slashes into a single one where appropriate. if (isUnc) { resolvedDevice = normalizeUNCRoot(resolvedDevice); } // At this point the path should be resolved to a full absolute path, // but handle relative paths to be safe (might happen when process.cwd() // fails) // Normalize the tail path resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), !resolvedAbsolute).join('\\'); return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || '.'; }; win32.normalize = function(path) { var result = win32StatPath(path), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail, trailingSlash = /[\\\/]$/.test(tail); // Normalize the tail path tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); if (!tail && !isAbsolute) { tail = '.'; } if (tail && trailingSlash) { tail += '\\'; } // Convert slashes to backslashes when `device` points to an UNC root. // Also squash multiple slashes into a single one where appropriate. if (isUnc) { device = normalizeUNCRoot(device); } return device + (isAbsolute ? '\\' : '') + tail; }; win32.isAbsolute = function(path) { return win32StatPath(path).isAbsolute; }; win32.join = function() { var paths = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!util.isString(arg)) { throw new TypeError('Arguments to path.join must be strings'); } if (arg) { paths.push(arg); } } var joined = paths.join('\\'); // Make sure that the joined path doesn't start with two slashes, because // normalize() will mistake it for an UNC path then. // // This step is skipped when it is very clear that the user actually // intended to point at an UNC path. This is assumed when the first // non-empty string arguments starts with exactly two slashes followed by // at least one more non-slash character. // // Note that for normalize() to treat a path as an UNC path it needs to // have at least 2 components, so we don't filter for that here. // This means that the user can use join to construct UNC paths from // a server name and a share name; for example: // path.join('//server', 'share') -> '\\\\server\\share\') if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { joined = joined.replace(/^[\\\/]{2,}/, '\\'); } return win32.normalize(joined); }; // path.relative(from, to) // it will solve the relative path from 'from' to 'to', for instance: // from = 'C:\\orandea\\test\\aaa' // to = 'C:\\orandea\\impl\\bbb' // The output of the function should be: '..\\..\\impl\\bbb' win32.relative = function(from, to) { from = win32.resolve(from); to = win32.resolve(to); // windows is not case sensitive var lowerFrom = from.toLowerCase(); var lowerTo = to.toLowerCase(); var toParts = trimArray(to.split('\\')); var lowerFromParts = trimArray(lowerFrom.split('\\')); var lowerToParts = trimArray(lowerTo.split('\\')); var length = Math.min(lowerFromParts.length, lowerToParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (lowerFromParts[i] !== lowerToParts[i]) { samePartsLength = i; break; } } if (samePartsLength == 0) { return to; } var outputParts = []; for (var i = samePartsLength; i < lowerFromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('\\'); }; win32._makeLong = function(path) { // Note: this will *probably* throw somewhere. if (!util.isString(path)) return path; if (!path) { return ''; } var resolvedPath = win32.resolve(path); if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { // path is local filesystem path, which needs to be converted // to long UNC path. return '\\\\?\\' + resolvedPath; } else if (/^\\\\[^?.]/.test(resolvedPath)) { // path is network UNC path, which needs to be converted // to long UNC path. return '\\\\?\\UNC\\' + resolvedPath.substring(2); } return path; }; win32.dirname = function(path) { var result = win32SplitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; win32.basename = function(path, ext) { var f = win32SplitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; win32.extname = function(path) { return win32SplitPath(path)[3]; }; win32.format = function(pathObject) { if (!util.isObject(pathObject)) { throw new TypeError( "Parameter 'pathObject' must be an object, not " + typeof pathObject ); } var root = pathObject.root || ''; if (!util.isString(root)) { throw new TypeError( "'pathObject.root' must be a string or undefined, not " + typeof pathObject.root ); } var dir = pathObject.dir; var base = pathObject.base || ''; if (!dir) { return base; } if (dir[dir.length - 1] === win32.sep) { return dir + base; } return dir + win32.sep + base; }; win32.parse = function(pathString) { if (!util.isString(pathString)) { throw new TypeError( "Parameter 'pathString' must be a string, not " + typeof pathString ); } var allParts = win32SplitPath(pathString); if (!allParts || allParts.length !== 4) { throw new TypeError("Invalid path '" + pathString + "'"); } return { root: allParts[0], dir: allParts[0] + allParts[1].slice(0, -1), base: allParts[2], ext: allParts[3], name: allParts[2].slice(0, allParts[2].length - allParts[3].length) }; }; win32.sep = '\\'; win32.delimiter = ';'; // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var posix = {}; function posixSplitPath(filename) { return splitPathRe.exec(filename).slice(1); } // path.resolve([from ...], to) // posix version posix.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (!util.isString(path)) { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path[0] === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version posix.normalize = function(path) { var isAbsolute = posix.isAbsolute(path), trailingSlash = path && path[path.length - 1] === '/'; // Normalize the path path = normalizeArray(path.split('/'), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version posix.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version posix.join = function() { var path = ''; for (var i = 0; i < arguments.length; i++) { var segment = arguments[i]; if (!util.isString(segment)) { throw new TypeError('Arguments to path.join must be strings'); } if (segment) { if (!path) { path += segment; } else { path += '/' + segment; } } } return posix.normalize(path); }; // path.relative(from, to) // posix version posix.relative = function(from, to) { from = posix.resolve(from).substr(1); to = posix.resolve(to).substr(1); var fromParts = trimArray(from.split('/')); var toParts = trimArray(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; posix._makeLong = function(path) { return path; }; posix.dirname = function(path) { var result = posixSplitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; posix.basename = function(path, ext) { var f = posixSplitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; posix.extname = function(path) { return posixSplitPath(path)[3]; }; posix.format = function(pathObject) { if (!util.isObject(pathObject)) { throw new TypeError( "Parameter 'pathObject' must be an object, not " + typeof pathObject ); } var root = pathObject.root || ''; if (!util.isString(root)) { throw new TypeError( "'pathObject.root' must be a string or undefined, not " + typeof pathObject.root ); } var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; var base = pathObject.base || ''; return dir + base; }; posix.parse = function(pathString) { if (!util.isString(pathString)) { throw new TypeError( "Parameter 'pathString' must be a string, not " + typeof pathString ); } var allParts = posixSplitPath(pathString); if (!allParts || allParts.length !== 4) { throw new TypeError("Invalid path '" + pathString + "'"); } allParts[1] = allParts[1] || ''; allParts[2] = allParts[2] || ''; allParts[3] = allParts[3] || ''; return { root: allParts[0], dir: allParts[0] + allParts[1].slice(0, -1), base: allParts[2], ext: allParts[3], name: allParts[2].slice(0, allParts[2].length - allParts[3].length) }; }; posix.sep = '/'; posix.delimiter = ':'; if (isWindows) module.exports = win32; else /* posix */ module.exports = posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }), /* 4 */ /***/ ((module) => { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 5 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* provided dependency */ var process = __webpack_require__(4); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function(x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { // Allow for deprecating things in the process of starting up. if (isUndefined(__webpack_require__.g.process)) { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } if (process.noDeprecation === true) { return fn; } var warned = false; function deprecated() { if (!warned) { if (process.throwDeprecation) { throw new Error(msg); } else if (process.traceDeprecation) { console.trace(msg); } else { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnviron; exports.debuglog = function(set) { if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function() {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold' : [1, 22], 'italic' : [3, 23], 'underline' : [4, 24], 'inverse' : [7, 27], 'white' : [37, 39], 'grey' : [90, 39], 'black' : [30, 39], 'blue' : [34, 39], 'cyan' : [36, 39], 'green' : [32, 39], 'magenta' : [35, 39], 'red' : [31, 39], 'yellow' : [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function(val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') .replace(/'/g, "\\'") .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function(key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; }).join('\n').substr(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.substr(1, name.length - 2); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") .replace(/\\"/g, '"') .replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var numLinesEst = 0; var length = output.reduce(function(prev, cur) { numLinesEst++; if (cur.indexOf('\n') >= 0) numLinesEst++; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = __webpack_require__(6); function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function() { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = __webpack_require__(7); exports._extend = function(origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } /***/ }), /* 6 */ /***/ ((module) => { module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } /***/ }), /* 7 */ /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 8 */ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PYTHON_SELECTOR = exports.DJANGO_HTML_SELECTOR = void 0; exports.DJANGO_HTML_SELECTOR = { scheme: 'file', language: 'django-html' }; exports.PYTHON_SELECTOR = { scheme: 'file', language: 'python' }; /***/ }), /* 9 */ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DjangoUrlCompletionItemProvider = exports.DjangoTemplatetagsCompletionItemProvider = exports.DjangoViewCompletionItemProvider = exports.DjangoModelCompletionItemProvider = exports.DjangoMigrationCompletionItemProvider = exports.DjangoManagerCompletionItemProvider = exports.DjangoFormCompletionItemProvider = exports.DjangoAdminCompletionItemProvider = exports.DjangoPythonCompletionItemProvider = void 0; const constants_1 = __webpack_require__(8); const base_1 = __webpack_require__(10); class DjangoPythonCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = constants_1.PYTHON_SELECTOR; this.directory = 'python'; this.files = ["imports.toml", "utils.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoPythonCompletionItemProvider = DjangoPythonCompletionItemProvider; class DjangoAdminCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/admin{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "admin"; this.files = ["classes.toml", "imports.toml", "options.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoAdminCompletionItemProvider = DjangoAdminCompletionItemProvider; class DjangoFormCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/forms{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "forms"; this.files = ["classes.toml", "imports.toml", "fields.toml", "fields-postgres.toml", "methods.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoFormCompletionItemProvider = DjangoFormCompletionItemProvider; class DjangoManagerCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/{models,managers,querysets}{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "models"; this.files = ["managers.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoManagerCompletionItemProvider = DjangoManagerCompletionItemProvider; class DjangoMigrationCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/migrations/**/*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "models"; this.files = ["migrations.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoMigrationCompletionItemProvider = DjangoMigrationCompletionItemProvider; class DjangoModelCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/{models,migrations}{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "models"; this.files = ["classes.toml", "imports.toml", "fields.toml", "fields-postgres.toml", "methods.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoModelCompletionItemProvider = DjangoModelCompletionItemProvider; class DjangoViewCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/views{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "views"; this.files = ["classes.toml", "imports.toml", "methods.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoViewCompletionItemProvider = DjangoViewCompletionItemProvider; class DjangoTemplatetagsCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/templatetags/**/*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "templatetags"; this.files = ["imports.toml", "methods.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoTemplatetagsCompletionItemProvider = DjangoTemplatetagsCompletionItemProvider; class DjangoUrlCompletionItemProvider extends base_1.DjangoCompletionItemProvider { constructor(snippetPrvider) { super(); this.selector = Object.assign({ pattern: '**/urls{**/,}*.py' }, constants_1.PYTHON_SELECTOR); this.directory = "urls"; this.files = ["imports.toml", "methods.toml", "regexes.toml"]; this.loadSnippets(snippetPrvider); } } exports.DjangoUrlCompletionItemProvider = DjangoUrlCompletionItemProvider; /***/ }), /* 10 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DjangoCompletionItemProvider = void 0; const vscode_1 = __webpack_require__(1); const constants_1 = __webpack_require__(8); const settings = vscode_1.workspace.getConfiguration("django"); const exclusions = settings.snippets.exclude; class DjangoCompletionItemProvider { constructor() { this.selector = constants_1.PYTHON_SELECTOR; this.directory = ''; this.files = []; this.snippets = []; } loadSnippets(snippetPrvider) { return __awaiter(this, void 0, void 0, function* () { if (!settings.snippets.use) return; if (exclusions.some(word => this.directory.includes(word))) return; this.snippets = Array.prototype.concat(...yield Promise.all(this.files.filter(file => !exclusions.some(word => file.includes(word))) .map(file => snippetPrvider.readSnippets(`${this.directory}/${file}`)))); if (!settings.i18n) { this.snippets = this.snippets.map(snippet => { snippet.body = snippet.body.replace(/_\("(\S*)"\)/g, '"$1"'); return snippet; }); } }); } buildSnippet(snippet) { let item = new vscode_1.CompletionItem(snippet.prefix, vscode_1.CompletionItemKind.Snippet); item.insertText = new vscode_1.SnippetString(snippet.body); item.detail = snippet.detail; item.documentation = new vscode_1.MarkdownString(snippet.description); return item; } provideCompletionItems(document, position, token, context) { return __awaiter(this, void 0, void 0, function* () { return this.snippets.map(this.buildSnippet); }); } } exports.DjangoCompletionItemProvider = DjangoCompletionItemProvider; /***/ }), /* 11 */ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.postInitHook = exports.SnippetProvider = void 0; const toml = __webpack_require__(12); const vscode = __webpack_require__(1); const util_1 = __webpack_require__(5); class SnippetProvider { constructor(extensionUri) { this.extensionUri = extensionUri; } readSnippets(name) { return __awaiter(this, void 0, void 0, function* () { const location = vscode.Uri.joinPath(this.extensionUri, 'completions/snippets', name); const buffer = yield vscode.workspace.fs.readFile(location); const str = new util_1.TextDecoder("utf-8").decode(buffer); return toml.parse(str).snippets; }); } } exports.SnippetProvider = SnippetProvider; function postInitHook() { return __awaiter(this, void 0, void 0, function* () { }); } exports.postInitHook = postInitHook; /***/ }), /* 12 */ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parser = __webpack_require__(13); var compiler = __webpack_require__(14); module.exports = { parse: function(input) { var nodes = parser.parse(input.toString()); return compiler.compile(nodes); } }; /***/ }), /* 13 */ /***/ ((module) => { module.exports = (function() { /* * Generated by PEG.js 0.8.0. * * http://pegjs.majda.cz/ */ 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 parse(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(node) { return node.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(text) { return node('Float', parseFloat(text), 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(text) { return node('Integer', parseInt(text, 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 '\t' }, 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: 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(expected) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected); } function peg$buildException(message, expected, pos) { function cleanupExpected(expected) { var i = 1; expected.sort(function(a, b) { if (a.description < b.description) { return -1; } else if (a.description > b.description) { return 1; } else { return 0; } }); while (i < expected.length) { if (expected[i - 1] === expected[i]) { expected.splice(i, 1); } else { i++; } } } function buildMessage(expected, found) { 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(expected.length), expectedDesc, foundDesc, i; for (i = 0; i < expected.length; i++) { expectedDescs[i] = expected[i].description; } expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected.length - 1] : expectedDescs[0]; foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; return "Expected " + expectedDesc + " but " + foundDesc + " found."; } var posDetails = peg$computePosDetails(pos), found = pos < input.length ? input.charAt(pos) : null; if (expected !== null) { cleanupExpected(expected); } return new SyntaxError( message !== null ? message : buildMessage(expected, found), expected, found, pos, posDetails.line, posDetails.column ); } function peg$parsestart() { var s0, s1, s2; var key = peg$currPos * 49 + 0, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseline(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseline(); } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c1(); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseline() { var s0, s1, s2, s3, s4, s5, s6; var key = peg$currPos * 49 + 1, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parseexpression(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parsecomment(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parsecomment(); } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseNL(); if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseNL(); } } else { s5 = peg$c2; } if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } if (s5 !== peg$FAILED) { s1 = [s1, s2, s3, s4, s5]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseNL(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseNL(); } } else { s2 = peg$c2; } if (s2 === peg$FAILED) { s2 = peg$parseEOF(); } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$parseNL(); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseexpression() { var s0; var key = peg$currPos * 49 + 2, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsecomment(); if (s0 === peg$FAILED) { s0 = peg$parsepath(); if (s0 === peg$FAILED) { s0 = peg$parsetablearray(); if (s0 === peg$FAILED) { s0 = peg$parseassignment(); } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsecomment() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 3, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 35) { s1 = peg$c3; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseNL(); if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c5; } else { peg$currPos = s4; s4 = peg$c2; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c2; } } else { peg$currPos = s3; s3 = peg$c2; } while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$currPos; s4 = peg$currPos; peg$silentFails++; s5 = peg$parseNL(); if (s5 === peg$FAILED) { s5 = peg$parseEOF(); } peg$silentFails--; if (s5 === peg$FAILED) { s4 = peg$c5; } else { peg$currPos = s4; s4 = peg$c2; } if (s4 !== peg$FAILED) { if (input.length > peg$currPos) { s5 = input.charAt(peg$currPos); peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s5 !== peg$FAILED) { s4 = [s4, s5]; s3 = s4; } else { peg$currPos = s3; s3 = peg$c2; } } else { peg$currPos = s3; s3 = peg$c2; } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsepath() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 4, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { s3 = peg$parsetable_key(); if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s5 = peg$c9; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c11(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetablearray() { var s0, s1, s2, s3, s4, s5, s6, s7; var key = peg$currPos * 49 + 5, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 91) { s2 = peg$c7; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { s4 = peg$parsetable_key(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s6 = peg$c9; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s7 = peg$c9; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s7 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c12(s4); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetable_key() { var s0, s1, s2; var key = peg$currPos * 49 + 6, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parsedot_ended_table_key_part(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsedot_ended_table_key_part(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { s2 = peg$parsetable_key_part(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c13(s1, s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsetable_key_part(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c14(s1); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetable_key_part() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 7, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsequoted_key(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedot_ended_table_key_part() { var s0, s1, s2, s3, s4, s5, s6; var key = peg$currPos * 49 + 8, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsequoted_key(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c15(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseassignment() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 9, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsekey(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { s5 = peg$parsevalue(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsequoted_key(); if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s3 = peg$c18; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { s5 = peg$parsevalue(); if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsekey() { var s0, s1, s2; var key = peg$currPos * 49 + 10, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseASCII_BASIC(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseASCII_BASIC(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c21(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsequoted_key() { var s0, s1; var key = peg$currPos * 49 + 11, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsedouble_quoted_single_line_string(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c22(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsesingle_quoted_single_line_string(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c22(s1); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsevalue() { var s0; var key = peg$currPos * 49 + 12, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsestring(); if (s0 === peg$FAILED) { s0 = peg$parsedatetime(); if (s0 === peg$FAILED) { s0 = peg$parsefloat(); if (s0 === peg$FAILED) { s0 = peg$parseinteger(); if (s0 === peg$FAILED) { s0 = peg$parseboolean(); if (s0 === peg$FAILED) { s0 = peg$parsearray(); if (s0 === peg$FAILED) { s0 = peg$parseinline_table(); } } } } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsestring() { var s0; var key = peg$currPos * 49 + 13, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parsedouble_quoted_multiline_string(); if (s0 === peg$FAILED) { s0 = peg$parsedouble_quoted_single_line_string(); if (s0 === peg$FAILED) { s0 = peg$parsesingle_quoted_multiline_string(); if (s0 === peg$FAILED) { s0 = peg$parsesingle_quoted_single_line_string(); } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedouble_quoted_multiline_string() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 14, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c23) { s1 = peg$c23; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } if (s1 !== peg$FAILED) { s2 = peg$parseNL(); if (s2 === peg$FAILED) { s2 = peg$c25; } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parsemultiline_string_char(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsemultiline_string_char(); } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c23) { s4 = peg$c23; peg$currPos += 3; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c26(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedouble_quoted_single_line_string() { var s0, s1, s2, s3; var key = peg$currPos * 49 + 15, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { s1 = peg$c27; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c28); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsestring_char(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsestring_char(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { s3 = peg$c27; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c28); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c26(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsesingle_quoted_multiline_string() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 16, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 3) === peg$c29) { s1 = peg$c29; peg$currPos += 3; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c30); } } if (s1 !== peg$FAILED) { s2 = peg$parseNL(); if (s2 === peg$FAILED) { s2 = peg$c25; } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parsemultiline_literal_char(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsemultiline_literal_char(); } if (s3 !== peg$FAILED) { if (input.substr(peg$currPos, 3) === peg$c29) { s4 = peg$c29; peg$currPos += 3; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c30); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c26(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsesingle_quoted_single_line_string() { var s0, s1, s2, s3; var key = peg$currPos * 49 + 17, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 39) { s1 = peg$c31; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseliteral_char(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseliteral_char(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 39) { s3 = peg$c31; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c26(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsestring_char() { var s0, s1, s2; var key = peg$currPos * 49 + 18, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseESCAPED(); if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 34) { s2 = peg$c27; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c28); } } peg$silentFails--; if (s2 === peg$FAILED) { s1 = peg$c5; } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { if (input.length > peg$currPos) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c33(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseliteral_char() { var s0, s1, s2; var key = peg$currPos * 49 + 19, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 39) { s2 = peg$c31; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } peg$silentFails--; if (s2 === peg$FAILED) { s1 = peg$c5; } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { if (input.length > peg$currPos) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c33(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsemultiline_string_char() { var s0, s1, s2; var key = peg$currPos * 49 + 20, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseESCAPED(); if (s0 === peg$FAILED) { s0 = peg$parsemultiline_string_delim(); if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; if (input.substr(peg$currPos, 3) === peg$c23) { s2 = peg$c23; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c24); } } peg$silentFails--; if (s2 === peg$FAILED) { s1 = peg$c5; } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { if (input.length > peg$currPos) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c34(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsemultiline_string_delim() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 21, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { s1 = peg$c35; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c36); } } if (s1 !== peg$FAILED) { s2 = peg$parseNL(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseNLS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseNLS(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c37(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsemultiline_literal_char() { var s0, s1, s2; var key = peg$currPos * 49 + 22, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$currPos; peg$silentFails++; if (input.substr(peg$currPos, 3) === peg$c29) { s2 = peg$c29; peg$currPos += 3; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c30); } } peg$silentFails--; if (s2 === peg$FAILED) { s1 = peg$c5; } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { if (input.length > peg$currPos) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c33(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsefloat() { var s0, s1, s2, s3; var key = peg$currPos * 49 + 23, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsefloat_text(); if (s1 === peg$FAILED) { s1 = peg$parseinteger_text(); } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 101) { s2 = peg$c38; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c39); } } if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 69) { s2 = peg$c40; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c41); } } } if (s2 !== peg$FAILED) { s3 = peg$parseinteger_text(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c42(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsefloat_text(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c43(s1); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsefloat_text() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 24, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 43) { s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 === peg$FAILED) { s1 = peg$c25; } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parseDIGITS(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = peg$parseDIGITS(); if (s5 !== peg$FAILED) { s3 = [s3, s4, s5]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c46(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c47; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parseDIGITS(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s4 !== peg$FAILED) { s5 = peg$parseDIGITS(); if (s5 !== peg$FAILED) { s3 = [s3, s4, s5]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c49(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseinteger() { var s0, s1; var key = peg$currPos * 49 + 25, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parseinteger_text(); if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c50(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseinteger_text() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 26, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 43) { s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 === peg$FAILED) { s1 = peg$c25; } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseDIGIT_OR_UNDER(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseDIGIT_OR_UNDER(); } } else { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c5; } else { peg$currPos = s3; s3 = peg$c2; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c46(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { s1 = peg$c47; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseDIGIT_OR_UNDER(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseDIGIT_OR_UNDER(); } } else { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$currPos; peg$silentFails++; if (input.charCodeAt(peg$currPos) === 46) { s4 = peg$c16; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } peg$silentFails--; if (s4 === peg$FAILED) { s3 = peg$c5; } else { peg$currPos = s3; s3 = peg$c2; } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c49(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseboolean() { var s0, s1; var key = peg$currPos * 49 + 27, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 4) === peg$c51) { s1 = peg$c51; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c53(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 5) === peg$c54) { s1 = peg$c54; peg$currPos += 5; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c55); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c56(); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsearray() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 28, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsearray_sep(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsearray_sep(); } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c9; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c57(); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = peg$parsearray_value(); if (s2 === peg$FAILED) { s2 = peg$c25; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c9; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c58(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsearray_value_list(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsearray_value_list(); } } else { s2 = peg$c2; } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s3 = peg$c9; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c59(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 91) { s1 = peg$c7; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parsearray_value_list(); if (s3 !== peg$FAILED) { while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parsearray_value_list(); } } else { s2 = peg$c2; } if (s2 !== peg$FAILED) { s3 = peg$parsearray_value(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { s4 = peg$c9; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c60(s2, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsearray_value() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 29, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parsearray_sep(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsearray_sep(); } if (s1 !== peg$FAILED) { s2 = peg$parsevalue(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parsearray_sep(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsearray_sep(); } if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c61(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsearray_value_list() { var s0, s1, s2, s3, s4, s5, s6; var key = peg$currPos * 49 + 30, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parsearray_sep(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsearray_sep(); } if (s1 !== peg$FAILED) { s2 = peg$parsevalue(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parsearray_sep(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parsearray_sep(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s4 = peg$c62; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c63); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parsearray_sep(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parsearray_sep(); } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c61(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsearray_sep() { var s0; var key = peg$currPos * 49 + 31, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseS(); if (s0 === peg$FAILED) { s0 = peg$parseNL(); if (s0 === peg$FAILED) { s0 = peg$parsecomment(); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseinline_table() { var s0, s1, s2, s3, s4, s5; var key = peg$currPos * 49 + 32, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 123) { s1 = peg$c64; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c65); } } if (s1 !== peg$FAILED) { s2 = []; s3 = peg$parseS(); while (s3 !== peg$FAILED) { s2.push(s3); s3 = peg$parseS(); } if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseinline_table_assignment(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseinline_table_assignment(); } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parseS(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parseS(); } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s5 = peg$c66; peg$currPos++; } else { s5 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c67); } } if (s5 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c68(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseinline_table_assignment() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; var key = peg$currPos * 49 + 33, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s4 = peg$c18; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { s6 = peg$parsevalue(); if (s6 !== peg$FAILED) { s7 = []; s8 = peg$parseS(); while (s8 !== peg$FAILED) { s7.push(s8); s8 = peg$parseS(); } if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s8 = peg$c62; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c63); } } if (s8 !== peg$FAILED) { s9 = []; s10 = peg$parseS(); while (s10 !== peg$FAILED) { s9.push(s10); s10 = peg$parseS(); } if (s9 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c69(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; s2 = peg$parseS(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseS(); } if (s1 !== peg$FAILED) { s2 = peg$parsekey(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseS(); while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseS(); } if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { s4 = peg$c18; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c19); } } if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseS(); while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseS(); } if (s5 !== peg$FAILED) { s6 = peg$parsevalue(); if (s6 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c69(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsesecfragment() { var s0, s1, s2; var key = peg$currPos * 49 + 34, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 46) { s1 = peg$c16; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s1 !== peg$FAILED) { s2 = peg$parseDIGITS(); if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c70(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedate() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; var key = peg$currPos * 49 + 35, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parseDIGIT_OR_UNDER(); if (s2 !== peg$FAILED) { s3 = peg$parseDIGIT_OR_UNDER(); if (s3 !== peg$FAILED) { s4 = peg$parseDIGIT_OR_UNDER(); if (s4 !== peg$FAILED) { s5 = peg$parseDIGIT_OR_UNDER(); if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s6 = peg$c47; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s6 !== peg$FAILED) { s7 = peg$parseDIGIT_OR_UNDER(); if (s7 !== peg$FAILED) { s8 = peg$parseDIGIT_OR_UNDER(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s9 = peg$c47; peg$currPos++; } else { s9 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s9 !== peg$FAILED) { s10 = peg$parseDIGIT_OR_UNDER(); if (s10 !== peg$FAILED) { s11 = peg$parseDIGIT_OR_UNDER(); if (s11 !== peg$FAILED) { s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c71(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetime() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; var key = peg$currPos * 49 + 36, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parseDIGIT_OR_UNDER(); if (s2 !== peg$FAILED) { s3 = peg$parseDIGIT_OR_UNDER(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s4 = peg$c72; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s4 !== peg$FAILED) { s5 = peg$parseDIGIT_OR_UNDER(); if (s5 !== peg$FAILED) { s6 = peg$parseDIGIT_OR_UNDER(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s7 = peg$c72; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s7 !== peg$FAILED) { s8 = peg$parseDIGIT_OR_UNDER(); if (s8 !== peg$FAILED) { s9 = peg$parseDIGIT_OR_UNDER(); if (s9 !== peg$FAILED) { s10 = peg$parsesecfragment(); if (s10 === peg$FAILED) { s10 = peg$c25; } if (s10 !== peg$FAILED) { s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c74(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsetime_with_offset() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16; var key = peg$currPos * 49 + 37, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$currPos; s2 = peg$parseDIGIT_OR_UNDER(); if (s2 !== peg$FAILED) { s3 = peg$parseDIGIT_OR_UNDER(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s4 = peg$c72; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s4 !== peg$FAILED) { s5 = peg$parseDIGIT_OR_UNDER(); if (s5 !== peg$FAILED) { s6 = peg$parseDIGIT_OR_UNDER(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s7 = peg$c72; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s7 !== peg$FAILED) { s8 = peg$parseDIGIT_OR_UNDER(); if (s8 !== peg$FAILED) { s9 = peg$parseDIGIT_OR_UNDER(); if (s9 !== peg$FAILED) { s10 = peg$parsesecfragment(); if (s10 === peg$FAILED) { s10 = peg$c25; } if (s10 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { s11 = peg$c47; peg$currPos++; } else { s11 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c48); } } if (s11 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 43) { s11 = peg$c44; peg$currPos++; } else { s11 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c45); } } } if (s11 !== peg$FAILED) { s12 = peg$parseDIGIT_OR_UNDER(); if (s12 !== peg$FAILED) { s13 = peg$parseDIGIT_OR_UNDER(); if (s13 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { s14 = peg$c72; peg$currPos++; } else { s14 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c73); } } if (s14 !== peg$FAILED) { s15 = peg$parseDIGIT_OR_UNDER(); if (s15 !== peg$FAILED) { s16 = peg$parseDIGIT_OR_UNDER(); if (s16 !== peg$FAILED) { s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16]; s1 = s2; } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } } else { peg$currPos = s1; s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c74(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parsedatetime() { var s0, s1, s2, s3, s4; var key = peg$currPos * 49 + 38, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = peg$parsedate(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 84) { s2 = peg$c75; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { s3 = peg$parsetime(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 90) { s4 = peg$c77; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s4 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c79(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsedate(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 84) { s2 = peg$c75; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c76); } } if (s2 !== peg$FAILED) { s3 = peg$parsetime_with_offset(); if (s3 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c80(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseS() { var s0; var key = peg$currPos * 49 + 39, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (peg$c81.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c82); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseNL() { var s0, s1, s2; var key = peg$currPos * 49 + 40, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (input.charCodeAt(peg$currPos) === 10) { s0 = peg$c83; peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 13) { s1 = peg$c85; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c86); } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 10) { s2 = peg$c83; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c84); } } if (s2 !== peg$FAILED) { s1 = [s1, s2]; s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseNLS() { var s0; var key = peg$currPos * 49 + 41, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$parseNL(); if (s0 === peg$FAILED) { s0 = peg$parseS(); } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseEOF() { var s0, s1; var key = peg$currPos * 49 + 42, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; peg$silentFails++; if (input.length > peg$currPos) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } peg$silentFails--; if (s1 === peg$FAILED) { s0 = peg$c5; } else { peg$currPos = s0; s0 = peg$c2; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseHEX() { var s0; var key = peg$currPos * 49 + 43, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (peg$c87.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c88); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseDIGIT_OR_UNDER() { var s0, s1; var key = peg$currPos * 49 + 44, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (peg$c89.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c90); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 95) { s1 = peg$c91; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c92); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c93(); } s0 = s1; } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseASCII_BASIC() { var s0; var key = peg$currPos * 49 + 45, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } if (peg$c94.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c95); } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseDIGITS() { var s0, s1, s2; var key = peg$currPos * 49 + 46, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; s1 = []; s2 = peg$parseDIGIT_OR_UNDER(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parseDIGIT_OR_UNDER(); } } else { s1 = peg$c2; } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c96(s1); } s0 = s1; peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseESCAPED() { var s0, s1; var key = peg$currPos * 49 + 47, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c97) { s1 = peg$c97; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c98); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c99(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c100) { s1 = peg$c100; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c102(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c103) { s1 = peg$c103; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c104); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c105(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c106) { s1 = peg$c106; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c107); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c108(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c109) { s1 = peg$c109; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c110); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c111(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c112) { s1 = peg$c112; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c113); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c114(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c115) { s1 = peg$c115; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c116); } } if (s1 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c117(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$parseESCAPED_UNICODE(); } } } } } } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } function peg$parseESCAPED_UNICODE() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; var key = peg$currPos * 49 + 48, cached = peg$cache[key]; if (cached) { peg$currPos = cached.nextPos; return cached.result; } s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c118) { s1 = peg$c118; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c119); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parseHEX(); if (s3 !== peg$FAILED) { s4 = peg$parseHEX(); if (s4 !== peg$FAILED) { s5 = peg$parseHEX(); if (s5 !== peg$FAILED) { s6 = peg$parseHEX(); if (s6 !== peg$FAILED) { s7 = peg$parseHEX(); if (s7 !== peg$FAILED) { s8 = peg$parseHEX(); if (s8 !== peg$FAILED) { s9 = peg$parseHEX(); if (s9 !== peg$FAILED) { s10 = peg$parseHEX(); if (s10 !== peg$FAILED) { s3 = [s3, s4, s5, s6, s7, s8, s9, s10]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c120(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c121) { s1 = peg$c121; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c122); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$parseHEX(); if (s3 !== peg$FAILED) { s4 = peg$parseHEX(); if (s4 !== peg$FAILED) { s5 = peg$parseHEX(); if (s5 !== peg$FAILED) { s6 = peg$parseHEX(); if (s6 !== peg$FAILED) { s3 = [s3, s4, s5, s6]; s2 = s3; } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } } else { peg$currPos = s2; s2 = peg$c2; } if (s2 !== peg$FAILED) { peg$reportedPos = s0; s1 = peg$c120(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$c2; } } else { peg$currPos = s0; s0 = peg$c2; } } peg$cache[key] = { nextPos: peg$currPos, result: s0 }; return s0; } var nodes = []; function genError(err, line, col) { var ex = new Error(err); ex.line = line; ex.column = col; throw ex; } function addNode(node) { nodes.push(node); } function node(type, value, line, column, key) { var obj = { type: type, value: value, line: line(), column: column() }; if (key) obj.key = key; return obj; } function convertCodePoint(str, line, col) { var num = parseInt("0x" + str); if ( !isFinite(num) || Math.floor(num) != num || num < 0 || num > 0x10FFFF || (num > 0xD7FF && num < 0xE000) ) { genError("Invalid Unicode escape code: " + str, line, col); } else { return fromCodePoint(num); } } function fromCodePoint() { var MAX_SIZE = 0x4000; var codeUnits = []; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } var result = ''; while (++index < length) { var codePoint = Number(arguments[index]); if (codePoint <= 0xFFFF) { // BMP code point codeUnits.push(codePoint); } else { // Astral code point; split in surrogate halves // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = (codePoint % 0x400) + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } if (index + 1 == length || codeUnits.length > MAX_SIZE) { result += String.fromCharCode.apply(null, codeUnits); codeUnits.length = 0; } } return result; } peg$result = peg$startRuleFunction(); if (peg$result !== peg$FAILED && peg$currPos === input.length) { return peg$result; } else { if (peg$result !== peg$FAILED && peg$currPos < input.length) { peg$fail({ type: "end", description: "end of input" }); } throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); } } return { SyntaxError: SyntaxError, parse: parse }; })(); /***/ }), /* 14 */ /***/ ((module) => { "use strict"; function compile(nodes) { var assignedPaths = []; var valueAssignments = []; var currentPath = ""; var data = Object.create(null); var context = data; var arrayMode = false; return reduce(nodes); function reduce(nodes) { var node; for (var i = 0; i < nodes.length; i++) { node = nodes[i]; switch (node.type) { case "Assign": assign(node); break; case "ObjectPath": setPath(node); break; case "ArrayPath": addTableArray(node); break; } } return data; } function genError(err, line, col) { var ex = new Error(err); ex.line = line; ex.column = col; throw ex; } function assign(node) { var key = node.key; var value = node.value; var line = node.line; var column = node.column; var fullPath; if (currentPath) { fullPath = currentPath + "." + key; } else { fullPath = key; } if (typeof context[key] !== "undefined") { genError("Cannot redefine existing key '" + fullPath + "'.", line, column); } context[key] = reduceValueNode(value); if (!pathAssigned(fullPath)) { assignedPaths.push(fullPath); valueAssignments.push(fullPath); } } function pathAssigned(path) { return assignedPaths.indexOf(path) !== -1; } function reduceValueNode(node) { if (node.type === "Array") { return reduceArrayWithTypeChecking(node.value); } else if (node.type === "InlineTable") { return reduceInlineTableNode(node.value); } else { return node.value; } } function reduceInlineTableNode(values) { var obj = Object.create(null); for (var i = 0; i < values.length; i++) { var val = values[i]; if (val.value.type === "InlineTable") { obj[val.key] = reduceInlineTableNode(val.value.value); } else if (val.type === "InlineTableValue") { obj[val.key] = reduceValueNode(val.value); } } return obj; } function setPath(node) { var path = node.value; var quotedPath = path.map(quoteDottedString).join("."); var line = node.line; var column = node.column; if (pathAssigned(quotedPath)) { genError("Cannot redefine existing key '" + path + "'.", line, column); } assignedPaths.push(quotedPath); context = deepRef(data, path, Object.create(null), line, column); currentPath = path; } function addTableArray(node) { var path = node.value; var quotedPath = path.map(quoteDottedString).join("."); var line = node.line; var column = node.column; if (!pathAssigned(quotedPath)) { assignedPaths.push(quotedPath); } assignedPaths = assignedPaths.filter(function(p) { return p.indexOf(quotedPath) !== 0; }); assignedPaths.push(quotedPath); context = deepRef(data, path, [], line, column); currentPath = quotedPath; if (context instanceof Array) { var newObj = Object.create(null); context.push(newObj); context = newObj; } else { genError("Cannot redefine existing key '" + path + "'.", line, column); } } // Given a path 'a.b.c', create (as necessary) `start.a`, // `start.a.b`, and `start.a.b.c`, assigning `value` to `start.a.b.c`. // If `a` or `b` are arrays and have items in them, the last item in the // array is used as the context for the next sub-path. function deepRef(start, keys, value, line, column) { var traversed = []; var traversedPath = ""; var path = keys.join("."); var ctx = start; for (var i = 0; i < keys.length; i++) { var key = keys[i]; traversed.push(key); traversedPath = traversed.join("."); if (typeof ctx[key] === "undefined") { if (i === keys.length - 1) { ctx[key] = value; } else { ctx[key] = Object.create(null); } } else if (i !== keys.length - 1 && valueAssignments.indexOf(traversedPath) > -1) { // already a non-object value at key, can't be used as part of a new path genError("Cannot redefine existing key '" + traversedPath + "'.", line, column); } ctx = ctx[key]; if (ctx instanceof Array && ctx.length && i < keys.length - 1) { ctx = ctx[ctx.length - 1]; } } return ctx; } function reduceArrayWithTypeChecking(array) { // Ensure that all items in the array are of the same type var firstType = null; for (var i = 0; i < array.length; i++) { var node = array[i]; if (firstType === null) { firstType = node.type; } else { if (node.type !== firstType) { genError("Cannot add value of type " + node.type + " to array of type " + firstType + ".", node.line, node.column); } } } // Recursively reduce array of nodes into array of the nodes' values return array.map(reduceValueNode); } function quoteDottedString(str) { if (str.indexOf(".") > -1) { return "\"" + str + "\""; } else { return str; } } } module.exports = { compile: compile }; /***/ }) /******/ ]); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module is referenced by other modules so it can't be inlined /******/ var __webpack_exports__ = __webpack_require__(0); /******/ var __webpack_export_target__ = exports; /******/ for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i]; /******/ if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true }); /******/ /******/ })() ; //# sourceMappingURL=extension-web.js.map