@willbooster/web-tree-sitter 23.0.1 → 23.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug/web-tree-sitter.cjs +1 -1
- package/debug/web-tree-sitter.cjs.map +1 -1
- package/debug/web-tree-sitter.js +1 -1
- package/debug/web-tree-sitter.js.map +1 -1
- package/debug/web-tree-sitter.wasm +0 -0
- package/debug/web-tree-sitter.wasm.map +7 -5
- package/package.json +4 -4
- package/web-tree-sitter.wasm +0 -0
- package/web-tree-sitter.wasm.map +7 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/web-tree-sitter.cjs", "../src/index.ts", "../src/constants.ts", "../src/finalization_registry.ts", "../src/tree_cursor.ts", "../src/tree.ts", "../src/node.ts", "../src/marshal.ts", "../src/language.ts", "../src/bindings.ts", "../src/parser.ts"],
|
|
4
|
-
"sourcesContent": ["// This code implements the `-sMODULARIZE` settings by taking the generated\n// JS program code (INNER_JS_CODE) and wrapping it in a factory function.\n\n// Single threaded MINIMAL_RUNTIME programs do not need access to\n// document.currentScript, so a simple export declaration is enough.\nvar Module = (() => {\n // When MODULARIZE this JS may be executed later,\n // after document.currentScript is gone, so we save it.\n // In EXPORT_ES6 mode we can just use 'import.meta.url'.\n var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;\n return async function(moduleArg = {}) {\n var moduleRtn;\n\n// include: shell.js\n// The Module object: Our interface to the outside world. We import\n// and export values on it. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(moduleArg) => Promise<Module>\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to check if Module already exists (e.g. case 3 above).\n// Substitution will be replaced with actual code on later stage of the build,\n// this way Closure Compiler will not mangle it (e.g. case 4. above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module = moduleArg;\n\n// Determine the runtime environment we are in. You can customize this by\n// setting the ENVIRONMENT setting at compile time (see settings.js).\n// Attempt to auto-detect the environment\nvar ENVIRONMENT_IS_WEB = typeof window == \"object\";\n\nvar ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != \"undefined\";\n\n// N.b. Electron.js environment is simultaneously a NODE-environment, but\n// also a web environment.\nvar ENVIRONMENT_IS_NODE = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\n// --pre-jses are emitted after the Module integration code, so that they can\n// refer to Module (if they choose; they can also define Module)\n// include: lib/binding_web/lib/prefix.js\nModule.currentProgressCallback = null;\n\nModule.currentLogCallback = null;\n\nModule.currentParseCallback = null;\n\nModule.treeSitterSetMemoryLimit = function(maxBytes) {\n if (!maxBytes) {\n if (Module.treeSitterOriginalMemoryGrow) {\n wasmMemory.grow = Module.treeSitterOriginalMemoryGrow;\n Module.treeSitterOriginalMemoryGrow = null;\n }\n return true;\n }\n if (wasmMemory.buffer.byteLength > maxBytes) return false;\n if (Module.treeSitterOriginalMemoryGrow) return false;\n Module.treeSitterOriginalMemoryGrow = wasmMemory.grow;\n wasmMemory.grow = function(pages) {\n if (wasmMemory.buffer.byteLength + pages * 65536 > maxBytes) {\n throw new RangeError(\"Parse memory limit exceeded\");\n }\n return Module.treeSitterOriginalMemoryGrow.call(wasmMemory, pages);\n };\n return true;\n};\n\n// end include: lib/binding_web/lib/prefix.js\nvar arguments_ = [];\n\nvar thisProgram = \"./this.program\";\n\nvar quit_ = (status, toThrow) => {\n throw toThrow;\n};\n\nif (typeof __filename != \"undefined\") {\n // Node\n _scriptName = __filename;\n} else if (ENVIRONMENT_IS_WORKER) {\n _scriptName = self.location.href;\n}\n\n// `/` should be present at the end if `scriptDirectory` is not empty\nvar scriptDirectory = \"\";\n\nfunction locateFile(path) {\n if (Module[\"locateFile\"]) {\n return Module[\"locateFile\"](path, scriptDirectory);\n }\n return scriptDirectory + path;\n}\n\n// Hooks that are implemented differently in different runtime environments.\nvar readAsync, readBinary;\n\nif (ENVIRONMENT_IS_NODE) {\n const isNode = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n if (!isNode) throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n var nodeVersion = process.versions.node;\n var numericVersion = nodeVersion.split(\".\").slice(0, 3);\n numericVersion = (numericVersion[0] * 1e4) + (numericVersion[1] * 100) + (numericVersion[2].split(\"-\")[0] * 1);\n if (numericVersion < 16e4) {\n throw new Error(\"This emscripten-generated code requires node v16.0.0 (detected v\" + nodeVersion + \")\");\n }\n // These modules will usually be used on Node.js. Load them eagerly to avoid\n // the complexity of lazy-loading.\n var fs = require(\"fs\");\n scriptDirectory = __dirname + \"/\";\n // include: node_shell_read.js\n readBinary = filename => {\n // We need to re-wrap `file://` strings to URLs.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename);\n assert(Buffer.isBuffer(ret));\n return ret;\n };\n readAsync = async (filename, binary = true) => {\n // See the comment in the `readBinary` function.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename, binary ? undefined : \"utf8\");\n assert(binary ? Buffer.isBuffer(ret) : typeof ret == \"string\");\n return ret;\n };\n // end include: node_shell_read.js\n if (process.argv.length > 1) {\n thisProgram = process.argv[1].replace(/\\\\/g, \"/\");\n }\n arguments_ = process.argv.slice(2);\n quit_ = (status, toThrow) => {\n process.exitCode = status;\n throw toThrow;\n };\n} else if (ENVIRONMENT_IS_SHELL) {\n const isNode = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n if (isNode || typeof window == \"object\" || typeof WorkerGlobalScope != \"undefined\") throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n} else // Note that this includes Node.js workers when relevant (pthreads is enabled).\n// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and\n// ENVIRONMENT_IS_NODE.\nif (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n try {\n scriptDirectory = new URL(\".\", _scriptName).href;\n } catch {}\n if (!(typeof window == \"object\" || typeof WorkerGlobalScope != \"undefined\")) throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n {\n // include: web_or_worker_shell_read.js\n if (ENVIRONMENT_IS_WORKER) {\n readBinary = url => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, false);\n xhr.responseType = \"arraybuffer\";\n xhr.send(null);\n return new Uint8Array(/** @type{!ArrayBuffer} */ (xhr.response));\n };\n }\n readAsync = async url => {\n // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.\n // See https://github.com/github/fetch/pull/92#issuecomment-140665932\n // Cordova or Electron apps are typically loaded from a file:// url.\n // So use XHR on webview if URL is a file URL.\n if (isFileURI(url)) {\n return new Promise((resolve, reject) => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"arraybuffer\";\n xhr.onload = () => {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {\n // file URLs can return 0\n resolve(xhr.response);\n return;\n }\n reject(xhr.status);\n };\n xhr.onerror = reject;\n xhr.send(null);\n });\n }\n var response = await fetch(url, {\n credentials: \"same-origin\"\n });\n if (response.ok) {\n return response.arrayBuffer();\n }\n throw new Error(response.status + \" : \" + response.url);\n };\n }\n} else {\n throw new Error(\"environment detection error\");\n}\n\nvar out = console.log.bind(console);\n\nvar err = console.error.bind(console);\n\nvar IDBFS = \"IDBFS is no longer included by default; build with -lidbfs.js\";\n\nvar PROXYFS = \"PROXYFS is no longer included by default; build with -lproxyfs.js\";\n\nvar WORKERFS = \"WORKERFS is no longer included by default; build with -lworkerfs.js\";\n\nvar FETCHFS = \"FETCHFS is no longer included by default; build with -lfetchfs.js\";\n\nvar ICASEFS = \"ICASEFS is no longer included by default; build with -licasefs.js\";\n\nvar JSFILEFS = \"JSFILEFS is no longer included by default; build with -ljsfilefs.js\";\n\nvar OPFS = \"OPFS is no longer included by default; build with -lopfs.js\";\n\nvar NODEFS = \"NODEFS is no longer included by default; build with -lnodefs.js\";\n\n// perform assertions in shell.js after we set up out() and err(), as otherwise\n// if an assertion fails it cannot print the message\nassert(!ENVIRONMENT_IS_SHELL, \"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.\");\n\n// end include: shell.js\n// include: preamble.js\n// === Preamble library stuff ===\n// Documentation for the public APIs defined in this file must be updated in:\n// site/source/docs/api_reference/preamble.js.rst\n// A prebuilt local version of the documentation is available at:\n// site/build/text/docs/api_reference/preamble.js.txt\n// You can also build docs locally as HTML or other formats in site/\n// An online HTML version (which may be of a different version of Emscripten)\n// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html\nvar dynamicLibraries = [];\n\nvar wasmBinary;\n\nif (typeof WebAssembly != \"object\") {\n err(\"no native wasm support detected\");\n}\n\n// Wasm globals\n//========================================\n// Runtime essentials\n//========================================\n// whether we are quitting the application. no code should run after this.\n// set in exit() and abort()\nvar ABORT = false;\n\n// set by exit() and abort(). Passed to 'onExit' handler.\n// NOTE: This is also used as the process return code code in shell environments\n// but only when noExitRuntime is false.\nvar EXITSTATUS;\n\n// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we\n// don't define it at all in release modes. This matches the behaviour of\n// MINIMAL_RUNTIME.\n// TODO(sbc): Make this the default even without STRICT enabled.\n/** @type {function(*, string=)} */ function assert(condition, text) {\n if (!condition) {\n abort(\"Assertion failed\" + (text ? \": \" + text : \"\"));\n }\n}\n\n// We used to include malloc/free by default in the past. Show a helpful error in\n// builds with assertions.\n/**\n * Indicates whether filename is delivered via file protocol (as opposed to http/https)\n * @noinline\n */ var isFileURI = filename => filename.startsWith(\"file://\");\n\n// include: runtime_common.js\n// include: runtime_stack_check.js\n// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.\nfunction writeStackCookie() {\n var max = _emscripten_stack_get_end();\n assert((max & 3) == 0);\n // If the stack ends at address zero we write our cookies 4 bytes into the\n // stack. This prevents interference with SAFE_HEAP and ASAN which also\n // monitor writes to address zero.\n if (max == 0) {\n max += 4;\n }\n // The stack grow downwards towards _emscripten_stack_get_end.\n // We write cookies to the final two words in the stack and detect if they are\n // ever overwritten.\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((max) >> 2), \"storing\")] = 34821223;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((max) + (4)) >> 2), \"storing\")] = 2310721022;\n}\n\nfunction checkStackCookie() {\n if (ABORT) return;\n var max = _emscripten_stack_get_end();\n // See writeStackCookie().\n if (max == 0) {\n max += 4;\n }\n var cookie1 = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((max) >> 2), \"loading\")];\n var cookie2 = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((max) + (4)) >> 2), \"loading\")];\n if (cookie1 != 34821223 || cookie2 != 2310721022) {\n abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`);\n }\n}\n\n// end include: runtime_stack_check.js\n// include: runtime_exceptions.js\n// end include: runtime_exceptions.js\n// include: runtime_debug.js\nvar runtimeDebug = true;\n\n// Switch to false at runtime to disable logging at the right times\n// Used by XXXXX_DEBUG settings to output debug messages.\nfunction dbg(...args) {\n if (!runtimeDebug && typeof runtimeDebug != \"undefined\") return;\n // TODO(sbc): Make this configurable somehow. Its not always convenient for\n // logging to show up as warnings.\n console.warn(...args);\n}\n\n// Endianness check\n(() => {\n var h16 = new Int16Array(1);\n var h8 = new Int8Array(h16.buffer);\n h16[0] = 25459;\n if (h8[0] !== 115 || h8[1] !== 99) abort(\"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)\");\n})();\n\nfunction consumedModuleProp(prop) {\n if (!Object.getOwnPropertyDescriptor(Module, prop)) {\n Object.defineProperty(Module, prop, {\n configurable: true,\n set() {\n abort(`Attempt to set \\`Module.${prop}\\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`);\n }\n });\n }\n}\n\nfunction makeInvalidEarlyAccess(name) {\n return () => assert(false, `call to '${name}' via reference taken before Wasm module initialization`);\n}\n\nfunction ignoredModuleProp(prop) {\n if (Object.getOwnPropertyDescriptor(Module, prop)) {\n abort(`\\`Module.${prop}\\` was supplied but \\`${prop}\\` not included in INCOMING_MODULE_JS_API`);\n }\n}\n\n// forcing the filesystem exports a few things by default\nfunction isExportedByForceFilesystem(name) {\n return name === \"FS_createPath\" || name === \"FS_createDataFile\" || name === \"FS_createPreloadedFile\" || name === \"FS_preloadFile\" || name === \"FS_unlink\" || name === \"addRunDependency\" || // The old FS has some functionality that WasmFS lacks.\n name === \"FS_createLazyFile\" || name === \"FS_createDevice\" || name === \"removeRunDependency\";\n}\n\nfunction missingLibrarySymbol(sym) {\n // Any symbol that is not included from the JS library is also (by definition)\n // not exported on the Module object.\n unexportedRuntimeSymbol(sym);\n}\n\nfunction unexportedRuntimeSymbol(sym) {\n if (!Object.getOwnPropertyDescriptor(Module, sym)) {\n Object.defineProperty(Module, sym, {\n configurable: true,\n get() {\n var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;\n if (isExportedByForceFilesystem(sym)) {\n msg += \". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\";\n }\n abort(msg);\n }\n });\n }\n}\n\n// end include: runtime_debug.js\n// include: runtime_safe_heap.js\nfunction SAFE_HEAP_INDEX(arr, idx, action) {\n const bytes = arr.BYTES_PER_ELEMENT;\n const dest = idx * bytes;\n if (idx <= 0) abort(`segmentation fault ${action} ${bytes} bytes at address ${dest}`);\n if (runtimeInitialized) {\n var brk = _sbrk(0);\n if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when ${action} ${bytes} bytes at address ${dest}. DYNAMICTOP=${brk}`);\n if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);\n // sbrk-managed memory must be above the stack\n if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);\n }\n return idx;\n}\n\nfunction segfault() {\n abort(\"segmentation fault\");\n}\n\nfunction alignfault() {\n abort(\"alignment fault\");\n}\n\n// end include: runtime_safe_heap.js\nvar readyPromiseResolve, readyPromiseReject;\n\n// Memory management\nvar wasmMemory;\n\nvar /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ HEAPF64;\n\n// BigInt64Array type is not correctly defined in closure\nvar /** not-@type {!BigInt64Array} */ HEAP64, /* BigUint64Array type is not correctly defined in closure\n/** not-@type {!BigUint64Array} */ HEAPU64;\n\nvar runtimeInitialized = false;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n HEAP8 = new Int8Array(b);\n HEAP16 = new Int16Array(b);\n HEAPU8 = new Uint8Array(b);\n Module[\"HEAPU16\"] = HEAPU16 = new Uint16Array(b);\n Module[\"HEAP32\"] = HEAP32 = new Int32Array(b);\n Module[\"HEAPU32\"] = HEAPU32 = new Uint32Array(b);\n HEAPF32 = new Float32Array(b);\n HEAPF64 = new Float64Array(b);\n HEAP64 = new BigInt64Array(b);\n HEAPU64 = new BigUint64Array(b);\n}\n\n// In non-standalone/normal mode, we create the memory here.\n// include: runtime_init_memory.js\n// Create the wasm memory. (Note: this only applies if IMPORTED_MEMORY is defined)\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nfunction initMemory() {\n if (Module[\"wasmMemory\"]) {\n wasmMemory = Module[\"wasmMemory\"];\n } else {\n var INITIAL_MEMORY = Module[\"INITIAL_MEMORY\"] || 524288;\n assert(INITIAL_MEMORY >= 65536, \"INITIAL_MEMORY should be larger than STACK_SIZE, was \" + INITIAL_MEMORY + \"! (STACK_SIZE=\" + 65536 + \")\");\n /** @suppress {checkTypes} */ wasmMemory = new WebAssembly.Memory({\n \"initial\": INITIAL_MEMORY / 65536,\n // In theory we should not need to emit the maximum if we want \"unlimited\"\n // or 4GB of memory, but VMs error on that atm, see\n // https://github.com/emscripten-core/emscripten/issues/14130\n // And in the pthreads case we definitely need to emit a maximum. So\n // always emit one.\n \"maximum\": 32768\n });\n }\n updateMemoryViews();\n}\n\n// end include: runtime_init_memory.js\n// include: memoryprofiler.js\n// end include: memoryprofiler.js\n// end include: runtime_common.js\nassert(typeof Int32Array != \"undefined\" && typeof Float64Array !== \"undefined\" && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined, \"JS engine does not provide full typed array support\");\n\nvar __RELOC_FUNCS__ = [];\n\nfunction preRun() {\n if (Module[\"preRun\"]) {\n if (typeof Module[\"preRun\"] == \"function\") Module[\"preRun\"] = [ Module[\"preRun\"] ];\n while (Module[\"preRun\"].length) {\n addOnPreRun(Module[\"preRun\"].shift());\n }\n }\n consumedModuleProp(\"preRun\");\n // Begin ATPRERUNS hooks\n callRuntimeCallbacks(onPreRuns);\n}\n\nfunction initRuntime() {\n assert(!runtimeInitialized);\n runtimeInitialized = true;\n checkStackCookie();\n callRuntimeCallbacks(__RELOC_FUNCS__);\n // No ATINITS hooks\n wasmExports[\"__wasm_call_ctors\"]();\n // Begin ATPOSTCTORS hooks\n callRuntimeCallbacks(onPostCtors);\n}\n\nfunction preMain() {\n checkStackCookie();\n}\n\nfunction postRun() {\n checkStackCookie();\n // PThreads reuse the runtime from the main thread.\n if (Module[\"postRun\"]) {\n if (typeof Module[\"postRun\"] == \"function\") Module[\"postRun\"] = [ Module[\"postRun\"] ];\n while (Module[\"postRun\"].length) {\n addOnPostRun(Module[\"postRun\"].shift());\n }\n }\n consumedModuleProp(\"postRun\");\n // Begin ATPOSTRUNS hooks\n callRuntimeCallbacks(onPostRuns);\n}\n\n/** @param {string|number=} what */ function abort(what) {\n Module[\"onAbort\"]?.(what);\n what = \"Aborted(\" + what + \")\";\n // TODO(sbc): Should we remove printing and leave it up to whoever\n // catches the exception?\n err(what);\n ABORT = true;\n // Use a wasm runtime error, because a JS error might be seen as a foreign\n // exception, which means we'd run destructors on it. We need the error to\n // simply make the program stop.\n // FIXME This approach does not work in Wasm EH because it currently does not assume\n // all RuntimeErrors are from traps; it decides whether a RuntimeError is from\n // a trap or not based on a hidden field within the object. So at the moment\n // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that\n // allows this in the wasm spec.\n // Suppress closure compiler warning here. Closure compiler's builtin extern\n // definition for WebAssembly.RuntimeError claims it takes no arguments even\n // though it can.\n // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.\n /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);\n readyPromiseReject?.(e);\n // Throw the error whether or not MODULARIZE is set because abort is used\n // in code paths apart from instantiation where an exception is expected\n // to be thrown when abort is called.\n throw e;\n}\n\n// show errors on likely calls to FS when it was not included\nvar FS = {\n error() {\n abort(\"Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM\");\n },\n init() {\n FS.error();\n },\n createDataFile() {\n FS.error();\n },\n createPreloadedFile() {\n FS.error();\n },\n createLazyFile() {\n FS.error();\n },\n open() {\n FS.error();\n },\n mkdev() {\n FS.error();\n },\n registerDevice() {\n FS.error();\n },\n analyzePath() {\n FS.error();\n },\n ErrnoError() {\n FS.error();\n }\n};\n\nfunction createExportWrapper(name, nargs) {\n return (...args) => {\n assert(runtimeInitialized, `native function \\`${name}\\` called before runtime initialization`);\n var f = wasmExports[name];\n assert(f, `exported native function \\`${name}\\` not found`);\n // Only assert for too many arguments. Too few can be valid since the missing arguments will be zero filled.\n assert(args.length <= nargs, `native function \\`${name}\\` called with ${args.length} args but expects ${nargs}`);\n return f(...args);\n };\n}\n\nvar wasmBinaryFile;\n\nfunction findWasmBinary() {\n return locateFile(\"web-tree-sitter.wasm\");\n}\n\nfunction getBinarySync(file) {\n if (file == wasmBinaryFile && wasmBinary) {\n return new Uint8Array(wasmBinary);\n }\n if (readBinary) {\n return readBinary(file);\n }\n // Throwing a plain string here, even though it not normally adviables since\n // this gets turning into an `abort` in instantiateArrayBuffer.\n throw \"both async and sync fetching of the wasm failed\";\n}\n\nasync function getWasmBinary(binaryFile) {\n // If we don't have the binary yet, load it asynchronously using readAsync.\n if (!wasmBinary) {\n // Fetch the binary using readAsync\n try {\n var response = await readAsync(binaryFile);\n return new Uint8Array(response);\n } catch {}\n }\n // Otherwise, getBinarySync should be able to get it synchronously\n return getBinarySync(binaryFile);\n}\n\nasync function instantiateArrayBuffer(binaryFile, imports) {\n try {\n var binary = await getWasmBinary(binaryFile);\n var instance = await WebAssembly.instantiate(binary, imports);\n return instance;\n } catch (reason) {\n err(`failed to asynchronously prepare wasm: ${reason}`);\n // Warn on some common problems.\n if (isFileURI(binaryFile)) {\n err(`warning: Loading from a file URI (${binaryFile}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`);\n }\n abort(reason);\n }\n}\n\nasync function instantiateAsync(binary, binaryFile, imports) {\n if (!binary && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE) {\n try {\n var response = fetch(binaryFile, {\n credentials: \"same-origin\"\n });\n var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);\n return instantiationResult;\n } catch (reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err(`wasm streaming compile failed: ${reason}`);\n err(\"falling back to ArrayBuffer instantiation\");\n }\n }\n return instantiateArrayBuffer(binaryFile, imports);\n}\n\nfunction getWasmImports() {\n // prepare imports\n return {\n \"env\": wasmImports,\n \"wasi_snapshot_preview1\": wasmImports,\n \"GOT.mem\": new Proxy(wasmImports, GOTHandler),\n \"GOT.func\": new Proxy(wasmImports, GOTHandler)\n };\n}\n\n// Create the wasm instance.\n// Receives the wasm imports, returns the exports.\nasync function createWasm() {\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n wasmExports = relocateExports(wasmExports, 1024);\n var metadata = getDylinkMetadata(module);\n if (metadata.neededDynlibs) {\n dynamicLibraries = metadata.neededDynlibs.concat(dynamicLibraries);\n }\n const scannerAllocators = {malloc: wasmExports.ts_scanner_malloc_wasm, calloc: wasmExports.ts_scanner_calloc_wasm, realloc: wasmExports.ts_scanner_realloc_wasm}; Object.assign(wasmImports, scannerAllocators); updateGOT(scannerAllocators, true); mergeLibSymbols(wasmExports, \"main\");\n LDSO.init();\n loadDylibs();\n __RELOC_FUNCS__.push(wasmExports[\"__wasm_apply_data_relocs\"]);\n assignWasmExports(wasmExports);\n return wasmExports;\n }\n // Prefer streaming instantiation if available.\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiationResult(result) {\n // 'result' is a ResultObject object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, \"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?\");\n trueModule = null;\n return receiveInstance(result[\"instance\"], result[\"module\"]);\n }\n var info = getWasmImports();\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to\n // run the instantiation parallel to any other async startup actions they are\n // performing.\n // Also pthreads and wasm workers initialize the wasm instance through this\n // path.\n if (Module[\"instantiateWasm\"]) {\n return new Promise((resolve, reject) => {\n try {\n Module[\"instantiateWasm\"](info, (mod, inst) => {\n resolve(receiveInstance(mod, inst));\n });\n } catch (e) {\n err(`Module.instantiateWasm callback failed with error: ${e}`);\n reject(e);\n }\n });\n }\n wasmBinaryFile ??= findWasmBinary();\n var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);\n var exports = receiveInstantiationResult(result);\n return exports;\n}\n\n// end include: preamble.js\n// Begin JS library code\nclass ExitStatus {\n name=\"ExitStatus\";\n constructor(status) {\n this.message = `Program terminated with exit(${status})`;\n this.status = status;\n }\n}\n\nvar GOT = {};\n\nvar currentModuleWeakSymbols = new Set([]);\n\nvar GOTHandler = {\n get(obj, symName) {\n var rtn = GOT[symName];\n if (!rtn) {\n rtn = GOT[symName] = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n }\n if (!currentModuleWeakSymbols.has(symName)) {\n // Any non-weak reference to a symbol marks it as `required`, which\n // enabled `reportUndefinedSymbols` to report undefined symbol errors\n // correctly.\n rtn.required = true;\n }\n return rtn;\n }\n};\n\nvar callRuntimeCallbacks = callbacks => {\n while (callbacks.length > 0) {\n // Pass the module as the first argument.\n callbacks.shift()(Module);\n }\n};\n\nvar onPostRuns = [];\n\nvar addOnPostRun = cb => onPostRuns.push(cb);\n\nvar onPreRuns = [];\n\nvar addOnPreRun = cb => onPreRuns.push(cb);\n\nvar UTF8Decoder = typeof TextDecoder != \"undefined\" ? new TextDecoder : undefined;\n\nvar findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => {\n var maxIdx = idx + maxBytesToRead;\n if (ignoreNul) return maxIdx;\n // TextDecoder needs to know the byte length in advance, it doesn't stop on\n // null terminator by itself.\n // As a tiny code save trick, compare idx against maxIdx using a negation,\n // so that maxBytesToRead=undefined/NaN means Infinity.\n while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;\n return idx;\n};\n\nvar warnOnce = text => {\n warnOnce.shown ||= {};\n if (!warnOnce.shown[text]) {\n warnOnce.shown[text] = 1;\n if (ENVIRONMENT_IS_NODE) text = \"warning: \" + text;\n err(text);\n }\n};\n\n/**\n * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given\n * array that contains uint8 values, returns a copy of that string as a\n * Javascript String object.\n * heapOrArray is either a regular array, or a JavaScript typed array view.\n * @param {number=} idx\n * @param {number=} maxBytesToRead\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => {\n var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);\n // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.\n if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n }\n var str = \"\";\n while (idx < endPtr) {\n // For UTF8 byte structure, see:\n // http://en.wikipedia.org/wiki/UTF-8#Description\n // https://www.ietf.org/rfc/rfc2279.txt\n // https://tools.ietf.org/html/rfc3629\n var u0 = heapOrArray[idx++];\n if (!(u0 & 128)) {\n str += String.fromCharCode(u0);\n continue;\n }\n var u1 = heapOrArray[idx++] & 63;\n if ((u0 & 224) == 192) {\n str += String.fromCharCode(((u0 & 31) << 6) | u1);\n continue;\n }\n var u2 = heapOrArray[idx++] & 63;\n if ((u0 & 240) == 224) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n if ((u0 & 248) != 240) warnOnce(\"Invalid UTF-8 leading byte \" + ptrToString(u0) + \" encountered when deserializing a UTF-8 string in wasm memory to a JS string!\");\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);\n }\n if (u0 < 65536) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 65536;\n str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));\n }\n }\n return str;\n};\n\nvar getDylinkMetadata = binary => {\n var offset = 0;\n var end = 0;\n function getU8() {\n return binary[offset++];\n }\n function getLEB() {\n var ret = 0;\n var mul = 1;\n while (1) {\n var byte = binary[offset++];\n ret += ((byte & 127) * mul);\n mul *= 128;\n if (!(byte & 128)) break;\n }\n return ret;\n }\n function getString() {\n var len = getLEB();\n offset += len;\n return UTF8ArrayToString(binary, offset - len, len);\n }\n function getStringList() {\n var count = getLEB();\n var rtn = [];\n while (count--) rtn.push(getString());\n return rtn;\n }\n /** @param {string=} message */ function failIf(condition, message) {\n if (condition) throw new Error(message);\n }\n if (binary instanceof WebAssembly.Module) {\n var dylinkSection = WebAssembly.Module.customSections(binary, \"dylink.0\");\n failIf(dylinkSection.length === 0, \"need dylink section\");\n binary = new Uint8Array(dylinkSection[0]);\n end = binary.length;\n } else {\n var int32View = new Uint32Array(new Uint8Array(binary.subarray(0, 24)).buffer);\n var magicNumberFound = int32View[0] == 1836278016;\n failIf(!magicNumberFound, \"need to see wasm magic number\");\n // \\0asm\n // we should see the dylink custom section right after the magic number and wasm version\n failIf(binary[8] !== 0, \"need the dylink section to be first\");\n offset = 9;\n var section_size = getLEB();\n //section size\n end = offset + section_size;\n var name = getString();\n failIf(name !== \"dylink.0\");\n }\n var customSection = {\n neededDynlibs: [],\n tlsExports: new Set,\n weakImports: new Set,\n runtimePaths: []\n };\n var WASM_DYLINK_MEM_INFO = 1;\n var WASM_DYLINK_NEEDED = 2;\n var WASM_DYLINK_EXPORT_INFO = 3;\n var WASM_DYLINK_IMPORT_INFO = 4;\n var WASM_DYLINK_RUNTIME_PATH = 5;\n var WASM_SYMBOL_TLS = 256;\n var WASM_SYMBOL_BINDING_MASK = 3;\n var WASM_SYMBOL_BINDING_WEAK = 1;\n while (offset < end) {\n var subsectionType = getU8();\n var subsectionSize = getLEB();\n if (subsectionType === WASM_DYLINK_MEM_INFO) {\n customSection.memorySize = getLEB();\n customSection.memoryAlign = getLEB();\n customSection.tableSize = getLEB();\n customSection.tableAlign = getLEB();\n } else if (subsectionType === WASM_DYLINK_NEEDED) {\n customSection.neededDynlibs = getStringList();\n } else if (subsectionType === WASM_DYLINK_EXPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var symname = getString();\n var flags = getLEB();\n if (flags & WASM_SYMBOL_TLS) {\n customSection.tlsExports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_IMPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var modname = getString();\n var symname = getString();\n var flags = getLEB();\n if ((flags & WASM_SYMBOL_BINDING_MASK) == WASM_SYMBOL_BINDING_WEAK) {\n customSection.weakImports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_RUNTIME_PATH) {\n customSection.runtimePaths = getStringList();\n } else {\n err(\"unknown dylink.0 subsection:\", subsectionType);\n // unknown subsection\n offset += subsectionSize;\n }\n }\n var tableAlign = Math.pow(2, customSection.tableAlign);\n assert(tableAlign === 1, `invalid tableAlign ${tableAlign}`);\n assert(offset == end);\n return customSection;\n};\n\n/**\n * @param {number} ptr\n * @param {string} type\n */ function getValue(ptr, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n return HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"loading\")];\n\n case \"i8\":\n return HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"loading\")];\n\n case \"i16\":\n return HEAP16[SAFE_HEAP_INDEX(HEAP16, ((ptr) >> 1), \"loading\")];\n\n case \"i32\":\n return HEAP32[SAFE_HEAP_INDEX(HEAP32, ((ptr) >> 2), \"loading\")];\n\n case \"i64\":\n return HEAP64[SAFE_HEAP_INDEX(HEAP64, ((ptr) >> 3), \"loading\")];\n\n case \"float\":\n return HEAPF32[SAFE_HEAP_INDEX(HEAPF32, ((ptr) >> 2), \"loading\")];\n\n case \"double\":\n return HEAPF64[SAFE_HEAP_INDEX(HEAPF64, ((ptr) >> 3), \"loading\")];\n\n case \"*\":\n return HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((ptr) >> 2), \"loading\")];\n\n default:\n abort(`invalid type for getValue: ${type}`);\n }\n}\n\nvar newDSO = (name, handle, syms) => {\n var dso = {\n refcount: Infinity,\n name,\n exports: syms,\n global: true\n };\n LDSO.loadedLibsByName[name] = dso;\n if (handle != undefined) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return dso;\n};\n\nvar LDSO = {\n loadedLibsByName: {},\n loadedLibsByHandle: {},\n init() {\n // This function needs to run after the initial wasmImports object\n // as been created.\n assert(wasmImports);\n newDSO(\"__main__\", 0, wasmImports);\n }\n};\n\nvar ___heap_base = 81984;\n\nvar alignMemory = (size, alignment) => {\n assert(alignment, \"alignment argument is required\");\n return Math.ceil(size / alignment) * alignment;\n};\n\nvar getMemory = size => {\n // After the runtime is initialized, we must only use sbrk() normally.\n if (runtimeInitialized) {\n // Currently we don't support freeing of static data when modules are\n // unloaded via dlclose. This function is tagged as `noleakcheck` to\n // avoid having this reported as leak.\n return _calloc(size, 1);\n }\n var ret = ___heap_base;\n // Keep __heap_base stack aligned.\n var end = ret + alignMemory(size, 16);\n assert(end <= HEAP8.length, \"failure to getMemory - memory growth etc. is not supported there, call malloc/sbrk directly or increase INITIAL_MEMORY\");\n ___heap_base = end;\n GOT[\"__heap_base\"].value = end;\n return ret;\n};\n\nvar isInternalSym = symName => [ \"__cpp_exception\", \"__c_longjmp\", \"__wasm_apply_data_relocs\", \"__dso_handle\", \"__tls_size\", \"__tls_align\", \"__set_stack_limits\", \"_emscripten_tls_init\", \"__wasm_init_tls\", \"__wasm_call_ctors\", \"__start_em_asm\", \"__stop_em_asm\", \"__start_em_js\", \"__stop_em_js\" ].includes(symName) || symName.startsWith(\"__em_js__\");\n\nvar uleb128EncodeWithLen = arr => {\n const n = arr.length;\n assert(n < 16384);\n // Note: this LEB128 length encoding produces extra byte for n < 128,\n // but we don't care as it's only used in a temporary representation.\n return [ (n % 128) | 128, n >> 7, ...arr ];\n};\n\nvar wasmTypeCodes = {\n \"i\": 127,\n // i32\n \"p\": 127,\n // i32\n \"j\": 126,\n // i64\n \"f\": 125,\n // f32\n \"d\": 124,\n // f64\n \"e\": 111\n};\n\nvar generateTypePack = types => uleb128EncodeWithLen(Array.from(types, type => {\n var code = wasmTypeCodes[type];\n assert(code, `invalid signature char: ${type}`);\n return code;\n}));\n\nvar convertJsFunctionToWasm = (func, sig) => {\n // Rest of the module is static\n var bytes = Uint8Array.of(0, 97, 115, 109, // magic (\"\\0asm\")\n 1, 0, 0, 0, // version: 1\n 1, // Type section code\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n ...uleb128EncodeWithLen([ 1, // count: 1\n 96, // param types\n ...generateTypePack(sig.slice(1)), // return types (for now only supporting [] if `void` and single [T] otherwise)\n ...generateTypePack(sig[0] === \"v\" ? \"\" : sig[0]) ]), // The rest of the module is static\n 2, 7, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 1, 1, 101, 1, 102, 0, 0, 7, 5, // export section\n // (export \"f\" (func 0 (type 0)))\n 1, 1, 102, 0, 0);\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n \"e\": {\n \"f\": func\n }\n });\n var wrappedFunc = instance.exports[\"f\"];\n return wrappedFunc;\n};\n\nvar wasmTableMirror = [];\n\n/** @type {WebAssembly.Table} */ var wasmTable = new WebAssembly.Table({\n \"initial\": 59,\n \"element\": \"anyfunc\"\n});\n\nvar getWasmTableEntry = funcPtr => {\n var func = wasmTableMirror[funcPtr];\n if (!func) {\n /** @suppress {checkTypes} */ wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);\n }\n /** @suppress {checkTypes} */ assert(wasmTable.get(funcPtr) == func, \"JavaScript-side Wasm function table mirror is out of date!\");\n return func;\n};\n\nvar updateTableMap = (offset, count) => {\n if (functionsInTableMap) {\n for (var i = offset; i < offset + count; i++) {\n var item = getWasmTableEntry(i);\n // Ignore null values.\n if (item) {\n functionsInTableMap.set(item, i);\n }\n }\n }\n};\n\nvar functionsInTableMap;\n\nvar getFunctionAddress = func => {\n // First, create the map if this is the first use.\n if (!functionsInTableMap) {\n functionsInTableMap = new WeakMap;\n updateTableMap(0, wasmTable.length);\n }\n return functionsInTableMap.get(func) || 0;\n};\n\nvar freeTableIndexes = [];\n\nvar getEmptyTableSlot = () => {\n // Reuse a free index if there is one, otherwise grow.\n if (freeTableIndexes.length) {\n return freeTableIndexes.pop();\n }\n try {\n // Grow the table\n return wasmTable[\"grow\"](1);\n } catch (err) {\n if (!(err instanceof RangeError)) {\n throw err;\n }\n abort(\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\");\n }\n};\n\nvar setWasmTableEntry = (idx, func) => {\n /** @suppress {checkTypes} */ wasmTable.set(idx, func);\n // With ABORT_ON_WASM_EXCEPTIONS wasmTable.get is overridden to return wrapped\n // functions so we need to call it here to retrieve the potential wrapper correctly\n // instead of just storing 'func' directly into wasmTableMirror\n /** @suppress {checkTypes} */ wasmTableMirror[idx] = wasmTable.get(idx);\n};\n\n/** @param {string=} sig */ var addFunction = (func, sig) => {\n assert(typeof func != \"undefined\");\n // Check if the function is already in the table, to ensure each function\n // gets a unique index.\n var rtn = getFunctionAddress(func);\n if (rtn) {\n return rtn;\n }\n // It's not in the table, add it now.\n var ret = getEmptyTableSlot();\n // Set the new value.\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n setWasmTableEntry(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n assert(typeof sig != \"undefined\", \"Missing signature argument to addFunction: \" + func);\n var wrapped = convertJsFunctionToWasm(func, sig);\n setWasmTableEntry(ret, wrapped);\n }\n functionsInTableMap.set(func, ret);\n return ret;\n};\n\nvar updateGOT = (exports, replace) => {\n for (var symName in exports) {\n if (isInternalSym(symName)) {\n continue;\n }\n var value = exports[symName];\n GOT[symName] ||= new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n if (replace || GOT[symName].value == 0) {\n if (typeof value == \"function\") {\n GOT[symName].value = addFunction(value);\n } else if (typeof value == \"number\") {\n GOT[symName].value = value;\n } else {\n err(`unhandled export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\n/** @param {boolean=} replace */ var relocateExports = (exports, memoryBase, replace) => {\n var relocated = {};\n for (var e in exports) {\n var value = exports[e];\n if (typeof value == \"object\") {\n // a breaking change in the wasm spec, globals are now objects\n // https://github.com/WebAssembly/mutable-global/issues/1\n value = value.value;\n }\n if (typeof value == \"number\") {\n value += memoryBase;\n }\n relocated[e] = value;\n }\n updateGOT(relocated, replace);\n return relocated;\n};\n\nvar isSymbolDefined = symName => {\n // Ignore 'stub' symbols that are auto-generated as part of the original\n // `wasmImports` used to instantiate the main module.\n var existing = wasmImports[symName];\n if (!existing || existing.stub) {\n return false;\n }\n return true;\n};\n\nvar dynCall = (sig, ptr, args = [], promising = false) => {\n assert(!promising, \"async dynCall is not supported in this mode\");\n assert(getWasmTableEntry(ptr), `missing table entry in dynCall: ${ptr}`);\n var func = getWasmTableEntry(ptr);\n var rtn = func(...args);\n function convert(rtn) {\n return rtn;\n }\n return convert(rtn);\n};\n\nvar stackSave = () => _emscripten_stack_get_current();\n\nvar stackRestore = val => __emscripten_stack_restore(val);\n\nvar createInvokeFunction = sig => (ptr, ...args) => {\n var sp = stackSave();\n try {\n return dynCall(sig, ptr, args);\n } catch (e) {\n stackRestore(sp);\n // Create a try-catch guard that rethrows the Emscripten EH exception.\n // Exceptions thrown from C++ will be a pointer (number) and longjmp\n // will throw the number Infinity. Use the compact and fast \"e !== e+0\"\n // test to check if e was not a Number.\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n // In theory this if statement could be done on\n // creating the function, but I just added this to\n // save wasting code space as it only happens on exception.\n if (sig[0] == \"j\") return 0n;\n }\n};\n\nvar resolveGlobalSymbol = (symName, direct = false) => {\n var sym;\n if (isSymbolDefined(symName)) {\n sym = wasmImports[symName];\n } else if (symName.startsWith(\"invoke_\")) {\n // Create (and cache) new invoke_ functions on demand.\n sym = wasmImports[symName] = createInvokeFunction(symName.split(\"_\")[1]);\n }\n return {\n sym,\n name: symName\n };\n};\n\nvar onPostCtors = [];\n\nvar addOnPostCtor = cb => onPostCtors.push(cb);\n\n/**\n * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the\n * emscripten HEAP, returns a copy of that string as a Javascript String object.\n *\n * @param {number} ptr\n * @param {number=} maxBytesToRead - An optional length that specifies the\n * maximum number of bytes to read. You can omit this parameter to scan the\n * string until the first 0 byte. If maxBytesToRead is passed, and the string\n * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the\n * string will cut short at that byte index.\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => {\n assert(typeof ptr == \"number\", `UTF8ToString expects a number (got ${typeof ptr})`);\n return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : \"\";\n};\n\n/**\n * @param {string=} libName\n * @param {Object=} localScope\n * @param {number=} handle\n */ var loadWebAssemblyModule = (binary, flags, libName, localScope, handle) => {\n var metadata = getDylinkMetadata(binary);\n // loadModule loads the wasm module after all its dependencies have been loaded.\n // can be called both sync/async.\n function loadModule() {\n var originalTable = wasmTable;\n // alignments are powers of 2\n var memAlign = Math.pow(2, metadata.memoryAlign);\n // prepare memory\n var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0;\n // TODO: add to cleanups\n var tableBase = metadata.tableSize ? wasmTable.length : 0;\n if (handle) {\n HEAP8[SAFE_HEAP_INDEX(HEAP8, (handle) + (8), \"storing\")] = 1;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (12)) >> 2), \"storing\")] = memoryBase;\n HEAP32[SAFE_HEAP_INDEX(HEAP32, (((handle) + (16)) >> 2), \"storing\")] = metadata.memorySize;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (20)) >> 2), \"storing\")] = tableBase;\n HEAP32[SAFE_HEAP_INDEX(HEAP32, (((handle) + (24)) >> 2), \"storing\")] = metadata.tableSize;\n }\n if (metadata.tableSize) {\n assert(wasmTable.length == tableBase, `unexpected table size while loading ${libName}: ${wasmTable.length}`);\n wasmTable.grow(metadata.tableSize);\n }\n // This is the export map that we ultimately return. We declare it here\n // so it can be used within resolveSymbol. We resolve symbols against\n // this local symbol map in the case there they are not present on the\n // global Module object. We need this fallback because Modules sometime\n // need to import their own symbols\n var moduleExports;\n function resolveSymbol(sym) {\n var resolved = resolveGlobalSymbol(sym).sym;\n if (!resolved && localScope) {\n resolved = localScope[sym];\n }\n if (!resolved) {\n resolved = moduleExports[sym];\n }\n assert(resolved, `undefined symbol '${sym}'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment`);\n return resolved;\n }\n // TODO kill \u2193\u2193\u2193 (except \"symbols local to this module\", it will likely be\n // not needed if we require that if A wants symbols from B it has to link\n // to B explicitly: similarly to -Wl,--no-undefined)\n // wasm dynamic libraries are pure wasm, so they cannot assist in\n // their own loading. When side module A wants to import something\n // provided by a side module B that is loaded later, we need to\n // add a layer of indirection, but worse, we can't even tell what\n // to add the indirection for, without inspecting what A's imports\n // are. To do that here, we use a JS proxy (another option would\n // be to inspect the binary directly).\n var proxyHandler = {\n get(stubs, prop) {\n // symbols that should be local to this module\n switch (prop) {\n case \"__memory_base\":\n return memoryBase;\n\n case \"__table_base\":\n return tableBase;\n }\n if (prop in wasmImports && !wasmImports[prop].stub) {\n // No stub needed, symbol already exists in symbol table\n var res = wasmImports[prop];\n return res;\n }\n // Return a stub function that will resolve the symbol\n // when first called.\n if (!(prop in stubs)) {\n var resolved;\n stubs[prop] = (...args) => {\n resolved ||= resolveSymbol(prop);\n return resolved(...args);\n };\n }\n return stubs[prop];\n }\n };\n var proxy = new Proxy({}, proxyHandler);\n currentModuleWeakSymbols = metadata.weakImports;\n var info = {\n \"GOT.mem\": new Proxy({}, GOTHandler),\n \"GOT.func\": new Proxy({}, GOTHandler),\n \"env\": proxy,\n \"wasi_snapshot_preview1\": proxy\n };\n function postInstantiation(module, instance) {\n // the table should be unchanged\n assert(wasmTable === originalTable);\n // add new entries to functionsInTableMap\n updateTableMap(tableBase, metadata.tableSize);\n moduleExports = relocateExports(instance.exports, memoryBase);\n if (!flags.allowUndefined) {\n reportUndefinedSymbols();\n }\n function addEmAsm(addr, body) {\n var args = [];\n var arity = 0;\n for (;arity < 16; arity++) {\n if (body.indexOf(\"$\" + arity) != -1) {\n args.push(\"$\" + arity);\n } else {\n break;\n }\n }\n args = args.join(\",\");\n var func = `(${args}) => { ${body} };`;\n ASM_CONSTS[start] = eval(func);\n }\n // Add any EM_ASM function that exist in the side module\n if (\"__start_em_asm\" in moduleExports) {\n var start = moduleExports[\"__start_em_asm\"];\n var stop = moduleExports[\"__stop_em_asm\"];\n while (start < stop) {\n var jsString = UTF8ToString(start);\n addEmAsm(start, jsString);\n start = HEAPU8.indexOf(0, start) + 1;\n }\n }\n function addEmJs(name, cSig, body) {\n // The signature here is a C signature (e.g. \"(int foo, char* bar)\").\n // See `create_em_js` in emcc.py` for the build-time version of this\n // code.\n var jsArgs = [];\n cSig = cSig.slice(1, -1);\n if (cSig != \"void\") {\n cSig = cSig.split(\",\");\n for (var i in cSig) {\n var jsArg = cSig[i].split(\" \").pop();\n jsArgs.push(jsArg.replace(\"*\", \"\"));\n }\n }\n var func = `(${jsArgs}) => ${body};`;\n moduleExports[name] = eval(func);\n }\n for (var name in moduleExports) {\n if (name.startsWith(\"__em_js__\")) {\n var start = moduleExports[name];\n var jsString = UTF8ToString(start);\n // EM_JS strings are stored in the data section in the form\n // SIG<::>BODY.\n var parts = jsString.split(\"<::>\");\n addEmJs(name.replace(\"__em_js__\", \"\"), parts[0], parts[1]);\n delete moduleExports[name];\n }\n }\n // initialize the module\n var applyRelocs = moduleExports[\"__wasm_apply_data_relocs\"];\n if (applyRelocs) {\n if (runtimeInitialized) {\n applyRelocs();\n } else {\n __RELOC_FUNCS__.push(applyRelocs);\n }\n }\n var init = moduleExports[\"__wasm_call_ctors\"];\n if (init) {\n if (runtimeInitialized) {\n init();\n } else {\n // we aren't ready to run compiled code yet\n addOnPostCtor(init);\n }\n }\n return moduleExports;\n }\n if (flags.loadAsync) {\n return (async () => {\n var instance;\n if (binary instanceof WebAssembly.Module) {\n instance = await WebAssembly.instantiate(binary, info);\n } else {\n // Destructuring assignment without declaration has to be wrapped\n // with parens or parser will treat the l-value as an object\n // literal instead.\n (({module: binary, instance} = await WebAssembly.instantiate(binary, info)));\n }\n return postInstantiation(binary, instance);\n })();\n }\n var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary);\n var instance = new WebAssembly.Instance(module, info);\n return postInstantiation(module, instance);\n }\n // We need to set rpath in flags based on the current library's rpath.\n // We can't mutate flags or else if a depends on b and c and b depends on d,\n // then c will be loaded with b's rpath instead of a's.\n flags = {\n ...flags,\n rpath: {\n parentLibPath: libName,\n paths: metadata.runtimePaths\n }\n };\n // now load needed libraries and the module itself.\n if (flags.loadAsync) {\n return metadata.neededDynlibs.reduce((chain, dynNeeded) => chain.then(() => loadDynamicLibrary(dynNeeded, flags, localScope)), Promise.resolve()).then(loadModule);\n }\n metadata.neededDynlibs.forEach(needed => loadDynamicLibrary(needed, flags, localScope));\n return loadModule();\n};\n\nvar mergeLibSymbols = (exports, libName) => {\n // add symbols into global namespace TODO: weak linking etc.\n for (var [sym, exp] of Object.entries(exports)) {\n // When RTLD_GLOBAL is enabled, the symbols defined by this shared object\n // will be made available for symbol resolution of subsequently loaded\n // shared objects.\n // We should copy the symbols (which include methods and variables) from\n // SIDE_MODULE to MAIN_MODULE.\n const setImport = target => {\n if (!isSymbolDefined(target)) {\n wasmImports[target] = exp;\n }\n };\n setImport(sym);\n // Special case for handling of main symbol: If a side module exports\n // `main` that also acts a definition for `__main_argc_argv` and vice\n // versa.\n const main_alias = \"__main_argc_argv\";\n if (sym == \"main\") {\n setImport(main_alias);\n }\n if (sym == main_alias) {\n setImport(\"main\");\n }\n }\n};\n\nvar asyncLoad = async url => {\n var arrayBuffer = await readAsync(url);\n assert(arrayBuffer, `Loading data file \"${url}\" failed (no arrayBuffer).`);\n return new Uint8Array(arrayBuffer);\n};\n\n/**\n * @param {number=} handle\n * @param {Object=} localScope\n */ function loadDynamicLibrary(libName, flags = {\n global: true,\n nodelete: true\n}, localScope, handle) {\n // when loadDynamicLibrary did not have flags, libraries were loaded\n // globally & permanently\n var dso = LDSO.loadedLibsByName[libName];\n if (dso) {\n // the library is being loaded or has been loaded already.\n assert(dso.exports !== \"loading\", `Attempt to load '${libName}' twice before the first load completed`);\n if (!flags.global) {\n if (localScope) {\n Object.assign(localScope, dso.exports);\n }\n } else if (!dso.global) {\n // The library was previously loaded only locally but not\n // we have a request with global=true.\n dso.global = true;\n mergeLibSymbols(dso.exports, libName);\n }\n // same for \"nodelete\"\n if (flags.nodelete && dso.refcount !== Infinity) {\n dso.refcount = Infinity;\n }\n dso.refcount++;\n if (handle) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return flags.loadAsync ? Promise.resolve(true) : true;\n }\n // allocate new DSO\n dso = newDSO(libName, handle, \"loading\");\n dso.refcount = flags.nodelete ? Infinity : 1;\n dso.global = flags.global;\n // libName -> libData\n function loadLibData() {\n // for wasm, we can use fetch for async, but for fs mode we can only imitate it\n if (handle) {\n var data = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (28)) >> 2), \"loading\")];\n var dataSize = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (32)) >> 2), \"loading\")];\n if (data && dataSize) {\n var libData = HEAP8.slice(data, data + dataSize);\n return flags.loadAsync ? Promise.resolve(libData) : libData;\n }\n }\n var libFile = locateFile(libName);\n if (flags.loadAsync) {\n return asyncLoad(libFile);\n }\n // load the binary synchronously\n if (!readBinary) {\n throw new Error(`${libFile}: file not found, and synchronous loading of external files is not available`);\n }\n return readBinary(libFile);\n }\n // libName -> exports\n function getExports() {\n // module not preloaded - load lib data and create new module from it\n if (flags.loadAsync) {\n return loadLibData().then(libData => loadWebAssemblyModule(libData, flags, libName, localScope, handle));\n }\n return loadWebAssemblyModule(loadLibData(), flags, libName, localScope, handle);\n }\n // module for lib is loaded - update the dso & global namespace\n function moduleLoaded(exports) {\n if (dso.global) {\n mergeLibSymbols(exports, libName);\n } else if (localScope) {\n Object.assign(localScope, exports);\n }\n dso.exports = exports;\n }\n if (flags.loadAsync) {\n return getExports().then(exports => {\n moduleLoaded(exports);\n return true;\n });\n }\n moduleLoaded(getExports());\n return true;\n}\n\nvar reportUndefinedSymbols = () => {\n for (var [symName, entry] of Object.entries(GOT)) {\n if (entry.value == 0) {\n var value = resolveGlobalSymbol(symName, true).sym;\n if (!value && !entry.required) {\n // Ignore undefined symbols that are imported as weak.\n continue;\n }\n assert(value, `undefined symbol '${symName}'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment`);\n if (typeof value == \"function\") {\n /** @suppress {checkTypes} */ entry.value = addFunction(value, value.sig);\n } else if (typeof value == \"number\") {\n entry.value = value;\n } else {\n throw new Error(`bad export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\nvar runDependencies = 0;\n\nvar dependenciesFulfilled = null;\n\nvar runDependencyTracking = {};\n\nvar runDependencyWatcher = null;\n\nvar removeRunDependency = id => {\n runDependencies--;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n assert(id, \"removeRunDependency requires an ID\");\n assert(runDependencyTracking[id]);\n delete runDependencyTracking[id];\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback();\n }\n }\n};\n\nvar addRunDependency = id => {\n runDependencies++;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n assert(id, \"addRunDependency requires an ID\");\n assert(!runDependencyTracking[id]);\n runDependencyTracking[id] = 1;\n if (runDependencyWatcher === null && typeof setInterval != \"undefined\") {\n // Check for missing dependencies every few seconds\n runDependencyWatcher = setInterval(() => {\n if (ABORT) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n return;\n }\n var shown = false;\n for (var dep in runDependencyTracking) {\n if (!shown) {\n shown = true;\n err(\"still waiting on run dependencies:\");\n }\n err(`dependency: ${dep}`);\n }\n if (shown) {\n err(\"(end of list)\");\n }\n }, 1e4);\n // Prevent this timer from keeping the runtime alive if nothing\n // else is.\n runDependencyWatcher.unref?.();\n }\n};\n\nvar loadDylibs = async () => {\n if (!dynamicLibraries.length) {\n reportUndefinedSymbols();\n return;\n }\n addRunDependency(\"loadDylibs\");\n // Load binaries asynchronously\n for (var lib of dynamicLibraries) {\n await loadDynamicLibrary(lib, {\n loadAsync: true,\n global: true,\n nodelete: true,\n allowUndefined: true\n });\n }\n // we got them all, wonderful\n reportUndefinedSymbols();\n removeRunDependency(\"loadDylibs\");\n};\n\nvar noExitRuntime = true;\n\nvar ptrToString = ptr => {\n assert(typeof ptr === \"number\");\n // Convert to 32-bit unsigned value\n ptr >>>= 0;\n return \"0x\" + ptr.toString(16).padStart(8, \"0\");\n};\n\n/**\n * @param {number} ptr\n * @param {number} value\n * @param {string} type\n */ function setValue(ptr, value, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"storing\")] = value;\n break;\n\n case \"i8\":\n HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"storing\")] = value;\n break;\n\n case \"i16\":\n HEAP16[SAFE_HEAP_INDEX(HEAP16, ((ptr) >> 1), \"storing\")] = value;\n break;\n\n case \"i32\":\n HEAP32[SAFE_HEAP_INDEX(HEAP32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n case \"i64\":\n HEAP64[SAFE_HEAP_INDEX(HEAP64, ((ptr) >> 3), \"storing\")] = BigInt(value);\n break;\n\n case \"float\":\n HEAPF32[SAFE_HEAP_INDEX(HEAPF32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n case \"double\":\n HEAPF64[SAFE_HEAP_INDEX(HEAPF64, ((ptr) >> 3), \"storing\")] = value;\n break;\n\n case \"*\":\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n default:\n abort(`invalid type for setValue: ${type}`);\n }\n}\n\nvar ___memory_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1024);\n\nvar ___stack_high = 81984;\n\nvar ___stack_low = 16448;\n\nvar ___stack_pointer = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n}, 81984);\n\nvar ___table_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1);\n\nvar __emscripten_throw_longjmp = () => {\n throw Infinity;\n};\n\n__emscripten_throw_longjmp.sig = \"v\";\n\nvar getHeapMax = () => // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate\n// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side\n// for any code that deals with heap sizes, which would require special\n// casing all heap size related code to treat 0 specially.\n2147483648;\n\nvar growMemory = size => {\n var oldHeapSize = wasmMemory.buffer.byteLength;\n var pages = ((size - oldHeapSize + 65535) / 65536) | 0;\n try {\n // round size grow request up to wasm page size (fixed 64KB per spec)\n wasmMemory.grow(pages);\n // .grow() takes a delta compared to the previous size\n updateMemoryViews();\n return 1;\n } catch (e) {\n err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`);\n }\n};\n\nvar _emscripten_resize_heap = requestedSize => {\n var oldSize = HEAPU8.length;\n // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.\n requestedSize >>>= 0;\n // With multithreaded builds, races can happen (another thread might increase the size\n // in between), so return a failure, and let the caller retry.\n assert(requestedSize > oldSize);\n // Memory resize rules:\n // 1. Always increase heap size to at least the requested size, rounded up\n // to next page multiple.\n // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap\n // geometrically: increase the heap size according to\n // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most\n // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).\n // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap\n // linearly: increase the heap size by at least\n // MEMORY_GROWTH_LINEAR_STEP bytes.\n // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by\n // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest\n // 4. If we were unable to allocate as much memory, it may be due to\n // over-eager decision to excessively reserve due to (3) above.\n // Hence if an allocation fails, cut down on the amount of excess\n // growth, in an attempt to succeed to perform a smaller allocation.\n // A limit is set for how much we can grow. We should not exceed that\n // (the wasm binary specifies it, so if we tried, we'd fail anyhow).\n var maxHeapSize = getHeapMax();\n if (requestedSize > maxHeapSize) {\n err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`);\n return false;\n }\n // Loop through potential heap size increases. If we attempt a too eager\n // reservation that fails, cut down on the attempted size and reserve a\n // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)\n for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n var overGrownHeapSize = oldSize * (1 + 0 / cutDown);\n // ensure geometric growth\n // but limit overreserving (default to capping at +96MB overgrowth at most)\n overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));\n var replacement = growMemory(newSize);\n if (replacement) {\n return true;\n }\n }\n err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`);\n return false;\n};\n\n_emscripten_resize_heap.sig = \"ip\";\n\nvar SYSCALLS = {\n varargs: undefined,\n getStr(ptr) {\n var ret = UTF8ToString(ptr);\n return ret;\n }\n};\n\nvar _fd_close = fd => {\n abort(\"fd_close called without SYSCALLS_REQUIRE_FILESYSTEM\");\n};\n\n_fd_close.sig = \"ii\";\n\nvar INT53_MAX = 9007199254740992;\n\nvar INT53_MIN = -9007199254740992;\n\nvar bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);\n\nfunction _fd_seek(fd, offset, whence, newOffset) {\n offset = bigintToI53Checked(offset);\n return 70;\n}\n\n_fd_seek.sig = \"iijip\";\n\nvar printCharBuffers = [ null, [], [] ];\n\nvar printChar = (stream, curr) => {\n var buffer = printCharBuffers[stream];\n assert(buffer);\n if (curr === 0 || curr === 10) {\n (stream === 1 ? out : err)(UTF8ArrayToString(buffer));\n buffer.length = 0;\n } else {\n buffer.push(curr);\n }\n};\n\nvar flush_NO_FILESYSTEM = () => {\n // flush anything remaining in the buffers during shutdown\n _fflush(0);\n if (printCharBuffers[1].length) printChar(1, 10);\n if (printCharBuffers[2].length) printChar(2, 10);\n};\n\nvar _fd_write = (fd, iov, iovcnt, pnum) => {\n // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0\n var num = 0;\n for (var i = 0; i < iovcnt; i++) {\n var ptr = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((iov) >> 2), \"loading\")];\n var len = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((iov) + (4)) >> 2), \"loading\")];\n iov += 8;\n for (var j = 0; j < len; j++) {\n printChar(fd, HEAPU8[SAFE_HEAP_INDEX(HEAPU8, ptr + j, \"loading\")]);\n }\n num += len;\n }\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((pnum) >> 2), \"storing\")] = num;\n return 0;\n};\n\n_fd_write.sig = \"iippp\";\n\nfunction _tree_sitter_log_callback(isLexMessage, messageAddress) {\n if (Module.currentLogCallback) {\n const message = UTF8ToString(messageAddress);\n Module.currentLogCallback(message, isLexMessage !== 0);\n }\n}\n\nfunction _tree_sitter_parse_callback(inputBufferAddress, maxCodeUnits, index, row, column, lengthAddress) {\n const source = Module.currentParseCallback;\n const isString = typeof source === \"string\";\n const chunk = isString ? source : source(index, {\n row,\n column\n });\n const offset = isString ? index : 0;\n const remaining = typeof chunk === \"string\" ? chunk.length - offset : 0;\n if (remaining <= 0) {\n HEAP32[SAFE_HEAP_INDEX(HEAP32, lengthAddress >>> 2, \"storing\")] = 0;\n return;\n }\n let count = remaining < maxCodeUnits ? remaining : maxCodeUnits;\n if (count < remaining && count > 1) {\n const last = chunk.charCodeAt(offset + count - 1);\n if (last >= 55296 && last <= 56319) count--;\n }\n const base = inputBufferAddress >>> 1;\n for (let i = 0; i < count; i++) {\n HEAPU16[SAFE_HEAP_INDEX(HEAPU16, base + i, \"storing\")] = chunk.charCodeAt(offset + i);\n }\n HEAP32[SAFE_HEAP_INDEX(HEAP32, lengthAddress >>> 2, \"storing\")] = count;\n}\n\nfunction _tree_sitter_progress_callback(currentOffset, hasError) {\n if (Module.currentProgressCallback) {\n return Module.currentProgressCallback({\n currentOffset,\n hasError: hasError !== 0\n }) === true;\n }\n return false;\n}\n\nvar runtimeKeepaliveCounter = 0;\n\nvar keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;\n\nvar _proc_exit = code => {\n EXITSTATUS = code;\n if (!keepRuntimeAlive()) {\n Module[\"onExit\"]?.(code);\n ABORT = true;\n }\n quit_(code, new ExitStatus(code));\n};\n\n_proc_exit.sig = \"vi\";\n\n/** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n checkUnflushedContent();\n // if exit() was called explicitly, warn the user if the runtime isn't actually being shut down\n if (keepRuntimeAlive() && !implicit) {\n var msg = `program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;\n readyPromiseReject?.(msg);\n err(msg);\n }\n _proc_exit(status);\n};\n\nvar handleException = e => {\n // Certain exception types we do not treat as errors since they are used for\n // internal control flow.\n // 1. ExitStatus, which is thrown by exit()\n // 2. \"unwind\", which is thrown by emscripten_unwind_to_js_event_loop() and others\n // that wish to return to JS event loop.\n if (e instanceof ExitStatus || e == \"unwind\") {\n return EXITSTATUS;\n }\n checkStackCookie();\n if (e instanceof WebAssembly.RuntimeError) {\n if (_emscripten_stack_get_current() <= 0) {\n err(\"Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)\");\n }\n }\n quit_(1, e);\n};\n\nvar lengthBytesUTF8 = str => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code\n // unit, not a Unicode code point of the character! So decode\n // UTF16->UTF32->UTF8.\n // See http://unicode.org/faq/utf_bom.html#utf16-3\n var c = str.charCodeAt(i);\n // possibly a lead surrogate\n if (c <= 127) {\n len++;\n } else if (c <= 2047) {\n len += 2;\n } else if (c >= 55296 && c <= 57343) {\n len += 4;\n ++i;\n } else {\n len += 3;\n }\n }\n return len;\n};\n\nvar stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {\n assert(typeof str === \"string\", `stringToUTF8Array expects a string (got ${typeof str})`);\n // Parameter maxBytesToWrite is not optional. Negative values, 0, null,\n // undefined and false each don't write out any bytes.\n if (!(maxBytesToWrite > 0)) return 0;\n var startIdx = outIdx;\n var endIdx = outIdx + maxBytesToWrite - 1;\n // -1 for string null terminator.\n for (var i = 0; i < str.length; ++i) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description\n // and https://www.ietf.org/rfc/rfc2279.txt\n // and https://tools.ietf.org/html/rfc3629\n var u = str.codePointAt(i);\n if (u <= 127) {\n if (outIdx >= endIdx) break;\n heap[outIdx++] = u;\n } else if (u <= 2047) {\n if (outIdx + 1 >= endIdx) break;\n heap[outIdx++] = 192 | (u >> 6);\n heap[outIdx++] = 128 | (u & 63);\n } else if (u <= 65535) {\n if (outIdx + 2 >= endIdx) break;\n heap[outIdx++] = 224 | (u >> 12);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n } else {\n if (outIdx + 3 >= endIdx) break;\n if (u > 1114111) warnOnce(\"Invalid Unicode code point \" + ptrToString(u) + \" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).\");\n heap[outIdx++] = 240 | (u >> 18);\n heap[outIdx++] = 128 | ((u >> 12) & 63);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.\n // We need to manually skip over the second code unit for correct iteration.\n i++;\n }\n }\n // Null-terminate the pointer to the buffer.\n heap[outIdx] = 0;\n return outIdx - startIdx;\n};\n\nvar stringToUTF8 = (str, outPtr, maxBytesToWrite) => {\n assert(typeof maxBytesToWrite == \"number\", \"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\");\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n};\n\nvar stackAlloc = sz => __emscripten_stack_alloc(sz);\n\nvar stringToUTF8OnStack = str => {\n var size = lengthBytesUTF8(str) + 1;\n var ret = stackAlloc(size);\n stringToUTF8(str, ret, size);\n return ret;\n};\n\nvar AsciiToString = ptr => {\n var str = \"\";\n while (1) {\n var ch = HEAPU8[SAFE_HEAP_INDEX(HEAPU8, ptr++, \"loading\")];\n if (!ch) return str;\n str += String.fromCharCode(ch);\n }\n};\n\n// End JS library code\n// include: postlibrary.js\n// This file is included after the automatically-generated JS library code\n// but before the wasm module is created.\n{\n // With WASM_ESM_INTEGRATION this has to happen at the top level and not\n // delayed until processModuleArgs.\n initMemory();\n // Begin ATMODULES hooks\n if (Module[\"noExitRuntime\"]) noExitRuntime = Module[\"noExitRuntime\"];\n if (Module[\"print\"]) out = Module[\"print\"];\n if (Module[\"printErr\"]) err = Module[\"printErr\"];\n if (Module[\"dynamicLibraries\"]) dynamicLibraries = Module[\"dynamicLibraries\"];\n if (Module[\"wasmBinary\"]) wasmBinary = Module[\"wasmBinary\"];\n Module[\"FS_createDataFile\"] = FS.createDataFile;\n Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;\n // End ATMODULES hooks\n checkIncomingModuleAPI();\n if (Module[\"arguments\"]) arguments_ = Module[\"arguments\"];\n if (Module[\"thisProgram\"]) thisProgram = Module[\"thisProgram\"];\n // Assertions on removed incoming Module JS APIs.\n assert(typeof Module[\"memoryInitializerPrefixURL\"] == \"undefined\", \"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"pthreadMainPrefixURL\"] == \"undefined\", \"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"cdInitializerPrefixURL\"] == \"undefined\", \"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"filePackagePrefixURL\"] == \"undefined\", \"Module.filePackagePrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"read\"] == \"undefined\", \"Module.read option was removed\");\n assert(typeof Module[\"readAsync\"] == \"undefined\", \"Module.readAsync option was removed (modify readAsync in JS)\");\n assert(typeof Module[\"readBinary\"] == \"undefined\", \"Module.readBinary option was removed (modify readBinary in JS)\");\n assert(typeof Module[\"setWindowTitle\"] == \"undefined\", \"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)\");\n assert(typeof Module[\"TOTAL_MEMORY\"] == \"undefined\", \"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY\");\n assert(typeof Module[\"ENVIRONMENT\"] == \"undefined\", \"Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)\");\n assert(typeof Module[\"STACK_SIZE\"] == \"undefined\", \"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time\");\n if (Module[\"preInit\"]) {\n if (typeof Module[\"preInit\"] == \"function\") Module[\"preInit\"] = [ Module[\"preInit\"] ];\n while (Module[\"preInit\"].length > 0) {\n Module[\"preInit\"].shift()();\n }\n }\n consumedModuleProp(\"preInit\");\n}\n\n// Begin runtime exports\nModule[\"UTF8ToString\"] = UTF8ToString;\n\nModule[\"stringToUTF8\"] = stringToUTF8;\n\nModule[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n\nModule[\"AsciiToString\"] = AsciiToString;\n\nModule[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\n\nvar missingLibrarySymbols = [ \"writeI53ToI64\", \"writeI53ToI64Clamped\", \"writeI53ToI64Signaling\", \"writeI53ToU64Clamped\", \"writeI53ToU64Signaling\", \"readI53FromI64\", \"readI53FromU64\", \"convertI32PairToI53\", \"convertI32PairToI53Checked\", \"convertU32PairToI53\", \"getTempRet0\", \"setTempRet0\", \"zeroMemory\", \"withStackSave\", \"strError\", \"inetPton4\", \"inetNtop4\", \"inetPton6\", \"inetNtop6\", \"readSockaddr\", \"writeSockaddr\", \"readEmAsmArgs\", \"runEmAsmFunction\", \"runMainThreadEmAsm\", \"jstoi_q\", \"getExecutableName\", \"autoResumeAudioContext\", \"getDynCaller\", \"runtimeKeepalivePush\", \"runtimeKeepalivePop\", \"callUserCallback\", \"maybeExit\", \"asmjsMangle\", \"mmapAlloc\", \"HandleAllocator\", \"getNativeTypeSize\", \"getUniqueRunDependency\", \"addOnInit\", \"addOnPreMain\", \"addOnExit\", \"STACK_SIZE\", \"STACK_ALIGN\", \"POINTER_SIZE\", \"ASSERTIONS\", \"ccall\", \"cwrap\", \"removeFunction\", \"intArrayFromString\", \"intArrayToString\", \"stringToAscii\", \"UTF16ToString\", \"stringToUTF16\", \"lengthBytesUTF16\", \"UTF32ToString\", \"stringToUTF32\", \"lengthBytesUTF32\", \"stringToNewUTF8\", \"writeArrayToMemory\", \"registerKeyEventCallback\", \"maybeCStringToJsString\", \"findEventTarget\", \"getBoundingClientRect\", \"fillMouseEventData\", \"registerMouseEventCallback\", \"registerWheelEventCallback\", \"registerUiEventCallback\", \"registerFocusEventCallback\", \"fillDeviceOrientationEventData\", \"registerDeviceOrientationEventCallback\", \"fillDeviceMotionEventData\", \"registerDeviceMotionEventCallback\", \"screenOrientation\", \"fillOrientationChangeEventData\", \"registerOrientationChangeEventCallback\", \"fillFullscreenChangeEventData\", \"registerFullscreenChangeEventCallback\", \"JSEvents_requestFullscreen\", \"JSEvents_resizeCanvasForFullscreen\", \"registerRestoreOldStyle\", \"hideEverythingExceptGivenElement\", \"restoreHiddenElements\", \"setLetterbox\", \"softFullscreenResizeWebGLRenderTarget\", \"doRequestFullscreen\", \"fillPointerlockChangeEventData\", \"registerPointerlockChangeEventCallback\", \"registerPointerlockErrorEventCallback\", \"requestPointerLock\", \"fillVisibilityChangeEventData\", \"registerVisibilityChangeEventCallback\", \"registerTouchEventCallback\", \"fillGamepadEventData\", \"registerGamepadEventCallback\", \"registerBeforeUnloadEventCallback\", \"fillBatteryEventData\", \"registerBatteryEventCallback\", \"setCanvasElementSize\", \"getCanvasElementSize\", \"jsStackTrace\", \"getCallstack\", \"convertPCtoSourceLocation\", \"getEnvStrings\", \"checkWasiClock\", \"wasiRightsToMuslOFlags\", \"wasiOFlagsToMuslOFlags\", \"initRandomFill\", \"randomFill\", \"safeSetTimeout\", \"setImmediateWrapped\", \"safeRequestAnimationFrame\", \"clearImmediateWrapped\", \"registerPostMainLoop\", \"registerPreMainLoop\", \"getPromise\", \"makePromise\", \"idsToPromises\", \"makePromiseCallback\", \"Browser_asyncPrepareDataCounter\", \"isLeapYear\", \"ydayFromDate\", \"arraySum\", \"addDays\", \"getSocketFromFD\", \"getSocketAddress\", \"dlopenInternal\", \"heapObjectForWebGLType\", \"toTypedArrayIndex\", \"webgl_enable_ANGLE_instanced_arrays\", \"webgl_enable_OES_vertex_array_object\", \"webgl_enable_WEBGL_draw_buffers\", \"webgl_enable_WEBGL_multi_draw\", \"webgl_enable_EXT_polygon_offset_clamp\", \"webgl_enable_EXT_clip_control\", \"webgl_enable_WEBGL_polygon_mode\", \"emscriptenWebGLGet\", \"computeUnpackAlignedImageSize\", \"colorChannelsInGlTextureFormat\", \"emscriptenWebGLGetTexPixelData\", \"emscriptenWebGLGetUniform\", \"webglGetUniformLocation\", \"webglPrepareUniformLocationsBeforeFirstUse\", \"webglGetLeftBracePos\", \"emscriptenWebGLGetVertexAttrib\", \"__glGetActiveAttribOrUniform\", \"writeGLArray\", \"registerWebGlEventCallback\", \"runAndAbortIfError\", \"ALLOC_NORMAL\", \"ALLOC_STACK\", \"allocate\", \"writeStringToMemory\", \"writeAsciiToMemory\", \"demangle\", \"stackTrace\" ];\n\nmissingLibrarySymbols.forEach(missingLibrarySymbol);\n\nvar unexportedSymbols = [ \"run\", \"out\", \"err\", \"callMain\", \"abort\", \"wasmMemory\", \"wasmExports\", \"HEAPF32\", \"HEAPF64\", \"HEAP8\", \"HEAPU8\", \"HEAP16\", \"HEAP64\", \"HEAPU64\", \"writeStackCookie\", \"checkStackCookie\", \"INT53_MAX\", \"INT53_MIN\", \"bigintToI53Checked\", \"stackSave\", \"stackRestore\", \"stackAlloc\", \"ptrToString\", \"exitJS\", \"getHeapMax\", \"growMemory\", \"ENV\", \"ERRNO_CODES\", \"DNS\", \"Protocols\", \"Sockets\", \"timers\", \"warnOnce\", \"readEmAsmArgsArray\", \"dynCall\", \"handleException\", \"keepRuntimeAlive\", \"asyncLoad\", \"alignMemory\", \"wasmTable\", \"noExitRuntime\", \"addRunDependency\", \"removeRunDependency\", \"addOnPreRun\", \"addOnPostCtor\", \"addOnPostRun\", \"convertJsFunctionToWasm\", \"freeTableIndexes\", \"functionsInTableMap\", \"getEmptyTableSlot\", \"updateTableMap\", \"getFunctionAddress\", \"addFunction\", \"setValue\", \"getValue\", \"PATH\", \"PATH_FS\", \"UTF8Decoder\", \"UTF8ArrayToString\", \"stringToUTF8Array\", \"UTF16Decoder\", \"stringToUTF8OnStack\", \"JSEvents\", \"specialHTMLTargets\", \"findCanvasEventTarget\", \"currentFullscreenStrategy\", \"restoreOldWindowedStyle\", \"UNWIND_CACHE\", \"ExitStatus\", \"flush_NO_FILESYSTEM\", \"emSetImmediate\", \"emClearImmediate_deps\", \"emClearImmediate\", \"promiseMap\", \"Browser\", \"requestFullscreen\", \"requestFullScreen\", \"setCanvasSize\", \"getUserMedia\", \"createContext\", \"getPreloadedImageData__data\", \"wget\", \"MONTH_DAYS_REGULAR\", \"MONTH_DAYS_LEAP\", \"MONTH_DAYS_REGULAR_CUMULATIVE\", \"MONTH_DAYS_LEAP_CUMULATIVE\", \"SYSCALLS\", \"isSymbolDefined\", \"GOT\", \"currentModuleWeakSymbols\", \"LDSO\", \"getMemory\", \"mergeLibSymbols\", \"newDSO\", \"loadDynamicLibrary\", \"tempFixedLengthArray\", \"miniTempWebGLFloatBuffers\", \"miniTempWebGLIntBuffers\", \"GL\", \"AL\", \"GLUT\", \"EGL\", \"GLEW\", \"IDBStore\", \"SDL\", \"SDL_gfx\", \"allocateUTF8\", \"allocateUTF8OnStack\", \"print\", \"printErr\", \"jstoi_s\" ];\n\nunexportedSymbols.forEach(unexportedRuntimeSymbol);\n\n// End runtime exports\n// Begin JS library exports\n// End JS library exports\n// end include: postlibrary.js\nfunction checkIncomingModuleAPI() {\n ignoredModuleProp(\"fetchSettings\");\n}\n\nvar ASM_CONSTS = {};\n\n// Imports from the Wasm binary.\nvar _malloc = Module[\"_malloc\"] = makeInvalidEarlyAccess(\"_malloc\");\n\nvar _calloc = Module[\"_calloc\"] = makeInvalidEarlyAccess(\"_calloc\");\n\nvar _realloc = Module[\"_realloc\"] = makeInvalidEarlyAccess(\"_realloc\");\n\nvar _free = Module[\"_free\"] = makeInvalidEarlyAccess(\"_free\");\n\nvar _ts_language_symbol_count = Module[\"_ts_language_symbol_count\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_count\");\n\nvar _ts_language_state_count = Module[\"_ts_language_state_count\"] = makeInvalidEarlyAccess(\"_ts_language_state_count\");\n\nvar _ts_language_abi_version = Module[\"_ts_language_abi_version\"] = makeInvalidEarlyAccess(\"_ts_language_abi_version\");\n\nvar _ts_language_name = Module[\"_ts_language_name\"] = makeInvalidEarlyAccess(\"_ts_language_name\");\n\nvar _ts_language_field_count = Module[\"_ts_language_field_count\"] = makeInvalidEarlyAccess(\"_ts_language_field_count\");\n\nvar _ts_language_symbol_name = Module[\"_ts_language_symbol_name\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_name\");\n\nvar _ts_language_symbol_for_name = Module[\"_ts_language_symbol_for_name\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_for_name\");\n\nvar _strncmp = Module[\"_strncmp\"] = makeInvalidEarlyAccess(\"_strncmp\");\n\nvar _ts_language_symbol_type = Module[\"_ts_language_symbol_type\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_type\");\n\nvar _ts_language_field_name_for_id = Module[\"_ts_language_field_name_for_id\"] = makeInvalidEarlyAccess(\"_ts_language_field_name_for_id\");\n\nvar _memcmp = Module[\"_memcmp\"] = makeInvalidEarlyAccess(\"_memcmp\");\n\nvar _ts_parser_delete = Module[\"_ts_parser_delete\"] = makeInvalidEarlyAccess(\"_ts_parser_delete\");\n\nvar _ts_parser_set_language = Module[\"_ts_parser_set_language\"] = makeInvalidEarlyAccess(\"_ts_parser_set_language\");\n\nvar _ts_parser_reset = Module[\"_ts_parser_reset\"] = makeInvalidEarlyAccess(\"_ts_parser_reset\");\n\nvar _ts_tree_cursor_current_descendant_index = Module[\"_ts_tree_cursor_current_descendant_index\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_descendant_index\");\n\nvar _ts_tree_cursor_current_depth = Module[\"_ts_tree_cursor_current_depth\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_depth\");\n\nvar _ts_tree_copy = Module[\"_ts_tree_copy\"] = makeInvalidEarlyAccess(\"_ts_tree_copy\");\n\nvar _ts_tree_delete = Module[\"_ts_tree_delete\"] = makeInvalidEarlyAccess(\"_ts_tree_delete\");\n\nvar _ts_init = Module[\"_ts_init\"] = makeInvalidEarlyAccess(\"_ts_init\");\n\nvar _ts_free_wasm = Module[\"_ts_free_wasm\"] = makeInvalidEarlyAccess(\"_ts_free_wasm\");\n\nvar _ts_scanner_malloc_wasm = Module[\"_ts_scanner_malloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_malloc_wasm\");\n\nvar _ts_scanner_calloc_wasm = Module[\"_ts_scanner_calloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_calloc_wasm\");\n\nvar _ts_scanner_realloc_wasm = Module[\"_ts_scanner_realloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_realloc_wasm\");\n\nvar _ts_parser_new_wasm = Module[\"_ts_parser_new_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_new_wasm\");\n\nvar _ts_parser_enable_logger_wasm = Module[\"_ts_parser_enable_logger_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_enable_logger_wasm\");\n\nvar _ts_parser_parse_wasm = Module[\"_ts_parser_parse_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_parse_wasm\");\n\nvar _ts_parser_parse_limited_wasm = Module[\"_ts_parser_parse_limited_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_parse_limited_wasm\");\n\nvar _ts_parser_last_parse_operations_wasm = Module[\"_ts_parser_last_parse_operations_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_last_parse_operations_wasm\");\n\nvar _ts_parser_abort_limited_wasm = Module[\"_ts_parser_abort_limited_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_abort_limited_wasm\");\n\nvar _ts_parser_included_ranges_wasm = Module[\"_ts_parser_included_ranges_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_included_ranges_wasm\");\n\nvar _ts_language_type_is_named_wasm = Module[\"_ts_language_type_is_named_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_type_is_named_wasm\");\n\nvar _ts_language_type_is_visible_wasm = Module[\"_ts_language_type_is_visible_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_type_is_visible_wasm\");\n\nvar _ts_language_metadata_wasm = Module[\"_ts_language_metadata_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_metadata_wasm\");\n\nvar _ts_language_supertypes_wasm = Module[\"_ts_language_supertypes_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_supertypes_wasm\");\n\nvar _ts_language_subtypes_wasm = Module[\"_ts_language_subtypes_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_subtypes_wasm\");\n\nvar _ts_tree_root_node_wasm = Module[\"_ts_tree_root_node_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_root_node_wasm\");\n\nvar _ts_tree_root_node_with_offset_wasm = Module[\"_ts_tree_root_node_with_offset_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_root_node_with_offset_wasm\");\n\nvar _ts_tree_included_ranges_wasm = Module[\"_ts_tree_included_ranges_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_included_ranges_wasm\");\n\nvar _ts_tree_cursor_new_wasm = Module[\"_ts_tree_cursor_new_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_new_wasm\");\n\nvar _ts_tree_cursor_copy_wasm = Module[\"_ts_tree_cursor_copy_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_copy_wasm\");\n\nvar _ts_tree_cursor_delete_wasm = Module[\"_ts_tree_cursor_delete_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_delete_wasm\");\n\nvar _ts_tree_cursor_reset_wasm = Module[\"_ts_tree_cursor_reset_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_reset_wasm\");\n\nvar _ts_tree_cursor_reset_to_wasm = Module[\"_ts_tree_cursor_reset_to_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_reset_to_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_wasm = Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_wasm\");\n\nvar _ts_tree_cursor_goto_last_child_wasm = Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_last_child_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_for_index_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_for_index_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_for_position_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_for_position_wasm\");\n\nvar _ts_tree_cursor_goto_next_sibling_wasm = Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_next_sibling_wasm\");\n\nvar _ts_tree_cursor_goto_previous_sibling_wasm = Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_previous_sibling_wasm\");\n\nvar _ts_tree_cursor_goto_descendant_wasm = Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_descendant_wasm\");\n\nvar _ts_tree_cursor_goto_parent_wasm = Module[\"_ts_tree_cursor_goto_parent_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_parent_wasm\");\n\nvar _ts_tree_cursor_current_node_id_wasm = Module[\"_ts_tree_cursor_current_node_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_node_id_wasm\");\n\nvar _ts_tree_cursor_start_position_wasm = Module[\"_ts_tree_cursor_start_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_start_position_wasm\");\n\nvar _ts_tree_cursor_end_position_wasm = Module[\"_ts_tree_cursor_end_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_end_position_wasm\");\n\nvar _ts_tree_cursor_current_node_wasm = Module[\"_ts_tree_cursor_current_node_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_node_wasm\");\n\nvar _ts_node_field_name_for_child_wasm = Module[\"_ts_node_field_name_for_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_field_name_for_child_wasm\");\n\nvar _ts_node_field_name_for_named_child_wasm = Module[\"_ts_node_field_name_for_named_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_field_name_for_named_child_wasm\");\n\nvar _ts_node_children_by_field_id_wasm = Module[\"_ts_node_children_by_field_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_children_by_field_id_wasm\");\n\nvar _ts_node_first_child_for_byte_wasm = Module[\"_ts_node_first_child_for_byte_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_first_child_for_byte_wasm\");\n\nvar _ts_node_first_named_child_for_byte_wasm = Module[\"_ts_node_first_named_child_for_byte_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_first_named_child_for_byte_wasm\");\n\nvar _ts_node_grammar_symbol_wasm = Module[\"_ts_node_grammar_symbol_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_grammar_symbol_wasm\");\n\nvar _ts_node_child_count_wasm = Module[\"_ts_node_child_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_count_wasm\");\n\nvar _ts_node_named_child_count_wasm = Module[\"_ts_node_named_child_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_child_count_wasm\");\n\nvar _ts_node_child_wasm = Module[\"_ts_node_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_wasm\");\n\nvar _ts_node_named_child_wasm = Module[\"_ts_node_named_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_child_wasm\");\n\nvar _ts_node_child_by_field_id_wasm = Module[\"_ts_node_child_by_field_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_by_field_id_wasm\");\n\nvar _ts_node_next_sibling_wasm = Module[\"_ts_node_next_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_next_sibling_wasm\");\n\nvar _ts_node_prev_sibling_wasm = Module[\"_ts_node_prev_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_prev_sibling_wasm\");\n\nvar _ts_node_next_named_sibling_wasm = Module[\"_ts_node_next_named_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_next_named_sibling_wasm\");\n\nvar _ts_node_prev_named_sibling_wasm = Module[\"_ts_node_prev_named_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_prev_named_sibling_wasm\");\n\nvar _ts_node_descendant_count_wasm = Module[\"_ts_node_descendant_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_count_wasm\");\n\nvar _ts_node_parent_wasm = Module[\"_ts_node_parent_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_parent_wasm\");\n\nvar _ts_node_child_with_descendant_wasm = Module[\"_ts_node_child_with_descendant_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_with_descendant_wasm\");\n\nvar _ts_node_descendant_for_index_wasm = Module[\"_ts_node_descendant_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_for_index_wasm\");\n\nvar _ts_node_named_descendant_for_index_wasm = Module[\"_ts_node_named_descendant_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_descendant_for_index_wasm\");\n\nvar _ts_node_descendant_for_position_wasm = Module[\"_ts_node_descendant_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_for_position_wasm\");\n\nvar _ts_node_named_descendant_for_position_wasm = Module[\"_ts_node_named_descendant_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_descendant_for_position_wasm\");\n\nvar _ts_node_to_string_wasm = Module[\"_ts_node_to_string_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_to_string_wasm\");\n\nvar _ts_node_children_wasm = Module[\"_ts_node_children_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_children_wasm\");\n\nvar _ts_node_named_children_wasm = Module[\"_ts_node_named_children_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_children_wasm\");\n\nvar _ts_node_descendants_of_type_wasm = Module[\"_ts_node_descendants_of_type_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendants_of_type_wasm\");\n\nvar _memcpy = Module[\"_memcpy\"] = makeInvalidEarlyAccess(\"_memcpy\");\n\nvar _memmove = Module[\"_memmove\"] = makeInvalidEarlyAccess(\"_memmove\");\n\nvar _memset = Module[\"_memset\"] = makeInvalidEarlyAccess(\"_memset\");\n\nvar _fflush = makeInvalidEarlyAccess(\"_fflush\");\n\nvar _strlen = Module[\"_strlen\"] = makeInvalidEarlyAccess(\"_strlen\");\n\nvar _iswalnum = Module[\"_iswalnum\"] = makeInvalidEarlyAccess(\"_iswalnum\");\n\nvar _iswalpha = Module[\"_iswalpha\"] = makeInvalidEarlyAccess(\"_iswalpha\");\n\nvar _iswblank = Module[\"_iswblank\"] = makeInvalidEarlyAccess(\"_iswblank\");\n\nvar _iswdigit = Module[\"_iswdigit\"] = makeInvalidEarlyAccess(\"_iswdigit\");\n\nvar _iswlower = Module[\"_iswlower\"] = makeInvalidEarlyAccess(\"_iswlower\");\n\nvar _iswpunct = Module[\"_iswpunct\"] = makeInvalidEarlyAccess(\"_iswpunct\");\n\nvar _iswspace = Module[\"_iswspace\"] = makeInvalidEarlyAccess(\"_iswspace\");\n\nvar _iswupper = Module[\"_iswupper\"] = makeInvalidEarlyAccess(\"_iswupper\");\n\nvar _iswxdigit = Module[\"_iswxdigit\"] = makeInvalidEarlyAccess(\"_iswxdigit\");\n\nvar _memchr = Module[\"_memchr\"] = makeInvalidEarlyAccess(\"_memchr\");\n\nvar _emscripten_stack_get_end = makeInvalidEarlyAccess(\"_emscripten_stack_get_end\");\n\nvar _emscripten_stack_get_base = makeInvalidEarlyAccess(\"_emscripten_stack_get_base\");\n\nvar _strcmp = Module[\"_strcmp\"] = makeInvalidEarlyAccess(\"_strcmp\");\n\nvar _strncat = Module[\"_strncat\"] = makeInvalidEarlyAccess(\"_strncat\");\n\nvar _strncpy = Module[\"_strncpy\"] = makeInvalidEarlyAccess(\"_strncpy\");\n\nvar _towlower = Module[\"_towlower\"] = makeInvalidEarlyAccess(\"_towlower\");\n\nvar _towupper = Module[\"_towupper\"] = makeInvalidEarlyAccess(\"_towupper\");\n\nvar _sbrk = makeInvalidEarlyAccess(\"_sbrk\");\n\nvar _emscripten_get_sbrk_ptr = makeInvalidEarlyAccess(\"_emscripten_get_sbrk_ptr\");\n\nvar _setThrew = makeInvalidEarlyAccess(\"_setThrew\");\n\nvar _emscripten_stack_set_limits = makeInvalidEarlyAccess(\"_emscripten_stack_set_limits\");\n\nvar _emscripten_stack_get_free = makeInvalidEarlyAccess(\"_emscripten_stack_get_free\");\n\nvar __emscripten_stack_restore = makeInvalidEarlyAccess(\"__emscripten_stack_restore\");\n\nvar __emscripten_stack_alloc = makeInvalidEarlyAccess(\"__emscripten_stack_alloc\");\n\nvar _emscripten_stack_get_current = makeInvalidEarlyAccess(\"_emscripten_stack_get_current\");\n\nvar ___wasm_apply_data_relocs = makeInvalidEarlyAccess(\"___wasm_apply_data_relocs\");\n\nfunction assignWasmExports(wasmExports) {\n Module[\"_malloc\"] = _malloc = createExportWrapper(\"malloc\", 1);\n Module[\"_calloc\"] = _calloc = createExportWrapper(\"calloc\", 2);\n Module[\"_realloc\"] = _realloc = createExportWrapper(\"realloc\", 2);\n Module[\"_free\"] = _free = createExportWrapper(\"free\", 1);\n Module[\"_ts_language_symbol_count\"] = _ts_language_symbol_count = createExportWrapper(\"ts_language_symbol_count\", 1);\n Module[\"_ts_language_state_count\"] = _ts_language_state_count = createExportWrapper(\"ts_language_state_count\", 1);\n Module[\"_ts_language_abi_version\"] = _ts_language_abi_version = createExportWrapper(\"ts_language_abi_version\", 1);\n Module[\"_ts_language_name\"] = _ts_language_name = createExportWrapper(\"ts_language_name\", 1);\n Module[\"_ts_language_field_count\"] = _ts_language_field_count = createExportWrapper(\"ts_language_field_count\", 1);\n Module[\"_ts_language_symbol_name\"] = _ts_language_symbol_name = createExportWrapper(\"ts_language_symbol_name\", 2);\n Module[\"_ts_language_symbol_for_name\"] = _ts_language_symbol_for_name = createExportWrapper(\"ts_language_symbol_for_name\", 4);\n Module[\"_strncmp\"] = _strncmp = createExportWrapper(\"strncmp\", 3);\n Module[\"_ts_language_symbol_type\"] = _ts_language_symbol_type = createExportWrapper(\"ts_language_symbol_type\", 2);\n Module[\"_ts_language_field_name_for_id\"] = _ts_language_field_name_for_id = createExportWrapper(\"ts_language_field_name_for_id\", 2);\n Module[\"_memcmp\"] = _memcmp = createExportWrapper(\"memcmp\", 3);\n Module[\"_ts_parser_delete\"] = _ts_parser_delete = createExportWrapper(\"ts_parser_delete\", 1);\n Module[\"_ts_parser_set_language\"] = _ts_parser_set_language = createExportWrapper(\"ts_parser_set_language\", 2);\n Module[\"_ts_parser_reset\"] = _ts_parser_reset = createExportWrapper(\"ts_parser_reset\", 1);\n Module[\"_ts_tree_cursor_current_descendant_index\"] = _ts_tree_cursor_current_descendant_index = createExportWrapper(\"ts_tree_cursor_current_descendant_index\", 1);\n Module[\"_ts_tree_cursor_current_depth\"] = _ts_tree_cursor_current_depth = createExportWrapper(\"ts_tree_cursor_current_depth\", 1);\n Module[\"_ts_tree_copy\"] = _ts_tree_copy = createExportWrapper(\"ts_tree_copy\", 1);\n Module[\"_ts_tree_delete\"] = _ts_tree_delete = createExportWrapper(\"ts_tree_delete\", 1);\n Module[\"_ts_init\"] = _ts_init = createExportWrapper(\"ts_init\", 0);\n Module[\"_ts_free_wasm\"] = _ts_free_wasm = createExportWrapper(\"ts_free_wasm\", 1);\n Module[\"_ts_scanner_malloc_wasm\"] = _ts_scanner_malloc_wasm = createExportWrapper(\"ts_scanner_malloc_wasm\", 1);\n Module[\"_ts_scanner_calloc_wasm\"] = _ts_scanner_calloc_wasm = createExportWrapper(\"ts_scanner_calloc_wasm\", 2);\n Module[\"_ts_scanner_realloc_wasm\"] = _ts_scanner_realloc_wasm = createExportWrapper(\"ts_scanner_realloc_wasm\", 2);\n Module[\"_ts_parser_new_wasm\"] = _ts_parser_new_wasm = createExportWrapper(\"ts_parser_new_wasm\", 0);\n Module[\"_ts_parser_enable_logger_wasm\"] = _ts_parser_enable_logger_wasm = createExportWrapper(\"ts_parser_enable_logger_wasm\", 2);\n Module[\"_ts_parser_parse_wasm\"] = _ts_parser_parse_wasm = createExportWrapper(\"ts_parser_parse_wasm\", 2);\n Module[\"_ts_parser_parse_limited_wasm\"] = _ts_parser_parse_limited_wasm = createExportWrapper(\"ts_parser_parse_limited_wasm\", 2);\n Module[\"_ts_parser_last_parse_operations_wasm\"] = _ts_parser_last_parse_operations_wasm = createExportWrapper(\"ts_parser_last_parse_operations_wasm\", 1);\n Module[\"_ts_parser_abort_limited_wasm\"] = _ts_parser_abort_limited_wasm = createExportWrapper(\"ts_parser_abort_limited_wasm\", 0);\n Module[\"_ts_parser_included_ranges_wasm\"] = _ts_parser_included_ranges_wasm = createExportWrapper(\"ts_parser_included_ranges_wasm\", 1);\n Module[\"_ts_language_type_is_named_wasm\"] = _ts_language_type_is_named_wasm = createExportWrapper(\"ts_language_type_is_named_wasm\", 2);\n Module[\"_ts_language_type_is_visible_wasm\"] = _ts_language_type_is_visible_wasm = createExportWrapper(\"ts_language_type_is_visible_wasm\", 2);\n Module[\"_ts_language_metadata_wasm\"] = _ts_language_metadata_wasm = createExportWrapper(\"ts_language_metadata_wasm\", 1);\n Module[\"_ts_language_supertypes_wasm\"] = _ts_language_supertypes_wasm = createExportWrapper(\"ts_language_supertypes_wasm\", 1);\n Module[\"_ts_language_subtypes_wasm\"] = _ts_language_subtypes_wasm = createExportWrapper(\"ts_language_subtypes_wasm\", 2);\n Module[\"_ts_tree_root_node_wasm\"] = _ts_tree_root_node_wasm = createExportWrapper(\"ts_tree_root_node_wasm\", 1);\n Module[\"_ts_tree_root_node_with_offset_wasm\"] = _ts_tree_root_node_with_offset_wasm = createExportWrapper(\"ts_tree_root_node_with_offset_wasm\", 1);\n Module[\"_ts_tree_included_ranges_wasm\"] = _ts_tree_included_ranges_wasm = createExportWrapper(\"ts_tree_included_ranges_wasm\", 1);\n Module[\"_ts_tree_cursor_new_wasm\"] = _ts_tree_cursor_new_wasm = createExportWrapper(\"ts_tree_cursor_new_wasm\", 1);\n Module[\"_ts_tree_cursor_copy_wasm\"] = _ts_tree_cursor_copy_wasm = createExportWrapper(\"ts_tree_cursor_copy_wasm\", 1);\n Module[\"_ts_tree_cursor_delete_wasm\"] = _ts_tree_cursor_delete_wasm = createExportWrapper(\"ts_tree_cursor_delete_wasm\", 1);\n Module[\"_ts_tree_cursor_reset_wasm\"] = _ts_tree_cursor_reset_wasm = createExportWrapper(\"ts_tree_cursor_reset_wasm\", 2);\n Module[\"_ts_tree_cursor_reset_to_wasm\"] = _ts_tree_cursor_reset_to_wasm = createExportWrapper(\"ts_tree_cursor_reset_to_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = _ts_tree_cursor_goto_first_child_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = _ts_tree_cursor_goto_last_child_wasm = createExportWrapper(\"ts_tree_cursor_goto_last_child_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = _ts_tree_cursor_goto_first_child_for_index_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_for_index_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = _ts_tree_cursor_goto_first_child_for_position_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_for_position_wasm\", 3);\n Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = _ts_tree_cursor_goto_next_sibling_wasm = createExportWrapper(\"ts_tree_cursor_goto_next_sibling_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = _ts_tree_cursor_goto_previous_sibling_wasm = createExportWrapper(\"ts_tree_cursor_goto_previous_sibling_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = _ts_tree_cursor_goto_descendant_wasm = createExportWrapper(\"ts_tree_cursor_goto_descendant_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_parent_wasm\"] = _ts_tree_cursor_goto_parent_wasm = createExportWrapper(\"ts_tree_cursor_goto_parent_wasm\", 1);\n Module[\"_ts_tree_cursor_current_node_id_wasm\"] = _ts_tree_cursor_current_node_id_wasm = createExportWrapper(\"ts_tree_cursor_current_node_id_wasm\", 1);\n Module[\"_ts_tree_cursor_start_position_wasm\"] = _ts_tree_cursor_start_position_wasm = createExportWrapper(\"ts_tree_cursor_start_position_wasm\", 1);\n Module[\"_ts_tree_cursor_end_position_wasm\"] = _ts_tree_cursor_end_position_wasm = createExportWrapper(\"ts_tree_cursor_end_position_wasm\", 1);\n Module[\"_ts_tree_cursor_current_node_wasm\"] = _ts_tree_cursor_current_node_wasm = createExportWrapper(\"ts_tree_cursor_current_node_wasm\", 1);\n Module[\"_ts_node_field_name_for_child_wasm\"] = _ts_node_field_name_for_child_wasm = createExportWrapper(\"ts_node_field_name_for_child_wasm\", 2);\n Module[\"_ts_node_field_name_for_named_child_wasm\"] = _ts_node_field_name_for_named_child_wasm = createExportWrapper(\"ts_node_field_name_for_named_child_wasm\", 2);\n Module[\"_ts_node_children_by_field_id_wasm\"] = _ts_node_children_by_field_id_wasm = createExportWrapper(\"ts_node_children_by_field_id_wasm\", 2);\n Module[\"_ts_node_first_child_for_byte_wasm\"] = _ts_node_first_child_for_byte_wasm = createExportWrapper(\"ts_node_first_child_for_byte_wasm\", 1);\n Module[\"_ts_node_first_named_child_for_byte_wasm\"] = _ts_node_first_named_child_for_byte_wasm = createExportWrapper(\"ts_node_first_named_child_for_byte_wasm\", 1);\n Module[\"_ts_node_grammar_symbol_wasm\"] = _ts_node_grammar_symbol_wasm = createExportWrapper(\"ts_node_grammar_symbol_wasm\", 1);\n Module[\"_ts_node_child_count_wasm\"] = _ts_node_child_count_wasm = createExportWrapper(\"ts_node_child_count_wasm\", 1);\n Module[\"_ts_node_named_child_count_wasm\"] = _ts_node_named_child_count_wasm = createExportWrapper(\"ts_node_named_child_count_wasm\", 1);\n Module[\"_ts_node_child_wasm\"] = _ts_node_child_wasm = createExportWrapper(\"ts_node_child_wasm\", 2);\n Module[\"_ts_node_named_child_wasm\"] = _ts_node_named_child_wasm = createExportWrapper(\"ts_node_named_child_wasm\", 2);\n Module[\"_ts_node_child_by_field_id_wasm\"] = _ts_node_child_by_field_id_wasm = createExportWrapper(\"ts_node_child_by_field_id_wasm\", 2);\n Module[\"_ts_node_next_sibling_wasm\"] = _ts_node_next_sibling_wasm = createExportWrapper(\"ts_node_next_sibling_wasm\", 1);\n Module[\"_ts_node_prev_sibling_wasm\"] = _ts_node_prev_sibling_wasm = createExportWrapper(\"ts_node_prev_sibling_wasm\", 1);\n Module[\"_ts_node_next_named_sibling_wasm\"] = _ts_node_next_named_sibling_wasm = createExportWrapper(\"ts_node_next_named_sibling_wasm\", 1);\n Module[\"_ts_node_prev_named_sibling_wasm\"] = _ts_node_prev_named_sibling_wasm = createExportWrapper(\"ts_node_prev_named_sibling_wasm\", 1);\n Module[\"_ts_node_descendant_count_wasm\"] = _ts_node_descendant_count_wasm = createExportWrapper(\"ts_node_descendant_count_wasm\", 1);\n Module[\"_ts_node_parent_wasm\"] = _ts_node_parent_wasm = createExportWrapper(\"ts_node_parent_wasm\", 1);\n Module[\"_ts_node_child_with_descendant_wasm\"] = _ts_node_child_with_descendant_wasm = createExportWrapper(\"ts_node_child_with_descendant_wasm\", 1);\n Module[\"_ts_node_descendant_for_index_wasm\"] = _ts_node_descendant_for_index_wasm = createExportWrapper(\"ts_node_descendant_for_index_wasm\", 1);\n Module[\"_ts_node_named_descendant_for_index_wasm\"] = _ts_node_named_descendant_for_index_wasm = createExportWrapper(\"ts_node_named_descendant_for_index_wasm\", 1);\n Module[\"_ts_node_descendant_for_position_wasm\"] = _ts_node_descendant_for_position_wasm = createExportWrapper(\"ts_node_descendant_for_position_wasm\", 1);\n Module[\"_ts_node_named_descendant_for_position_wasm\"] = _ts_node_named_descendant_for_position_wasm = createExportWrapper(\"ts_node_named_descendant_for_position_wasm\", 1);\n Module[\"_ts_node_to_string_wasm\"] = _ts_node_to_string_wasm = createExportWrapper(\"ts_node_to_string_wasm\", 1);\n Module[\"_ts_node_children_wasm\"] = _ts_node_children_wasm = createExportWrapper(\"ts_node_children_wasm\", 1);\n Module[\"_ts_node_named_children_wasm\"] = _ts_node_named_children_wasm = createExportWrapper(\"ts_node_named_children_wasm\", 1);\n Module[\"_ts_node_descendants_of_type_wasm\"] = _ts_node_descendants_of_type_wasm = createExportWrapper(\"ts_node_descendants_of_type_wasm\", 3);\n Module[\"_memcpy\"] = _memcpy = createExportWrapper(\"memcpy\", 3);\n Module[\"_memmove\"] = _memmove = createExportWrapper(\"memmove\", 3);\n Module[\"_memset\"] = _memset = createExportWrapper(\"memset\", 3);\n _fflush = createExportWrapper(\"fflush\", 1);\n Module[\"_strlen\"] = _strlen = createExportWrapper(\"strlen\", 1);\n Module[\"_iswalnum\"] = _iswalnum = createExportWrapper(\"iswalnum\", 1);\n Module[\"_iswalpha\"] = _iswalpha = createExportWrapper(\"iswalpha\", 1);\n Module[\"_iswblank\"] = _iswblank = createExportWrapper(\"iswblank\", 1);\n Module[\"_iswdigit\"] = _iswdigit = createExportWrapper(\"iswdigit\", 1);\n Module[\"_iswlower\"] = _iswlower = createExportWrapper(\"iswlower\", 1);\n Module[\"_iswpunct\"] = _iswpunct = createExportWrapper(\"iswpunct\", 1);\n Module[\"_iswspace\"] = _iswspace = createExportWrapper(\"iswspace\", 1);\n Module[\"_iswupper\"] = _iswupper = createExportWrapper(\"iswupper\", 1);\n Module[\"_iswxdigit\"] = _iswxdigit = createExportWrapper(\"iswxdigit\", 1);\n Module[\"_memchr\"] = _memchr = createExportWrapper(\"memchr\", 3);\n _emscripten_stack_get_end = wasmExports[\"emscripten_stack_get_end\"];\n _emscripten_stack_get_base = wasmExports[\"emscripten_stack_get_base\"];\n Module[\"_strcmp\"] = _strcmp = createExportWrapper(\"strcmp\", 2);\n Module[\"_strncat\"] = _strncat = createExportWrapper(\"strncat\", 3);\n Module[\"_strncpy\"] = _strncpy = createExportWrapper(\"strncpy\", 3);\n Module[\"_towlower\"] = _towlower = createExportWrapper(\"towlower\", 1);\n Module[\"_towupper\"] = _towupper = createExportWrapper(\"towupper\", 1);\n _sbrk = createExportWrapper(\"sbrk\", 1);\n _emscripten_get_sbrk_ptr = createExportWrapper(\"emscripten_get_sbrk_ptr\", 0);\n _setThrew = createExportWrapper(\"setThrew\", 2);\n _emscripten_stack_set_limits = wasmExports[\"emscripten_stack_set_limits\"];\n _emscripten_stack_get_free = wasmExports[\"emscripten_stack_get_free\"];\n __emscripten_stack_restore = wasmExports[\"_emscripten_stack_restore\"];\n __emscripten_stack_alloc = wasmExports[\"_emscripten_stack_alloc\"];\n _emscripten_stack_get_current = wasmExports[\"emscripten_stack_get_current\"];\n ___wasm_apply_data_relocs = createExportWrapper(\"__wasm_apply_data_relocs\", 0);\n}\n\nvar wasmImports = {\n /** @export */ __heap_base: ___heap_base,\n /** @export */ __indirect_function_table: wasmTable,\n /** @export */ __memory_base: ___memory_base,\n /** @export */ __stack_high: ___stack_high,\n /** @export */ __stack_low: ___stack_low,\n /** @export */ __stack_pointer: ___stack_pointer,\n /** @export */ __table_base: ___table_base,\n /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp,\n /** @export */ alignfault,\n /** @export */ emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */ fd_close: _fd_close,\n /** @export */ fd_seek: _fd_seek,\n /** @export */ fd_write: _fd_write,\n /** @export */ invoke_ii,\n /** @export */ invoke_iii,\n /** @export */ invoke_iiii,\n /** @export */ invoke_ji,\n /** @export */ invoke_vi,\n /** @export */ invoke_vj,\n /** @export */ memory: wasmMemory,\n /** @export */ segfault,\n /** @export */ tree_sitter_log_callback: _tree_sitter_log_callback,\n /** @export */ tree_sitter_parse_callback: _tree_sitter_parse_callback,\n /** @export */ tree_sitter_progress_callback: _tree_sitter_progress_callback\n};\n\nfunction invoke_vi(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_ii(index, a1) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vj(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_ji(index, a1) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n return 0n;\n }\n}\n\nfunction invoke_iiii(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_iii(index, a1, a2) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\n// include: postamble.js\n// === Auto-generated postamble setup entry stuff ===\nvar calledRun;\n\nfunction callMain(args = []) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module[\"onRuntimeInitialized\"])');\n assert(typeof onPreRuns === \"undefined\" || onPreRuns.length == 0, \"cannot call main when preRun functions remain to be called\");\n var entryFunction = resolveGlobalSymbol(\"main\").sym;\n // Main modules can't tell if they have main() at compile time, since it may\n // arrive from a dynamic library.\n if (!entryFunction) return;\n args.unshift(thisProgram);\n var argc = args.length;\n var argv = stackAlloc((argc + 1) * 4);\n var argv_ptr = argv;\n args.forEach(arg => {\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((argv_ptr) >> 2), \"storing\")] = stringToUTF8OnStack(arg);\n argv_ptr += 4;\n });\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((argv_ptr) >> 2), \"storing\")] = 0;\n try {\n var ret = entryFunction(argc, argv);\n // if we're not running an evented main loop, it's time to exit\n exitJS(ret, /* implicit = */ true);\n return ret;\n } catch (e) {\n return handleException(e);\n }\n}\n\nfunction stackCheckInit() {\n // This is normally called automatically during __wasm_call_ctors but need to\n // get these values before even running any of the ctors so we call it redundantly\n // here.\n _emscripten_stack_set_limits(81984, 16448);\n // TODO(sbc): Move writeStackCookie to native to to avoid this.\n writeStackCookie();\n}\n\nfunction run(args = arguments_) {\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n stackCheckInit();\n preRun();\n // a preRun added a dependency, run will be called later\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n assert(!calledRun);\n calledRun = true;\n Module[\"calledRun\"] = true;\n if (ABORT) return;\n initRuntime();\n preMain();\n readyPromiseResolve?.(Module);\n Module[\"onRuntimeInitialized\"]?.();\n consumedModuleProp(\"onRuntimeInitialized\");\n var noInitialRun = Module[\"noInitialRun\"] || false;\n if (!noInitialRun) callMain(args);\n postRun();\n }\n if (Module[\"setStatus\"]) {\n Module[\"setStatus\"](\"Running...\");\n setTimeout(() => {\n setTimeout(() => Module[\"setStatus\"](\"\"), 1);\n doRun();\n }, 1);\n } else {\n doRun();\n }\n checkStackCookie();\n}\n\nfunction checkUnflushedContent() {\n // Compiler settings do not allow exiting the runtime, so flushing\n // the streams is not possible. but in ASSERTIONS mode we check\n // if there was something to flush, and if so tell the user they\n // should request that the runtime be exitable.\n // Normally we would not even include flush() at all, but in ASSERTIONS\n // builds we do so just for this check, and here we see if there is any\n // content to flush, that is, we check if there would have been\n // something a non-ASSERTIONS build would have not seen.\n // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0\n // mode (which has its own special function for this; otherwise, all\n // the code is inside libc)\n var oldOut = out;\n var oldErr = err;\n var has = false;\n out = err = x => {\n has = true;\n };\n try {\n // it doesn't matter if it fails\n flush_NO_FILESYSTEM();\n } catch (e) {}\n out = oldOut;\n err = oldErr;\n if (has) {\n warnOnce(\"stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.\");\n warnOnce(\"(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)\");\n }\n}\n\nvar wasmExports;\n\n// In modularize mode the generated code is within a factory function so we\n// can use await here (since it's not top-level-await).\nwasmExports = await (createWasm());\n\nrun();\n\n// end include: postamble.js\n// include: postamble_modularize.js\n// In MODULARIZE mode we wrap the generated code in a factory function\n// and return either the Module itself, or a promise of the module.\n// We assign to the `moduleRtn` global here and configure closure to see\n// this as and extern so it won't get minified.\nif (runtimeInitialized) {\n moduleRtn = Module;\n} else {\n // Set up the promise that indicates the Module is initialized\n moduleRtn = new Promise((resolve, reject) => {\n readyPromiseResolve = resolve;\n readyPromiseReject = reject;\n });\n}\n\n// Assertion for attempting to access module properties on the incoming\n// moduleArg. In the past we used this object as the prototype of the module\n// and assigned properties to it, but now we return a distinct object. This\n// keeps the instance private until it is ready (i.e the promise has been\n// resolved).\nfor (const prop of Object.keys(Module)) {\n if (!(prop in moduleArg)) {\n Object.defineProperty(moduleArg, prop, {\n configurable: true,\n get() {\n abort(`Access to module property ('${prop}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`);\n }\n });\n }\n}\n\n\n return moduleRtn;\n };\n})();\n\n// Export using a UMD style export, or ES6 exports if selected\nif (typeof exports === 'object' && typeof module === 'object') {\n module.exports = Module;\n // This default export looks redundant, but it allows TS to import this\n // commonjs style module.\n module.exports.default = Module;\n} else if (typeof define === 'function' && define['amd'])\n define([], () => Module);\n\n", "export type {\n Point,\n Range,\n ParseCallback,\n ProgressCallback,\n LogCallback,\n} from './constants';\nexport type { ParserInitOptions } from './bindings';\nexport {\n type ParseOptions,\n type ParseState,\n LANGUAGE_VERSION,\n MIN_COMPATIBLE_VERSION,\n Parser,\n} from './parser';\nexport { Language } from './language';\nexport { Tree } from './tree';\nexport { Node } from './node';\nexport { TreeCursor } from './tree_cursor';\n", "import { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { ParseState, type Parser } from './parser';\n\n/**\n * A position in a multi-line text document, in terms of rows and columns.\n *\n * Rows and columns are zero-based.\n */\nexport interface Point {\n /** The zero-based row number. */\n row: number;\n\n /** The zero-based column number. */\n column: number;\n}\n\n/**\n * A range of positions in a multi-line text document, both in terms of bytes\n * and of rows and columns.\n */\nexport interface Range {\n /** The start position of the range. */\n startPosition: Point;\n\n /** The end position of the range. */\n endPosition: Point;\n\n /** The start index of the range. */\n startIndex: number;\n\n /** The end index of the range. */\n endIndex: number;\n}\n\n/** @internal */\nexport const SIZE_OF_INT = 4;\n\n/** @internal */\nexport const SIZE_OF_NODE = 9 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_POINT = 2 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT;\n\n/** @internal */\nexport const ZERO_POINT: Point = { row: 0, column: 0 };\n\n/**\n * A callback for parsing that takes an index and point, and should return a string.\n */\nexport type ParseCallback = (index: number, position: Point) => string | undefined;\n\n/**\n * A callback that receives the parse state during parsing.\n */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\nexport type ProgressCallback = (progress: ParseState) => boolean | void;\n\n/**\n * A callback for logging messages.\n *\n * If `isLex` is `true`, the message is from the lexer, otherwise it's from the parser.\n */\nexport type LogCallback = (message: string, isLex: boolean) => void;\n\n// Helper type for internal use\n/** @internal */\nexport const INTERNAL = Symbol('INTERNAL');\n/** @internal */\nexport type Internal = typeof INTERNAL;\n\n// Helper functions for type checking\n/** @internal */\nexport function assertInternal(x: unknown): asserts x is Internal {\n if (x !== INTERNAL) throw new Error('Illegal constructor');\n}\n\n/** @internal */\nexport function isPoint(point?: Point): point is Point {\n return (\n !!point &&\n typeof (point).row === 'number' &&\n typeof (point).column === 'number'\n );\n}\n\n/**\n * @internal\n *\n * Sets the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport function setModule(module: MainModule) {\n C = module;\n}\n\n/**\n * @internal\n *\n * `C` is a convenient shorthand for the Tree-sitter Wasm module,\n * which allows us to call all of the exported functions.\n */\nexport let C: MainModule;\n", "export function newFinalizer<T>(handler: (value: T) => void): FinalizationRegistry<T> | undefined {\n try {\n return new FinalizationRegistry(handler);\n } catch(e) {\n console.error('Unsupported FinalizationRegistry:', e);\n return;\n }\n}\n", "import { INTERNAL, Internal, assertInternal, Point, C } from './constants';\nimport { marshalNode, unmarshalNode, unmarshalPoint } from './marshal';\nimport { Node } from './node';\nimport { TRANSFER_BUFFER } from './parser';\nimport { getCallbackText, Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_cursor_delete_wasm(address);\n});\n\n/** A stateful object for walking a syntax {@link Tree} efficiently. */\nexport class TreeCursor {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private tree: Tree;\n\n /** @internal */\n private _nodeTypeId = 0;\n\n /** @internal */\n private _fieldId = 0;\n\n /** @internal */\n private _startIndex = 0;\n\n /** @internal */\n private _endIndex = 0;\n\n /** @internal */\n private _flags = 0;\n\n /** @internal */\n constructor(internal: Internal, tree: Tree, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.tree = tree;\n this.readNodeCache();\n finalizer?.register(this, address, this);\n }\n\n /** Creates a deep copy of the tree cursor. This allocates new memory. */\n copy(): TreeCursor {\n const address = C._ts_tree_cursor_copy_wasm(this[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Delete the tree cursor, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_cursor_delete_wasm(this[0]);\n this[0] = 0;\n }\n\n /** Get the tree cursor's current {@link Node}. */\n get currentNode(): Node {\n C._ts_tree_cursor_current_node_wasm(this[0]);\n return unmarshalNode(this.tree)!;\n }\n\n /**\n * Get the numerical field id of this tree cursor's current node.\n *\n * See also {@link TreeCursor#currentFieldName}.\n */\n get currentFieldId(): number {\n return this._fieldId;\n }\n\n /** Get the field name of this tree cursor's current node. */\n get currentFieldName(): string | null {\n return this.tree.language.fields[this._fieldId] ?? null;\n }\n\n /**\n * Get the depth of the cursor's current node relative to the original\n * node that the cursor was constructed with.\n */\n get currentDepth(): number {\n return C._ts_tree_cursor_current_depth(this[0]) >>> 0;\n }\n\n /**\n * Get the index of the cursor's current node out of all of the\n * descendants of the original node that the cursor was constructed with.\n */\n get currentDescendantIndex(): number {\n return C._ts_tree_cursor_current_descendant_index(this[0]) >>> 0;\n }\n\n /** Get the type of the cursor's current node. */\n get nodeType(): string {\n return this.tree.language.types[this._nodeTypeId] || 'ERROR';\n }\n\n /** Get the type id of the cursor's current node. */\n get nodeTypeId(): number {\n return this._nodeTypeId;\n }\n\n /** Get the id of the cursor's current node. */\n get nodeId(): number {\n return C._ts_tree_cursor_current_node_id_wasm(this[0]);\n }\n\n /**\n * Check if the cursor's current node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get nodeIsNamed(): boolean {\n return (this._flags & 1) !== 0;\n }\n\n /**\n * Check if the cursor's current node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get nodeIsMissing(): boolean {\n return (this._flags & 2) !== 0;\n }\n\n /** Get the string content of the cursor's current node. */\n get nodeText(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this._startIndex, this._endIndex)\n : getCallbackText(textSource, this._startIndex, this._endIndex, this.startPosition);\n }\n\n /** Get the start position of the cursor's current node. */\n get startPosition(): Point {\n C._ts_tree_cursor_start_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the end position of the cursor's current node. */\n get endPosition(): Point {\n C._ts_tree_cursor_end_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the start index of the cursor's current node. */\n get startIndex(): number {\n return this._startIndex;\n }\n\n /** Get the end index of the cursor's current node. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /**\n * Move this cursor to the first child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n */\n gotoFirstChild(): boolean {\n if (!C._ts_tree_cursor_goto_first_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the last child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoFirstChild} because it needs to\n * iterate through all the children to compute the child's position.\n */\n gotoLastChild(): boolean {\n if (!C._ts_tree_cursor_goto_last_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the parent of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no parent node (the cursor was already on the\n * root node).\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoParent(): boolean {\n if (!C._ts_tree_cursor_goto_parent_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the next sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no next sibling node.\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoNextSibling(): boolean {\n if (!C._ts_tree_cursor_goto_next_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the previous sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no previous sibling node.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoNextSibling} due to how node\n * positions are stored. In the worst case, this will need to iterate\n * through all the children up to the previous sibling node to recalculate\n * its position. Also note that the node the cursor was constructed with is\n * considered the root of the cursor, and the cursor cannot walk outside this node.\n */\n gotoPreviousSibling(): boolean {\n if (!C._ts_tree_cursor_goto_previous_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move the cursor to the node that is the nth descendant of\n * the original node that the cursor was constructed with, where\n * zero represents the original node itself.\n */\n gotoDescendant(goalDescendantIndex: number): void {\n C._ts_tree_cursor_goto_descendant_wasm(this[0], goalDescendantIndex);\n this.readNodeCache();\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given index.\n *\n * This returns `true` if the cursor successfully moved to a child node, and returns\n * `false` if no such child was found.\n */\n gotoFirstChildForIndex(goalIndex: number): boolean {\n if (!C._ts_tree_cursor_goto_first_child_for_index_wasm(this[0], goalIndex)) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given position.\n *\n * This returns `true` if the cursor successfully moved to a child node, and returns\n * `false` if no such child was found.\n */\n gotoFirstChildForPosition(goalPosition: Point): boolean {\n if (\n !C._ts_tree_cursor_goto_first_child_for_position_wasm(\n this[0],\n goalPosition.row,\n goalPosition.column,\n )\n ) {\n return false;\n }\n this.readNodeCache();\n return true;\n }\n\n /**\n * Re-initialize this tree cursor to start at the original node that the\n * cursor was constructed with.\n */\n reset(node: Node): void {\n marshalNode(node);\n this.tree = node.tree;\n C._ts_tree_cursor_reset_wasm(this[0], node.tree[0]);\n this.readNodeCache();\n }\n\n /**\n * Re-initialize a tree cursor to the same position as another cursor.\n *\n * Unlike {@link TreeCursor#reset}, this will not lose parent\n * information and allows reusing already created cursors.\n */\n resetTo(cursor: TreeCursor): void {\n if (this[0] === cursor[0]) return;\n this.tree = cursor.tree;\n C._ts_tree_cursor_reset_to_wasm(this[0], cursor[0]);\n this.readNodeCache();\n }\n\n /** @internal */\n private readNodeCache(): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heap = C.HEAPU32;\n this._nodeTypeId = heap[base];\n this._fieldId = heap[base + 1];\n this._startIndex = heap[base + 2];\n this._endIndex = heap[base + 3];\n this._flags = heap[base + 4];\n }\n}\n", "import { INTERNAL, Internal, assertInternal, ParseCallback, Point, Range, SIZE_OF_NODE, SIZE_OF_INT, C } from './constants';\nimport { Language } from './language';\nimport { Node } from './node';\nimport { TreeCursor } from './tree_cursor';\nimport { marshalPoint, unmarshalNode, unmarshalRanges } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { newFinalizer } from './finalization_registry';\n\n/** @internal */\nexport function getCallbackText(\n textSource: ParseCallback,\n startIndex: number,\n endIndex: number,\n startPosition: Point,\n): string {\n const length = endIndex - startIndex;\n let result = textSource(startIndex, startPosition);\n if (result) {\n startIndex += result.length;\n while (startIndex < endIndex) {\n const string = textSource(startIndex, startPosition);\n if (string && string.length > 0) {\n startIndex += string.length;\n result += string;\n } else {\n break;\n }\n }\n if (startIndex > endIndex) {\n result = result.slice(0, length);\n }\n }\n return result ?? '';\n}\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_delete(address);\n});\n\n/** A tree that represents the syntactic structure of a source code file. */\nexport class Tree {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n textSource: string | ParseCallback;\n\n /** The language that was used to parse the syntax tree. */\n language: Language;\n\n /** @internal */\n constructor(internal: Internal, address: number, language: Language, textSource: string | ParseCallback) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n this.textSource = textSource;\n finalizer?.register(this, address, this);\n }\n\n /** Create a shallow copy of the syntax tree. This is very fast. */\n copy(): Tree {\n const address = C._ts_tree_copy(this[0]);\n return new Tree(INTERNAL, address, this.language, this.textSource);\n }\n\n /** Delete the syntax tree, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_delete(this[0]);\n this[0] = 0;\n }\n\n /** Get the root node of the syntax tree. */\n get rootNode(): Node {\n C._ts_tree_root_node_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /**\n * Get the root node of the syntax tree, but with its position shifted\n * forward by the given offset.\n */\n rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node {\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = offsetBytes;\n marshalPoint(address + SIZE_OF_INT, offsetExtent);\n C._ts_tree_root_node_with_offset_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /** Create a new {@link TreeCursor} starting from the root of the tree. */\n walk(): TreeCursor {\n C._ts_tree_root_node_wasm(this[0]);\n const address = C._ts_tree_cursor_new_wasm(this[0]);\n return new TreeCursor(INTERNAL, this, address);\n }\n\n /** Get the included ranges that were used to parse the syntax tree. */\n getIncludedRanges(): Range[] {\n C._ts_tree_included_ranges_wasm(this[0]);\n return unmarshalRanges();\n }\n}\n", "import { INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, ZERO_POINT, isPoint, C, Point } from './constants';\nimport { getCallbackText, Tree } from './tree';\nimport { TreeCursor } from './tree_cursor';\nimport { Language } from './language';\nimport { marshalNode, marshalPoint, unmarshalNode, unmarshalNodeArray } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst EMPTY_SYMBOLS = new Uint32Array(0);\nconst symbolsByTypeCache = new WeakMap<Language, Map<string, Uint32Array>>();\n\n/** A single node within a syntax {@link Tree}. */\nexport class Node {\n /** @internal */\n // @ts-expect-error: never read\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private _endIndex: number;\n\n /** @internal */\n private _endRow: number;\n\n /** @internal */\n private _endColumn: number;\n\n /** @internal */\n private _flags: number;\n\n /** @internal */\n private _children?: Node[];\n\n /** @internal */\n private _namedChildren?: Node[];\n\n /** @internal */\n constructor(\n internal: Internal,\n {\n id,\n tree,\n startIndex,\n startPosition,\n other,\n endIndex,\n endRow,\n endColumn,\n flags,\n }: {\n id: number;\n tree: Tree;\n startIndex: number;\n startPosition: Point;\n other: number;\n endIndex: number;\n endRow: number;\n endColumn: number;\n flags: number;\n }\n ) {\n assertInternal(internal);\n this[0] = other;\n this.id = id;\n this.tree = tree;\n this.startIndex = startIndex;\n this.startPosition = startPosition;\n this._endIndex = endIndex;\n this._endRow = endRow;\n this._endColumn = endColumn;\n this._flags = flags;\n }\n\n /**\n * The numeric id for this node that is unique.\n *\n * Within a given syntax tree, no two nodes have the same id.\n */\n id: number;\n\n /** The byte index where this node starts. */\n startIndex: number;\n\n /** The position where this node starts. */\n startPosition: Point;\n\n /** The tree that this node belongs to. */\n tree: Tree;\n\n /** Get this node's type as a numerical id. */\n get typeId(): number {\n return this._flags & 0xffff;\n }\n\n /**\n * Get the node's type as a numerical id as it appears in the grammar,\n * ignoring aliases.\n */\n get grammarId(): number {\n marshalNode(this);\n return C._ts_node_grammar_symbol_wasm(this.tree[0]);\n }\n\n /** Get this node's type as a string. */\n get type(): string {\n return this.tree.language.types[this._flags & 0xffff] || 'ERROR';\n }\n\n /**\n * Get this node's symbol name as it appears in the grammar, ignoring\n * aliases as a string.\n */\n get grammarType(): string {\n return this.tree.language.types[this.grammarId] || 'ERROR';\n }\n\n /**\n * Check if this node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get isNamed(): boolean {\n return (this._flags & 0x10000) !== 0;\n }\n\n /**\n * Check if this node is *extra*.\n *\n * Extra nodes represent things like comments, which are not required\n * by the grammar, but can appear anywhere.\n */\n get isExtra(): boolean {\n return (this._flags & 0x20000) !== 0;\n }\n\n /**\n * Check if this node represents a syntax error.\n *\n * Syntax errors represent parts of the code that could not be incorporated\n * into a valid syntax tree.\n */\n get isError(): boolean {\n return (this._flags & 0x100000) !== 0;\n }\n\n /**\n * Check if this node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get isMissing(): boolean {\n return (this._flags & 0x40000) !== 0;\n }\n\n /**\n * Check if this node represents a syntax error or contains any syntax\n * errors anywhere within it.\n */\n get hasError(): boolean {\n return (this._flags & 0x80000) !== 0;\n }\n\n /** Get the byte index where this node ends. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /** Get the position where this node ends. */\n get endPosition(): Point {\n return { row: this._endRow, column: this._endColumn };\n }\n\n /** Get the string content of this node. */\n get text(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this.startIndex, this._endIndex)\n : getCallbackText(textSource, this.startIndex, this._endIndex, this.startPosition);\n }\n\n /** Check if this node is equal to another node. */\n equals(other: Node): boolean {\n return this.tree === other.tree && this.id === other.id;\n }\n\n /**\n * Get the node's child at the given index, where zero represents the first child.\n *\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#children} instead.\n */\n child(index: number): Node | null {\n marshalNode(this);\n C._ts_node_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's *named* child at the given index.\n *\n * See also {@link Node#isNamed}.\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#namedChildren} instead.\n */\n namedChild(index: number): Node | null {\n marshalNode(this);\n C._ts_node_named_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's child with the given numerical field id.\n *\n * See also {@link Node#childForFieldName}. You can\n * convert a field name to an id using {@link Language#fieldIdForName}.\n */\n childForFieldId(fieldId: number): Node | null {\n marshalNode(this);\n C._ts_node_child_by_field_id_wasm(this.tree[0], fieldId);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the first child with the given field name.\n *\n * If multiple children may have the same field name, access them using\n * {@link Node#childrenForFieldName}.\n */\n childForFieldName(fieldName: string): Node | null {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1) return this.childForFieldId(fieldId);\n return null;\n }\n\n /** Get the field name of this node's child at the given index. */\n fieldNameForChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n\n /** Get the field name of this node's named child at the given index. */\n fieldNameForNamedChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_named_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n /**\n * Get an array of this node's children with a given field name.\n *\n * See also {@link Node#children}.\n */\n childrenForFieldName(fieldName: string): Node[] {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1 && fieldId !== 0) return this.childrenForFieldId(fieldId);\n return [];\n }\n\n /**\n * Get an array of this node's children with a given field id.\n *\n * See also {@link Node#childrenForFieldName}.\n */\n childrenForFieldId(fieldId: number): Node[] {\n marshalNode(this);\n C._ts_node_children_by_field_id_wasm(this.tree[0], fieldId);\n return unmarshalNodeArray(this.tree, true);\n }\n\n /** Get the node's first child that contains or starts after the given byte offset. */\n firstChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = index;\n C._ts_node_first_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's first named child that contains or starts after the given byte offset. */\n firstNamedChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = index;\n C._ts_node_first_named_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's number of children. */\n get childCount(): number {\n marshalNode(this);\n return C._ts_node_child_count_wasm(this.tree[0]);\n }\n\n\n /**\n * Get this node's number of *named* children.\n *\n * See also {@link Node#isNamed}.\n */\n get namedChildCount(): number {\n marshalNode(this);\n return C._ts_node_named_child_count_wasm(this.tree[0]);\n }\n\n /** Get this node's first child. */\n get firstChild(): Node | null {\n return this.child(0);\n }\n\n /**\n * Get this node's first named child.\n *\n * See also {@link Node#isNamed}.\n */\n get firstNamedChild(): Node | null {\n return this.namedChild(0);\n }\n\n /** Get this node's last child. */\n get lastChild(): Node | null {\n return this.child(this.childCount - 1);\n }\n\n /**\n * Get this node's last named child.\n *\n * See also {@link Node#isNamed}.\n */\n get lastNamedChild(): Node | null {\n return this.namedChild(this.namedChildCount - 1);\n }\n\n /**\n * Iterate over this node's children.\n *\n * If you're walking the tree recursively, you may want to use the\n * {@link TreeCursor} APIs directly instead.\n */\n get children(): Node[] {\n if (!this._children) {\n marshalNode(this);\n C._ts_node_children_wasm(this.tree[0]);\n this._children = unmarshalNodeArray(this.tree);\n }\n return this._children;\n }\n\n /**\n * Iterate over this node's named children.\n *\n * See also {@link Node#children}.\n */\n get namedChildren(): Node[] {\n if (!this._namedChildren) {\n marshalNode(this);\n C._ts_node_named_children_wasm(this.tree[0]);\n this._namedChildren = unmarshalNodeArray(this.tree);\n }\n return this._namedChildren;\n }\n\n /**\n * Get the descendants of this node that are the given type, or in the given types array.\n *\n * The types array should contain node type strings, which can be retrieved from {@link Language#types}.\n *\n * Additionally, a `startPosition` and `endPosition` can be passed in to restrict the search to a byte range.\n */\n descendantsOfType(\n types: string | string[],\n startPosition: Point = ZERO_POINT,\n endPosition: Point = ZERO_POINT\n ): Node[] {\n const symbols = symbolsForTypes(this.tree.language, types);\n if (symbols.length === 0) return [];\n\n const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n C.HEAPU32.set(symbols, symbolsAddress >>> 2);\n\n marshalNode(this);\n const pointAddress = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(pointAddress, startPosition);\n marshalPoint(pointAddress + SIZE_OF_POINT, endPosition);\n C._ts_node_descendants_of_type_wasm(\n this.tree[0],\n symbolsAddress,\n symbols.length,\n );\n\n const result = unmarshalNodeArray(this.tree, true);\n C._free(symbolsAddress);\n return result;\n }\n\n /** Get this node's next sibling. */\n get nextSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's previous sibling. */\n get previousSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's next *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get nextNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's previous *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get previousNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's number of descendants, including one for the node itself. */\n get descendantCount(): number {\n marshalNode(this);\n return C._ts_node_descendant_count_wasm(this.tree[0]);\n }\n\n /**\n * Get this node's immediate parent.\n * Prefer {@link Node#childWithDescendant} for iterating over this node's ancestors.\n */\n get parent(): Node | null {\n marshalNode(this);\n C._ts_node_parent_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the node that contains `descendant`.\n *\n * Note that this can return `descendant` itself.\n */\n childWithDescendant(descendant: Node): Node | null {\n if (descendant.tree !== this.tree) return null;\n marshalNode(this);\n marshalNode(descendant, 1);\n C._ts_node_child_with_descendant_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given byte range. */\n descendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\n C._ts_node_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given byte range. */\n namedDescendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\n C._ts_node_named_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given point range. */\n descendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given point range. */\n namedDescendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_named_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Create a new {@link TreeCursor} starting from this node.\n *\n * Note that the given node is considered the root of the cursor,\n * and the cursor cannot walk outside this node.\n */\n walk(): TreeCursor {\n marshalNode(this);\n const address = C._ts_tree_cursor_new_wasm(this.tree[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Get the S-expression representation of this node. */\n toString(): string {\n marshalNode(this);\n const address = C._ts_node_to_string_wasm(this.tree[0]);\n const result = C.AsciiToString(address);\n C._ts_free_wasm(address);\n return result;\n }\n}\n\nfunction symbolsForTypes(language: Language, types: string | string[]): Uint32Array {\n const byType = symbolsByTypeForLanguage(language);\n if (typeof types === 'string') {\n return byType.get(types) ?? EMPTY_SYMBOLS;\n }\n if (types.length === 0) return EMPTY_SYMBOLS;\n if (types.length === 1) {\n return byType.get(types[0]) ?? EMPTY_SYMBOLS;\n }\n return collectSymbolsForTypes(byType, types);\n}\n\nfunction symbolsByTypeForLanguage(language: Language): Map<string, Uint32Array> {\n let cached = symbolsByTypeCache.get(language);\n if (!cached) {\n cached = buildSymbolsByType(language.types);\n symbolsByTypeCache.set(language, cached);\n }\n return cached;\n}\n\nfunction buildSymbolsByType(typesBySymbol: (string | undefined)[]): Map<string, Uint32Array> {\n const grouped = new Map<string, number[]>();\n for (let i = 0, n = typesBySymbol.length; i < n; i++) {\n const type = typesBySymbol[i];\n if (type !== undefined) {\n let list = grouped.get(type);\n if (!list) {\n list = [];\n grouped.set(type, list);\n }\n list.push(i);\n }\n }\n // `symbols_contain` in tree-sitter.c expects ascending symbols, and\n // ts_builtin_sym_error is -1, which is UINT16_MAX.\n const errorSymbols = grouped.get('ERROR');\n if (errorSymbols) {\n if (errorSymbols[errorSymbols.length - 1] !== 65535) {\n errorSymbols.push(65535);\n }\n } else {\n grouped.set('ERROR', [65535]);\n }\n const result = new Map<string, Uint32Array>();\n for (const [type, list] of grouped) {\n result.set(type, Uint32Array.from(list));\n }\n return result;\n}\n\nfunction collectSymbolsForTypes(byType: Map<string, Uint32Array>, types: string[]): Uint32Array {\n const symbols: number[] = [];\n for (const type of new Set(types)) {\n const matches = byType.get(type);\n if (matches) {\n for (const symbol of matches) symbols.push(symbol);\n }\n }\n if (symbols.length === 0) return EMPTY_SYMBOLS;\n return Uint32Array.from(symbols).sort();\n}\n", "import { INTERNAL, Point, Range, SIZE_OF_NODE, SIZE_OF_RANGE, C } from './constants';\nimport { Node } from './node';\nimport { Tree } from './tree';\nimport { TRANSFER_BUFFER } from './parser';\nimport { LanguageMetadata } from './language';\n\n/**\n * @internal\n *\n * Marshals a {@link Node} to the transfer buffer.\n */\nexport function marshalNode(node: Node, index = 0): void {\n const base = (TRANSFER_BUFFER + index * SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = node.id;\n heap[base + 1] = node.startIndex;\n heap[base + 2] = node.startPosition.row;\n heap[base + 3] = node.startPosition.column;\n heap[base + 4] = node[0];\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Node} from the transfer buffer.\n */\nexport function unmarshalNode(tree: Tree, address = TRANSFER_BUFFER): Node | null {\n const base = address >>> 2;\n const heap = C.HEAP32;\n const id = heap[base];\n if (id === 0) return null;\n\n const heapU32 = C.HEAPU32;\n return new Node(INTERNAL, {\n id,\n tree,\n startIndex: heapU32[base + 1],\n startPosition: { row: heapU32[base + 2], column: heapU32[base + 3] },\n other: heap[base + 4],\n endIndex: heapU32[base + 5],\n endRow: heapU32[base + 6],\n endColumn: heapU32[base + 7],\n flags: heapU32[base + 8],\n });\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Point} to the transfer buffer.\n */\nexport function marshalPoint(address: number, point: Point): void {\n const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = point.row;\n heap[base + 1] = point.column;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Point} from the transfer buffer.\n */\nexport function unmarshalPoint(address: number): Point {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n row: heap[base],\n column: heap[base + 1],\n };\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Range} to the transfer buffer.\n */\nexport function marshalRange(address: number, range: Range): void {\n const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = range.startPosition.row;\n heap[base + 1] = range.startPosition.column;\n heap[base + 2] = range.endPosition.row;\n heap[base + 3] = range.endPosition.column;\n heap[base + 4] = range.startIndex;\n heap[base + 5] = range.endIndex;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Range} from the transfer buffer.\n */\nexport function unmarshalRange(address: number): Range {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n startPosition: { row: heap[base], column: heap[base + 1] },\n endPosition: { row: heap[base + 2], column: heap[base + 3] },\n startIndex: heap[base + 4],\n endIndex: heap[base + 5],\n };\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link LanguageMetadata} from the transfer buffer.\n */\nexport function unmarshalLanguageMetadata(address: number): LanguageMetadata {\n const base = address >>> 2;\n const heap = C.HEAP32;\n return {\n major_version: heap[base],\n minor_version: heap[base + 1],\n patch_version: heap[base + 2],\n };\n}\n\n/** @internal */\nexport function unmarshalSymbols(): number[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAPU32[base + 1];\n const result = new Array<number>(count);\n if (count > 0) {\n const symbolBase = buffer >>> 1;\n const heapU16 = C.HEAPU16;\n for (let i = 0; i < count; i++) {\n result[i] = heapU16[symbolBase + i];\n }\n }\n return result;\n}\n\n/** @internal */\nexport function unmarshalRanges(useTsFree = true): Range[] {\n return unmarshalArray(SIZE_OF_RANGE, unmarshalRange, useTsFree);\n}\n\n/** @internal */\nexport function unmarshalNodeArray(tree: Tree, useTsFree = false): Node[] {\n return unmarshalArray(SIZE_OF_NODE, (address) => unmarshalNode(tree, address)!, useTsFree);\n}\n\nfunction unmarshalArray<T>(\n stride: number,\n readItem: (address: number) => T,\n useTsFree: boolean,\n): T[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAP32[base + 1];\n const result = new Array<T>(count);\n for (let i = 0, address = buffer; i < count; i++, address += stride) {\n result[i] = readItem(address);\n }\n if (buffer) {\n if (useTsFree) C._ts_free_wasm(buffer);\n else C._free(buffer);\n }\n return result;\n}\n", "import { C, INTERNAL, Internal, assertInternal, SIZE_OF_INT } from './constants';\nimport { unmarshalLanguageMetadata, unmarshalSymbols } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\\w+$/;\n\nexport interface LanguageMetadata {\n readonly major_version: number;\n readonly minor_version: number;\n readonly patch_version: number;\n}\n\ntype LanguageWasmExports = Record<string, () => number>;\n\n/**\n * An opaque object that defines how to parse a particular language.\n * The code for each `Language` is generated by the Tree-sitter CLI.\n */\nexport class Language {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /**\n * A list of all node types in the language. The index of each type in this\n * array is its node type id.\n */\n types: string[];\n\n /**\n * A list of all field names in the language. The index of each field name in\n * this array is its field id.\n */\n fields: (string | null)[];\n\n /** @internal */\n constructor(internal: Internal, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.types = new Array<string>(C._ts_language_symbol_count(this[0]));\n for (let i = 0, n = this.types.length; i < n; i++) {\n if (C._ts_language_symbol_type(this[0], i) < 2) {\n this.types[i] = C.UTF8ToString(C._ts_language_symbol_name(this[0], i));\n }\n }\n this.fields = new Array<string>(C._ts_language_field_count(this[0]) + 1);\n for (let i = 0, n = this.fields.length; i < n; i++) {\n const fieldName = C._ts_language_field_name_for_id(this[0], i);\n if (fieldName !== 0) {\n this.fields[i] = C.UTF8ToString(fieldName);\n } else {\n this.fields[i] = null;\n }\n }\n }\n\n\n /**\n * Gets the name of the language.\n */\n get name(): string | null {\n const ptr = C._ts_language_name(this[0]);\n if (ptr === 0) return null;\n return C.UTF8ToString(ptr);\n }\n\n /**\n * Gets the ABI version of the language.\n */\n get abiVersion(): number {\n return C._ts_language_abi_version(this[0]);\n }\n\n /**\n * Get the metadata for this language. This information is generated by the\n * CLI, and relies on the language author providing the correct metadata in\n * the language's `tree-sitter.json` file.\n */\n get metadata(): LanguageMetadata | null {\n C._ts_language_metadata_wasm(this[0]);\n const length = C.HEAP32[TRANSFER_BUFFER >>> 2];\n if (length === 0) return null;\n return unmarshalLanguageMetadata(TRANSFER_BUFFER + SIZE_OF_INT);\n }\n\n /**\n * Gets the number of fields in the language.\n */\n get fieldCount(): number {\n return this.fields.length - 1;\n }\n\n /**\n * Gets the number of states in the language.\n */\n get stateCount(): number {\n return C._ts_language_state_count(this[0]);\n }\n\n /**\n * Get the field id for a field name.\n */\n fieldIdForName(fieldName: string): number | null {\n const result = this.fields.indexOf(fieldName);\n return result !== -1 ? result : null;\n }\n\n /**\n * Get the field name for a field id.\n */\n fieldNameForId(fieldId: number): string | null {\n return this.fields[fieldId] ?? null;\n }\n\n /**\n * Get the node type id for a node type name.\n */\n idForNodeType(type: string, named: boolean): number | null {\n const typeLength = C.lengthBytesUTF8(type);\n const typeAddress = C._malloc(typeLength + 1);\n C.stringToUTF8(type, typeAddress, typeLength + 1);\n const result = C._ts_language_symbol_for_name(this[0], typeAddress, typeLength, named ? 1 : 0);\n C._free(typeAddress);\n return result || null;\n }\n\n /**\n * Gets the number of node types in the language.\n */\n get nodeTypeCount(): number {\n return C._ts_language_symbol_count(this[0]);\n }\n\n /**\n * Get the node type name for a node type id.\n */\n nodeTypeForId(typeId: number): string | null {\n const name = C._ts_language_symbol_name(this[0], typeId);\n return name ? C.UTF8ToString(name) : null;\n }\n\n /**\n * Check if a node type is named.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#named-vs-anonymous-nodes}\n */\n nodeTypeIsNamed(typeId: number): boolean {\n return C._ts_language_type_is_named_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Check if a node type is visible.\n */\n nodeTypeIsVisible(typeId: number): boolean {\n return C._ts_language_type_is_visible_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Get the supertypes ids of this language.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types.html?highlight=supertype#supertype-nodes}\n */\n get supertypes(): number[] {\n C._ts_language_supertypes_wasm(this[0]);\n return unmarshalSymbols();\n }\n\n /**\n * Get the subtype ids for a given supertype node id.\n */\n subtypes(supertype: number): number[] {\n C._ts_language_subtypes_wasm(this[0], supertype);\n return unmarshalSymbols();\n }\n\n /**\n * Load a language from a WebAssembly module.\n * The module can be provided as a path to a file, a `URL` to a file, a\n * buffer, or a precompiled `WebAssembly.Module`. In Cloudflare Workers, which\n * do not allow compiling Wasm at run time, pass the imported `.wasm` module.\n */\n static async load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language> {\n let binary: Uint8Array | WebAssembly.Module;\n if (input instanceof Uint8Array || input instanceof WebAssembly.Module) {\n binary = input;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n } else if (globalThis.process?.versions.node) {\n const fs: typeof import('fs/promises') = await import('fs/promises');\n binary = await fs.readFile(input);\n } else {\n const response = await fetch(input);\n\n if (!response.ok){\n const body = await response.text();\n throw new Error(`Language.load failed with status ${response.status}.\\n\\n${body}`);\n }\n\n const retryResp = response.clone();\n try {\n binary = await WebAssembly.compileStreaming(response);\n } catch (reason) {\n console.error('wasm streaming compile failed:', reason);\n console.error('falling back to ArrayBuffer instantiation');\n // fallback, probably because of bad MIME type\n binary = new Uint8Array(await retryResp.arrayBuffer())\n }\n }\n\n const mod = await C.loadWebAssemblyModule(binary, { loadAsync: true });\n return loadFromWasmExports(mod, { sync: false });\n }\n\n /**\n * Load a language synchronously from a pre-compiled WebAssembly module.\n * Use this when the host environment provides a `WebAssembly.Module` directly.\n */\n static loadSync(wasmModule: WebAssembly.Module): Language {\n const mod = C.loadWebAssemblyModule(wasmModule, { loadAsync: false });\n return loadFromWasmExports(mod, { sync: true });\n }\n}\n\n// Outside the class, since a private member in the declarations would make the ES module and the CommonJS copies of\n// `typeof Language` incompatible with each other.\nfunction loadFromWasmExports(mod: LanguageWasmExports, { sync }: { sync: boolean }): Language {\n const symbolNames = Object.keys(mod);\n const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) &&\n !key.includes('external_scanner_'));\n if (!functionName) {\n console.log(`Couldn't find language function in Wasm file. Symbols:\\n${JSON.stringify(symbolNames, null, 2)}`);\n throw new Error(`Language.${sync ? 'loadSync' : 'load'} failed: no language function found in Wasm file`);\n }\n const languageAddress = mod[functionName]();\n return new Language(INTERNAL, languageAddress);\n}\n", "import createModule, { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type Parser } from './parser';\n\nexport let Module: MainModule | null = null;\n\n/** Options for {@link Parser.init}. */\nexport interface ParserInitOptions extends Partial<EmscriptenModule> {\n /**\n * The precompiled `web-tree-sitter.wasm` module. Pass it where compiling Wasm from bytes at run time is not\n * allowed, such as in Cloudflare Workers, which provide an imported `.wasm` file as a `WebAssembly.Module`.\n */\n wasmModule?: WebAssembly.Module;\n\n /** The memory imported by `web-tree-sitter.wasm`. */\n wasmMemory?: WebAssembly.Memory;\n}\n\n/**\n * @internal\n *\n * Initialize the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport async function initializeBinding(options?: ParserInitOptions): Promise<MainModule> {\n if (Module) return Module;\n const { wasmModule, ...moduleOptions } = options ?? {};\n if (!wasmModule) return Module ??= await createModule(moduleOptions);\n\n // Emscripten gives `instantiateWasm` no way to report a failure, so its initialization would never settle;\n // the failure is raced against it instead.\n const instantiationFailure = new Promise<never>((_, reject) => {\n moduleOptions.instantiateWasm = (imports, receiveInstance) => {\n WebAssembly.instantiate(wasmModule, imports)\n .then((instance) => {\n // Emscripten reads the dynamic-linking metadata from the module passed with the instance, so both are passed.\n (receiveInstance as (instance: WebAssembly.Instance, module: WebAssembly.Module) => void)(instance, wasmModule);\n })\n .catch(reject);\n return {};\n };\n });\n return Module ??= await Promise.race([createModule(moduleOptions), instantiationFailure]);\n}\n\n/**\n * @internal\n *\n * Checks if the Tree-sitter Wasm module has been initialized.\n */\nexport function checkModule(): boolean {\n return !!Module;\n}\n", "import { C, INTERNAL, LogCallback, ParseCallback, Range, SIZE_OF_RANGE, setModule } from './constants';\nimport { Language } from './language';\nimport { marshalRange, unmarshalRanges } from './marshal';\nimport { checkModule, initializeBinding, type ParserInitOptions } from './bindings';\nimport { Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst TWO_POW_32 = 0x1_0000_0000;\n\n/**\n * Options for parsing\n *\n * The `includedRanges` property is an array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * The `progressCallback` property is a function that is called periodically\n * during parsing to check whether parsing should be cancelled.\n *\n * See {@link Parser#parse} for more information.\n */\nexport interface ParseOptions {\n /**\n * An array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * This sets the ranges of text that the parser should include when parsing.\n * By default, the parser will always include entire documents. This\n * function allows you to parse only a *portion* of a document but\n * still return a syntax tree whose ranges match up with the document\n * as a whole. You can also pass multiple disjoint ranges.\n * If `ranges` is empty, then the entire document will be parsed.\n * Otherwise, the given ranges must be ordered from earliest to latest\n * in the document, and they must not overlap. That is, the following\n * must hold for all `i` < `length - 1`:\n * ```text\n * ranges[i].end_byte <= ranges[i + 1].start_byte\n * ```\n */\n includedRanges?: Range[];\n\n /**\n * A function that is called periodically during parsing to check\n * whether parsing should be cancelled. If the progress callback returns\n * `true`, then parsing will be cancelled. You can also use this to instrument\n * parsing and check where the parser is at in the document. The progress callback\n * takes a single argument, which is a {@link ParseState} representing the current\n * state of the parser.\n */\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\n progressCallback?: (state: ParseState) => boolean | void;\n\n /**\n * The maximum size of Wasm memory during this parse, in bytes. Reaching it\n * cancels the parse. Memory is shared by all parsers and does not shrink, so\n * a parse also returns `null` when memory already exceeds this limit.\n */\n maxMemoryBytes?: number;\n\n /**\n * The maximum number of parse operations allowed during this parse. Exceeding\n * it cancels the parse and resets the parser.\n */\n maxOperations?: number;\n}\n\n/**\n * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}\n * to provide the current state of the parser.\n */\nexport interface ParseState {\n /** The byte offset in the document that the parser is at. */\n currentOffset: number;\n\n /** Indicates whether the parser has encountered an error during parsing. */\n hasError: boolean;\n}\n\n/**\n * @internal\n *\n * Global variable for transferring data across the FFI boundary\n */\nexport let TRANSFER_BUFFER: number;\n\n/**\n * The latest ABI version that the current version of the library supports. The\n * CLI of this fork assigns it to each generated language. Its upper 16 bits\n * (`0x5742`, \"WB\") tag the fork and its lower 16 bits count the fork's ABI\n * revisions, so that it never equals an ABI version of upstream Tree-sitter:\n * the library rejects languages generated by upstream's CLI, and upstream's\n * library rejects languages generated by this fork's CLI.\n */\nexport let LANGUAGE_VERSION: number;\n\n/**\n * The earliest ABI version that is supported by the current version of the\n * library.\n */\nexport let MIN_COMPATIBLE_VERSION: number;\n\n/**\n * @internal\n *\n * Throws unless the CLI of this fork generated the language.\n */\nexport function assertSupportedLanguage(language: Language): void {\n const version = C._ts_language_abi_version(language[0]);\n if (version < MIN_COMPATIBLE_VERSION || version > LANGUAGE_VERSION) {\n throw new Error(\n `Incompatible language version 0x${(version >>> 0).toString(16)}. ` +\n `Expected 0x${LANGUAGE_VERSION.toString(16)}.`\n );\n }\n}\n\nconst finalizer = newFinalizer((addresses: number[]) => {\n C._ts_parser_delete(addresses[0]);\n C._free(addresses[1]);\n});\n\n/**\n * A stateful object that is used to produce a {@link Tree} based on some\n * source code.\n */\nexport class Parser {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private [1] = 0; // Internal handle for Wasm\n\n /** @internal */\n private logCallback: LogCallback | null = null;\n\n /** @internal */\n private loggerEnabled = false;\n\n /** The parser's current language. */\n language: Language | null = null;\n\n /** The number of parse operations executed by the most recent {@link Parser#parse} call. */\n lastParseOperations = 0;\n\n /**\n * This must always be called before creating a Parser.\n *\n * You can optionally pass in options to configure the Wasm module, the most common\n * one being `locateFile` to help the module find the `.wasm` file. In Cloudflare Workers,\n * pass the imported `web-tree-sitter.wasm` module as `wasmModule` instead.\n */\n static async init(options?: ParserInitOptions) {\n setModule(await initializeBinding(options));\n TRANSFER_BUFFER = C._ts_init();\n const base = TRANSFER_BUFFER >>> 2;\n LANGUAGE_VERSION = C.HEAP32[base];\n MIN_COMPATIBLE_VERSION = C.HEAP32[base + 1];\n }\n\n /**\n * Create a new parser.\n */\n constructor() {\n this.initialize();\n finalizer?.register(this, [this[0], this[1]], this);\n }\n\n /** @internal */\n initialize() {\n if (!checkModule()) {\n throw new Error('cannot construct a Parser before calling `init()`');\n }\n C._ts_parser_new_wasm();\n const base = TRANSFER_BUFFER >>> 2;\n this[0] = C.HEAP32[base];\n this[1] = C.HEAP32[base + 1];\n this.loggerEnabled = false;\n }\n\n /** Delete the parser, freeing its resources. */\n delete() {\n finalizer?.unregister(this);\n C._ts_parser_delete(this[0]);\n C._free(this[1]);\n this[0] = 0;\n this[1] = 0;\n }\n\n /**\n * Set the language that the parser should use for parsing.\n *\n * If the language was not successfully assigned, an error will be thrown.\n * This happens if the language was generated with an incompatible\n * version of the Tree-sitter CLI. Check the language's version using\n * {@link Language#abiVersion}; this library accepts versions from\n * {@link MIN_COMPATIBLE_VERSION} to {@link LANGUAGE_VERSION}.\n */\n setLanguage(language: Language | null): this {\n let address: number;\n if (!language) {\n address = 0;\n this.language = null;\n } else if (language.constructor === Language) {\n address = language[0];\n assertSupportedLanguage(language);\n this.language = language;\n } else {\n throw new Error('Argument must be a Language');\n }\n\n C._ts_parser_set_language(this[0], address);\n return this;\n }\n\n /**\n * Parse a slice of UTF8 text.\n *\n * @param {string | ParseCallback} callback - The UTF8-encoded text to parse or a callback function.\n *\n * @param {ParseOptions} [options] - Options for parsing the text.\n * This can be used to set the included ranges, or a progress callback.\n *\n * @returns {Tree | null} A {@link Tree} if parsing succeeded, or `null` if:\n * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.\n * - The progress callback returned true.\n * - The memory limit was reached or the operation limit was exceeded.\n */\n parse(\n callback: string | ParseCallback,\n options?: ParseOptions,\n ): Tree | null {\n const maxMemoryBytes = validateMemoryLimit(options?.maxMemoryBytes);\n const maxOperations = validateOperationLimit(options?.maxOperations);\n if (typeof callback !== 'string' && typeof callback !== 'function') {\n throw new Error('Argument must be a string or a function');\n }\n\n const progressCallback = options?.progressCallback ?? null;\n C.currentParseCallback = callback;\n C.currentProgressCallback = progressCallback;\n this.syncLogger();\n this.lastParseOperations = 0;\n\n try {\n const treeAddress = this.runParse(options, maxMemoryBytes, maxOperations);\n if (!treeAddress) return null;\n if (!this.language) throw new Error('Parser must have a language to parse');\n return new Tree(INTERNAL, treeAddress, this.language, callback);\n } finally {\n clearCallbacks();\n }\n }\n\n /** @internal */\n private syncLogger(): void {\n if (this.logCallback) {\n C.currentLogCallback = this.logCallback;\n if (!this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 1);\n this.loggerEnabled = true;\n }\n } else {\n C.currentLogCallback = null;\n if (this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 0);\n this.loggerEnabled = false;\n }\n }\n }\n\n /** @internal */\n private runParse(\n options: ParseOptions | undefined,\n maxMemoryBytes: number | undefined,\n maxOperations: number | undefined,\n ): number {\n if (maxMemoryBytes !== undefined && !C.treeSitterSetMemoryLimit(maxMemoryBytes)) {\n return 0;\n }\n try {\n const [rangeAddress, rangeCount] = prepareRanges(options?.includedRanges);\n if (rangeCount && !rangeAddress) return 0;\n marshalParseInputs(maxOperations, rangeAddress, rangeCount, options?.progressCallback ? 1 : 0);\n try {\n return maxMemoryBytes === undefined\n ? this.executeOrdinaryParse()\n : this.executeLimitedParse();\n } finally {\n this.lastParseOperations = unmarshalOperationCount();\n }\n } finally {\n if (maxMemoryBytes !== undefined) C.treeSitterSetMemoryLimit(0);\n }\n }\n\n /** @internal */\n private executeOrdinaryParse(): number {\n try {\n return C._ts_parser_parse_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_last_parse_operations_wasm(this[0]);\n throw error;\n }\n }\n\n /** @internal */\n private executeLimitedParse(): number {\n try {\n return C._ts_parser_parse_limited_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_abort_limited_wasm();\n throw error;\n }\n }\n\n /**\n * Instruct the parser to start the next parse from the beginning.\n *\n * If the parser previously failed because of a callback,\n * then by default, it will resume where it left off on the\n * next call to {@link Parser#parse} or other parsing functions.\n * If you don't want to resume, and instead intend to use this parser to\n * parse some other document, you must call `reset` first.\n */\n reset(): void {\n C._ts_parser_reset(this[0]);\n }\n\n /** Get the ranges of text that the parser will include when parsing. */\n getIncludedRanges(): Range[] {\n C._ts_parser_included_ranges_wasm(this[0]);\n return unmarshalRanges(false);\n }\n\n /** Set the logging callback that a parser should use during parsing. */\n setLogger(callback: LogCallback | boolean | null): this {\n if (!callback) {\n this.logCallback = null;\n } else if (typeof callback !== 'function') {\n throw new Error('Logger callback must be a function');\n } else {\n this.logCallback = callback;\n }\n return this;\n }\n\n /** Get the parser's current logger. */\n getLogger(): LogCallback | null {\n return this.logCallback;\n }\n}\n\nfunction validateMemoryLimit(maxMemoryBytes?: number): number | undefined {\n if (maxMemoryBytes !== undefined &&\n (!Number.isSafeInteger(maxMemoryBytes) || maxMemoryBytes <= 0 || maxMemoryBytes > 0x7fffffff)) {\n throw new RangeError('maxMemoryBytes must be a positive integer no greater than 2147483647');\n }\n return maxMemoryBytes;\n}\n\nfunction validateOperationLimit(maxOperations?: number): number | undefined {\n if (maxOperations !== undefined && (!Number.isSafeInteger(maxOperations) || maxOperations <= 0)) {\n throw new RangeError('maxOperations must be a positive safe integer');\n }\n return maxOperations;\n}\n\nfunction prepareRanges(ranges?: Range[]): [number, number] {\n if (!ranges?.length) return [0, 0];\n const rangeAddress = C._calloc(ranges.length, SIZE_OF_RANGE);\n if (!rangeAddress) return [0, ranges.length];\n try {\n let address = rangeAddress;\n for (const range of ranges) {\n marshalRange(address, range);\n address += SIZE_OF_RANGE;\n }\n return [rangeAddress, ranges.length];\n } catch (error) {\n C._free(rangeAddress);\n throw error;\n }\n}\n\nfunction marshalParseInputs(\n maxOperations: number | undefined,\n rangeAddress: number,\n rangeCount: number,\n hasProgressCallback: number,\n): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n heapU32[base] = maxOperations === undefined ? 0 : maxOperations >>> 0;\n heapU32[base + 1] = maxOperations === undefined ? 0 : Math.floor(maxOperations / TWO_POW_32) >>> 0;\n heapU32[base + 2] = rangeAddress;\n heapU32[base + 3] = rangeCount;\n heapU32[base + 4] = hasProgressCallback;\n}\n\nfunction unmarshalOperationCount(): number {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n return heapU32[base] + heapU32[base + 1] * TWO_POW_32;\n}\n\nfunction clearCallbacks(): void {\n C.currentParseCallback = null;\n C.currentLogCallback = null;\n C.currentProgressCallback = null;\n}\n"],
|
|
4
|
+
"sourcesContent": ["// This code implements the `-sMODULARIZE` settings by taking the generated\n// JS program code (INNER_JS_CODE) and wrapping it in a factory function.\n\n// Single threaded MINIMAL_RUNTIME programs do not need access to\n// document.currentScript, so a simple export declaration is enough.\nvar Module = (() => {\n // When MODULARIZE this JS may be executed later,\n // after document.currentScript is gone, so we save it.\n // In EXPORT_ES6 mode we can just use 'import.meta.url'.\n var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined;\n return async function(moduleArg = {}) {\n var moduleRtn;\n\n// include: shell.js\n// The Module object: Our interface to the outside world. We import\n// and export values on it. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(moduleArg) => Promise<Module>\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to check if Module already exists (e.g. case 3 above).\n// Substitution will be replaced with actual code on later stage of the build,\n// this way Closure Compiler will not mangle it (e.g. case 4. above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module = moduleArg;\n\n// Determine the runtime environment we are in. You can customize this by\n// setting the ENVIRONMENT setting at compile time (see settings.js).\n// Attempt to auto-detect the environment\nvar ENVIRONMENT_IS_WEB = typeof window == \"object\";\n\nvar ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != \"undefined\";\n\n// N.b. Electron.js environment is simultaneously a NODE-environment, but\n// also a web environment.\nvar ENVIRONMENT_IS_NODE = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n\nvar ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;\n\n// --pre-jses are emitted after the Module integration code, so that they can\n// refer to Module (if they choose; they can also define Module)\n// include: lib/binding_web/lib/prefix.js\nModule.currentProgressCallback = null;\n\nModule.currentLogCallback = null;\n\nModule.currentParseCallback = null;\n\nModule.treeSitterSetMemoryLimit = function(maxBytes) {\n if (!maxBytes) {\n if (Module.treeSitterOriginalMemoryGrow) {\n wasmMemory.grow = Module.treeSitterOriginalMemoryGrow;\n Module.treeSitterOriginalMemoryGrow = null;\n }\n return true;\n }\n if (wasmMemory.buffer.byteLength > maxBytes) return false;\n if (Module.treeSitterOriginalMemoryGrow) return false;\n Module.treeSitterOriginalMemoryGrow = wasmMemory.grow;\n wasmMemory.grow = function(pages) {\n if (wasmMemory.buffer.byteLength + pages * 65536 > maxBytes) {\n throw new RangeError(\"Parse memory limit exceeded\");\n }\n return Module.treeSitterOriginalMemoryGrow.call(wasmMemory, pages);\n };\n return true;\n};\n\n// end include: lib/binding_web/lib/prefix.js\nvar arguments_ = [];\n\nvar thisProgram = \"./this.program\";\n\nvar quit_ = (status, toThrow) => {\n throw toThrow;\n};\n\nif (typeof __filename != \"undefined\") {\n // Node\n _scriptName = __filename;\n} else if (ENVIRONMENT_IS_WORKER) {\n _scriptName = self.location.href;\n}\n\n// `/` should be present at the end if `scriptDirectory` is not empty\nvar scriptDirectory = \"\";\n\nfunction locateFile(path) {\n if (Module[\"locateFile\"]) {\n return Module[\"locateFile\"](path, scriptDirectory);\n }\n return scriptDirectory + path;\n}\n\n// Hooks that are implemented differently in different runtime environments.\nvar readAsync, readBinary;\n\nif (ENVIRONMENT_IS_NODE) {\n const isNode = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n if (!isNode) throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n var nodeVersion = process.versions.node;\n var numericVersion = nodeVersion.split(\".\").slice(0, 3);\n numericVersion = (numericVersion[0] * 1e4) + (numericVersion[1] * 100) + (numericVersion[2].split(\"-\")[0] * 1);\n if (numericVersion < 16e4) {\n throw new Error(\"This emscripten-generated code requires node v16.0.0 (detected v\" + nodeVersion + \")\");\n }\n // These modules will usually be used on Node.js. Load them eagerly to avoid\n // the complexity of lazy-loading.\n var fs = require(\"fs\");\n scriptDirectory = __dirname + \"/\";\n // include: node_shell_read.js\n readBinary = filename => {\n // We need to re-wrap `file://` strings to URLs.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename);\n assert(Buffer.isBuffer(ret));\n return ret;\n };\n readAsync = async (filename, binary = true) => {\n // See the comment in the `readBinary` function.\n filename = isFileURI(filename) ? new URL(filename) : filename;\n var ret = fs.readFileSync(filename, binary ? undefined : \"utf8\");\n assert(binary ? Buffer.isBuffer(ret) : typeof ret == \"string\");\n return ret;\n };\n // end include: node_shell_read.js\n if (process.argv.length > 1) {\n thisProgram = process.argv[1].replace(/\\\\/g, \"/\");\n }\n arguments_ = process.argv.slice(2);\n quit_ = (status, toThrow) => {\n process.exitCode = status;\n throw toThrow;\n };\n} else if (ENVIRONMENT_IS_SHELL) {\n const isNode = typeof process == \"object\" && process.versions?.node && process.type != \"renderer\";\n if (isNode || typeof window == \"object\" || typeof WorkerGlobalScope != \"undefined\") throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n} else // Note that this includes Node.js workers when relevant (pthreads is enabled).\n// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and\n// ENVIRONMENT_IS_NODE.\nif (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n try {\n scriptDirectory = new URL(\".\", _scriptName).href;\n } catch {}\n if (!(typeof window == \"object\" || typeof WorkerGlobalScope != \"undefined\")) throw new Error(\"not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)\");\n {\n // include: web_or_worker_shell_read.js\n if (ENVIRONMENT_IS_WORKER) {\n readBinary = url => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, false);\n xhr.responseType = \"arraybuffer\";\n xhr.send(null);\n return new Uint8Array(/** @type{!ArrayBuffer} */ (xhr.response));\n };\n }\n readAsync = async url => {\n // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.\n // See https://github.com/github/fetch/pull/92#issuecomment-140665932\n // Cordova or Electron apps are typically loaded from a file:// url.\n // So use XHR on webview if URL is a file URL.\n if (isFileURI(url)) {\n return new Promise((resolve, reject) => {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"arraybuffer\";\n xhr.onload = () => {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {\n // file URLs can return 0\n resolve(xhr.response);\n return;\n }\n reject(xhr.status);\n };\n xhr.onerror = reject;\n xhr.send(null);\n });\n }\n var response = await fetch(url, {\n credentials: \"same-origin\"\n });\n if (response.ok) {\n return response.arrayBuffer();\n }\n throw new Error(response.status + \" : \" + response.url);\n };\n }\n} else {\n throw new Error(\"environment detection error\");\n}\n\nvar out = console.log.bind(console);\n\nvar err = console.error.bind(console);\n\nvar IDBFS = \"IDBFS is no longer included by default; build with -lidbfs.js\";\n\nvar PROXYFS = \"PROXYFS is no longer included by default; build with -lproxyfs.js\";\n\nvar WORKERFS = \"WORKERFS is no longer included by default; build with -lworkerfs.js\";\n\nvar FETCHFS = \"FETCHFS is no longer included by default; build with -lfetchfs.js\";\n\nvar ICASEFS = \"ICASEFS is no longer included by default; build with -licasefs.js\";\n\nvar JSFILEFS = \"JSFILEFS is no longer included by default; build with -ljsfilefs.js\";\n\nvar OPFS = \"OPFS is no longer included by default; build with -lopfs.js\";\n\nvar NODEFS = \"NODEFS is no longer included by default; build with -lnodefs.js\";\n\n// perform assertions in shell.js after we set up out() and err(), as otherwise\n// if an assertion fails it cannot print the message\nassert(!ENVIRONMENT_IS_SHELL, \"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.\");\n\n// end include: shell.js\n// include: preamble.js\n// === Preamble library stuff ===\n// Documentation for the public APIs defined in this file must be updated in:\n// site/source/docs/api_reference/preamble.js.rst\n// A prebuilt local version of the documentation is available at:\n// site/build/text/docs/api_reference/preamble.js.txt\n// You can also build docs locally as HTML or other formats in site/\n// An online HTML version (which may be of a different version of Emscripten)\n// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html\nvar dynamicLibraries = [];\n\nvar wasmBinary;\n\nif (typeof WebAssembly != \"object\") {\n err(\"no native wasm support detected\");\n}\n\n// Wasm globals\n//========================================\n// Runtime essentials\n//========================================\n// whether we are quitting the application. no code should run after this.\n// set in exit() and abort()\nvar ABORT = false;\n\n// set by exit() and abort(). Passed to 'onExit' handler.\n// NOTE: This is also used as the process return code code in shell environments\n// but only when noExitRuntime is false.\nvar EXITSTATUS;\n\n// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we\n// don't define it at all in release modes. This matches the behaviour of\n// MINIMAL_RUNTIME.\n// TODO(sbc): Make this the default even without STRICT enabled.\n/** @type {function(*, string=)} */ function assert(condition, text) {\n if (!condition) {\n abort(\"Assertion failed\" + (text ? \": \" + text : \"\"));\n }\n}\n\n// We used to include malloc/free by default in the past. Show a helpful error in\n// builds with assertions.\n/**\n * Indicates whether filename is delivered via file protocol (as opposed to http/https)\n * @noinline\n */ var isFileURI = filename => filename.startsWith(\"file://\");\n\n// include: runtime_common.js\n// include: runtime_stack_check.js\n// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.\nfunction writeStackCookie() {\n var max = _emscripten_stack_get_end();\n assert((max & 3) == 0);\n // If the stack ends at address zero we write our cookies 4 bytes into the\n // stack. This prevents interference with SAFE_HEAP and ASAN which also\n // monitor writes to address zero.\n if (max == 0) {\n max += 4;\n }\n // The stack grow downwards towards _emscripten_stack_get_end.\n // We write cookies to the final two words in the stack and detect if they are\n // ever overwritten.\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((max) >> 2), \"storing\")] = 34821223;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((max) + (4)) >> 2), \"storing\")] = 2310721022;\n}\n\nfunction checkStackCookie() {\n if (ABORT) return;\n var max = _emscripten_stack_get_end();\n // See writeStackCookie().\n if (max == 0) {\n max += 4;\n }\n var cookie1 = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((max) >> 2), \"loading\")];\n var cookie2 = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((max) + (4)) >> 2), \"loading\")];\n if (cookie1 != 34821223 || cookie2 != 2310721022) {\n abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`);\n }\n}\n\n// end include: runtime_stack_check.js\n// include: runtime_exceptions.js\n// end include: runtime_exceptions.js\n// include: runtime_debug.js\nvar runtimeDebug = true;\n\n// Switch to false at runtime to disable logging at the right times\n// Used by XXXXX_DEBUG settings to output debug messages.\nfunction dbg(...args) {\n if (!runtimeDebug && typeof runtimeDebug != \"undefined\") return;\n // TODO(sbc): Make this configurable somehow. Its not always convenient for\n // logging to show up as warnings.\n console.warn(...args);\n}\n\n// Endianness check\n(() => {\n var h16 = new Int16Array(1);\n var h8 = new Int8Array(h16.buffer);\n h16[0] = 25459;\n if (h8[0] !== 115 || h8[1] !== 99) abort(\"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)\");\n})();\n\nfunction consumedModuleProp(prop) {\n if (!Object.getOwnPropertyDescriptor(Module, prop)) {\n Object.defineProperty(Module, prop, {\n configurable: true,\n set() {\n abort(`Attempt to set \\`Module.${prop}\\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`);\n }\n });\n }\n}\n\nfunction makeInvalidEarlyAccess(name) {\n return () => assert(false, `call to '${name}' via reference taken before Wasm module initialization`);\n}\n\nfunction ignoredModuleProp(prop) {\n if (Object.getOwnPropertyDescriptor(Module, prop)) {\n abort(`\\`Module.${prop}\\` was supplied but \\`${prop}\\` not included in INCOMING_MODULE_JS_API`);\n }\n}\n\n// forcing the filesystem exports a few things by default\nfunction isExportedByForceFilesystem(name) {\n return name === \"FS_createPath\" || name === \"FS_createDataFile\" || name === \"FS_createPreloadedFile\" || name === \"FS_preloadFile\" || name === \"FS_unlink\" || name === \"addRunDependency\" || // The old FS has some functionality that WasmFS lacks.\n name === \"FS_createLazyFile\" || name === \"FS_createDevice\" || name === \"removeRunDependency\";\n}\n\nfunction missingLibrarySymbol(sym) {\n // Any symbol that is not included from the JS library is also (by definition)\n // not exported on the Module object.\n unexportedRuntimeSymbol(sym);\n}\n\nfunction unexportedRuntimeSymbol(sym) {\n if (!Object.getOwnPropertyDescriptor(Module, sym)) {\n Object.defineProperty(Module, sym, {\n configurable: true,\n get() {\n var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;\n if (isExportedByForceFilesystem(sym)) {\n msg += \". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you\";\n }\n abort(msg);\n }\n });\n }\n}\n\n// end include: runtime_debug.js\n// include: runtime_safe_heap.js\nfunction SAFE_HEAP_INDEX(arr, idx, action) {\n const bytes = arr.BYTES_PER_ELEMENT;\n const dest = idx * bytes;\n if (idx <= 0) abort(`segmentation fault ${action} ${bytes} bytes at address ${dest}`);\n if (runtimeInitialized) {\n var brk = _sbrk(0);\n if (dest + bytes > brk) abort(`segmentation fault, exceeded the top of the available dynamic heap when ${action} ${bytes} bytes at address ${dest}. DYNAMICTOP=${brk}`);\n if (brk < _emscripten_stack_get_base()) abort(`brk >= _emscripten_stack_get_base() (brk=${brk}, _emscripten_stack_get_base()=${_emscripten_stack_get_base()})`);\n // sbrk-managed memory must be above the stack\n if (brk > wasmMemory.buffer.byteLength) abort(`brk <= wasmMemory.buffer.byteLength (brk=${brk}, wasmMemory.buffer.byteLength=${wasmMemory.buffer.byteLength})`);\n }\n return idx;\n}\n\nfunction segfault() {\n abort(\"segmentation fault\");\n}\n\nfunction alignfault() {\n abort(\"alignment fault\");\n}\n\n// end include: runtime_safe_heap.js\nvar readyPromiseResolve, readyPromiseReject;\n\n// Memory management\nvar wasmMemory;\n\nvar /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ HEAPF64;\n\n// BigInt64Array type is not correctly defined in closure\nvar /** not-@type {!BigInt64Array} */ HEAP64, /* BigUint64Array type is not correctly defined in closure\n/** not-@type {!BigUint64Array} */ HEAPU64;\n\nvar runtimeInitialized = false;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n HEAP8 = new Int8Array(b);\n HEAP16 = new Int16Array(b);\n HEAPU8 = new Uint8Array(b);\n Module[\"HEAPU16\"] = HEAPU16 = new Uint16Array(b);\n Module[\"HEAP32\"] = HEAP32 = new Int32Array(b);\n Module[\"HEAPU32\"] = HEAPU32 = new Uint32Array(b);\n HEAPF32 = new Float32Array(b);\n HEAPF64 = new Float64Array(b);\n HEAP64 = new BigInt64Array(b);\n HEAPU64 = new BigUint64Array(b);\n}\n\n// In non-standalone/normal mode, we create the memory here.\n// include: runtime_init_memory.js\n// Create the wasm memory. (Note: this only applies if IMPORTED_MEMORY is defined)\n// check for full engine support (use string 'subarray' to avoid closure compiler confusion)\nfunction initMemory() {\n if (Module[\"wasmMemory\"]) {\n wasmMemory = Module[\"wasmMemory\"];\n } else {\n var INITIAL_MEMORY = Module[\"INITIAL_MEMORY\"] || 524288;\n assert(INITIAL_MEMORY >= 65536, \"INITIAL_MEMORY should be larger than STACK_SIZE, was \" + INITIAL_MEMORY + \"! (STACK_SIZE=\" + 65536 + \")\");\n /** @suppress {checkTypes} */ wasmMemory = new WebAssembly.Memory({\n \"initial\": INITIAL_MEMORY / 65536,\n // In theory we should not need to emit the maximum if we want \"unlimited\"\n // or 4GB of memory, but VMs error on that atm, see\n // https://github.com/emscripten-core/emscripten/issues/14130\n // And in the pthreads case we definitely need to emit a maximum. So\n // always emit one.\n \"maximum\": 32768\n });\n }\n updateMemoryViews();\n}\n\n// end include: runtime_init_memory.js\n// include: memoryprofiler.js\n// end include: memoryprofiler.js\n// end include: runtime_common.js\nassert(typeof Int32Array != \"undefined\" && typeof Float64Array !== \"undefined\" && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined, \"JS engine does not provide full typed array support\");\n\nvar __RELOC_FUNCS__ = [];\n\nfunction preRun() {\n if (Module[\"preRun\"]) {\n if (typeof Module[\"preRun\"] == \"function\") Module[\"preRun\"] = [ Module[\"preRun\"] ];\n while (Module[\"preRun\"].length) {\n addOnPreRun(Module[\"preRun\"].shift());\n }\n }\n consumedModuleProp(\"preRun\");\n // Begin ATPRERUNS hooks\n callRuntimeCallbacks(onPreRuns);\n}\n\nfunction initRuntime() {\n assert(!runtimeInitialized);\n runtimeInitialized = true;\n checkStackCookie();\n callRuntimeCallbacks(__RELOC_FUNCS__);\n // No ATINITS hooks\n wasmExports[\"__wasm_call_ctors\"]();\n // Begin ATPOSTCTORS hooks\n callRuntimeCallbacks(onPostCtors);\n}\n\nfunction preMain() {\n checkStackCookie();\n}\n\nfunction postRun() {\n checkStackCookie();\n // PThreads reuse the runtime from the main thread.\n if (Module[\"postRun\"]) {\n if (typeof Module[\"postRun\"] == \"function\") Module[\"postRun\"] = [ Module[\"postRun\"] ];\n while (Module[\"postRun\"].length) {\n addOnPostRun(Module[\"postRun\"].shift());\n }\n }\n consumedModuleProp(\"postRun\");\n // Begin ATPOSTRUNS hooks\n callRuntimeCallbacks(onPostRuns);\n}\n\n/** @param {string|number=} what */ function abort(what) {\n Module[\"onAbort\"]?.(what);\n what = \"Aborted(\" + what + \")\";\n // TODO(sbc): Should we remove printing and leave it up to whoever\n // catches the exception?\n err(what);\n ABORT = true;\n // Use a wasm runtime error, because a JS error might be seen as a foreign\n // exception, which means we'd run destructors on it. We need the error to\n // simply make the program stop.\n // FIXME This approach does not work in Wasm EH because it currently does not assume\n // all RuntimeErrors are from traps; it decides whether a RuntimeError is from\n // a trap or not based on a hidden field within the object. So at the moment\n // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that\n // allows this in the wasm spec.\n // Suppress closure compiler warning here. Closure compiler's builtin extern\n // definition for WebAssembly.RuntimeError claims it takes no arguments even\n // though it can.\n // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.\n /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);\n readyPromiseReject?.(e);\n // Throw the error whether or not MODULARIZE is set because abort is used\n // in code paths apart from instantiation where an exception is expected\n // to be thrown when abort is called.\n throw e;\n}\n\n// show errors on likely calls to FS when it was not included\nvar FS = {\n error() {\n abort(\"Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM\");\n },\n init() {\n FS.error();\n },\n createDataFile() {\n FS.error();\n },\n createPreloadedFile() {\n FS.error();\n },\n createLazyFile() {\n FS.error();\n },\n open() {\n FS.error();\n },\n mkdev() {\n FS.error();\n },\n registerDevice() {\n FS.error();\n },\n analyzePath() {\n FS.error();\n },\n ErrnoError() {\n FS.error();\n }\n};\n\nfunction createExportWrapper(name, nargs) {\n return (...args) => {\n assert(runtimeInitialized, `native function \\`${name}\\` called before runtime initialization`);\n var f = wasmExports[name];\n assert(f, `exported native function \\`${name}\\` not found`);\n // Only assert for too many arguments. Too few can be valid since the missing arguments will be zero filled.\n assert(args.length <= nargs, `native function \\`${name}\\` called with ${args.length} args but expects ${nargs}`);\n return f(...args);\n };\n}\n\nvar wasmBinaryFile;\n\nfunction findWasmBinary() {\n return locateFile(\"web-tree-sitter.wasm\");\n}\n\nfunction getBinarySync(file) {\n if (file == wasmBinaryFile && wasmBinary) {\n return new Uint8Array(wasmBinary);\n }\n if (readBinary) {\n return readBinary(file);\n }\n // Throwing a plain string here, even though it not normally adviables since\n // this gets turning into an `abort` in instantiateArrayBuffer.\n throw \"both async and sync fetching of the wasm failed\";\n}\n\nasync function getWasmBinary(binaryFile) {\n // If we don't have the binary yet, load it asynchronously using readAsync.\n if (!wasmBinary) {\n // Fetch the binary using readAsync\n try {\n var response = await readAsync(binaryFile);\n return new Uint8Array(response);\n } catch {}\n }\n // Otherwise, getBinarySync should be able to get it synchronously\n return getBinarySync(binaryFile);\n}\n\nasync function instantiateArrayBuffer(binaryFile, imports) {\n try {\n var binary = await getWasmBinary(binaryFile);\n var instance = await WebAssembly.instantiate(binary, imports);\n return instance;\n } catch (reason) {\n err(`failed to asynchronously prepare wasm: ${reason}`);\n // Warn on some common problems.\n if (isFileURI(binaryFile)) {\n err(`warning: Loading from a file URI (${binaryFile}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`);\n }\n abort(reason);\n }\n}\n\nasync function instantiateAsync(binary, binaryFile, imports) {\n if (!binary && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE) {\n try {\n var response = fetch(binaryFile, {\n credentials: \"same-origin\"\n });\n var instantiationResult = await WebAssembly.instantiateStreaming(response, imports);\n return instantiationResult;\n } catch (reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err(`wasm streaming compile failed: ${reason}`);\n err(\"falling back to ArrayBuffer instantiation\");\n }\n }\n return instantiateArrayBuffer(binaryFile, imports);\n}\n\nfunction getWasmImports() {\n // prepare imports\n return {\n \"env\": wasmImports,\n \"wasi_snapshot_preview1\": wasmImports,\n \"GOT.mem\": new Proxy(wasmImports, GOTHandler),\n \"GOT.func\": new Proxy(wasmImports, GOTHandler)\n };\n}\n\n// Create the wasm instance.\n// Receives the wasm imports, returns the exports.\nasync function createWasm() {\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n wasmExports = relocateExports(wasmExports, 1024);\n var metadata = getDylinkMetadata(module);\n if (metadata.neededDynlibs) {\n dynamicLibraries = metadata.neededDynlibs.concat(dynamicLibraries);\n }\n const scannerAllocators = {malloc: wasmExports.ts_scanner_malloc_wasm, calloc: wasmExports.ts_scanner_calloc_wasm, realloc: wasmExports.ts_scanner_realloc_wasm}; Object.assign(wasmImports, scannerAllocators); updateGOT(scannerAllocators, true); mergeLibSymbols(wasmExports, \"main\");\n LDSO.init();\n loadDylibs();\n __RELOC_FUNCS__.push(wasmExports[\"__wasm_apply_data_relocs\"]);\n assignWasmExports(wasmExports);\n return wasmExports;\n }\n // Prefer streaming instantiation if available.\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiationResult(result) {\n // 'result' is a ResultObject object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, \"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?\");\n trueModule = null;\n return receiveInstance(result[\"instance\"], result[\"module\"]);\n }\n var info = getWasmImports();\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to\n // run the instantiation parallel to any other async startup actions they are\n // performing.\n // Also pthreads and wasm workers initialize the wasm instance through this\n // path.\n if (Module[\"instantiateWasm\"]) {\n return new Promise((resolve, reject) => {\n try {\n Module[\"instantiateWasm\"](info, (mod, inst) => {\n resolve(receiveInstance(mod, inst));\n });\n } catch (e) {\n err(`Module.instantiateWasm callback failed with error: ${e}`);\n reject(e);\n }\n });\n }\n wasmBinaryFile ??= findWasmBinary();\n var result = await instantiateAsync(wasmBinary, wasmBinaryFile, info);\n var exports = receiveInstantiationResult(result);\n return exports;\n}\n\n// end include: preamble.js\n// Begin JS library code\nclass ExitStatus {\n name=\"ExitStatus\";\n constructor(status) {\n this.message = `Program terminated with exit(${status})`;\n this.status = status;\n }\n}\n\nvar GOT = {};\n\nvar currentModuleWeakSymbols = new Set([]);\n\nvar GOTHandler = {\n get(obj, symName) {\n var rtn = GOT[symName];\n if (!rtn) {\n rtn = GOT[symName] = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n }\n if (!currentModuleWeakSymbols.has(symName)) {\n // Any non-weak reference to a symbol marks it as `required`, which\n // enabled `reportUndefinedSymbols` to report undefined symbol errors\n // correctly.\n rtn.required = true;\n }\n return rtn;\n }\n};\n\nvar callRuntimeCallbacks = callbacks => {\n while (callbacks.length > 0) {\n // Pass the module as the first argument.\n callbacks.shift()(Module);\n }\n};\n\nvar onPostRuns = [];\n\nvar addOnPostRun = cb => onPostRuns.push(cb);\n\nvar onPreRuns = [];\n\nvar addOnPreRun = cb => onPreRuns.push(cb);\n\nvar UTF8Decoder = typeof TextDecoder != \"undefined\" ? new TextDecoder : undefined;\n\nvar findStringEnd = (heapOrArray, idx, maxBytesToRead, ignoreNul) => {\n var maxIdx = idx + maxBytesToRead;\n if (ignoreNul) return maxIdx;\n // TextDecoder needs to know the byte length in advance, it doesn't stop on\n // null terminator by itself.\n // As a tiny code save trick, compare idx against maxIdx using a negation,\n // so that maxBytesToRead=undefined/NaN means Infinity.\n while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;\n return idx;\n};\n\nvar warnOnce = text => {\n warnOnce.shown ||= {};\n if (!warnOnce.shown[text]) {\n warnOnce.shown[text] = 1;\n if (ENVIRONMENT_IS_NODE) text = \"warning: \" + text;\n err(text);\n }\n};\n\n/**\n * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given\n * array that contains uint8 values, returns a copy of that string as a\n * Javascript String object.\n * heapOrArray is either a regular array, or a JavaScript typed array view.\n * @param {number=} idx\n * @param {number=} maxBytesToRead\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead, ignoreNul) => {\n var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);\n // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.\n if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n }\n var str = \"\";\n while (idx < endPtr) {\n // For UTF8 byte structure, see:\n // http://en.wikipedia.org/wiki/UTF-8#Description\n // https://www.ietf.org/rfc/rfc2279.txt\n // https://tools.ietf.org/html/rfc3629\n var u0 = heapOrArray[idx++];\n if (!(u0 & 128)) {\n str += String.fromCharCode(u0);\n continue;\n }\n var u1 = heapOrArray[idx++] & 63;\n if ((u0 & 224) == 192) {\n str += String.fromCharCode(((u0 & 31) << 6) | u1);\n continue;\n }\n var u2 = heapOrArray[idx++] & 63;\n if ((u0 & 240) == 224) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n if ((u0 & 248) != 240) warnOnce(\"Invalid UTF-8 leading byte \" + ptrToString(u0) + \" encountered when deserializing a UTF-8 string in wasm memory to a JS string!\");\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);\n }\n if (u0 < 65536) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 65536;\n str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));\n }\n }\n return str;\n};\n\nvar getDylinkMetadata = binary => {\n var offset = 0;\n var end = 0;\n function getU8() {\n return binary[offset++];\n }\n function getLEB() {\n var ret = 0;\n var mul = 1;\n while (1) {\n var byte = binary[offset++];\n ret += ((byte & 127) * mul);\n mul *= 128;\n if (!(byte & 128)) break;\n }\n return ret;\n }\n function getString() {\n var len = getLEB();\n offset += len;\n return UTF8ArrayToString(binary, offset - len, len);\n }\n function getStringList() {\n var count = getLEB();\n var rtn = [];\n while (count--) rtn.push(getString());\n return rtn;\n }\n /** @param {string=} message */ function failIf(condition, message) {\n if (condition) throw new Error(message);\n }\n if (binary instanceof WebAssembly.Module) {\n var dylinkSection = WebAssembly.Module.customSections(binary, \"dylink.0\");\n failIf(dylinkSection.length === 0, \"need dylink section\");\n binary = new Uint8Array(dylinkSection[0]);\n end = binary.length;\n } else {\n var int32View = new Uint32Array(new Uint8Array(binary.subarray(0, 24)).buffer);\n var magicNumberFound = int32View[0] == 1836278016;\n failIf(!magicNumberFound, \"need to see wasm magic number\");\n // \\0asm\n // we should see the dylink custom section right after the magic number and wasm version\n failIf(binary[8] !== 0, \"need the dylink section to be first\");\n offset = 9;\n var section_size = getLEB();\n //section size\n end = offset + section_size;\n var name = getString();\n failIf(name !== \"dylink.0\");\n }\n var customSection = {\n neededDynlibs: [],\n tlsExports: new Set,\n weakImports: new Set,\n runtimePaths: []\n };\n var WASM_DYLINK_MEM_INFO = 1;\n var WASM_DYLINK_NEEDED = 2;\n var WASM_DYLINK_EXPORT_INFO = 3;\n var WASM_DYLINK_IMPORT_INFO = 4;\n var WASM_DYLINK_RUNTIME_PATH = 5;\n var WASM_SYMBOL_TLS = 256;\n var WASM_SYMBOL_BINDING_MASK = 3;\n var WASM_SYMBOL_BINDING_WEAK = 1;\n while (offset < end) {\n var subsectionType = getU8();\n var subsectionSize = getLEB();\n if (subsectionType === WASM_DYLINK_MEM_INFO) {\n customSection.memorySize = getLEB();\n customSection.memoryAlign = getLEB();\n customSection.tableSize = getLEB();\n customSection.tableAlign = getLEB();\n } else if (subsectionType === WASM_DYLINK_NEEDED) {\n customSection.neededDynlibs = getStringList();\n } else if (subsectionType === WASM_DYLINK_EXPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var symname = getString();\n var flags = getLEB();\n if (flags & WASM_SYMBOL_TLS) {\n customSection.tlsExports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_IMPORT_INFO) {\n var count = getLEB();\n while (count--) {\n var modname = getString();\n var symname = getString();\n var flags = getLEB();\n if ((flags & WASM_SYMBOL_BINDING_MASK) == WASM_SYMBOL_BINDING_WEAK) {\n customSection.weakImports.add(symname);\n }\n }\n } else if (subsectionType === WASM_DYLINK_RUNTIME_PATH) {\n customSection.runtimePaths = getStringList();\n } else {\n err(\"unknown dylink.0 subsection:\", subsectionType);\n // unknown subsection\n offset += subsectionSize;\n }\n }\n var tableAlign = Math.pow(2, customSection.tableAlign);\n assert(tableAlign === 1, `invalid tableAlign ${tableAlign}`);\n assert(offset == end);\n return customSection;\n};\n\n/**\n * @param {number} ptr\n * @param {string} type\n */ function getValue(ptr, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n return HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"loading\")];\n\n case \"i8\":\n return HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"loading\")];\n\n case \"i16\":\n return HEAP16[SAFE_HEAP_INDEX(HEAP16, ((ptr) >> 1), \"loading\")];\n\n case \"i32\":\n return HEAP32[SAFE_HEAP_INDEX(HEAP32, ((ptr) >> 2), \"loading\")];\n\n case \"i64\":\n return HEAP64[SAFE_HEAP_INDEX(HEAP64, ((ptr) >> 3), \"loading\")];\n\n case \"float\":\n return HEAPF32[SAFE_HEAP_INDEX(HEAPF32, ((ptr) >> 2), \"loading\")];\n\n case \"double\":\n return HEAPF64[SAFE_HEAP_INDEX(HEAPF64, ((ptr) >> 3), \"loading\")];\n\n case \"*\":\n return HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((ptr) >> 2), \"loading\")];\n\n default:\n abort(`invalid type for getValue: ${type}`);\n }\n}\n\nvar newDSO = (name, handle, syms) => {\n var dso = {\n refcount: Infinity,\n name,\n exports: syms,\n global: true\n };\n LDSO.loadedLibsByName[name] = dso;\n if (handle != undefined) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return dso;\n};\n\nvar LDSO = {\n loadedLibsByName: {},\n loadedLibsByHandle: {},\n init() {\n // This function needs to run after the initial wasmImports object\n // as been created.\n assert(wasmImports);\n newDSO(\"__main__\", 0, wasmImports);\n }\n};\n\nvar ___heap_base = 81984;\n\nvar alignMemory = (size, alignment) => {\n assert(alignment, \"alignment argument is required\");\n return Math.ceil(size / alignment) * alignment;\n};\n\nvar getMemory = size => {\n // After the runtime is initialized, we must only use sbrk() normally.\n if (runtimeInitialized) {\n // Currently we don't support freeing of static data when modules are\n // unloaded via dlclose. This function is tagged as `noleakcheck` to\n // avoid having this reported as leak.\n return _calloc(size, 1);\n }\n var ret = ___heap_base;\n // Keep __heap_base stack aligned.\n var end = ret + alignMemory(size, 16);\n assert(end <= HEAP8.length, \"failure to getMemory - memory growth etc. is not supported there, call malloc/sbrk directly or increase INITIAL_MEMORY\");\n ___heap_base = end;\n GOT[\"__heap_base\"].value = end;\n return ret;\n};\n\nvar isInternalSym = symName => [ \"__cpp_exception\", \"__c_longjmp\", \"__wasm_apply_data_relocs\", \"__dso_handle\", \"__tls_size\", \"__tls_align\", \"__set_stack_limits\", \"_emscripten_tls_init\", \"__wasm_init_tls\", \"__wasm_call_ctors\", \"__start_em_asm\", \"__stop_em_asm\", \"__start_em_js\", \"__stop_em_js\" ].includes(symName) || symName.startsWith(\"__em_js__\");\n\nvar uleb128EncodeWithLen = arr => {\n const n = arr.length;\n assert(n < 16384);\n // Note: this LEB128 length encoding produces extra byte for n < 128,\n // but we don't care as it's only used in a temporary representation.\n return [ (n % 128) | 128, n >> 7, ...arr ];\n};\n\nvar wasmTypeCodes = {\n \"i\": 127,\n // i32\n \"p\": 127,\n // i32\n \"j\": 126,\n // i64\n \"f\": 125,\n // f32\n \"d\": 124,\n // f64\n \"e\": 111\n};\n\nvar generateTypePack = types => uleb128EncodeWithLen(Array.from(types, type => {\n var code = wasmTypeCodes[type];\n assert(code, `invalid signature char: ${type}`);\n return code;\n}));\n\nvar convertJsFunctionToWasm = (func, sig) => {\n // Rest of the module is static\n var bytes = Uint8Array.of(0, 97, 115, 109, // magic (\"\\0asm\")\n 1, 0, 0, 0, // version: 1\n 1, // Type section code\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n ...uleb128EncodeWithLen([ 1, // count: 1\n 96, // param types\n ...generateTypePack(sig.slice(1)), // return types (for now only supporting [] if `void` and single [T] otherwise)\n ...generateTypePack(sig[0] === \"v\" ? \"\" : sig[0]) ]), // The rest of the module is static\n 2, 7, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 1, 1, 101, 1, 102, 0, 0, 7, 5, // export section\n // (export \"f\" (func 0 (type 0)))\n 1, 1, 102, 0, 0);\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n \"e\": {\n \"f\": func\n }\n });\n var wrappedFunc = instance.exports[\"f\"];\n return wrappedFunc;\n};\n\nvar wasmTableMirror = [];\n\n/** @type {WebAssembly.Table} */ var wasmTable = new WebAssembly.Table({\n \"initial\": 60,\n \"element\": \"anyfunc\"\n});\n\nvar getWasmTableEntry = funcPtr => {\n var func = wasmTableMirror[funcPtr];\n if (!func) {\n /** @suppress {checkTypes} */ wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);\n }\n /** @suppress {checkTypes} */ assert(wasmTable.get(funcPtr) == func, \"JavaScript-side Wasm function table mirror is out of date!\");\n return func;\n};\n\nvar updateTableMap = (offset, count) => {\n if (functionsInTableMap) {\n for (var i = offset; i < offset + count; i++) {\n var item = getWasmTableEntry(i);\n // Ignore null values.\n if (item) {\n functionsInTableMap.set(item, i);\n }\n }\n }\n};\n\nvar functionsInTableMap;\n\nvar getFunctionAddress = func => {\n // First, create the map if this is the first use.\n if (!functionsInTableMap) {\n functionsInTableMap = new WeakMap;\n updateTableMap(0, wasmTable.length);\n }\n return functionsInTableMap.get(func) || 0;\n};\n\nvar freeTableIndexes = [];\n\nvar getEmptyTableSlot = () => {\n // Reuse a free index if there is one, otherwise grow.\n if (freeTableIndexes.length) {\n return freeTableIndexes.pop();\n }\n try {\n // Grow the table\n return wasmTable[\"grow\"](1);\n } catch (err) {\n if (!(err instanceof RangeError)) {\n throw err;\n }\n abort(\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\");\n }\n};\n\nvar setWasmTableEntry = (idx, func) => {\n /** @suppress {checkTypes} */ wasmTable.set(idx, func);\n // With ABORT_ON_WASM_EXCEPTIONS wasmTable.get is overridden to return wrapped\n // functions so we need to call it here to retrieve the potential wrapper correctly\n // instead of just storing 'func' directly into wasmTableMirror\n /** @suppress {checkTypes} */ wasmTableMirror[idx] = wasmTable.get(idx);\n};\n\n/** @param {string=} sig */ var addFunction = (func, sig) => {\n assert(typeof func != \"undefined\");\n // Check if the function is already in the table, to ensure each function\n // gets a unique index.\n var rtn = getFunctionAddress(func);\n if (rtn) {\n return rtn;\n }\n // It's not in the table, add it now.\n var ret = getEmptyTableSlot();\n // Set the new value.\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n setWasmTableEntry(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n assert(typeof sig != \"undefined\", \"Missing signature argument to addFunction: \" + func);\n var wrapped = convertJsFunctionToWasm(func, sig);\n setWasmTableEntry(ret, wrapped);\n }\n functionsInTableMap.set(func, ret);\n return ret;\n};\n\nvar updateGOT = (exports, replace) => {\n for (var symName in exports) {\n if (isInternalSym(symName)) {\n continue;\n }\n var value = exports[symName];\n GOT[symName] ||= new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n });\n if (replace || GOT[symName].value == 0) {\n if (typeof value == \"function\") {\n GOT[symName].value = addFunction(value);\n } else if (typeof value == \"number\") {\n GOT[symName].value = value;\n } else {\n err(`unhandled export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\n/** @param {boolean=} replace */ var relocateExports = (exports, memoryBase, replace) => {\n var relocated = {};\n for (var e in exports) {\n var value = exports[e];\n if (typeof value == \"object\") {\n // a breaking change in the wasm spec, globals are now objects\n // https://github.com/WebAssembly/mutable-global/issues/1\n value = value.value;\n }\n if (typeof value == \"number\") {\n value += memoryBase;\n }\n relocated[e] = value;\n }\n updateGOT(relocated, replace);\n return relocated;\n};\n\nvar isSymbolDefined = symName => {\n // Ignore 'stub' symbols that are auto-generated as part of the original\n // `wasmImports` used to instantiate the main module.\n var existing = wasmImports[symName];\n if (!existing || existing.stub) {\n return false;\n }\n return true;\n};\n\nvar dynCall = (sig, ptr, args = [], promising = false) => {\n assert(!promising, \"async dynCall is not supported in this mode\");\n assert(getWasmTableEntry(ptr), `missing table entry in dynCall: ${ptr}`);\n var func = getWasmTableEntry(ptr);\n var rtn = func(...args);\n function convert(rtn) {\n return rtn;\n }\n return convert(rtn);\n};\n\nvar stackSave = () => _emscripten_stack_get_current();\n\nvar stackRestore = val => __emscripten_stack_restore(val);\n\nvar createInvokeFunction = sig => (ptr, ...args) => {\n var sp = stackSave();\n try {\n return dynCall(sig, ptr, args);\n } catch (e) {\n stackRestore(sp);\n // Create a try-catch guard that rethrows the Emscripten EH exception.\n // Exceptions thrown from C++ will be a pointer (number) and longjmp\n // will throw the number Infinity. Use the compact and fast \"e !== e+0\"\n // test to check if e was not a Number.\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n // In theory this if statement could be done on\n // creating the function, but I just added this to\n // save wasting code space as it only happens on exception.\n if (sig[0] == \"j\") return 0n;\n }\n};\n\nvar resolveGlobalSymbol = (symName, direct = false) => {\n var sym;\n if (isSymbolDefined(symName)) {\n sym = wasmImports[symName];\n } else if (symName.startsWith(\"invoke_\")) {\n // Create (and cache) new invoke_ functions on demand.\n sym = wasmImports[symName] = createInvokeFunction(symName.split(\"_\")[1]);\n }\n return {\n sym,\n name: symName\n };\n};\n\nvar onPostCtors = [];\n\nvar addOnPostCtor = cb => onPostCtors.push(cb);\n\n/**\n * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the\n * emscripten HEAP, returns a copy of that string as a Javascript String object.\n *\n * @param {number} ptr\n * @param {number=} maxBytesToRead - An optional length that specifies the\n * maximum number of bytes to read. You can omit this parameter to scan the\n * string until the first 0 byte. If maxBytesToRead is passed, and the string\n * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the\n * string will cut short at that byte index.\n * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.\n * @return {string}\n */ var UTF8ToString = (ptr, maxBytesToRead, ignoreNul) => {\n assert(typeof ptr == \"number\", `UTF8ToString expects a number (got ${typeof ptr})`);\n return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : \"\";\n};\n\n/**\n * @param {string=} libName\n * @param {Object=} localScope\n * @param {number=} handle\n */ var loadWebAssemblyModule = (binary, flags, libName, localScope, handle) => {\n var metadata = getDylinkMetadata(binary);\n // loadModule loads the wasm module after all its dependencies have been loaded.\n // can be called both sync/async.\n function loadModule() {\n var originalTable = wasmTable;\n // alignments are powers of 2\n var memAlign = Math.pow(2, metadata.memoryAlign);\n // prepare memory\n var memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0;\n // TODO: add to cleanups\n var tableBase = metadata.tableSize ? wasmTable.length : 0;\n if (handle) {\n HEAP8[SAFE_HEAP_INDEX(HEAP8, (handle) + (8), \"storing\")] = 1;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (12)) >> 2), \"storing\")] = memoryBase;\n HEAP32[SAFE_HEAP_INDEX(HEAP32, (((handle) + (16)) >> 2), \"storing\")] = metadata.memorySize;\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (20)) >> 2), \"storing\")] = tableBase;\n HEAP32[SAFE_HEAP_INDEX(HEAP32, (((handle) + (24)) >> 2), \"storing\")] = metadata.tableSize;\n }\n if (metadata.tableSize) {\n assert(wasmTable.length == tableBase, `unexpected table size while loading ${libName}: ${wasmTable.length}`);\n wasmTable.grow(metadata.tableSize);\n }\n // This is the export map that we ultimately return. We declare it here\n // so it can be used within resolveSymbol. We resolve symbols against\n // this local symbol map in the case there they are not present on the\n // global Module object. We need this fallback because Modules sometime\n // need to import their own symbols\n var moduleExports;\n function resolveSymbol(sym) {\n var resolved = resolveGlobalSymbol(sym).sym;\n if (!resolved && localScope) {\n resolved = localScope[sym];\n }\n if (!resolved) {\n resolved = moduleExports[sym];\n }\n assert(resolved, `undefined symbol '${sym}'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment`);\n return resolved;\n }\n // TODO kill \u2193\u2193\u2193 (except \"symbols local to this module\", it will likely be\n // not needed if we require that if A wants symbols from B it has to link\n // to B explicitly: similarly to -Wl,--no-undefined)\n // wasm dynamic libraries are pure wasm, so they cannot assist in\n // their own loading. When side module A wants to import something\n // provided by a side module B that is loaded later, we need to\n // add a layer of indirection, but worse, we can't even tell what\n // to add the indirection for, without inspecting what A's imports\n // are. To do that here, we use a JS proxy (another option would\n // be to inspect the binary directly).\n var proxyHandler = {\n get(stubs, prop) {\n // symbols that should be local to this module\n switch (prop) {\n case \"__memory_base\":\n return memoryBase;\n\n case \"__table_base\":\n return tableBase;\n }\n if (prop in wasmImports && !wasmImports[prop].stub) {\n // No stub needed, symbol already exists in symbol table\n var res = wasmImports[prop];\n return res;\n }\n // Return a stub function that will resolve the symbol\n // when first called.\n if (!(prop in stubs)) {\n var resolved;\n stubs[prop] = (...args) => {\n resolved ||= resolveSymbol(prop);\n return resolved(...args);\n };\n }\n return stubs[prop];\n }\n };\n var proxy = new Proxy({}, proxyHandler);\n currentModuleWeakSymbols = metadata.weakImports;\n var info = {\n \"GOT.mem\": new Proxy({}, GOTHandler),\n \"GOT.func\": new Proxy({}, GOTHandler),\n \"env\": proxy,\n \"wasi_snapshot_preview1\": proxy\n };\n function postInstantiation(module, instance) {\n // the table should be unchanged\n assert(wasmTable === originalTable);\n // add new entries to functionsInTableMap\n updateTableMap(tableBase, metadata.tableSize);\n moduleExports = relocateExports(instance.exports, memoryBase);\n if (!flags.allowUndefined) {\n reportUndefinedSymbols();\n }\n function addEmAsm(addr, body) {\n var args = [];\n var arity = 0;\n for (;arity < 16; arity++) {\n if (body.indexOf(\"$\" + arity) != -1) {\n args.push(\"$\" + arity);\n } else {\n break;\n }\n }\n args = args.join(\",\");\n var func = `(${args}) => { ${body} };`;\n ASM_CONSTS[start] = eval(func);\n }\n // Add any EM_ASM function that exist in the side module\n if (\"__start_em_asm\" in moduleExports) {\n var start = moduleExports[\"__start_em_asm\"];\n var stop = moduleExports[\"__stop_em_asm\"];\n while (start < stop) {\n var jsString = UTF8ToString(start);\n addEmAsm(start, jsString);\n start = HEAPU8.indexOf(0, start) + 1;\n }\n }\n function addEmJs(name, cSig, body) {\n // The signature here is a C signature (e.g. \"(int foo, char* bar)\").\n // See `create_em_js` in emcc.py` for the build-time version of this\n // code.\n var jsArgs = [];\n cSig = cSig.slice(1, -1);\n if (cSig != \"void\") {\n cSig = cSig.split(\",\");\n for (var i in cSig) {\n var jsArg = cSig[i].split(\" \").pop();\n jsArgs.push(jsArg.replace(\"*\", \"\"));\n }\n }\n var func = `(${jsArgs}) => ${body};`;\n moduleExports[name] = eval(func);\n }\n for (var name in moduleExports) {\n if (name.startsWith(\"__em_js__\")) {\n var start = moduleExports[name];\n var jsString = UTF8ToString(start);\n // EM_JS strings are stored in the data section in the form\n // SIG<::>BODY.\n var parts = jsString.split(\"<::>\");\n addEmJs(name.replace(\"__em_js__\", \"\"), parts[0], parts[1]);\n delete moduleExports[name];\n }\n }\n // initialize the module\n var applyRelocs = moduleExports[\"__wasm_apply_data_relocs\"];\n if (applyRelocs) {\n if (runtimeInitialized) {\n applyRelocs();\n } else {\n __RELOC_FUNCS__.push(applyRelocs);\n }\n }\n var init = moduleExports[\"__wasm_call_ctors\"];\n if (init) {\n if (runtimeInitialized) {\n init();\n } else {\n // we aren't ready to run compiled code yet\n addOnPostCtor(init);\n }\n }\n return moduleExports;\n }\n if (flags.loadAsync) {\n return (async () => {\n var instance;\n if (binary instanceof WebAssembly.Module) {\n instance = await WebAssembly.instantiate(binary, info);\n } else {\n // Destructuring assignment without declaration has to be wrapped\n // with parens or parser will treat the l-value as an object\n // literal instead.\n (({module: binary, instance} = await WebAssembly.instantiate(binary, info)));\n }\n return postInstantiation(binary, instance);\n })();\n }\n var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary);\n var instance = new WebAssembly.Instance(module, info);\n return postInstantiation(module, instance);\n }\n // We need to set rpath in flags based on the current library's rpath.\n // We can't mutate flags or else if a depends on b and c and b depends on d,\n // then c will be loaded with b's rpath instead of a's.\n flags = {\n ...flags,\n rpath: {\n parentLibPath: libName,\n paths: metadata.runtimePaths\n }\n };\n // now load needed libraries and the module itself.\n if (flags.loadAsync) {\n return metadata.neededDynlibs.reduce((chain, dynNeeded) => chain.then(() => loadDynamicLibrary(dynNeeded, flags, localScope)), Promise.resolve()).then(loadModule);\n }\n metadata.neededDynlibs.forEach(needed => loadDynamicLibrary(needed, flags, localScope));\n return loadModule();\n};\n\nvar mergeLibSymbols = (exports, libName) => {\n // add symbols into global namespace TODO: weak linking etc.\n for (var [sym, exp] of Object.entries(exports)) {\n // When RTLD_GLOBAL is enabled, the symbols defined by this shared object\n // will be made available for symbol resolution of subsequently loaded\n // shared objects.\n // We should copy the symbols (which include methods and variables) from\n // SIDE_MODULE to MAIN_MODULE.\n const setImport = target => {\n if (!isSymbolDefined(target)) {\n wasmImports[target] = exp;\n }\n };\n setImport(sym);\n // Special case for handling of main symbol: If a side module exports\n // `main` that also acts a definition for `__main_argc_argv` and vice\n // versa.\n const main_alias = \"__main_argc_argv\";\n if (sym == \"main\") {\n setImport(main_alias);\n }\n if (sym == main_alias) {\n setImport(\"main\");\n }\n }\n};\n\nvar asyncLoad = async url => {\n var arrayBuffer = await readAsync(url);\n assert(arrayBuffer, `Loading data file \"${url}\" failed (no arrayBuffer).`);\n return new Uint8Array(arrayBuffer);\n};\n\n/**\n * @param {number=} handle\n * @param {Object=} localScope\n */ function loadDynamicLibrary(libName, flags = {\n global: true,\n nodelete: true\n}, localScope, handle) {\n // when loadDynamicLibrary did not have flags, libraries were loaded\n // globally & permanently\n var dso = LDSO.loadedLibsByName[libName];\n if (dso) {\n // the library is being loaded or has been loaded already.\n assert(dso.exports !== \"loading\", `Attempt to load '${libName}' twice before the first load completed`);\n if (!flags.global) {\n if (localScope) {\n Object.assign(localScope, dso.exports);\n }\n } else if (!dso.global) {\n // The library was previously loaded only locally but not\n // we have a request with global=true.\n dso.global = true;\n mergeLibSymbols(dso.exports, libName);\n }\n // same for \"nodelete\"\n if (flags.nodelete && dso.refcount !== Infinity) {\n dso.refcount = Infinity;\n }\n dso.refcount++;\n if (handle) {\n LDSO.loadedLibsByHandle[handle] = dso;\n }\n return flags.loadAsync ? Promise.resolve(true) : true;\n }\n // allocate new DSO\n dso = newDSO(libName, handle, \"loading\");\n dso.refcount = flags.nodelete ? Infinity : 1;\n dso.global = flags.global;\n // libName -> libData\n function loadLibData() {\n // for wasm, we can use fetch for async, but for fs mode we can only imitate it\n if (handle) {\n var data = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (28)) >> 2), \"loading\")];\n var dataSize = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((handle) + (32)) >> 2), \"loading\")];\n if (data && dataSize) {\n var libData = HEAP8.slice(data, data + dataSize);\n return flags.loadAsync ? Promise.resolve(libData) : libData;\n }\n }\n var libFile = locateFile(libName);\n if (flags.loadAsync) {\n return asyncLoad(libFile);\n }\n // load the binary synchronously\n if (!readBinary) {\n throw new Error(`${libFile}: file not found, and synchronous loading of external files is not available`);\n }\n return readBinary(libFile);\n }\n // libName -> exports\n function getExports() {\n // module not preloaded - load lib data and create new module from it\n if (flags.loadAsync) {\n return loadLibData().then(libData => loadWebAssemblyModule(libData, flags, libName, localScope, handle));\n }\n return loadWebAssemblyModule(loadLibData(), flags, libName, localScope, handle);\n }\n // module for lib is loaded - update the dso & global namespace\n function moduleLoaded(exports) {\n if (dso.global) {\n mergeLibSymbols(exports, libName);\n } else if (localScope) {\n Object.assign(localScope, exports);\n }\n dso.exports = exports;\n }\n if (flags.loadAsync) {\n return getExports().then(exports => {\n moduleLoaded(exports);\n return true;\n });\n }\n moduleLoaded(getExports());\n return true;\n}\n\nvar reportUndefinedSymbols = () => {\n for (var [symName, entry] of Object.entries(GOT)) {\n if (entry.value == 0) {\n var value = resolveGlobalSymbol(symName, true).sym;\n if (!value && !entry.required) {\n // Ignore undefined symbols that are imported as weak.\n continue;\n }\n assert(value, `undefined symbol '${symName}'. perhaps a side module was not linked in? if this global was expected to arrive from a system library, try to build the MAIN_MODULE with EMCC_FORCE_STDLIBS=1 in the environment`);\n if (typeof value == \"function\") {\n /** @suppress {checkTypes} */ entry.value = addFunction(value, value.sig);\n } else if (typeof value == \"number\") {\n entry.value = value;\n } else {\n throw new Error(`bad export type for '${symName}': ${typeof value}`);\n }\n }\n }\n};\n\nvar runDependencies = 0;\n\nvar dependenciesFulfilled = null;\n\nvar runDependencyTracking = {};\n\nvar runDependencyWatcher = null;\n\nvar removeRunDependency = id => {\n runDependencies--;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n assert(id, \"removeRunDependency requires an ID\");\n assert(runDependencyTracking[id]);\n delete runDependencyTracking[id];\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback();\n }\n }\n};\n\nvar addRunDependency = id => {\n runDependencies++;\n Module[\"monitorRunDependencies\"]?.(runDependencies);\n assert(id, \"addRunDependency requires an ID\");\n assert(!runDependencyTracking[id]);\n runDependencyTracking[id] = 1;\n if (runDependencyWatcher === null && typeof setInterval != \"undefined\") {\n // Check for missing dependencies every few seconds\n runDependencyWatcher = setInterval(() => {\n if (ABORT) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n return;\n }\n var shown = false;\n for (var dep in runDependencyTracking) {\n if (!shown) {\n shown = true;\n err(\"still waiting on run dependencies:\");\n }\n err(`dependency: ${dep}`);\n }\n if (shown) {\n err(\"(end of list)\");\n }\n }, 1e4);\n // Prevent this timer from keeping the runtime alive if nothing\n // else is.\n runDependencyWatcher.unref?.();\n }\n};\n\nvar loadDylibs = async () => {\n if (!dynamicLibraries.length) {\n reportUndefinedSymbols();\n return;\n }\n addRunDependency(\"loadDylibs\");\n // Load binaries asynchronously\n for (var lib of dynamicLibraries) {\n await loadDynamicLibrary(lib, {\n loadAsync: true,\n global: true,\n nodelete: true,\n allowUndefined: true\n });\n }\n // we got them all, wonderful\n reportUndefinedSymbols();\n removeRunDependency(\"loadDylibs\");\n};\n\nvar noExitRuntime = true;\n\nvar ptrToString = ptr => {\n assert(typeof ptr === \"number\");\n // Convert to 32-bit unsigned value\n ptr >>>= 0;\n return \"0x\" + ptr.toString(16).padStart(8, \"0\");\n};\n\n/**\n * @param {number} ptr\n * @param {number} value\n * @param {string} type\n */ function setValue(ptr, value, type = \"i8\") {\n if (type.endsWith(\"*\")) type = \"*\";\n switch (type) {\n case \"i1\":\n HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"storing\")] = value;\n break;\n\n case \"i8\":\n HEAP8[SAFE_HEAP_INDEX(HEAP8, ptr, \"storing\")] = value;\n break;\n\n case \"i16\":\n HEAP16[SAFE_HEAP_INDEX(HEAP16, ((ptr) >> 1), \"storing\")] = value;\n break;\n\n case \"i32\":\n HEAP32[SAFE_HEAP_INDEX(HEAP32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n case \"i64\":\n HEAP64[SAFE_HEAP_INDEX(HEAP64, ((ptr) >> 3), \"storing\")] = BigInt(value);\n break;\n\n case \"float\":\n HEAPF32[SAFE_HEAP_INDEX(HEAPF32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n case \"double\":\n HEAPF64[SAFE_HEAP_INDEX(HEAPF64, ((ptr) >> 3), \"storing\")] = value;\n break;\n\n case \"*\":\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((ptr) >> 2), \"storing\")] = value;\n break;\n\n default:\n abort(`invalid type for setValue: ${type}`);\n }\n}\n\nvar ___memory_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1024);\n\nvar ___stack_high = 81984;\n\nvar ___stack_low = 16448;\n\nvar ___stack_pointer = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": true\n}, 81984);\n\nvar ___table_base = new WebAssembly.Global({\n \"value\": \"i32\",\n \"mutable\": false\n}, 1);\n\nvar __emscripten_throw_longjmp = () => {\n throw Infinity;\n};\n\n__emscripten_throw_longjmp.sig = \"v\";\n\nvar getHeapMax = () => // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate\n// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side\n// for any code that deals with heap sizes, which would require special\n// casing all heap size related code to treat 0 specially.\n2147483648;\n\nvar growMemory = size => {\n var oldHeapSize = wasmMemory.buffer.byteLength;\n var pages = ((size - oldHeapSize + 65535) / 65536) | 0;\n try {\n // round size grow request up to wasm page size (fixed 64KB per spec)\n wasmMemory.grow(pages);\n // .grow() takes a delta compared to the previous size\n updateMemoryViews();\n return 1;\n } catch (e) {\n err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`);\n }\n};\n\nvar _emscripten_resize_heap = requestedSize => {\n var oldSize = HEAPU8.length;\n // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.\n requestedSize >>>= 0;\n // With multithreaded builds, races can happen (another thread might increase the size\n // in between), so return a failure, and let the caller retry.\n assert(requestedSize > oldSize);\n // Memory resize rules:\n // 1. Always increase heap size to at least the requested size, rounded up\n // to next page multiple.\n // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap\n // geometrically: increase the heap size according to\n // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most\n // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).\n // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap\n // linearly: increase the heap size by at least\n // MEMORY_GROWTH_LINEAR_STEP bytes.\n // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by\n // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest\n // 4. If we were unable to allocate as much memory, it may be due to\n // over-eager decision to excessively reserve due to (3) above.\n // Hence if an allocation fails, cut down on the amount of excess\n // growth, in an attempt to succeed to perform a smaller allocation.\n // A limit is set for how much we can grow. We should not exceed that\n // (the wasm binary specifies it, so if we tried, we'd fail anyhow).\n var maxHeapSize = getHeapMax();\n if (requestedSize > maxHeapSize) {\n err(`Cannot enlarge memory, requested ${requestedSize} bytes, but the limit is ${maxHeapSize} bytes!`);\n return false;\n }\n // Loop through potential heap size increases. If we attempt a too eager\n // reservation that fails, cut down on the attempted size and reserve a\n // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)\n for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n var overGrownHeapSize = oldSize * (1 + 0 / cutDown);\n // ensure geometric growth\n // but limit overreserving (default to capping at +96MB overgrowth at most)\n overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));\n var replacement = growMemory(newSize);\n if (replacement) {\n return true;\n }\n }\n err(`Failed to grow the heap from ${oldSize} bytes to ${newSize} bytes, not enough memory!`);\n return false;\n};\n\n_emscripten_resize_heap.sig = \"ip\";\n\nvar SYSCALLS = {\n varargs: undefined,\n getStr(ptr) {\n var ret = UTF8ToString(ptr);\n return ret;\n }\n};\n\nvar _fd_close = fd => {\n abort(\"fd_close called without SYSCALLS_REQUIRE_FILESYSTEM\");\n};\n\n_fd_close.sig = \"ii\";\n\nvar INT53_MAX = 9007199254740992;\n\nvar INT53_MIN = -9007199254740992;\n\nvar bigintToI53Checked = num => (num < INT53_MIN || num > INT53_MAX) ? NaN : Number(num);\n\nfunction _fd_seek(fd, offset, whence, newOffset) {\n offset = bigintToI53Checked(offset);\n return 70;\n}\n\n_fd_seek.sig = \"iijip\";\n\nvar printCharBuffers = [ null, [], [] ];\n\nvar printChar = (stream, curr) => {\n var buffer = printCharBuffers[stream];\n assert(buffer);\n if (curr === 0 || curr === 10) {\n (stream === 1 ? out : err)(UTF8ArrayToString(buffer));\n buffer.length = 0;\n } else {\n buffer.push(curr);\n }\n};\n\nvar flush_NO_FILESYSTEM = () => {\n // flush anything remaining in the buffers during shutdown\n _fflush(0);\n if (printCharBuffers[1].length) printChar(1, 10);\n if (printCharBuffers[2].length) printChar(2, 10);\n};\n\nvar _fd_write = (fd, iov, iovcnt, pnum) => {\n // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0\n var num = 0;\n for (var i = 0; i < iovcnt; i++) {\n var ptr = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((iov) >> 2), \"loading\")];\n var len = HEAPU32[SAFE_HEAP_INDEX(HEAPU32, (((iov) + (4)) >> 2), \"loading\")];\n iov += 8;\n for (var j = 0; j < len; j++) {\n printChar(fd, HEAPU8[SAFE_HEAP_INDEX(HEAPU8, ptr + j, \"loading\")]);\n }\n num += len;\n }\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((pnum) >> 2), \"storing\")] = num;\n return 0;\n};\n\n_fd_write.sig = \"iippp\";\n\nfunction _tree_sitter_log_callback(isLexMessage, messageAddress) {\n if (Module.currentLogCallback) {\n const message = UTF8ToString(messageAddress);\n Module.currentLogCallback(message, isLexMessage !== 0);\n }\n}\n\nfunction _tree_sitter_parse_callback(inputBufferAddress, maxCodeUnits, index, row, column, lengthAddress) {\n const source = Module.currentParseCallback;\n const isString = typeof source === \"string\";\n const chunk = isString ? source : source(index, {\n row,\n column\n });\n const offset = isString ? index : 0;\n const remaining = typeof chunk === \"string\" ? chunk.length - offset : 0;\n if (remaining <= 0) {\n HEAP32[SAFE_HEAP_INDEX(HEAP32, lengthAddress >>> 2, \"storing\")] = 0;\n return;\n }\n let count = remaining < maxCodeUnits ? remaining : maxCodeUnits;\n if (count < remaining && count > 1) {\n const last = chunk.charCodeAt(offset + count - 1);\n if (last >= 55296 && last <= 56319) count--;\n }\n const base = inputBufferAddress >>> 1;\n for (let i = 0; i < count; i++) {\n HEAPU16[SAFE_HEAP_INDEX(HEAPU16, base + i, \"storing\")] = chunk.charCodeAt(offset + i);\n }\n HEAP32[SAFE_HEAP_INDEX(HEAP32, lengthAddress >>> 2, \"storing\")] = count;\n}\n\nfunction _tree_sitter_progress_callback(currentOffset, hasError) {\n if (Module.currentProgressCallback) {\n return Module.currentProgressCallback({\n currentOffset,\n hasError: hasError !== 0\n }) === true;\n }\n return false;\n}\n\nvar runtimeKeepaliveCounter = 0;\n\nvar keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;\n\nvar _proc_exit = code => {\n EXITSTATUS = code;\n if (!keepRuntimeAlive()) {\n Module[\"onExit\"]?.(code);\n ABORT = true;\n }\n quit_(code, new ExitStatus(code));\n};\n\n_proc_exit.sig = \"vi\";\n\n/** @param {boolean|number=} implicit */ var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n checkUnflushedContent();\n // if exit() was called explicitly, warn the user if the runtime isn't actually being shut down\n if (keepRuntimeAlive() && !implicit) {\n var msg = `program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;\n readyPromiseReject?.(msg);\n err(msg);\n }\n _proc_exit(status);\n};\n\nvar handleException = e => {\n // Certain exception types we do not treat as errors since they are used for\n // internal control flow.\n // 1. ExitStatus, which is thrown by exit()\n // 2. \"unwind\", which is thrown by emscripten_unwind_to_js_event_loop() and others\n // that wish to return to JS event loop.\n if (e instanceof ExitStatus || e == \"unwind\") {\n return EXITSTATUS;\n }\n checkStackCookie();\n if (e instanceof WebAssembly.RuntimeError) {\n if (_emscripten_stack_get_current() <= 0) {\n err(\"Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)\");\n }\n }\n quit_(1, e);\n};\n\nvar lengthBytesUTF8 = str => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code\n // unit, not a Unicode code point of the character! So decode\n // UTF16->UTF32->UTF8.\n // See http://unicode.org/faq/utf_bom.html#utf16-3\n var c = str.charCodeAt(i);\n // possibly a lead surrogate\n if (c <= 127) {\n len++;\n } else if (c <= 2047) {\n len += 2;\n } else if (c >= 55296 && c <= 57343) {\n len += 4;\n ++i;\n } else {\n len += 3;\n }\n }\n return len;\n};\n\nvar stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {\n assert(typeof str === \"string\", `stringToUTF8Array expects a string (got ${typeof str})`);\n // Parameter maxBytesToWrite is not optional. Negative values, 0, null,\n // undefined and false each don't write out any bytes.\n if (!(maxBytesToWrite > 0)) return 0;\n var startIdx = outIdx;\n var endIdx = outIdx + maxBytesToWrite - 1;\n // -1 for string null terminator.\n for (var i = 0; i < str.length; ++i) {\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description\n // and https://www.ietf.org/rfc/rfc2279.txt\n // and https://tools.ietf.org/html/rfc3629\n var u = str.codePointAt(i);\n if (u <= 127) {\n if (outIdx >= endIdx) break;\n heap[outIdx++] = u;\n } else if (u <= 2047) {\n if (outIdx + 1 >= endIdx) break;\n heap[outIdx++] = 192 | (u >> 6);\n heap[outIdx++] = 128 | (u & 63);\n } else if (u <= 65535) {\n if (outIdx + 2 >= endIdx) break;\n heap[outIdx++] = 224 | (u >> 12);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n } else {\n if (outIdx + 3 >= endIdx) break;\n if (u > 1114111) warnOnce(\"Invalid Unicode code point \" + ptrToString(u) + \" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).\");\n heap[outIdx++] = 240 | (u >> 18);\n heap[outIdx++] = 128 | ((u >> 12) & 63);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.\n // We need to manually skip over the second code unit for correct iteration.\n i++;\n }\n }\n // Null-terminate the pointer to the buffer.\n heap[outIdx] = 0;\n return outIdx - startIdx;\n};\n\nvar stringToUTF8 = (str, outPtr, maxBytesToWrite) => {\n assert(typeof maxBytesToWrite == \"number\", \"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!\");\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n};\n\nvar stackAlloc = sz => __emscripten_stack_alloc(sz);\n\nvar stringToUTF8OnStack = str => {\n var size = lengthBytesUTF8(str) + 1;\n var ret = stackAlloc(size);\n stringToUTF8(str, ret, size);\n return ret;\n};\n\nvar AsciiToString = ptr => {\n var str = \"\";\n while (1) {\n var ch = HEAPU8[SAFE_HEAP_INDEX(HEAPU8, ptr++, \"loading\")];\n if (!ch) return str;\n str += String.fromCharCode(ch);\n }\n};\n\n// End JS library code\n// include: postlibrary.js\n// This file is included after the automatically-generated JS library code\n// but before the wasm module is created.\n{\n // With WASM_ESM_INTEGRATION this has to happen at the top level and not\n // delayed until processModuleArgs.\n initMemory();\n // Begin ATMODULES hooks\n if (Module[\"noExitRuntime\"]) noExitRuntime = Module[\"noExitRuntime\"];\n if (Module[\"print\"]) out = Module[\"print\"];\n if (Module[\"printErr\"]) err = Module[\"printErr\"];\n if (Module[\"dynamicLibraries\"]) dynamicLibraries = Module[\"dynamicLibraries\"];\n if (Module[\"wasmBinary\"]) wasmBinary = Module[\"wasmBinary\"];\n Module[\"FS_createDataFile\"] = FS.createDataFile;\n Module[\"FS_createPreloadedFile\"] = FS.createPreloadedFile;\n // End ATMODULES hooks\n checkIncomingModuleAPI();\n if (Module[\"arguments\"]) arguments_ = Module[\"arguments\"];\n if (Module[\"thisProgram\"]) thisProgram = Module[\"thisProgram\"];\n // Assertions on removed incoming Module JS APIs.\n assert(typeof Module[\"memoryInitializerPrefixURL\"] == \"undefined\", \"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"pthreadMainPrefixURL\"] == \"undefined\", \"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"cdInitializerPrefixURL\"] == \"undefined\", \"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"filePackagePrefixURL\"] == \"undefined\", \"Module.filePackagePrefixURL option was removed, use Module.locateFile instead\");\n assert(typeof Module[\"read\"] == \"undefined\", \"Module.read option was removed\");\n assert(typeof Module[\"readAsync\"] == \"undefined\", \"Module.readAsync option was removed (modify readAsync in JS)\");\n assert(typeof Module[\"readBinary\"] == \"undefined\", \"Module.readBinary option was removed (modify readBinary in JS)\");\n assert(typeof Module[\"setWindowTitle\"] == \"undefined\", \"Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)\");\n assert(typeof Module[\"TOTAL_MEMORY\"] == \"undefined\", \"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY\");\n assert(typeof Module[\"ENVIRONMENT\"] == \"undefined\", \"Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)\");\n assert(typeof Module[\"STACK_SIZE\"] == \"undefined\", \"STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time\");\n if (Module[\"preInit\"]) {\n if (typeof Module[\"preInit\"] == \"function\") Module[\"preInit\"] = [ Module[\"preInit\"] ];\n while (Module[\"preInit\"].length > 0) {\n Module[\"preInit\"].shift()();\n }\n }\n consumedModuleProp(\"preInit\");\n}\n\n// Begin runtime exports\nModule[\"UTF8ToString\"] = UTF8ToString;\n\nModule[\"stringToUTF8\"] = stringToUTF8;\n\nModule[\"lengthBytesUTF8\"] = lengthBytesUTF8;\n\nModule[\"AsciiToString\"] = AsciiToString;\n\nModule[\"loadWebAssemblyModule\"] = loadWebAssemblyModule;\n\nvar missingLibrarySymbols = [ \"writeI53ToI64\", \"writeI53ToI64Clamped\", \"writeI53ToI64Signaling\", \"writeI53ToU64Clamped\", \"writeI53ToU64Signaling\", \"readI53FromI64\", \"readI53FromU64\", \"convertI32PairToI53\", \"convertI32PairToI53Checked\", \"convertU32PairToI53\", \"getTempRet0\", \"setTempRet0\", \"zeroMemory\", \"withStackSave\", \"strError\", \"inetPton4\", \"inetNtop4\", \"inetPton6\", \"inetNtop6\", \"readSockaddr\", \"writeSockaddr\", \"readEmAsmArgs\", \"runEmAsmFunction\", \"runMainThreadEmAsm\", \"jstoi_q\", \"getExecutableName\", \"autoResumeAudioContext\", \"getDynCaller\", \"runtimeKeepalivePush\", \"runtimeKeepalivePop\", \"callUserCallback\", \"maybeExit\", \"asmjsMangle\", \"mmapAlloc\", \"HandleAllocator\", \"getNativeTypeSize\", \"getUniqueRunDependency\", \"addOnInit\", \"addOnPreMain\", \"addOnExit\", \"STACK_SIZE\", \"STACK_ALIGN\", \"POINTER_SIZE\", \"ASSERTIONS\", \"ccall\", \"cwrap\", \"removeFunction\", \"intArrayFromString\", \"intArrayToString\", \"stringToAscii\", \"UTF16ToString\", \"stringToUTF16\", \"lengthBytesUTF16\", \"UTF32ToString\", \"stringToUTF32\", \"lengthBytesUTF32\", \"stringToNewUTF8\", \"writeArrayToMemory\", \"registerKeyEventCallback\", \"maybeCStringToJsString\", \"findEventTarget\", \"getBoundingClientRect\", \"fillMouseEventData\", \"registerMouseEventCallback\", \"registerWheelEventCallback\", \"registerUiEventCallback\", \"registerFocusEventCallback\", \"fillDeviceOrientationEventData\", \"registerDeviceOrientationEventCallback\", \"fillDeviceMotionEventData\", \"registerDeviceMotionEventCallback\", \"screenOrientation\", \"fillOrientationChangeEventData\", \"registerOrientationChangeEventCallback\", \"fillFullscreenChangeEventData\", \"registerFullscreenChangeEventCallback\", \"JSEvents_requestFullscreen\", \"JSEvents_resizeCanvasForFullscreen\", \"registerRestoreOldStyle\", \"hideEverythingExceptGivenElement\", \"restoreHiddenElements\", \"setLetterbox\", \"softFullscreenResizeWebGLRenderTarget\", \"doRequestFullscreen\", \"fillPointerlockChangeEventData\", \"registerPointerlockChangeEventCallback\", \"registerPointerlockErrorEventCallback\", \"requestPointerLock\", \"fillVisibilityChangeEventData\", \"registerVisibilityChangeEventCallback\", \"registerTouchEventCallback\", \"fillGamepadEventData\", \"registerGamepadEventCallback\", \"registerBeforeUnloadEventCallback\", \"fillBatteryEventData\", \"registerBatteryEventCallback\", \"setCanvasElementSize\", \"getCanvasElementSize\", \"jsStackTrace\", \"getCallstack\", \"convertPCtoSourceLocation\", \"getEnvStrings\", \"checkWasiClock\", \"wasiRightsToMuslOFlags\", \"wasiOFlagsToMuslOFlags\", \"initRandomFill\", \"randomFill\", \"safeSetTimeout\", \"setImmediateWrapped\", \"safeRequestAnimationFrame\", \"clearImmediateWrapped\", \"registerPostMainLoop\", \"registerPreMainLoop\", \"getPromise\", \"makePromise\", \"idsToPromises\", \"makePromiseCallback\", \"Browser_asyncPrepareDataCounter\", \"isLeapYear\", \"ydayFromDate\", \"arraySum\", \"addDays\", \"getSocketFromFD\", \"getSocketAddress\", \"dlopenInternal\", \"heapObjectForWebGLType\", \"toTypedArrayIndex\", \"webgl_enable_ANGLE_instanced_arrays\", \"webgl_enable_OES_vertex_array_object\", \"webgl_enable_WEBGL_draw_buffers\", \"webgl_enable_WEBGL_multi_draw\", \"webgl_enable_EXT_polygon_offset_clamp\", \"webgl_enable_EXT_clip_control\", \"webgl_enable_WEBGL_polygon_mode\", \"emscriptenWebGLGet\", \"computeUnpackAlignedImageSize\", \"colorChannelsInGlTextureFormat\", \"emscriptenWebGLGetTexPixelData\", \"emscriptenWebGLGetUniform\", \"webglGetUniformLocation\", \"webglPrepareUniformLocationsBeforeFirstUse\", \"webglGetLeftBracePos\", \"emscriptenWebGLGetVertexAttrib\", \"__glGetActiveAttribOrUniform\", \"writeGLArray\", \"registerWebGlEventCallback\", \"runAndAbortIfError\", \"ALLOC_NORMAL\", \"ALLOC_STACK\", \"allocate\", \"writeStringToMemory\", \"writeAsciiToMemory\", \"demangle\", \"stackTrace\" ];\n\nmissingLibrarySymbols.forEach(missingLibrarySymbol);\n\nvar unexportedSymbols = [ \"run\", \"out\", \"err\", \"callMain\", \"abort\", \"wasmMemory\", \"wasmExports\", \"HEAPF32\", \"HEAPF64\", \"HEAP8\", \"HEAPU8\", \"HEAP16\", \"HEAP64\", \"HEAPU64\", \"writeStackCookie\", \"checkStackCookie\", \"INT53_MAX\", \"INT53_MIN\", \"bigintToI53Checked\", \"stackSave\", \"stackRestore\", \"stackAlloc\", \"ptrToString\", \"exitJS\", \"getHeapMax\", \"growMemory\", \"ENV\", \"ERRNO_CODES\", \"DNS\", \"Protocols\", \"Sockets\", \"timers\", \"warnOnce\", \"readEmAsmArgsArray\", \"dynCall\", \"handleException\", \"keepRuntimeAlive\", \"asyncLoad\", \"alignMemory\", \"wasmTable\", \"noExitRuntime\", \"addRunDependency\", \"removeRunDependency\", \"addOnPreRun\", \"addOnPostCtor\", \"addOnPostRun\", \"convertJsFunctionToWasm\", \"freeTableIndexes\", \"functionsInTableMap\", \"getEmptyTableSlot\", \"updateTableMap\", \"getFunctionAddress\", \"addFunction\", \"setValue\", \"getValue\", \"PATH\", \"PATH_FS\", \"UTF8Decoder\", \"UTF8ArrayToString\", \"stringToUTF8Array\", \"UTF16Decoder\", \"stringToUTF8OnStack\", \"JSEvents\", \"specialHTMLTargets\", \"findCanvasEventTarget\", \"currentFullscreenStrategy\", \"restoreOldWindowedStyle\", \"UNWIND_CACHE\", \"ExitStatus\", \"flush_NO_FILESYSTEM\", \"emSetImmediate\", \"emClearImmediate_deps\", \"emClearImmediate\", \"promiseMap\", \"Browser\", \"requestFullscreen\", \"requestFullScreen\", \"setCanvasSize\", \"getUserMedia\", \"createContext\", \"getPreloadedImageData__data\", \"wget\", \"MONTH_DAYS_REGULAR\", \"MONTH_DAYS_LEAP\", \"MONTH_DAYS_REGULAR_CUMULATIVE\", \"MONTH_DAYS_LEAP_CUMULATIVE\", \"SYSCALLS\", \"isSymbolDefined\", \"GOT\", \"currentModuleWeakSymbols\", \"LDSO\", \"getMemory\", \"mergeLibSymbols\", \"newDSO\", \"loadDynamicLibrary\", \"tempFixedLengthArray\", \"miniTempWebGLFloatBuffers\", \"miniTempWebGLIntBuffers\", \"GL\", \"AL\", \"GLUT\", \"EGL\", \"GLEW\", \"IDBStore\", \"SDL\", \"SDL_gfx\", \"allocateUTF8\", \"allocateUTF8OnStack\", \"print\", \"printErr\", \"jstoi_s\" ];\n\nunexportedSymbols.forEach(unexportedRuntimeSymbol);\n\n// End runtime exports\n// Begin JS library exports\n// End JS library exports\n// end include: postlibrary.js\nfunction checkIncomingModuleAPI() {\n ignoredModuleProp(\"fetchSettings\");\n}\n\nvar ASM_CONSTS = {};\n\n// Imports from the Wasm binary.\nvar _malloc = Module[\"_malloc\"] = makeInvalidEarlyAccess(\"_malloc\");\n\nvar _calloc = Module[\"_calloc\"] = makeInvalidEarlyAccess(\"_calloc\");\n\nvar _realloc = Module[\"_realloc\"] = makeInvalidEarlyAccess(\"_realloc\");\n\nvar _free = Module[\"_free\"] = makeInvalidEarlyAccess(\"_free\");\n\nvar _ts_language_symbol_count = Module[\"_ts_language_symbol_count\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_count\");\n\nvar _ts_language_state_count = Module[\"_ts_language_state_count\"] = makeInvalidEarlyAccess(\"_ts_language_state_count\");\n\nvar _ts_language_abi_version = Module[\"_ts_language_abi_version\"] = makeInvalidEarlyAccess(\"_ts_language_abi_version\");\n\nvar _ts_language_name = Module[\"_ts_language_name\"] = makeInvalidEarlyAccess(\"_ts_language_name\");\n\nvar _ts_language_field_count = Module[\"_ts_language_field_count\"] = makeInvalidEarlyAccess(\"_ts_language_field_count\");\n\nvar _ts_language_symbol_name = Module[\"_ts_language_symbol_name\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_name\");\n\nvar _ts_language_symbol_for_name = Module[\"_ts_language_symbol_for_name\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_for_name\");\n\nvar _strncmp = Module[\"_strncmp\"] = makeInvalidEarlyAccess(\"_strncmp\");\n\nvar _ts_language_symbol_type = Module[\"_ts_language_symbol_type\"] = makeInvalidEarlyAccess(\"_ts_language_symbol_type\");\n\nvar _ts_language_field_name_for_id = Module[\"_ts_language_field_name_for_id\"] = makeInvalidEarlyAccess(\"_ts_language_field_name_for_id\");\n\nvar _memcmp = Module[\"_memcmp\"] = makeInvalidEarlyAccess(\"_memcmp\");\n\nvar _ts_parser_delete = Module[\"_ts_parser_delete\"] = makeInvalidEarlyAccess(\"_ts_parser_delete\");\n\nvar _ts_parser_set_language = Module[\"_ts_parser_set_language\"] = makeInvalidEarlyAccess(\"_ts_parser_set_language\");\n\nvar _ts_parser_reset = Module[\"_ts_parser_reset\"] = makeInvalidEarlyAccess(\"_ts_parser_reset\");\n\nvar _ts_tree_cursor_current_descendant_index = Module[\"_ts_tree_cursor_current_descendant_index\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_descendant_index\");\n\nvar _ts_tree_cursor_current_depth = Module[\"_ts_tree_cursor_current_depth\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_depth\");\n\nvar _ts_tree_copy = Module[\"_ts_tree_copy\"] = makeInvalidEarlyAccess(\"_ts_tree_copy\");\n\nvar _ts_tree_delete = Module[\"_ts_tree_delete\"] = makeInvalidEarlyAccess(\"_ts_tree_delete\");\n\nvar _ts_init = Module[\"_ts_init\"] = makeInvalidEarlyAccess(\"_ts_init\");\n\nvar _ts_free_wasm = Module[\"_ts_free_wasm\"] = makeInvalidEarlyAccess(\"_ts_free_wasm\");\n\nvar _ts_scanner_malloc_wasm = Module[\"_ts_scanner_malloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_malloc_wasm\");\n\nvar _ts_scanner_calloc_wasm = Module[\"_ts_scanner_calloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_calloc_wasm\");\n\nvar _ts_scanner_realloc_wasm = Module[\"_ts_scanner_realloc_wasm\"] = makeInvalidEarlyAccess(\"_ts_scanner_realloc_wasm\");\n\nvar _ts_parser_new_wasm = Module[\"_ts_parser_new_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_new_wasm\");\n\nvar _ts_parser_enable_logger_wasm = Module[\"_ts_parser_enable_logger_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_enable_logger_wasm\");\n\nvar _ts_parser_parse_wasm = Module[\"_ts_parser_parse_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_parse_wasm\");\n\nvar _ts_parser_parse_limited_wasm = Module[\"_ts_parser_parse_limited_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_parse_limited_wasm\");\n\nvar _ts_parser_last_parse_operations_wasm = Module[\"_ts_parser_last_parse_operations_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_last_parse_operations_wasm\");\n\nvar _ts_parser_abort_limited_wasm = Module[\"_ts_parser_abort_limited_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_abort_limited_wasm\");\n\nvar _ts_parser_included_ranges_wasm = Module[\"_ts_parser_included_ranges_wasm\"] = makeInvalidEarlyAccess(\"_ts_parser_included_ranges_wasm\");\n\nvar _ts_language_type_is_named_wasm = Module[\"_ts_language_type_is_named_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_type_is_named_wasm\");\n\nvar _ts_language_type_is_visible_wasm = Module[\"_ts_language_type_is_visible_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_type_is_visible_wasm\");\n\nvar _ts_language_metadata_wasm = Module[\"_ts_language_metadata_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_metadata_wasm\");\n\nvar _ts_language_supertypes_wasm = Module[\"_ts_language_supertypes_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_supertypes_wasm\");\n\nvar _ts_language_subtypes_wasm = Module[\"_ts_language_subtypes_wasm\"] = makeInvalidEarlyAccess(\"_ts_language_subtypes_wasm\");\n\nvar _ts_tree_root_node_wasm = Module[\"_ts_tree_root_node_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_root_node_wasm\");\n\nvar _ts_tree_root_node_with_offset_wasm = Module[\"_ts_tree_root_node_with_offset_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_root_node_with_offset_wasm\");\n\nvar _ts_tree_included_ranges_wasm = Module[\"_ts_tree_included_ranges_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_included_ranges_wasm\");\n\nvar _ts_tree_cursor_new_wasm = Module[\"_ts_tree_cursor_new_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_new_wasm\");\n\nvar _ts_tree_cursor_copy_wasm = Module[\"_ts_tree_cursor_copy_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_copy_wasm\");\n\nvar _ts_tree_cursor_delete_wasm = Module[\"_ts_tree_cursor_delete_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_delete_wasm\");\n\nvar _ts_tree_cursor_reset_wasm = Module[\"_ts_tree_cursor_reset_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_reset_wasm\");\n\nvar _ts_tree_cursor_reset_to_wasm = Module[\"_ts_tree_cursor_reset_to_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_reset_to_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_wasm = Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_wasm\");\n\nvar _ts_tree_cursor_goto_last_child_wasm = Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_last_child_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_for_index_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_for_index_wasm\");\n\nvar _ts_tree_cursor_goto_first_child_for_position_wasm = Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_first_child_for_position_wasm\");\n\nvar _ts_tree_cursor_goto_next_sibling_wasm = Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_next_sibling_wasm\");\n\nvar _ts_tree_cursor_goto_previous_sibling_wasm = Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_previous_sibling_wasm\");\n\nvar _ts_tree_cursor_goto_descendant_wasm = Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_descendant_wasm\");\n\nvar _ts_tree_cursor_goto_parent_wasm = Module[\"_ts_tree_cursor_goto_parent_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_goto_parent_wasm\");\n\nvar _ts_tree_cursor_current_node_id_wasm = Module[\"_ts_tree_cursor_current_node_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_node_id_wasm\");\n\nvar _ts_tree_cursor_start_position_wasm = Module[\"_ts_tree_cursor_start_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_start_position_wasm\");\n\nvar _ts_tree_cursor_end_position_wasm = Module[\"_ts_tree_cursor_end_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_end_position_wasm\");\n\nvar _ts_tree_cursor_current_node_wasm = Module[\"_ts_tree_cursor_current_node_wasm\"] = makeInvalidEarlyAccess(\"_ts_tree_cursor_current_node_wasm\");\n\nvar _ts_node_field_name_for_child_wasm = Module[\"_ts_node_field_name_for_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_field_name_for_child_wasm\");\n\nvar _ts_node_field_name_for_named_child_wasm = Module[\"_ts_node_field_name_for_named_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_field_name_for_named_child_wasm\");\n\nvar _ts_node_children_by_field_id_wasm = Module[\"_ts_node_children_by_field_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_children_by_field_id_wasm\");\n\nvar _ts_node_first_child_for_byte_wasm = Module[\"_ts_node_first_child_for_byte_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_first_child_for_byte_wasm\");\n\nvar _ts_node_first_named_child_for_byte_wasm = Module[\"_ts_node_first_named_child_for_byte_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_first_named_child_for_byte_wasm\");\n\nvar _ts_node_grammar_symbol_wasm = Module[\"_ts_node_grammar_symbol_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_grammar_symbol_wasm\");\n\nvar _ts_node_child_count_wasm = Module[\"_ts_node_child_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_count_wasm\");\n\nvar _ts_node_named_child_count_wasm = Module[\"_ts_node_named_child_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_child_count_wasm\");\n\nvar _ts_node_child_wasm = Module[\"_ts_node_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_wasm\");\n\nvar _ts_node_named_child_wasm = Module[\"_ts_node_named_child_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_child_wasm\");\n\nvar _ts_node_child_by_field_id_wasm = Module[\"_ts_node_child_by_field_id_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_by_field_id_wasm\");\n\nvar _ts_node_next_sibling_wasm = Module[\"_ts_node_next_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_next_sibling_wasm\");\n\nvar _ts_node_prev_sibling_wasm = Module[\"_ts_node_prev_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_prev_sibling_wasm\");\n\nvar _ts_node_next_named_sibling_wasm = Module[\"_ts_node_next_named_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_next_named_sibling_wasm\");\n\nvar _ts_node_prev_named_sibling_wasm = Module[\"_ts_node_prev_named_sibling_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_prev_named_sibling_wasm\");\n\nvar _ts_node_descendant_count_wasm = Module[\"_ts_node_descendant_count_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_count_wasm\");\n\nvar _ts_node_parent_wasm = Module[\"_ts_node_parent_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_parent_wasm\");\n\nvar _ts_node_child_with_descendant_wasm = Module[\"_ts_node_child_with_descendant_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_child_with_descendant_wasm\");\n\nvar _ts_node_descendant_for_index_wasm = Module[\"_ts_node_descendant_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_for_index_wasm\");\n\nvar _ts_node_named_descendant_for_index_wasm = Module[\"_ts_node_named_descendant_for_index_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_descendant_for_index_wasm\");\n\nvar _ts_node_descendant_for_position_wasm = Module[\"_ts_node_descendant_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendant_for_position_wasm\");\n\nvar _ts_node_named_descendant_for_position_wasm = Module[\"_ts_node_named_descendant_for_position_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_descendant_for_position_wasm\");\n\nvar _ts_node_to_string_wasm = Module[\"_ts_node_to_string_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_to_string_wasm\");\n\nvar _ts_node_children_wasm = Module[\"_ts_node_children_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_children_wasm\");\n\nvar _ts_node_named_children_wasm = Module[\"_ts_node_named_children_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_named_children_wasm\");\n\nvar _ts_node_descendants_of_type_wasm = Module[\"_ts_node_descendants_of_type_wasm\"] = makeInvalidEarlyAccess(\"_ts_node_descendants_of_type_wasm\");\n\nvar _memcpy = Module[\"_memcpy\"] = makeInvalidEarlyAccess(\"_memcpy\");\n\nvar _memmove = Module[\"_memmove\"] = makeInvalidEarlyAccess(\"_memmove\");\n\nvar _memset = Module[\"_memset\"] = makeInvalidEarlyAccess(\"_memset\");\n\nvar _fflush = makeInvalidEarlyAccess(\"_fflush\");\n\nvar _strlen = Module[\"_strlen\"] = makeInvalidEarlyAccess(\"_strlen\");\n\nvar _iswalnum = Module[\"_iswalnum\"] = makeInvalidEarlyAccess(\"_iswalnum\");\n\nvar _iswalpha = Module[\"_iswalpha\"] = makeInvalidEarlyAccess(\"_iswalpha\");\n\nvar _iswblank = Module[\"_iswblank\"] = makeInvalidEarlyAccess(\"_iswblank\");\n\nvar _iswdigit = Module[\"_iswdigit\"] = makeInvalidEarlyAccess(\"_iswdigit\");\n\nvar _iswlower = Module[\"_iswlower\"] = makeInvalidEarlyAccess(\"_iswlower\");\n\nvar _iswpunct = Module[\"_iswpunct\"] = makeInvalidEarlyAccess(\"_iswpunct\");\n\nvar _iswspace = Module[\"_iswspace\"] = makeInvalidEarlyAccess(\"_iswspace\");\n\nvar _iswupper = Module[\"_iswupper\"] = makeInvalidEarlyAccess(\"_iswupper\");\n\nvar _iswxdigit = Module[\"_iswxdigit\"] = makeInvalidEarlyAccess(\"_iswxdigit\");\n\nvar _memchr = Module[\"_memchr\"] = makeInvalidEarlyAccess(\"_memchr\");\n\nvar _emscripten_stack_get_end = makeInvalidEarlyAccess(\"_emscripten_stack_get_end\");\n\nvar _emscripten_stack_get_base = makeInvalidEarlyAccess(\"_emscripten_stack_get_base\");\n\nvar _strcmp = Module[\"_strcmp\"] = makeInvalidEarlyAccess(\"_strcmp\");\n\nvar _strncat = Module[\"_strncat\"] = makeInvalidEarlyAccess(\"_strncat\");\n\nvar _strncpy = Module[\"_strncpy\"] = makeInvalidEarlyAccess(\"_strncpy\");\n\nvar _towlower = Module[\"_towlower\"] = makeInvalidEarlyAccess(\"_towlower\");\n\nvar _towupper = Module[\"_towupper\"] = makeInvalidEarlyAccess(\"_towupper\");\n\nvar _sbrk = makeInvalidEarlyAccess(\"_sbrk\");\n\nvar _emscripten_get_sbrk_ptr = makeInvalidEarlyAccess(\"_emscripten_get_sbrk_ptr\");\n\nvar _setThrew = makeInvalidEarlyAccess(\"_setThrew\");\n\nvar _emscripten_stack_set_limits = makeInvalidEarlyAccess(\"_emscripten_stack_set_limits\");\n\nvar _emscripten_stack_get_free = makeInvalidEarlyAccess(\"_emscripten_stack_get_free\");\n\nvar __emscripten_stack_restore = makeInvalidEarlyAccess(\"__emscripten_stack_restore\");\n\nvar __emscripten_stack_alloc = makeInvalidEarlyAccess(\"__emscripten_stack_alloc\");\n\nvar _emscripten_stack_get_current = makeInvalidEarlyAccess(\"_emscripten_stack_get_current\");\n\nvar ___wasm_apply_data_relocs = makeInvalidEarlyAccess(\"___wasm_apply_data_relocs\");\n\nfunction assignWasmExports(wasmExports) {\n Module[\"_malloc\"] = _malloc = createExportWrapper(\"malloc\", 1);\n Module[\"_calloc\"] = _calloc = createExportWrapper(\"calloc\", 2);\n Module[\"_realloc\"] = _realloc = createExportWrapper(\"realloc\", 2);\n Module[\"_free\"] = _free = createExportWrapper(\"free\", 1);\n Module[\"_ts_language_symbol_count\"] = _ts_language_symbol_count = createExportWrapper(\"ts_language_symbol_count\", 1);\n Module[\"_ts_language_state_count\"] = _ts_language_state_count = createExportWrapper(\"ts_language_state_count\", 1);\n Module[\"_ts_language_abi_version\"] = _ts_language_abi_version = createExportWrapper(\"ts_language_abi_version\", 1);\n Module[\"_ts_language_name\"] = _ts_language_name = createExportWrapper(\"ts_language_name\", 1);\n Module[\"_ts_language_field_count\"] = _ts_language_field_count = createExportWrapper(\"ts_language_field_count\", 1);\n Module[\"_ts_language_symbol_name\"] = _ts_language_symbol_name = createExportWrapper(\"ts_language_symbol_name\", 2);\n Module[\"_ts_language_symbol_for_name\"] = _ts_language_symbol_for_name = createExportWrapper(\"ts_language_symbol_for_name\", 4);\n Module[\"_strncmp\"] = _strncmp = createExportWrapper(\"strncmp\", 3);\n Module[\"_ts_language_symbol_type\"] = _ts_language_symbol_type = createExportWrapper(\"ts_language_symbol_type\", 2);\n Module[\"_ts_language_field_name_for_id\"] = _ts_language_field_name_for_id = createExportWrapper(\"ts_language_field_name_for_id\", 2);\n Module[\"_memcmp\"] = _memcmp = createExportWrapper(\"memcmp\", 3);\n Module[\"_ts_parser_delete\"] = _ts_parser_delete = createExportWrapper(\"ts_parser_delete\", 1);\n Module[\"_ts_parser_set_language\"] = _ts_parser_set_language = createExportWrapper(\"ts_parser_set_language\", 2);\n Module[\"_ts_parser_reset\"] = _ts_parser_reset = createExportWrapper(\"ts_parser_reset\", 1);\n Module[\"_ts_tree_cursor_current_descendant_index\"] = _ts_tree_cursor_current_descendant_index = createExportWrapper(\"ts_tree_cursor_current_descendant_index\", 1);\n Module[\"_ts_tree_cursor_current_depth\"] = _ts_tree_cursor_current_depth = createExportWrapper(\"ts_tree_cursor_current_depth\", 1);\n Module[\"_ts_tree_copy\"] = _ts_tree_copy = createExportWrapper(\"ts_tree_copy\", 1);\n Module[\"_ts_tree_delete\"] = _ts_tree_delete = createExportWrapper(\"ts_tree_delete\", 1);\n Module[\"_ts_init\"] = _ts_init = createExportWrapper(\"ts_init\", 0);\n Module[\"_ts_free_wasm\"] = _ts_free_wasm = createExportWrapper(\"ts_free_wasm\", 1);\n Module[\"_ts_scanner_malloc_wasm\"] = _ts_scanner_malloc_wasm = createExportWrapper(\"ts_scanner_malloc_wasm\", 1);\n Module[\"_ts_scanner_calloc_wasm\"] = _ts_scanner_calloc_wasm = createExportWrapper(\"ts_scanner_calloc_wasm\", 2);\n Module[\"_ts_scanner_realloc_wasm\"] = _ts_scanner_realloc_wasm = createExportWrapper(\"ts_scanner_realloc_wasm\", 2);\n Module[\"_ts_parser_new_wasm\"] = _ts_parser_new_wasm = createExportWrapper(\"ts_parser_new_wasm\", 0);\n Module[\"_ts_parser_enable_logger_wasm\"] = _ts_parser_enable_logger_wasm = createExportWrapper(\"ts_parser_enable_logger_wasm\", 2);\n Module[\"_ts_parser_parse_wasm\"] = _ts_parser_parse_wasm = createExportWrapper(\"ts_parser_parse_wasm\", 2);\n Module[\"_ts_parser_parse_limited_wasm\"] = _ts_parser_parse_limited_wasm = createExportWrapper(\"ts_parser_parse_limited_wasm\", 2);\n Module[\"_ts_parser_last_parse_operations_wasm\"] = _ts_parser_last_parse_operations_wasm = createExportWrapper(\"ts_parser_last_parse_operations_wasm\", 1);\n Module[\"_ts_parser_abort_limited_wasm\"] = _ts_parser_abort_limited_wasm = createExportWrapper(\"ts_parser_abort_limited_wasm\", 0);\n Module[\"_ts_parser_included_ranges_wasm\"] = _ts_parser_included_ranges_wasm = createExportWrapper(\"ts_parser_included_ranges_wasm\", 1);\n Module[\"_ts_language_type_is_named_wasm\"] = _ts_language_type_is_named_wasm = createExportWrapper(\"ts_language_type_is_named_wasm\", 2);\n Module[\"_ts_language_type_is_visible_wasm\"] = _ts_language_type_is_visible_wasm = createExportWrapper(\"ts_language_type_is_visible_wasm\", 2);\n Module[\"_ts_language_metadata_wasm\"] = _ts_language_metadata_wasm = createExportWrapper(\"ts_language_metadata_wasm\", 1);\n Module[\"_ts_language_supertypes_wasm\"] = _ts_language_supertypes_wasm = createExportWrapper(\"ts_language_supertypes_wasm\", 1);\n Module[\"_ts_language_subtypes_wasm\"] = _ts_language_subtypes_wasm = createExportWrapper(\"ts_language_subtypes_wasm\", 2);\n Module[\"_ts_tree_root_node_wasm\"] = _ts_tree_root_node_wasm = createExportWrapper(\"ts_tree_root_node_wasm\", 1);\n Module[\"_ts_tree_root_node_with_offset_wasm\"] = _ts_tree_root_node_with_offset_wasm = createExportWrapper(\"ts_tree_root_node_with_offset_wasm\", 1);\n Module[\"_ts_tree_included_ranges_wasm\"] = _ts_tree_included_ranges_wasm = createExportWrapper(\"ts_tree_included_ranges_wasm\", 1);\n Module[\"_ts_tree_cursor_new_wasm\"] = _ts_tree_cursor_new_wasm = createExportWrapper(\"ts_tree_cursor_new_wasm\", 1);\n Module[\"_ts_tree_cursor_copy_wasm\"] = _ts_tree_cursor_copy_wasm = createExportWrapper(\"ts_tree_cursor_copy_wasm\", 1);\n Module[\"_ts_tree_cursor_delete_wasm\"] = _ts_tree_cursor_delete_wasm = createExportWrapper(\"ts_tree_cursor_delete_wasm\", 1);\n Module[\"_ts_tree_cursor_reset_wasm\"] = _ts_tree_cursor_reset_wasm = createExportWrapper(\"ts_tree_cursor_reset_wasm\", 2);\n Module[\"_ts_tree_cursor_reset_to_wasm\"] = _ts_tree_cursor_reset_to_wasm = createExportWrapper(\"ts_tree_cursor_reset_to_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_first_child_wasm\"] = _ts_tree_cursor_goto_first_child_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_last_child_wasm\"] = _ts_tree_cursor_goto_last_child_wasm = createExportWrapper(\"ts_tree_cursor_goto_last_child_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_first_child_for_index_wasm\"] = _ts_tree_cursor_goto_first_child_for_index_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_for_index_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_first_child_for_position_wasm\"] = _ts_tree_cursor_goto_first_child_for_position_wasm = createExportWrapper(\"ts_tree_cursor_goto_first_child_for_position_wasm\", 3);\n Module[\"_ts_tree_cursor_goto_next_sibling_wasm\"] = _ts_tree_cursor_goto_next_sibling_wasm = createExportWrapper(\"ts_tree_cursor_goto_next_sibling_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_previous_sibling_wasm\"] = _ts_tree_cursor_goto_previous_sibling_wasm = createExportWrapper(\"ts_tree_cursor_goto_previous_sibling_wasm\", 1);\n Module[\"_ts_tree_cursor_goto_descendant_wasm\"] = _ts_tree_cursor_goto_descendant_wasm = createExportWrapper(\"ts_tree_cursor_goto_descendant_wasm\", 2);\n Module[\"_ts_tree_cursor_goto_parent_wasm\"] = _ts_tree_cursor_goto_parent_wasm = createExportWrapper(\"ts_tree_cursor_goto_parent_wasm\", 1);\n Module[\"_ts_tree_cursor_current_node_id_wasm\"] = _ts_tree_cursor_current_node_id_wasm = createExportWrapper(\"ts_tree_cursor_current_node_id_wasm\", 1);\n Module[\"_ts_tree_cursor_start_position_wasm\"] = _ts_tree_cursor_start_position_wasm = createExportWrapper(\"ts_tree_cursor_start_position_wasm\", 1);\n Module[\"_ts_tree_cursor_end_position_wasm\"] = _ts_tree_cursor_end_position_wasm = createExportWrapper(\"ts_tree_cursor_end_position_wasm\", 1);\n Module[\"_ts_tree_cursor_current_node_wasm\"] = _ts_tree_cursor_current_node_wasm = createExportWrapper(\"ts_tree_cursor_current_node_wasm\", 1);\n Module[\"_ts_node_field_name_for_child_wasm\"] = _ts_node_field_name_for_child_wasm = createExportWrapper(\"ts_node_field_name_for_child_wasm\", 2);\n Module[\"_ts_node_field_name_for_named_child_wasm\"] = _ts_node_field_name_for_named_child_wasm = createExportWrapper(\"ts_node_field_name_for_named_child_wasm\", 2);\n Module[\"_ts_node_children_by_field_id_wasm\"] = _ts_node_children_by_field_id_wasm = createExportWrapper(\"ts_node_children_by_field_id_wasm\", 2);\n Module[\"_ts_node_first_child_for_byte_wasm\"] = _ts_node_first_child_for_byte_wasm = createExportWrapper(\"ts_node_first_child_for_byte_wasm\", 1);\n Module[\"_ts_node_first_named_child_for_byte_wasm\"] = _ts_node_first_named_child_for_byte_wasm = createExportWrapper(\"ts_node_first_named_child_for_byte_wasm\", 1);\n Module[\"_ts_node_grammar_symbol_wasm\"] = _ts_node_grammar_symbol_wasm = createExportWrapper(\"ts_node_grammar_symbol_wasm\", 1);\n Module[\"_ts_node_child_count_wasm\"] = _ts_node_child_count_wasm = createExportWrapper(\"ts_node_child_count_wasm\", 1);\n Module[\"_ts_node_named_child_count_wasm\"] = _ts_node_named_child_count_wasm = createExportWrapper(\"ts_node_named_child_count_wasm\", 1);\n Module[\"_ts_node_child_wasm\"] = _ts_node_child_wasm = createExportWrapper(\"ts_node_child_wasm\", 2);\n Module[\"_ts_node_named_child_wasm\"] = _ts_node_named_child_wasm = createExportWrapper(\"ts_node_named_child_wasm\", 2);\n Module[\"_ts_node_child_by_field_id_wasm\"] = _ts_node_child_by_field_id_wasm = createExportWrapper(\"ts_node_child_by_field_id_wasm\", 2);\n Module[\"_ts_node_next_sibling_wasm\"] = _ts_node_next_sibling_wasm = createExportWrapper(\"ts_node_next_sibling_wasm\", 1);\n Module[\"_ts_node_prev_sibling_wasm\"] = _ts_node_prev_sibling_wasm = createExportWrapper(\"ts_node_prev_sibling_wasm\", 1);\n Module[\"_ts_node_next_named_sibling_wasm\"] = _ts_node_next_named_sibling_wasm = createExportWrapper(\"ts_node_next_named_sibling_wasm\", 1);\n Module[\"_ts_node_prev_named_sibling_wasm\"] = _ts_node_prev_named_sibling_wasm = createExportWrapper(\"ts_node_prev_named_sibling_wasm\", 1);\n Module[\"_ts_node_descendant_count_wasm\"] = _ts_node_descendant_count_wasm = createExportWrapper(\"ts_node_descendant_count_wasm\", 1);\n Module[\"_ts_node_parent_wasm\"] = _ts_node_parent_wasm = createExportWrapper(\"ts_node_parent_wasm\", 1);\n Module[\"_ts_node_child_with_descendant_wasm\"] = _ts_node_child_with_descendant_wasm = createExportWrapper(\"ts_node_child_with_descendant_wasm\", 1);\n Module[\"_ts_node_descendant_for_index_wasm\"] = _ts_node_descendant_for_index_wasm = createExportWrapper(\"ts_node_descendant_for_index_wasm\", 1);\n Module[\"_ts_node_named_descendant_for_index_wasm\"] = _ts_node_named_descendant_for_index_wasm = createExportWrapper(\"ts_node_named_descendant_for_index_wasm\", 1);\n Module[\"_ts_node_descendant_for_position_wasm\"] = _ts_node_descendant_for_position_wasm = createExportWrapper(\"ts_node_descendant_for_position_wasm\", 1);\n Module[\"_ts_node_named_descendant_for_position_wasm\"] = _ts_node_named_descendant_for_position_wasm = createExportWrapper(\"ts_node_named_descendant_for_position_wasm\", 1);\n Module[\"_ts_node_to_string_wasm\"] = _ts_node_to_string_wasm = createExportWrapper(\"ts_node_to_string_wasm\", 1);\n Module[\"_ts_node_children_wasm\"] = _ts_node_children_wasm = createExportWrapper(\"ts_node_children_wasm\", 1);\n Module[\"_ts_node_named_children_wasm\"] = _ts_node_named_children_wasm = createExportWrapper(\"ts_node_named_children_wasm\", 1);\n Module[\"_ts_node_descendants_of_type_wasm\"] = _ts_node_descendants_of_type_wasm = createExportWrapper(\"ts_node_descendants_of_type_wasm\", 3);\n Module[\"_memcpy\"] = _memcpy = createExportWrapper(\"memcpy\", 3);\n Module[\"_memmove\"] = _memmove = createExportWrapper(\"memmove\", 3);\n Module[\"_memset\"] = _memset = createExportWrapper(\"memset\", 3);\n _fflush = createExportWrapper(\"fflush\", 1);\n Module[\"_strlen\"] = _strlen = createExportWrapper(\"strlen\", 1);\n Module[\"_iswalnum\"] = _iswalnum = createExportWrapper(\"iswalnum\", 1);\n Module[\"_iswalpha\"] = _iswalpha = createExportWrapper(\"iswalpha\", 1);\n Module[\"_iswblank\"] = _iswblank = createExportWrapper(\"iswblank\", 1);\n Module[\"_iswdigit\"] = _iswdigit = createExportWrapper(\"iswdigit\", 1);\n Module[\"_iswlower\"] = _iswlower = createExportWrapper(\"iswlower\", 1);\n Module[\"_iswpunct\"] = _iswpunct = createExportWrapper(\"iswpunct\", 1);\n Module[\"_iswspace\"] = _iswspace = createExportWrapper(\"iswspace\", 1);\n Module[\"_iswupper\"] = _iswupper = createExportWrapper(\"iswupper\", 1);\n Module[\"_iswxdigit\"] = _iswxdigit = createExportWrapper(\"iswxdigit\", 1);\n Module[\"_memchr\"] = _memchr = createExportWrapper(\"memchr\", 3);\n _emscripten_stack_get_end = wasmExports[\"emscripten_stack_get_end\"];\n _emscripten_stack_get_base = wasmExports[\"emscripten_stack_get_base\"];\n Module[\"_strcmp\"] = _strcmp = createExportWrapper(\"strcmp\", 2);\n Module[\"_strncat\"] = _strncat = createExportWrapper(\"strncat\", 3);\n Module[\"_strncpy\"] = _strncpy = createExportWrapper(\"strncpy\", 3);\n Module[\"_towlower\"] = _towlower = createExportWrapper(\"towlower\", 1);\n Module[\"_towupper\"] = _towupper = createExportWrapper(\"towupper\", 1);\n _sbrk = createExportWrapper(\"sbrk\", 1);\n _emscripten_get_sbrk_ptr = createExportWrapper(\"emscripten_get_sbrk_ptr\", 0);\n _setThrew = createExportWrapper(\"setThrew\", 2);\n _emscripten_stack_set_limits = wasmExports[\"emscripten_stack_set_limits\"];\n _emscripten_stack_get_free = wasmExports[\"emscripten_stack_get_free\"];\n __emscripten_stack_restore = wasmExports[\"_emscripten_stack_restore\"];\n __emscripten_stack_alloc = wasmExports[\"_emscripten_stack_alloc\"];\n _emscripten_stack_get_current = wasmExports[\"emscripten_stack_get_current\"];\n ___wasm_apply_data_relocs = createExportWrapper(\"__wasm_apply_data_relocs\", 0);\n}\n\nvar wasmImports = {\n /** @export */ __heap_base: ___heap_base,\n /** @export */ __indirect_function_table: wasmTable,\n /** @export */ __memory_base: ___memory_base,\n /** @export */ __stack_high: ___stack_high,\n /** @export */ __stack_low: ___stack_low,\n /** @export */ __stack_pointer: ___stack_pointer,\n /** @export */ __table_base: ___table_base,\n /** @export */ _emscripten_throw_longjmp: __emscripten_throw_longjmp,\n /** @export */ alignfault,\n /** @export */ emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */ fd_close: _fd_close,\n /** @export */ fd_seek: _fd_seek,\n /** @export */ fd_write: _fd_write,\n /** @export */ invoke_ii,\n /** @export */ invoke_iii,\n /** @export */ invoke_iiii,\n /** @export */ invoke_ji,\n /** @export */ invoke_vi,\n /** @export */ invoke_vj,\n /** @export */ memory: wasmMemory,\n /** @export */ segfault,\n /** @export */ tree_sitter_log_callback: _tree_sitter_log_callback,\n /** @export */ tree_sitter_parse_callback: _tree_sitter_parse_callback,\n /** @export */ tree_sitter_progress_callback: _tree_sitter_progress_callback\n};\n\nfunction invoke_vi(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_ii(index, a1) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_vj(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_ji(index, a1) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n return 0n;\n }\n}\n\nfunction invoke_iiii(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\nfunction invoke_iii(index, a1, a2) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n}\n\n// include: postamble.js\n// === Auto-generated postamble setup entry stuff ===\nvar calledRun;\n\nfunction callMain(args = []) {\n assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module[\"onRuntimeInitialized\"])');\n assert(typeof onPreRuns === \"undefined\" || onPreRuns.length == 0, \"cannot call main when preRun functions remain to be called\");\n var entryFunction = resolveGlobalSymbol(\"main\").sym;\n // Main modules can't tell if they have main() at compile time, since it may\n // arrive from a dynamic library.\n if (!entryFunction) return;\n args.unshift(thisProgram);\n var argc = args.length;\n var argv = stackAlloc((argc + 1) * 4);\n var argv_ptr = argv;\n args.forEach(arg => {\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((argv_ptr) >> 2), \"storing\")] = stringToUTF8OnStack(arg);\n argv_ptr += 4;\n });\n HEAPU32[SAFE_HEAP_INDEX(HEAPU32, ((argv_ptr) >> 2), \"storing\")] = 0;\n try {\n var ret = entryFunction(argc, argv);\n // if we're not running an evented main loop, it's time to exit\n exitJS(ret, /* implicit = */ true);\n return ret;\n } catch (e) {\n return handleException(e);\n }\n}\n\nfunction stackCheckInit() {\n // This is normally called automatically during __wasm_call_ctors but need to\n // get these values before even running any of the ctors so we call it redundantly\n // here.\n _emscripten_stack_set_limits(81984, 16448);\n // TODO(sbc): Move writeStackCookie to native to to avoid this.\n writeStackCookie();\n}\n\nfunction run(args = arguments_) {\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n stackCheckInit();\n preRun();\n // a preRun added a dependency, run will be called later\n if (runDependencies > 0) {\n dependenciesFulfilled = run;\n return;\n }\n function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n assert(!calledRun);\n calledRun = true;\n Module[\"calledRun\"] = true;\n if (ABORT) return;\n initRuntime();\n preMain();\n readyPromiseResolve?.(Module);\n Module[\"onRuntimeInitialized\"]?.();\n consumedModuleProp(\"onRuntimeInitialized\");\n var noInitialRun = Module[\"noInitialRun\"] || false;\n if (!noInitialRun) callMain(args);\n postRun();\n }\n if (Module[\"setStatus\"]) {\n Module[\"setStatus\"](\"Running...\");\n setTimeout(() => {\n setTimeout(() => Module[\"setStatus\"](\"\"), 1);\n doRun();\n }, 1);\n } else {\n doRun();\n }\n checkStackCookie();\n}\n\nfunction checkUnflushedContent() {\n // Compiler settings do not allow exiting the runtime, so flushing\n // the streams is not possible. but in ASSERTIONS mode we check\n // if there was something to flush, and if so tell the user they\n // should request that the runtime be exitable.\n // Normally we would not even include flush() at all, but in ASSERTIONS\n // builds we do so just for this check, and here we see if there is any\n // content to flush, that is, we check if there would have been\n // something a non-ASSERTIONS build would have not seen.\n // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0\n // mode (which has its own special function for this; otherwise, all\n // the code is inside libc)\n var oldOut = out;\n var oldErr = err;\n var has = false;\n out = err = x => {\n has = true;\n };\n try {\n // it doesn't matter if it fails\n flush_NO_FILESYSTEM();\n } catch (e) {}\n out = oldOut;\n err = oldErr;\n if (has) {\n warnOnce(\"stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.\");\n warnOnce(\"(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)\");\n }\n}\n\nvar wasmExports;\n\n// In modularize mode the generated code is within a factory function so we\n// can use await here (since it's not top-level-await).\nwasmExports = await (createWasm());\n\nrun();\n\n// end include: postamble.js\n// include: postamble_modularize.js\n// In MODULARIZE mode we wrap the generated code in a factory function\n// and return either the Module itself, or a promise of the module.\n// We assign to the `moduleRtn` global here and configure closure to see\n// this as and extern so it won't get minified.\nif (runtimeInitialized) {\n moduleRtn = Module;\n} else {\n // Set up the promise that indicates the Module is initialized\n moduleRtn = new Promise((resolve, reject) => {\n readyPromiseResolve = resolve;\n readyPromiseReject = reject;\n });\n}\n\n// Assertion for attempting to access module properties on the incoming\n// moduleArg. In the past we used this object as the prototype of the module\n// and assigned properties to it, but now we return a distinct object. This\n// keeps the instance private until it is ready (i.e the promise has been\n// resolved).\nfor (const prop of Object.keys(Module)) {\n if (!(prop in moduleArg)) {\n Object.defineProperty(moduleArg, prop, {\n configurable: true,\n get() {\n abort(`Access to module property ('${prop}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`);\n }\n });\n }\n}\n\n\n return moduleRtn;\n };\n})();\n\n// Export using a UMD style export, or ES6 exports if selected\nif (typeof exports === 'object' && typeof module === 'object') {\n module.exports = Module;\n // This default export looks redundant, but it allows TS to import this\n // commonjs style module.\n module.exports.default = Module;\n} else if (typeof define === 'function' && define['amd'])\n define([], () => Module);\n\n", "export type {\n Point,\n Range,\n ParseCallback,\n ProgressCallback,\n LogCallback,\n} from './constants';\nexport type { ParserInitOptions } from './bindings';\nexport {\n type ParseOptions,\n type ParseState,\n LANGUAGE_VERSION,\n MIN_COMPATIBLE_VERSION,\n Parser,\n} from './parser';\nexport { Language } from './language';\nexport { Tree } from './tree';\nexport { Node } from './node';\nexport { TreeCursor } from './tree_cursor';\n", "import { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { ParseState, type Parser } from './parser';\n\n/**\n * A position in a multi-line text document, in terms of rows and columns.\n *\n * Rows and columns are zero-based.\n */\nexport interface Point {\n /** The zero-based row number. */\n row: number;\n\n /** The zero-based column number. */\n column: number;\n}\n\n/**\n * A range of positions in a multi-line text document, both in terms of bytes\n * and of rows and columns.\n */\nexport interface Range {\n /** The start position of the range. */\n startPosition: Point;\n\n /** The end position of the range. */\n endPosition: Point;\n\n /** The start index of the range. */\n startIndex: number;\n\n /** The end index of the range. */\n endIndex: number;\n}\n\n/** @internal */\nexport const SIZE_OF_INT = 4;\n\n/** @internal */\nexport const SIZE_OF_NODE = 9 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_POINT = 2 * SIZE_OF_INT;\n\n/** @internal */\nexport const SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT;\n\n/** @internal */\nexport const ZERO_POINT: Point = { row: 0, column: 0 };\n\n/**\n * A callback for parsing that takes an index and point, and should return a string.\n */\nexport type ParseCallback = (index: number, position: Point) => string | undefined;\n\n/**\n * A callback that receives the parse state during parsing.\n */\n// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\nexport type ProgressCallback = (progress: ParseState) => boolean | void;\n\n/**\n * A callback for logging messages.\n *\n * If `isLex` is `true`, the message is from the lexer, otherwise it's from the parser.\n */\nexport type LogCallback = (message: string, isLex: boolean) => void;\n\n// Helper type for internal use\n/** @internal */\nexport const INTERNAL = Symbol('INTERNAL');\n/** @internal */\nexport type Internal = typeof INTERNAL;\n\n// Helper functions for type checking\n/** @internal */\nexport function assertInternal(x: unknown): asserts x is Internal {\n if (x !== INTERNAL) throw new Error('Illegal constructor');\n}\n\n/** @internal */\nexport function isPoint(point?: Point): point is Point {\n return (\n !!point &&\n typeof (point).row === 'number' &&\n typeof (point).column === 'number'\n );\n}\n\n/**\n * @internal\n *\n * Sets the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport function setModule(module: MainModule) {\n C = module;\n}\n\n/**\n * @internal\n *\n * `C` is a convenient shorthand for the Tree-sitter Wasm module,\n * which allows us to call all of the exported functions.\n */\nexport let C: MainModule;\n", "export function newFinalizer<T>(handler: (value: T) => void): FinalizationRegistry<T> | undefined {\n try {\n return new FinalizationRegistry(handler);\n } catch(e) {\n console.error('Unsupported FinalizationRegistry:', e);\n return;\n }\n}\n", "import { INTERNAL, Internal, assertInternal, Point, C } from './constants';\nimport { marshalNode, unmarshalNode, unmarshalPoint } from './marshal';\nimport { Node } from './node';\nimport { TRANSFER_BUFFER } from './parser';\nimport { getCallbackText, Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_cursor_delete_wasm(address);\n});\n\n/** A stateful object for walking a syntax {@link Tree} efficiently. */\nexport class TreeCursor {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private tree: Tree;\n\n /** @internal */\n private _nodeTypeId = 0;\n\n /** @internal */\n private _fieldId = 0;\n\n /** @internal */\n private _startIndex = 0;\n\n /** @internal */\n private _endIndex = 0;\n\n /** @internal */\n private _flags = 0;\n\n /** @internal */\n constructor(internal: Internal, tree: Tree, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.tree = tree;\n this.readNodeCache();\n finalizer?.register(this, address, this);\n }\n\n /** Creates a deep copy of the tree cursor. This allocates new memory. */\n copy(): TreeCursor {\n const address = C._ts_tree_cursor_copy_wasm(this[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Delete the tree cursor, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_cursor_delete_wasm(this[0]);\n this[0] = 0;\n }\n\n /** Get the tree cursor's current {@link Node}. */\n get currentNode(): Node {\n C._ts_tree_cursor_current_node_wasm(this[0]);\n return unmarshalNode(this.tree)!;\n }\n\n /**\n * Get the numerical field id of this tree cursor's current node.\n *\n * See also {@link TreeCursor#currentFieldName}.\n */\n get currentFieldId(): number {\n return this._fieldId;\n }\n\n /** Get the field name of this tree cursor's current node. */\n get currentFieldName(): string | null {\n return this.tree.language.fields[this._fieldId] ?? null;\n }\n\n /**\n * Get the depth of the cursor's current node relative to the original\n * node that the cursor was constructed with.\n */\n get currentDepth(): number {\n return C._ts_tree_cursor_current_depth(this[0]) >>> 0;\n }\n\n /**\n * Get the index of the cursor's current node out of all of the\n * descendants of the original node that the cursor was constructed with.\n */\n get currentDescendantIndex(): number {\n return C._ts_tree_cursor_current_descendant_index(this[0]) >>> 0;\n }\n\n /** Get the type of the cursor's current node. */\n get nodeType(): string {\n return this.tree.language.types[this._nodeTypeId] || 'ERROR';\n }\n\n /** Get the type id of the cursor's current node. */\n get nodeTypeId(): number {\n return this._nodeTypeId;\n }\n\n /** Get the id of the cursor's current node. */\n get nodeId(): number {\n return C._ts_tree_cursor_current_node_id_wasm(this[0]);\n }\n\n /**\n * Check if the cursor's current node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get nodeIsNamed(): boolean {\n return (this._flags & 1) !== 0;\n }\n\n /**\n * Check if the cursor's current node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get nodeIsMissing(): boolean {\n return (this._flags & 2) !== 0;\n }\n\n /** Get the string content of the cursor's current node. */\n get nodeText(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this._startIndex, this._endIndex)\n : getCallbackText(textSource, this._startIndex, this._endIndex, this.startPosition);\n }\n\n /** Get the start position of the cursor's current node. */\n get startPosition(): Point {\n C._ts_tree_cursor_start_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the end position of the cursor's current node. */\n get endPosition(): Point {\n C._ts_tree_cursor_end_position_wasm(this[0]);\n return unmarshalPoint(TRANSFER_BUFFER);\n }\n\n /** Get the start index of the cursor's current node. */\n get startIndex(): number {\n return this._startIndex;\n }\n\n /** Get the end index of the cursor's current node. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /**\n * Move this cursor to the first child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n */\n gotoFirstChild(): boolean {\n if (!C._ts_tree_cursor_goto_first_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the last child of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there were no children.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoFirstChild} because it needs to\n * iterate through all the children to compute the child's position.\n */\n gotoLastChild(): boolean {\n if (!C._ts_tree_cursor_goto_last_child_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the parent of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no parent node (the cursor was already on the\n * root node).\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoParent(): boolean {\n if (!C._ts_tree_cursor_goto_parent_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the next sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no next sibling node.\n *\n * Note that the node the cursor was constructed with is considered the root\n * of the cursor, and the cursor cannot walk outside this node.\n */\n gotoNextSibling(): boolean {\n if (!C._ts_tree_cursor_goto_next_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the previous sibling of its current node.\n *\n * This returns `true` if the cursor successfully moved, and returns\n * `false` if there was no previous sibling node.\n *\n * Note that this function may be slower than\n * {@link TreeCursor#gotoNextSibling} due to how node\n * positions are stored. In the worst case, this will need to iterate\n * through all the children up to the previous sibling node to recalculate\n * its position. Also note that the node the cursor was constructed with is\n * considered the root of the cursor, and the cursor cannot walk outside this node.\n */\n gotoPreviousSibling(): boolean {\n if (!C._ts_tree_cursor_goto_previous_sibling_wasm(this[0])) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move the cursor to the node that is the nth descendant of\n * the original node that the cursor was constructed with, where\n * zero represents the original node itself.\n */\n gotoDescendant(goalDescendantIndex: number): void {\n C._ts_tree_cursor_goto_descendant_wasm(this[0], goalDescendantIndex);\n this.readNodeCache();\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given index.\n *\n * This returns `true` if the cursor successfully moved to a child node, and returns\n * `false` if no such child was found.\n */\n gotoFirstChildForIndex(goalIndex: number): boolean {\n if (!C._ts_tree_cursor_goto_first_child_for_index_wasm(this[0], goalIndex)) return false;\n this.readNodeCache();\n return true;\n }\n\n /**\n * Move this cursor to the first child of its current node that contains or\n * starts after the given position.\n *\n * This returns `true` if the cursor successfully moved to a child node, and returns\n * `false` if no such child was found.\n */\n gotoFirstChildForPosition(goalPosition: Point): boolean {\n if (\n !C._ts_tree_cursor_goto_first_child_for_position_wasm(\n this[0],\n goalPosition.row,\n goalPosition.column,\n )\n ) {\n return false;\n }\n this.readNodeCache();\n return true;\n }\n\n /**\n * Re-initialize this tree cursor to start at the original node that the\n * cursor was constructed with.\n */\n reset(node: Node): void {\n marshalNode(node);\n this.tree = node.tree;\n C._ts_tree_cursor_reset_wasm(this[0], node.tree[0]);\n this.readNodeCache();\n }\n\n /**\n * Re-initialize a tree cursor to the same position as another cursor.\n *\n * Unlike {@link TreeCursor#reset}, this will not lose parent\n * information and allows reusing already created cursors.\n */\n resetTo(cursor: TreeCursor): void {\n if (this[0] === cursor[0]) return;\n this.tree = cursor.tree;\n C._ts_tree_cursor_reset_to_wasm(this[0], cursor[0]);\n this.readNodeCache();\n }\n\n /** @internal */\n private readNodeCache(): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heap = C.HEAPU32;\n this._nodeTypeId = heap[base];\n this._fieldId = heap[base + 1];\n this._startIndex = heap[base + 2];\n this._endIndex = heap[base + 3];\n this._flags = heap[base + 4];\n }\n}\n", "import { INTERNAL, Internal, assertInternal, ParseCallback, Point, Range, SIZE_OF_NODE, SIZE_OF_INT, C } from './constants';\nimport { Language } from './language';\nimport { Node } from './node';\nimport { TreeCursor } from './tree_cursor';\nimport { marshalPoint, unmarshalNode, unmarshalRanges } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\nimport { newFinalizer } from './finalization_registry';\n\n/** @internal */\nexport function getCallbackText(\n textSource: ParseCallback,\n startIndex: number,\n endIndex: number,\n startPosition: Point,\n): string {\n const length = endIndex - startIndex;\n let result = textSource(startIndex, startPosition);\n if (result) {\n startIndex += result.length;\n while (startIndex < endIndex) {\n const string = textSource(startIndex, startPosition);\n if (string && string.length > 0) {\n startIndex += string.length;\n result += string;\n } else {\n break;\n }\n }\n if (startIndex > endIndex) {\n result = result.slice(0, length);\n }\n }\n return result ?? '';\n}\n\nconst finalizer = newFinalizer((address: number) => {\n C._ts_tree_delete(address);\n});\n\n/** A tree that represents the syntactic structure of a source code file. */\nexport class Tree {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n textSource: string | ParseCallback;\n\n /** The language that was used to parse the syntax tree. */\n language: Language;\n\n /** @internal */\n constructor(internal: Internal, address: number, language: Language, textSource: string | ParseCallback) {\n assertInternal(internal);\n this[0] = address;\n this.language = language;\n this.textSource = textSource;\n finalizer?.register(this, address, this);\n }\n\n /** Create a shallow copy of the syntax tree. This is very fast. */\n copy(): Tree {\n const address = C._ts_tree_copy(this[0]);\n return new Tree(INTERNAL, address, this.language, this.textSource);\n }\n\n /** Delete the syntax tree, freeing its resources. */\n delete(): void {\n finalizer?.unregister(this);\n C._ts_tree_delete(this[0]);\n this[0] = 0;\n }\n\n /** Get the root node of the syntax tree. */\n get rootNode(): Node {\n C._ts_tree_root_node_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /**\n * Get the root node of the syntax tree, but with its position shifted\n * forward by the given offset.\n */\n rootNodeWithOffset(offsetBytes: number, offsetExtent: Point): Node {\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = offsetBytes;\n marshalPoint(address + SIZE_OF_INT, offsetExtent);\n C._ts_tree_root_node_with_offset_wasm(this[0]);\n return unmarshalNode(this)!;\n }\n\n /** Create a new {@link TreeCursor} starting from the root of the tree. */\n walk(): TreeCursor {\n C._ts_tree_root_node_wasm(this[0]);\n const address = C._ts_tree_cursor_new_wasm(this[0]);\n return new TreeCursor(INTERNAL, this, address);\n }\n\n /** Get the included ranges that were used to parse the syntax tree. */\n getIncludedRanges(): Range[] {\n C._ts_tree_included_ranges_wasm(this[0]);\n return unmarshalRanges();\n }\n}\n", "import { INTERNAL, Internal, assertInternal, SIZE_OF_INT, SIZE_OF_NODE, SIZE_OF_POINT, ZERO_POINT, isPoint, C, Point } from './constants';\nimport { getCallbackText, Tree } from './tree';\nimport { TreeCursor } from './tree_cursor';\nimport { Language } from './language';\nimport { marshalNode, marshalPoint, unmarshalNode, unmarshalNodeArray } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst EMPTY_SYMBOLS = new Uint32Array(0);\nconst symbolsByTypeCache = new WeakMap<Language, Map<string, Uint32Array>>();\n\n/** A single node within a syntax {@link Tree}. */\nexport class Node {\n /** @internal */\n // @ts-expect-error: never read\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private _endIndex: number;\n\n /** @internal */\n private _endRow: number;\n\n /** @internal */\n private _endColumn: number;\n\n /** @internal */\n private _flags: number;\n\n /** @internal */\n private _children?: Node[];\n\n /** @internal */\n private _namedChildren?: Node[];\n\n /** @internal */\n constructor(\n internal: Internal,\n {\n id,\n tree,\n startIndex,\n startPosition,\n other,\n endIndex,\n endRow,\n endColumn,\n flags,\n }: {\n id: number;\n tree: Tree;\n startIndex: number;\n startPosition: Point;\n other: number;\n endIndex: number;\n endRow: number;\n endColumn: number;\n flags: number;\n }\n ) {\n assertInternal(internal);\n this[0] = other;\n this.id = id;\n this.tree = tree;\n this.startIndex = startIndex;\n this.startPosition = startPosition;\n this._endIndex = endIndex;\n this._endRow = endRow;\n this._endColumn = endColumn;\n this._flags = flags;\n }\n\n /**\n * The numeric id for this node that is unique.\n *\n * Within a given syntax tree, no two nodes have the same id.\n */\n id: number;\n\n /** The byte index where this node starts. */\n startIndex: number;\n\n /** The position where this node starts. */\n startPosition: Point;\n\n /** The tree that this node belongs to. */\n tree: Tree;\n\n /** Get this node's type as a numerical id. */\n get typeId(): number {\n return this._flags & 0xffff;\n }\n\n /**\n * Get the node's type as a numerical id as it appears in the grammar,\n * ignoring aliases.\n */\n get grammarId(): number {\n marshalNode(this);\n return C._ts_node_grammar_symbol_wasm(this.tree[0]);\n }\n\n /** Get this node's type as a string. */\n get type(): string {\n return this.tree.language.types[this._flags & 0xffff] || 'ERROR';\n }\n\n /**\n * Get this node's symbol name as it appears in the grammar, ignoring\n * aliases as a string.\n */\n get grammarType(): string {\n return this.tree.language.types[this.grammarId] || 'ERROR';\n }\n\n /**\n * Check if this node is *named*.\n *\n * Named nodes correspond to named rules in the grammar, whereas\n * *anonymous* nodes correspond to string literals in the grammar.\n */\n get isNamed(): boolean {\n return (this._flags & 0x10000) !== 0;\n }\n\n /**\n * Check if this node is *extra*.\n *\n * Extra nodes represent things like comments, which are not required\n * by the grammar, but can appear anywhere.\n */\n get isExtra(): boolean {\n return (this._flags & 0x20000) !== 0;\n }\n\n /**\n * Check if this node represents a syntax error.\n *\n * Syntax errors represent parts of the code that could not be incorporated\n * into a valid syntax tree.\n */\n get isError(): boolean {\n return (this._flags & 0x100000) !== 0;\n }\n\n /**\n * Check if this node is *missing*.\n *\n * Missing nodes are inserted by the parser in order to recover from\n * certain kinds of syntax errors.\n */\n get isMissing(): boolean {\n return (this._flags & 0x40000) !== 0;\n }\n\n /**\n * Check if this node represents a syntax error or contains any syntax\n * errors anywhere within it.\n */\n get hasError(): boolean {\n return (this._flags & 0x80000) !== 0;\n }\n\n /** Get the byte index where this node ends. */\n get endIndex(): number {\n return this._endIndex;\n }\n\n /** Get the position where this node ends. */\n get endPosition(): Point {\n return { row: this._endRow, column: this._endColumn };\n }\n\n /** Get the string content of this node. */\n get text(): string {\n const { textSource } = this.tree;\n return typeof textSource === 'string'\n ? textSource.slice(this.startIndex, this._endIndex)\n : getCallbackText(textSource, this.startIndex, this._endIndex, this.startPosition);\n }\n\n /** Check if this node is equal to another node. */\n equals(other: Node): boolean {\n return this.tree === other.tree && this.id === other.id;\n }\n\n /**\n * Get the node's child at the given index, where zero represents the first child.\n *\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#children} instead.\n */\n child(index: number): Node | null {\n marshalNode(this);\n C._ts_node_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's *named* child at the given index.\n *\n * See also {@link Node#isNamed}.\n * This method is fairly fast, but its cost is technically log(n), so if\n * you might be iterating over a long list of children, you should use\n * {@link Node#namedChildren} instead.\n */\n namedChild(index: number): Node | null {\n marshalNode(this);\n C._ts_node_named_child_wasm(this.tree[0], index);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's child with the given numerical field id.\n *\n * See also {@link Node#childForFieldName}. You can\n * convert a field name to an id using {@link Language#fieldIdForName}.\n */\n childForFieldId(fieldId: number): Node | null {\n marshalNode(this);\n C._ts_node_child_by_field_id_wasm(this.tree[0], fieldId);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the first child with the given field name.\n *\n * If multiple children may have the same field name, access them using\n * {@link Node#childrenForFieldName}.\n */\n childForFieldName(fieldName: string): Node | null {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1) return this.childForFieldId(fieldId);\n return null;\n }\n\n /** Get the field name of this node's child at the given index. */\n fieldNameForChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n\n /** Get the field name of this node's named child at the given index. */\n fieldNameForNamedChild(index: number): string | null {\n marshalNode(this);\n const address = C._ts_node_field_name_for_named_child_wasm(this.tree[0], index);\n if (!address) return null;\n return C.AsciiToString(address);\n }\n /**\n * Get an array of this node's children with a given field name.\n *\n * See also {@link Node#children}.\n */\n childrenForFieldName(fieldName: string): Node[] {\n const fieldId = this.tree.language.fields.indexOf(fieldName);\n if (fieldId !== -1 && fieldId !== 0) return this.childrenForFieldId(fieldId);\n return [];\n }\n\n /**\n * Get an array of this node's children with a given field id.\n *\n * See also {@link Node#childrenForFieldName}.\n */\n childrenForFieldId(fieldId: number): Node[] {\n marshalNode(this);\n C._ts_node_children_by_field_id_wasm(this.tree[0], fieldId);\n return unmarshalNodeArray(this.tree, true);\n }\n\n /** Get the node's first child that contains or starts after the given byte offset. */\n firstChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = index;\n C._ts_node_first_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's first named child that contains or starts after the given byte offset. */\n firstNamedChildForIndex(index: number): Node | null {\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n C.HEAP32[address >>> 2] = index;\n C._ts_node_first_named_child_for_byte_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's number of children. */\n get childCount(): number {\n marshalNode(this);\n return C._ts_node_child_count_wasm(this.tree[0]);\n }\n\n\n /**\n * Get this node's number of *named* children.\n *\n * See also {@link Node#isNamed}.\n */\n get namedChildCount(): number {\n marshalNode(this);\n return C._ts_node_named_child_count_wasm(this.tree[0]);\n }\n\n /** Get this node's first child. */\n get firstChild(): Node | null {\n return this.child(0);\n }\n\n /**\n * Get this node's first named child.\n *\n * See also {@link Node#isNamed}.\n */\n get firstNamedChild(): Node | null {\n return this.namedChild(0);\n }\n\n /** Get this node's last child. */\n get lastChild(): Node | null {\n return this.child(this.childCount - 1);\n }\n\n /**\n * Get this node's last named child.\n *\n * See also {@link Node#isNamed}.\n */\n get lastNamedChild(): Node | null {\n return this.namedChild(this.namedChildCount - 1);\n }\n\n /**\n * Iterate over this node's children.\n *\n * If you're walking the tree recursively, you may want to use the\n * {@link TreeCursor} APIs directly instead.\n */\n get children(): Node[] {\n if (!this._children) {\n marshalNode(this);\n C._ts_node_children_wasm(this.tree[0]);\n this._children = unmarshalNodeArray(this.tree);\n }\n return this._children;\n }\n\n /**\n * Iterate over this node's named children.\n *\n * See also {@link Node#children}.\n */\n get namedChildren(): Node[] {\n if (!this._namedChildren) {\n marshalNode(this);\n C._ts_node_named_children_wasm(this.tree[0]);\n this._namedChildren = unmarshalNodeArray(this.tree);\n }\n return this._namedChildren;\n }\n\n /**\n * Get the descendants of this node that are the given type, or in the given types array.\n *\n * The types array should contain node type strings, which can be retrieved from {@link Language#types}.\n *\n * Additionally, a `startPosition` and `endPosition` can be passed in to restrict the search to a byte range.\n */\n descendantsOfType(\n types: string | string[],\n startPosition: Point = ZERO_POINT,\n endPosition: Point = ZERO_POINT\n ): Node[] {\n const symbols = symbolsForTypes(this.tree.language, types);\n if (symbols.length === 0) return [];\n\n const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);\n C.HEAPU32.set(symbols, symbolsAddress >>> 2);\n\n marshalNode(this);\n const pointAddress = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(pointAddress, startPosition);\n marshalPoint(pointAddress + SIZE_OF_POINT, endPosition);\n C._ts_node_descendants_of_type_wasm(\n this.tree[0],\n symbolsAddress,\n symbols.length,\n );\n\n const result = unmarshalNodeArray(this.tree, true);\n C._free(symbolsAddress);\n return result;\n }\n\n /** Get this node's next sibling. */\n get nextSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get this node's previous sibling. */\n get previousSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's next *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get nextNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_next_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get this node's previous *named* sibling.\n *\n * See also {@link Node#isNamed}.\n */\n get previousNamedSibling(): Node | null {\n marshalNode(this);\n C._ts_node_prev_named_sibling_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the node's number of descendants, including one for the node itself. */\n get descendantCount(): number {\n marshalNode(this);\n return C._ts_node_descendant_count_wasm(this.tree[0]);\n }\n\n /**\n * Get this node's immediate parent.\n * Prefer {@link Node#childWithDescendant} for iterating over this node's ancestors.\n */\n get parent(): Node | null {\n marshalNode(this);\n C._ts_node_parent_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Get the node that contains `descendant`.\n *\n * Note that this can return `descendant` itself.\n */\n childWithDescendant(descendant: Node): Node | null {\n if (descendant.tree !== this.tree) return null;\n marshalNode(this);\n marshalNode(descendant, 1);\n C._ts_node_child_with_descendant_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given byte range. */\n descendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\n C._ts_node_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given byte range. */\n namedDescendantForIndex(start: number, end: number = start): Node | null {\n if (typeof start !== 'number' || typeof end !== 'number') {\n throw new Error('Arguments must be numbers');\n }\n\n marshalNode(this);\n const base = (TRANSFER_BUFFER + SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = start;\n heap[base + 1] = end;\n C._ts_node_named_descendant_for_index_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest node within this node that spans the given point range. */\n descendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /** Get the smallest named node within this node that spans the given point range. */\n namedDescendantForPosition(start: Point, end: Point = start) {\n if (!isPoint(start) || !isPoint(end)) {\n throw new Error('Arguments must be {row, column} objects');\n }\n\n marshalNode(this);\n const address = TRANSFER_BUFFER + SIZE_OF_NODE;\n marshalPoint(address, start);\n marshalPoint(address + SIZE_OF_POINT, end);\n C._ts_node_named_descendant_for_position_wasm(this.tree[0]);\n return unmarshalNode(this.tree);\n }\n\n /**\n * Create a new {@link TreeCursor} starting from this node.\n *\n * Note that the given node is considered the root of the cursor,\n * and the cursor cannot walk outside this node.\n */\n walk(): TreeCursor {\n marshalNode(this);\n const address = C._ts_tree_cursor_new_wasm(this.tree[0]);\n return new TreeCursor(INTERNAL, this.tree, address);\n }\n\n /** Get the S-expression representation of this node. */\n toString(): string {\n marshalNode(this);\n const address = C._ts_node_to_string_wasm(this.tree[0]);\n const result = C.AsciiToString(address);\n C._ts_free_wasm(address);\n return result;\n }\n}\n\nfunction symbolsForTypes(language: Language, types: string | string[]): Uint32Array {\n const byType = symbolsByTypeForLanguage(language);\n if (typeof types === 'string') {\n return byType.get(types) ?? EMPTY_SYMBOLS;\n }\n if (types.length === 0) return EMPTY_SYMBOLS;\n if (types.length === 1) {\n return byType.get(types[0]) ?? EMPTY_SYMBOLS;\n }\n return collectSymbolsForTypes(byType, types);\n}\n\nfunction symbolsByTypeForLanguage(language: Language): Map<string, Uint32Array> {\n let cached = symbolsByTypeCache.get(language);\n if (!cached) {\n cached = buildSymbolsByType(language.types);\n symbolsByTypeCache.set(language, cached);\n }\n return cached;\n}\n\nfunction buildSymbolsByType(typesBySymbol: (string | undefined)[]): Map<string, Uint32Array> {\n const grouped = new Map<string, number[]>();\n for (let i = 0, n = typesBySymbol.length; i < n; i++) {\n const type = typesBySymbol[i];\n if (type !== undefined) {\n let list = grouped.get(type);\n if (!list) {\n list = [];\n grouped.set(type, list);\n }\n list.push(i);\n }\n }\n // `symbols_contain` in tree-sitter.c expects ascending symbols, and\n // ts_builtin_sym_error is -1, which is UINT16_MAX.\n const errorSymbols = grouped.get('ERROR');\n if (errorSymbols) {\n if (errorSymbols[errorSymbols.length - 1] !== 65535) {\n errorSymbols.push(65535);\n }\n } else {\n grouped.set('ERROR', [65535]);\n }\n const result = new Map<string, Uint32Array>();\n for (const [type, list] of grouped) {\n result.set(type, Uint32Array.from(list));\n }\n return result;\n}\n\nfunction collectSymbolsForTypes(byType: Map<string, Uint32Array>, types: string[]): Uint32Array {\n const symbols: number[] = [];\n for (const type of new Set(types)) {\n const matches = byType.get(type);\n if (matches) {\n for (const symbol of matches) symbols.push(symbol);\n }\n }\n if (symbols.length === 0) return EMPTY_SYMBOLS;\n return Uint32Array.from(symbols).sort();\n}\n", "import { INTERNAL, Point, Range, SIZE_OF_NODE, SIZE_OF_RANGE, C } from './constants';\nimport { Node } from './node';\nimport { Tree } from './tree';\nimport { TRANSFER_BUFFER } from './parser';\nimport { LanguageMetadata } from './language';\n\n/**\n * @internal\n *\n * Marshals a {@link Node} to the transfer buffer.\n */\nexport function marshalNode(node: Node, index = 0): void {\n const base = (TRANSFER_BUFFER + index * SIZE_OF_NODE) >>> 2;\n const heap = C.HEAP32;\n heap[base] = node.id;\n heap[base + 1] = node.startIndex;\n heap[base + 2] = node.startPosition.row;\n heap[base + 3] = node.startPosition.column;\n heap[base + 4] = node[0];\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Node} from the transfer buffer.\n */\nexport function unmarshalNode(tree: Tree, address = TRANSFER_BUFFER): Node | null {\n const base = address >>> 2;\n const heap = C.HEAP32;\n const id = heap[base];\n if (id === 0) return null;\n\n const heapU32 = C.HEAPU32;\n return new Node(INTERNAL, {\n id,\n tree,\n startIndex: heapU32[base + 1],\n startPosition: { row: heapU32[base + 2], column: heapU32[base + 3] },\n other: heap[base + 4],\n endIndex: heapU32[base + 5],\n endRow: heapU32[base + 6],\n endColumn: heapU32[base + 7],\n flags: heapU32[base + 8],\n });\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Point} to the transfer buffer.\n */\nexport function marshalPoint(address: number, point: Point): void {\n const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = point.row;\n heap[base + 1] = point.column;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Point} from the transfer buffer.\n */\nexport function unmarshalPoint(address: number): Point {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n row: heap[base],\n column: heap[base + 1],\n };\n}\n\n/**\n * @internal\n *\n * Marshals a {@link Range} to the transfer buffer.\n */\nexport function marshalRange(address: number, range: Range): void {\n const base = address >>> 2;\n const heap = C.HEAP32;\n heap[base] = range.startPosition.row;\n heap[base + 1] = range.startPosition.column;\n heap[base + 2] = range.endPosition.row;\n heap[base + 3] = range.endPosition.column;\n heap[base + 4] = range.startIndex;\n heap[base + 5] = range.endIndex;\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link Range} from the transfer buffer.\n */\nexport function unmarshalRange(address: number): Range {\n const base = address >>> 2;\n const heap = C.HEAPU32;\n return {\n startPosition: { row: heap[base], column: heap[base + 1] },\n endPosition: { row: heap[base + 2], column: heap[base + 3] },\n startIndex: heap[base + 4],\n endIndex: heap[base + 5],\n };\n}\n\n/**\n * @internal\n *\n * Unmarshals a {@link LanguageMetadata} from the transfer buffer.\n */\nexport function unmarshalLanguageMetadata(address: number): LanguageMetadata {\n const base = address >>> 2;\n const heap = C.HEAP32;\n return {\n major_version: heap[base],\n minor_version: heap[base + 1],\n patch_version: heap[base + 2],\n };\n}\n\n/** @internal */\nexport function unmarshalSymbols(): number[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAPU32[base + 1];\n const result = new Array<number>(count);\n if (count > 0) {\n const symbolBase = buffer >>> 1;\n const heapU16 = C.HEAPU16;\n for (let i = 0; i < count; i++) {\n result[i] = heapU16[symbolBase + i];\n }\n }\n return result;\n}\n\n/** @internal */\nexport function unmarshalRanges(useTsFree = true): Range[] {\n return unmarshalArray(SIZE_OF_RANGE, unmarshalRange, useTsFree);\n}\n\n/** @internal */\nexport function unmarshalNodeArray(tree: Tree, useTsFree = false): Node[] {\n return unmarshalArray(SIZE_OF_NODE, (address) => unmarshalNode(tree, address)!, useTsFree);\n}\n\nfunction unmarshalArray<T>(\n stride: number,\n readItem: (address: number) => T,\n useTsFree: boolean,\n): T[] {\n const base = TRANSFER_BUFFER >>> 2;\n const count = C.HEAPU32[base];\n const buffer = C.HEAP32[base + 1];\n const result = new Array<T>(count);\n for (let i = 0, address = buffer; i < count; i++, address += stride) {\n result[i] = readItem(address);\n }\n if (buffer) {\n if (useTsFree) C._ts_free_wasm(buffer);\n else C._free(buffer);\n }\n return result;\n}\n", "import { C, INTERNAL, Internal, assertInternal, SIZE_OF_INT } from './constants';\nimport { unmarshalLanguageMetadata, unmarshalSymbols } from './marshal';\nimport { TRANSFER_BUFFER } from './parser';\n\nconst LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\\w+$/;\n\nexport interface LanguageMetadata {\n readonly major_version: number;\n readonly minor_version: number;\n readonly patch_version: number;\n}\n\ntype LanguageWasmExports = Record<string, () => number>;\n\n/**\n * An opaque object that defines how to parse a particular language.\n * The code for each `Language` is generated by the Tree-sitter CLI.\n */\nexport class Language {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /**\n * A list of all node types in the language. The index of each type in this\n * array is its node type id.\n */\n types: string[];\n\n /**\n * A list of all field names in the language. The index of each field name in\n * this array is its field id.\n */\n fields: (string | null)[];\n\n /** @internal */\n constructor(internal: Internal, address: number) {\n assertInternal(internal);\n this[0] = address;\n this.types = new Array<string>(C._ts_language_symbol_count(this[0]));\n for (let i = 0, n = this.types.length; i < n; i++) {\n if (C._ts_language_symbol_type(this[0], i) < 2) {\n this.types[i] = C.UTF8ToString(C._ts_language_symbol_name(this[0], i));\n }\n }\n this.fields = new Array<string>(C._ts_language_field_count(this[0]) + 1);\n for (let i = 0, n = this.fields.length; i < n; i++) {\n const fieldName = C._ts_language_field_name_for_id(this[0], i);\n if (fieldName !== 0) {\n this.fields[i] = C.UTF8ToString(fieldName);\n } else {\n this.fields[i] = null;\n }\n }\n }\n\n\n /**\n * Gets the name of the language.\n */\n get name(): string | null {\n const ptr = C._ts_language_name(this[0]);\n if (ptr === 0) return null;\n return C.UTF8ToString(ptr);\n }\n\n /**\n * Gets the ABI version of the language.\n */\n get abiVersion(): number {\n return C._ts_language_abi_version(this[0]);\n }\n\n /**\n * Get the metadata for this language. This information is generated by the\n * CLI, and relies on the language author providing the correct metadata in\n * the language's `tree-sitter.json` file.\n */\n get metadata(): LanguageMetadata | null {\n C._ts_language_metadata_wasm(this[0]);\n const length = C.HEAP32[TRANSFER_BUFFER >>> 2];\n if (length === 0) return null;\n return unmarshalLanguageMetadata(TRANSFER_BUFFER + SIZE_OF_INT);\n }\n\n /**\n * Gets the number of fields in the language.\n */\n get fieldCount(): number {\n return this.fields.length - 1;\n }\n\n /**\n * Gets the number of states in the language.\n */\n get stateCount(): number {\n return C._ts_language_state_count(this[0]);\n }\n\n /**\n * Get the field id for a field name.\n */\n fieldIdForName(fieldName: string): number | null {\n const result = this.fields.indexOf(fieldName);\n return result !== -1 ? result : null;\n }\n\n /**\n * Get the field name for a field id.\n */\n fieldNameForId(fieldId: number): string | null {\n return this.fields[fieldId] ?? null;\n }\n\n /**\n * Get the node type id for a node type name.\n */\n idForNodeType(type: string, named: boolean): number | null {\n const typeLength = C.lengthBytesUTF8(type);\n const typeAddress = C._malloc(typeLength + 1);\n C.stringToUTF8(type, typeAddress, typeLength + 1);\n const result = C._ts_language_symbol_for_name(this[0], typeAddress, typeLength, named ? 1 : 0);\n C._free(typeAddress);\n return result || null;\n }\n\n /**\n * Gets the number of node types in the language.\n */\n get nodeTypeCount(): number {\n return C._ts_language_symbol_count(this[0]);\n }\n\n /**\n * Get the node type name for a node type id.\n */\n nodeTypeForId(typeId: number): string | null {\n const name = C._ts_language_symbol_name(this[0], typeId);\n return name ? C.UTF8ToString(name) : null;\n }\n\n /**\n * Check if a node type is named.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#named-vs-anonymous-nodes}\n */\n nodeTypeIsNamed(typeId: number): boolean {\n return C._ts_language_type_is_named_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Check if a node type is visible.\n */\n nodeTypeIsVisible(typeId: number): boolean {\n return C._ts_language_type_is_visible_wasm(this[0], typeId) ? true : false;\n }\n\n /**\n * Get the supertypes ids of this language.\n *\n * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types.html?highlight=supertype#supertype-nodes}\n */\n get supertypes(): number[] {\n C._ts_language_supertypes_wasm(this[0]);\n return unmarshalSymbols();\n }\n\n /**\n * Get the subtype ids for a given supertype node id.\n */\n subtypes(supertype: number): number[] {\n C._ts_language_subtypes_wasm(this[0], supertype);\n return unmarshalSymbols();\n }\n\n /**\n * Load a language from a WebAssembly module.\n * The module can be provided as a path to a file, a `URL` to a file, a\n * buffer, or a precompiled `WebAssembly.Module`. In Cloudflare Workers, which\n * do not allow compiling Wasm at run time, pass the imported `.wasm` module.\n */\n static async load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language> {\n let binary: Uint8Array | WebAssembly.Module;\n if (input instanceof Uint8Array || input instanceof WebAssembly.Module) {\n binary = input;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n } else if (globalThis.process?.versions.node) {\n const fs: typeof import('fs/promises') = await import('fs/promises');\n binary = await fs.readFile(input);\n } else {\n const response = await fetch(input);\n\n if (!response.ok){\n const body = await response.text();\n throw new Error(`Language.load failed with status ${response.status}.\\n\\n${body}`);\n }\n\n const retryResp = response.clone();\n try {\n binary = await WebAssembly.compileStreaming(response);\n } catch (reason) {\n console.error('wasm streaming compile failed:', reason);\n console.error('falling back to ArrayBuffer instantiation');\n // fallback, probably because of bad MIME type\n binary = new Uint8Array(await retryResp.arrayBuffer())\n }\n }\n\n const mod = await C.loadWebAssemblyModule(binary, { loadAsync: true });\n return loadFromWasmExports(mod, { sync: false });\n }\n\n /**\n * Load a language synchronously from a pre-compiled WebAssembly module.\n * Use this when the host environment provides a `WebAssembly.Module` directly.\n */\n static loadSync(wasmModule: WebAssembly.Module): Language {\n const mod = C.loadWebAssemblyModule(wasmModule, { loadAsync: false });\n return loadFromWasmExports(mod, { sync: true });\n }\n}\n\n// Outside the class, since a private member in the declarations would make the ES module and the CommonJS copies of\n// `typeof Language` incompatible with each other.\nfunction loadFromWasmExports(mod: LanguageWasmExports, { sync }: { sync: boolean }): Language {\n const symbolNames = Object.keys(mod);\n const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) &&\n !key.includes('external_scanner_'));\n if (!functionName) {\n console.log(`Couldn't find language function in Wasm file. Symbols:\\n${JSON.stringify(symbolNames, null, 2)}`);\n throw new Error(`Language.${sync ? 'loadSync' : 'load'} failed: no language function found in Wasm file`);\n }\n const languageAddress = mod[functionName]();\n return new Language(INTERNAL, languageAddress);\n}\n", "import createModule, { type MainModule } from '../lib/web-tree-sitter';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type Parser } from './parser';\n\nexport let Module: MainModule | null = null;\n\n/** Options for {@link Parser.init}. */\nexport interface ParserInitOptions extends Partial<EmscriptenModule> {\n /**\n * The precompiled `web-tree-sitter.wasm` module. Pass it where compiling Wasm from bytes at run time is not\n * allowed, such as in Cloudflare Workers, which provide an imported `.wasm` file as a `WebAssembly.Module`.\n */\n wasmModule?: WebAssembly.Module;\n\n /** The memory imported by `web-tree-sitter.wasm`. */\n wasmMemory?: WebAssembly.Memory;\n}\n\n/**\n * @internal\n *\n * Initialize the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.\n */\nexport async function initializeBinding(options?: ParserInitOptions): Promise<MainModule> {\n if (Module) return Module;\n const { wasmModule, ...moduleOptions } = options ?? {};\n if (!wasmModule) return Module ??= await createModule(moduleOptions);\n\n // Emscripten gives `instantiateWasm` no way to report a failure, so its initialization would never settle;\n // the failure is raced against it instead.\n const instantiationFailure = new Promise<never>((_, reject) => {\n moduleOptions.instantiateWasm = (imports, receiveInstance) => {\n WebAssembly.instantiate(wasmModule, imports)\n .then((instance) => {\n // Emscripten reads the dynamic-linking metadata from the module passed with the instance, so both are passed.\n (receiveInstance as (instance: WebAssembly.Instance, module: WebAssembly.Module) => void)(instance, wasmModule);\n })\n .catch(reject);\n return {};\n };\n });\n return Module ??= await Promise.race([createModule(moduleOptions), instantiationFailure]);\n}\n\n/**\n * @internal\n *\n * Checks if the Tree-sitter Wasm module has been initialized.\n */\nexport function checkModule(): boolean {\n return !!Module;\n}\n", "import { C, INTERNAL, LogCallback, ParseCallback, Range, SIZE_OF_RANGE, setModule } from './constants';\nimport { Language } from './language';\nimport { marshalRange, unmarshalRanges } from './marshal';\nimport { checkModule, initializeBinding, type ParserInitOptions } from './bindings';\nimport { Tree } from './tree';\nimport { newFinalizer } from './finalization_registry';\n\nconst TWO_POW_32 = 0x1_0000_0000;\n\n/**\n * Options for parsing\n *\n * The `includedRanges` property is an array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * The `progressCallback` property is a function that is called periodically\n * during parsing to check whether parsing should be cancelled.\n *\n * See {@link Parser#parse} for more information.\n */\nexport interface ParseOptions {\n /**\n * An array of {@link Range} objects that\n * represent the ranges of text that the parser should include when parsing.\n *\n * This sets the ranges of text that the parser should include when parsing.\n * By default, the parser will always include entire documents. This\n * function allows you to parse only a *portion* of a document but\n * still return a syntax tree whose ranges match up with the document\n * as a whole. You can also pass multiple disjoint ranges.\n * If `ranges` is empty, then the entire document will be parsed.\n * Otherwise, the given ranges must be ordered from earliest to latest\n * in the document, and they must not overlap. That is, the following\n * must hold for all `i` < `length - 1`:\n * ```text\n * ranges[i].end_byte <= ranges[i + 1].start_byte\n * ```\n */\n includedRanges?: Range[];\n\n /**\n * A function that is called periodically during parsing to check\n * whether parsing should be cancelled. If the progress callback returns\n * `true`, then parsing will be cancelled. You can also use this to instrument\n * parsing and check where the parser is at in the document. The progress callback\n * takes a single argument, which is a {@link ParseState} representing the current\n * state of the parser.\n */\n // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- A callback may record progress without returning a cancellation decision.\n progressCallback?: (state: ParseState) => boolean | void;\n\n /**\n * The maximum size of Wasm memory during this parse, in bytes. Reaching it\n * cancels the parse. Memory is shared by all parsers and does not shrink, so\n * a parse also returns `null` when memory already exceeds this limit.\n */\n maxMemoryBytes?: number;\n\n /**\n * The maximum number of parse operations allowed during this parse. Exceeding\n * it cancels the parse and resets the parser.\n */\n maxOperations?: number;\n}\n\n/**\n * A stateful object that is passed into the progress callback {@link ParseOptions#progressCallback}\n * to provide the current state of the parser.\n */\nexport interface ParseState {\n /** The byte offset in the document that the parser is at. */\n currentOffset: number;\n\n /** Indicates whether the parser has encountered an error during parsing. */\n hasError: boolean;\n}\n\n/**\n * @internal\n *\n * Global variable for transferring data across the FFI boundary\n */\nexport let TRANSFER_BUFFER: number;\n\n/**\n * The latest ABI version that the current version of the library supports. The\n * CLI of this fork assigns it to each generated language. Its upper 16 bits\n * (`0x5742`, \"WB\") tag the fork and its lower 16 bits count the fork's ABI\n * revisions, so that it never equals an ABI version of upstream Tree-sitter:\n * the library rejects languages generated by upstream's CLI, and upstream's\n * library rejects languages generated by this fork's CLI.\n */\nexport let LANGUAGE_VERSION: number;\n\n/**\n * The earliest ABI version that is supported by the current version of the\n * library.\n */\nexport let MIN_COMPATIBLE_VERSION: number;\n\n/**\n * @internal\n *\n * Throws unless the CLI of this fork generated the language.\n */\nexport function assertSupportedLanguage(language: Language): void {\n const version = C._ts_language_abi_version(language[0]);\n if (version < MIN_COMPATIBLE_VERSION || version > LANGUAGE_VERSION) {\n throw new Error(\n `Incompatible language version 0x${(version >>> 0).toString(16)}. ` +\n `Expected 0x${LANGUAGE_VERSION.toString(16)}.`\n );\n }\n}\n\nconst finalizer = newFinalizer((addresses: number[]) => {\n C._ts_parser_delete(addresses[0]);\n C._free(addresses[1]);\n});\n\n/**\n * A stateful object that is used to produce a {@link Tree} based on some\n * source code.\n */\nexport class Parser {\n /** @internal */\n private [0] = 0; // Internal handle for Wasm\n\n /** @internal */\n private [1] = 0; // Internal handle for Wasm\n\n /** @internal */\n private logCallback: LogCallback | null = null;\n\n /** @internal */\n private loggerEnabled = false;\n\n /** The parser's current language. */\n language: Language | null = null;\n\n /** The number of parse operations executed by the most recent {@link Parser#parse} call. */\n lastParseOperations = 0;\n\n /**\n * This must always be called before creating a Parser.\n *\n * You can optionally pass in options to configure the Wasm module, the most common\n * one being `locateFile` to help the module find the `.wasm` file. In Cloudflare Workers,\n * pass the imported `web-tree-sitter.wasm` module as `wasmModule` instead.\n */\n static async init(options?: ParserInitOptions) {\n setModule(await initializeBinding(options));\n TRANSFER_BUFFER = C._ts_init();\n const base = TRANSFER_BUFFER >>> 2;\n LANGUAGE_VERSION = C.HEAP32[base];\n MIN_COMPATIBLE_VERSION = C.HEAP32[base + 1];\n }\n\n /**\n * Create a new parser.\n */\n constructor() {\n this.initialize();\n finalizer?.register(this, [this[0], this[1]], this);\n }\n\n /** @internal */\n initialize() {\n if (!checkModule()) {\n throw new Error('cannot construct a Parser before calling `init()`');\n }\n C._ts_parser_new_wasm();\n const base = TRANSFER_BUFFER >>> 2;\n this[0] = C.HEAP32[base];\n this[1] = C.HEAP32[base + 1];\n this.loggerEnabled = false;\n }\n\n /** Delete the parser, freeing its resources. */\n delete() {\n finalizer?.unregister(this);\n C._ts_parser_delete(this[0]);\n C._free(this[1]);\n this[0] = 0;\n this[1] = 0;\n }\n\n /**\n * Set the language that the parser should use for parsing.\n *\n * If the language was not successfully assigned, an error will be thrown.\n * This happens if the language was generated with an incompatible\n * version of the Tree-sitter CLI. Check the language's version using\n * {@link Language#abiVersion}; this library accepts versions from\n * {@link MIN_COMPATIBLE_VERSION} to {@link LANGUAGE_VERSION}.\n */\n setLanguage(language: Language | null): this {\n let address: number;\n if (!language) {\n address = 0;\n this.language = null;\n } else if (language.constructor === Language) {\n address = language[0];\n assertSupportedLanguage(language);\n this.language = language;\n } else {\n throw new Error('Argument must be a Language');\n }\n\n C._ts_parser_set_language(this[0], address);\n return this;\n }\n\n /**\n * Parse a slice of UTF8 text.\n *\n * @param {string | ParseCallback} callback - The UTF8-encoded text to parse or a callback function.\n *\n * @param {ParseOptions} [options] - Options for parsing the text.\n * This can be used to set the included ranges, or a progress callback.\n *\n * @returns {Tree | null} A {@link Tree} if parsing succeeded, or `null` if:\n * - The parser has not yet had a language assigned with {@link Parser#setLanguage}.\n * - The progress callback returned true.\n * - The memory limit was reached or the operation limit was exceeded.\n */\n parse(\n callback: string | ParseCallback,\n options?: ParseOptions,\n ): Tree | null {\n const maxMemoryBytes = validateMemoryLimit(options?.maxMemoryBytes);\n const maxOperations = validateOperationLimit(options?.maxOperations);\n if (typeof callback !== 'string' && typeof callback !== 'function') {\n throw new Error('Argument must be a string or a function');\n }\n\n const progressCallback = options?.progressCallback ?? null;\n C.currentParseCallback = callback;\n C.currentProgressCallback = progressCallback;\n this.syncLogger();\n this.lastParseOperations = 0;\n\n try {\n const treeAddress = this.runParse(options, maxMemoryBytes, maxOperations);\n if (!treeAddress) return null;\n if (!this.language) throw new Error('Parser must have a language to parse');\n return new Tree(INTERNAL, treeAddress, this.language, callback);\n } finally {\n clearCallbacks();\n }\n }\n\n /** @internal */\n private syncLogger(): void {\n if (this.logCallback) {\n C.currentLogCallback = this.logCallback;\n if (!this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 1);\n this.loggerEnabled = true;\n }\n } else {\n C.currentLogCallback = null;\n if (this.loggerEnabled) {\n C._ts_parser_enable_logger_wasm(this[0], 0);\n this.loggerEnabled = false;\n }\n }\n }\n\n /** @internal */\n private runParse(\n options: ParseOptions | undefined,\n maxMemoryBytes: number | undefined,\n maxOperations: number | undefined,\n ): number {\n if (maxMemoryBytes !== undefined && !C.treeSitterSetMemoryLimit(maxMemoryBytes)) {\n return 0;\n }\n try {\n const [rangeAddress, rangeCount] = prepareRanges(options?.includedRanges);\n if (rangeCount && !rangeAddress) return 0;\n marshalParseInputs(maxOperations, rangeAddress, rangeCount, options?.progressCallback ? 1 : 0);\n try {\n return maxMemoryBytes === undefined\n ? this.executeOrdinaryParse()\n : this.executeLimitedParse();\n } finally {\n this.lastParseOperations = unmarshalOperationCount();\n }\n } finally {\n if (maxMemoryBytes !== undefined) C.treeSitterSetMemoryLimit(0);\n }\n }\n\n /** @internal */\n private executeOrdinaryParse(): number {\n try {\n return C._ts_parser_parse_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_last_parse_operations_wasm(this[0]);\n throw error;\n }\n }\n\n /** @internal */\n private executeLimitedParse(): number {\n try {\n return C._ts_parser_parse_limited_wasm(this[0], this[1]);\n } catch (error) {\n C._ts_parser_abort_limited_wasm();\n throw error;\n }\n }\n\n /**\n * Instruct the parser to start the next parse from the beginning.\n *\n * If the parser previously failed because of a callback,\n * then by default, it will resume where it left off on the\n * next call to {@link Parser#parse} or other parsing functions.\n * If you don't want to resume, and instead intend to use this parser to\n * parse some other document, you must call `reset` first.\n */\n reset(): void {\n C._ts_parser_reset(this[0]);\n }\n\n /** Get the ranges of text that the parser will include when parsing. */\n getIncludedRanges(): Range[] {\n C._ts_parser_included_ranges_wasm(this[0]);\n return unmarshalRanges(false);\n }\n\n /** Set the logging callback that a parser should use during parsing. */\n setLogger(callback: LogCallback | boolean | null): this {\n if (!callback) {\n this.logCallback = null;\n } else if (typeof callback !== 'function') {\n throw new Error('Logger callback must be a function');\n } else {\n this.logCallback = callback;\n }\n return this;\n }\n\n /** Get the parser's current logger. */\n getLogger(): LogCallback | null {\n return this.logCallback;\n }\n}\n\nfunction validateMemoryLimit(maxMemoryBytes?: number): number | undefined {\n if (maxMemoryBytes !== undefined &&\n (!Number.isSafeInteger(maxMemoryBytes) || maxMemoryBytes <= 0 || maxMemoryBytes > 0x7fffffff)) {\n throw new RangeError('maxMemoryBytes must be a positive integer no greater than 2147483647');\n }\n return maxMemoryBytes;\n}\n\nfunction validateOperationLimit(maxOperations?: number): number | undefined {\n if (maxOperations !== undefined && (!Number.isSafeInteger(maxOperations) || maxOperations <= 0)) {\n throw new RangeError('maxOperations must be a positive safe integer');\n }\n return maxOperations;\n}\n\nfunction prepareRanges(ranges?: Range[]): [number, number] {\n if (!ranges?.length) return [0, 0];\n const rangeAddress = C._calloc(ranges.length, SIZE_OF_RANGE);\n if (!rangeAddress) return [0, ranges.length];\n try {\n let address = rangeAddress;\n for (const range of ranges) {\n marshalRange(address, range);\n address += SIZE_OF_RANGE;\n }\n return [rangeAddress, ranges.length];\n } catch (error) {\n C._free(rangeAddress);\n throw error;\n }\n}\n\nfunction marshalParseInputs(\n maxOperations: number | undefined,\n rangeAddress: number,\n rangeCount: number,\n hasProgressCallback: number,\n): void {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n heapU32[base] = maxOperations === undefined ? 0 : maxOperations >>> 0;\n heapU32[base + 1] = maxOperations === undefined ? 0 : Math.floor(maxOperations / TWO_POW_32) >>> 0;\n heapU32[base + 2] = rangeAddress;\n heapU32[base + 3] = rangeCount;\n heapU32[base + 4] = hasProgressCallback;\n}\n\nfunction unmarshalOperationCount(): number {\n const base = TRANSFER_BUFFER >>> 2;\n const heapU32 = C.HEAPU32;\n return heapU32[base] + heapU32[base + 1] * TWO_POW_32;\n}\n\nfunction clearCallbacks(): void {\n C.currentParseCallback = null;\n C.currentLogCallback = null;\n C.currentProgressCallback = null;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAKA,QAAI,UAAU,MAAM;AAIlB,UAAI,cAAc,OAAO,YAAY,cAAc,SAAS,eAAe,MAAM;AACjF,aAAO,eAAe,YAAY,CAAC,GAAG;AACpC,YAAI;AAgBR,YAAI,SAAS;AAKb,YAAI,qBAAqB,OAAO,UAAU;AAE1C,YAAI,wBAAwB,OAAO,qBAAqB;AAIxD,YAAI,sBAAsB,OAAO,WAAW,YAAY,QAAQ,UAAU,QAAQ,QAAQ,QAAQ;AAElG,YAAI,uBAAuB,CAAC,sBAAsB,CAAC,uBAAuB,CAAC;AAK3E,eAAO,0BAA0B;AAEjC,eAAO,qBAAqB;AAE5B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AAQ,QAAO,CAAC,GAAG,CAAC;AACjC,QAAM,eAAe,EAAE,QAAQ,OAAO,QAAQ,aAAa;AAC3D,MAAI,CAAC,aAAc,QAAO,CAAC,GAAG,OAAO,MAAM;AAC3C,MAAI;AACF,QAAI,UAAU;AACd,eAAW,SAAS,QAAQ;AAC1B,mBAAa,SAAS,KAAK;AAC3B,iBAAW;AAAA,IACb;AACA,WAAO,CAAC,cAAc,OAAO,MAAM;AAAA,EACrC,SAAS,OAAO;AACd,MAAE,MAAM,YAAY;AACpB,UAAM;AAAA,EACR;AACF;AAfS;AAiBT,SAAS,mBACP,eACA,cACA,YACA,qBACM;AACN,QAAM,OAAO,oBAAoB;AACjC,QAAM,UAAU,EAAE;AAClB,UAAQ,IAAI,IAAI,kBAAkB,SAAY,IAAI,kBAAkB;AACpE,UAAQ,OAAO,CAAC,IAAI,kBAAkB,SAAY,IAAI,KAAK,MAAM,gBAAgB,UAAU,MAAM;AACjG,UAAQ,OAAO,CAAC,IAAI;AACpB,UAAQ,OAAO,CAAC,IAAI;AACpB,UAAQ,OAAO,CAAC,IAAI;AACtB;AAbS;AAeT,SAAS,0BAAkC;AACzC,QAAM,OAAO,oBAAoB;AACjC,QAAM,UAAU,EAAE;AAClB,SAAO,QAAQ,IAAI,IAAI,QAAQ,OAAO,CAAC,IAAI;AAC7C;AAJS;AAMT,SAAS,iBAAuB;AAC9B,IAAE,uBAAuB;AACzB,IAAE,qBAAqB;AACvB,IAAE,0BAA0B;AAC9B;AAJS;",
|
|
6
6
|
"names": ["binary", "args", "name", "instance", "module", "metadata", "result", "info", "exports", "count", "flags", "handle", "func", "i", "err", "memoryBase", "rtn", "libName", "localScope", "wasmExports", "Tree", "module", "finalizer", "Tree", "flags", "start", "i", "i", "i", "name", "binary", "fs", "body", "Module", "createModule", "instance", "finalizer", "Tree"]
|
|
7
7
|
}
|