@willbooster/web-tree-sitter 26.2.1 → 26.3.1

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.
@@ -1958,7 +1958,7 @@ async function Module2(moduleArg = {}) {
1958
1958
  newDSO("__main__", 0, wasmImports);
1959
1959
  }
1960
1960
  };
1961
- var ___heap_base = 82e3;
1961
+ var ___heap_base = 82096;
1962
1962
  var alignMemory = /* @__PURE__ */ __name((size, alignment) => {
1963
1963
  assert(alignment, "alignment argument is required");
1964
1964
  return Math.ceil(size / alignment) * alignment;
@@ -2053,7 +2053,7 @@ async function Module2(moduleArg = {}) {
2053
2053
  }, "convertJsFunctionToWasm");
2054
2054
  var wasmTableMirror = [];
2055
2055
  var wasmTable = new WebAssembly.Table({
2056
- "initial": 64,
2056
+ "initial": 65,
2057
2057
  "element": "anyfunc"
2058
2058
  });
2059
2059
  var getWasmTableEntry = /* @__PURE__ */ __name((funcPtr) => {
@@ -2589,12 +2589,12 @@ async function Module2(moduleArg = {}) {
2589
2589
  "value": "i32",
2590
2590
  "mutable": false
2591
2591
  }, 1024);
2592
- var ___stack_high = 82e3;
2593
- var ___stack_low = 16464;
2592
+ var ___stack_high = 82096;
2593
+ var ___stack_low = 16560;
2594
2594
  var ___stack_pointer = new WebAssembly.Global({
2595
2595
  "value": "i32",
2596
2596
  "mutable": true
2597
- }, 82e3);
2597
+ }, 82096);
2598
2598
  var ___table_base = new WebAssembly.Global({
2599
2599
  "value": "i32",
2600
2600
  "mutable": false
@@ -3263,7 +3263,7 @@ async function Module2(moduleArg = {}) {
3263
3263
  }
3264
3264
  __name(callMain, "callMain");
3265
3265
  function stackCheckInit() {
3266
- _emscripten_stack_set_limits(82e3, 16464);
3266
+ _emscripten_stack_set_limits(82096, 16560);
3267
3267
  writeStackCookie();
3268
3268
  }
3269
3269
  __name(stackCheckInit, "stackCheckInit");
@@ -3453,7 +3453,9 @@ var Parser = class {
3453
3453
  *
3454
3454
  * If the language was not successfully assigned, an error will be thrown.
3455
3455
  * This happens if the language was generated with an incompatible
3456
- * version of the Tree-sitter CLI. Check the language's version using
3456
+ * version of the Tree-sitter CLI or has incompatible name-role tables.
3457
+ * Regenerate the grammar with the CLI from the runtime's release and
3458
+ * rebuild its Wasm file. Check the language's version using
3457
3459
  * {@link Language#abiVersion}; this library accepts versions from
3458
3460
  * {@link MIN_COMPATIBLE_VERSION} to {@link LANGUAGE_VERSION}.
3459
3461
  */
@@ -3461,15 +3463,17 @@ var Parser = class {
3461
3463
  let address;
3462
3464
  if (!language) {
3463
3465
  address = 0;
3464
- this.language = null;
3465
3466
  } else if (language.constructor === Language) {
3466
3467
  address = language[0];
3467
3468
  assertSupportedLanguage(language);
3468
- this.language = language;
3469
3469
  } else {
3470
3470
  throw new Error("Argument must be a Language");
3471
3471
  }
3472
- C._wb_ts_parser_set_language(this[0], address);
3472
+ if (!C._wb_ts_parser_set_language(this[0], address)) {
3473
+ this.language = null;
3474
+ throw new Error("Language cannot be used for parsing.");
3475
+ }
3476
+ this.language = address ? language : null;
3473
3477
  return this;
3474
3478
  }
3475
3479
  /**