@willbooster/web-tree-sitter 1.0.4 → 1.0.6
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 +15 -14
- package/debug/web-tree-sitter.cjs.map +2 -2
- package/debug/web-tree-sitter.js +15 -14
- package/debug/web-tree-sitter.js.map +2 -2
- package/package.json +8 -1
- package/web-tree-sitter.cjs +15 -14
- package/web-tree-sitter.cjs.map +2 -2
- package/web-tree-sitter.d.cts +0 -7
- package/web-tree-sitter.d.cts.map +1 -1
- package/web-tree-sitter.d.ts +0 -7
- package/web-tree-sitter.d.ts.map +1 -1
- package/web-tree-sitter.js +15 -14
- package/web-tree-sitter.js.map +2 -2
- package/web-tree-sitter.web.js +15 -14
- package/web-tree-sitter.web.js.map +2 -2
package/web-tree-sitter.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
declare module '@willbooster/web-tree-sitter' {
|
|
3
2
|
/**
|
|
4
3
|
* A position in a multi-line text document, in terms of rows and columns.
|
|
5
4
|
*
|
|
@@ -328,7 +327,6 @@ declare module '@willbooster/web-tree-sitter' {
|
|
|
328
327
|
* do not allow compiling Wasm at run time, pass the imported `.wasm` module.
|
|
329
328
|
*/
|
|
330
329
|
static load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language>;
|
|
331
|
-
private static loadFromWasmExports;
|
|
332
330
|
/**
|
|
333
331
|
* Load a language synchronously from a pre-compiled WebAssembly module.
|
|
334
332
|
* Use this when the host environment provides a `WebAssembly.Module` directly.
|
|
@@ -1051,10 +1049,5 @@ declare module '@willbooster/web-tree-sitter' {
|
|
|
1051
1049
|
}
|
|
1052
1050
|
|
|
1053
1051
|
export {};
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
declare module '@willbooster/web-tree-sitter/debug' {
|
|
1057
|
-
export * from '@willbooster/web-tree-sitter';
|
|
1058
|
-
}
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCINC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsEZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAyUvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzfLC,iBAAiBA",
|
|
60
60
|
"ignoreList": []
|
|
61
61
|
}
|
package/web-tree-sitter.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="emscripten" />
|
|
2
|
-
declare module '@willbooster/web-tree-sitter' {
|
|
3
2
|
/**
|
|
4
3
|
* A position in a multi-line text document, in terms of rows and columns.
|
|
5
4
|
*
|
|
@@ -328,7 +327,6 @@ declare module '@willbooster/web-tree-sitter' {
|
|
|
328
327
|
* do not allow compiling Wasm at run time, pass the imported `.wasm` module.
|
|
329
328
|
*/
|
|
330
329
|
static load(input: string | URL | Uint8Array | WebAssembly.Module): Promise<Language>;
|
|
331
|
-
private static loadFromWasmExports;
|
|
332
330
|
/**
|
|
333
331
|
* Load a language synchronously from a pre-compiled WebAssembly module.
|
|
334
332
|
* Use this when the host environment provides a `WebAssembly.Module` directly.
|
|
@@ -1051,10 +1049,5 @@ declare module '@willbooster/web-tree-sitter' {
|
|
|
1051
1049
|
}
|
|
1052
1050
|
|
|
1053
1051
|
export {};
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
declare module '@willbooster/web-tree-sitter/debug' {
|
|
1057
|
-
export * from '@willbooster/web-tree-sitter';
|
|
1058
|
-
}
|
|
1059
1052
|
|
|
1060
1053
|
//# sourceMappingURL=web-tree-sitter.d.ts.map
|
package/web-tree-sitter.d.ts.map
CHANGED
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
null,
|
|
57
57
|
null
|
|
58
58
|
],
|
|
59
|
-
"mappings": "
|
|
59
|
+
"mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAKbC,gBAAgBA;;;;;;aAOhBC,WAAWA;;kBChENC,iBAAiBA;;;;;;;cCLrBC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;;YAwBhBC,gBAAgBA;;;;;YAMhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCvFFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCEJC,UAAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCINC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsEZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAyUvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCzfLC,iBAAiBA",
|
|
60
60
|
"ignoreList": []
|
|
61
61
|
}
|
package/web-tree-sitter.js
CHANGED
|
@@ -1332,7 +1332,7 @@ __name(unmarshalLanguageMetadata, "unmarshalLanguageMetadata");
|
|
|
1332
1332
|
|
|
1333
1333
|
// src/language.ts
|
|
1334
1334
|
var LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\w+$/;
|
|
1335
|
-
var Language = class
|
|
1335
|
+
var Language = class {
|
|
1336
1336
|
static {
|
|
1337
1337
|
__name(this, "Language");
|
|
1338
1338
|
}
|
|
@@ -1551,18 +1551,7 @@ ${body2}`);
|
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
const mod = await C.loadWebAssemblyModule(binary2, { loadAsync: true });
|
|
1554
|
-
return
|
|
1555
|
-
}
|
|
1556
|
-
static loadFromWasmExports(mod, { sync }) {
|
|
1557
|
-
const symbolNames = Object.keys(mod);
|
|
1558
|
-
const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) && !key.includes("external_scanner_"));
|
|
1559
|
-
if (!functionName) {
|
|
1560
|
-
console.log(`Couldn't find language function in Wasm file. Symbols:
|
|
1561
|
-
${JSON.stringify(symbolNames, null, 2)}`);
|
|
1562
|
-
throw new Error(`Language.${sync ? "loadSync" : "load"} failed: no language function found in Wasm file`);
|
|
1563
|
-
}
|
|
1564
|
-
const languageAddress = mod[functionName]();
|
|
1565
|
-
return new _Language(INTERNAL, languageAddress);
|
|
1554
|
+
return loadFromWasmExports(mod, { sync: false });
|
|
1566
1555
|
}
|
|
1567
1556
|
/**
|
|
1568
1557
|
* Load a language synchronously from a pre-compiled WebAssembly module.
|
|
@@ -1570,9 +1559,21 @@ ${JSON.stringify(symbolNames, null, 2)}`);
|
|
|
1570
1559
|
*/
|
|
1571
1560
|
static loadSync(wasmModule) {
|
|
1572
1561
|
const mod = C.loadWebAssemblyModule(wasmModule, { loadAsync: false });
|
|
1573
|
-
return
|
|
1562
|
+
return loadFromWasmExports(mod, { sync: true });
|
|
1574
1563
|
}
|
|
1575
1564
|
};
|
|
1565
|
+
function loadFromWasmExports(mod, { sync }) {
|
|
1566
|
+
const symbolNames = Object.keys(mod);
|
|
1567
|
+
const functionName = symbolNames.find((key) => LANGUAGE_FUNCTION_REGEX.test(key) && !key.includes("external_scanner_"));
|
|
1568
|
+
if (!functionName) {
|
|
1569
|
+
console.log(`Couldn't find language function in Wasm file. Symbols:
|
|
1570
|
+
${JSON.stringify(symbolNames, null, 2)}`);
|
|
1571
|
+
throw new Error(`Language.${sync ? "loadSync" : "load"} failed: no language function found in Wasm file`);
|
|
1572
|
+
}
|
|
1573
|
+
const languageAddress = mod[functionName]();
|
|
1574
|
+
return new Language(INTERNAL, languageAddress);
|
|
1575
|
+
}
|
|
1576
|
+
__name(loadFromWasmExports, "loadFromWasmExports");
|
|
1576
1577
|
|
|
1577
1578
|
// lib/web-tree-sitter.mjs
|
|
1578
1579
|
async function Module2(moduleArg = {}) {
|