@parsanol/wasm 0.20.14 → 0.20.16
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/package.json +1 -1
- package/parsanol.d.ts +10 -0
- package/parsanol.js +20 -0
- package/parsanol_bg.wasm +0 -0
- package/parsanol_bg.wasm.d.ts +2 -0
package/package.json
CHANGED
package/parsanol.d.ts
CHANGED
|
@@ -32,6 +32,14 @@ export class PargArtifactJs {
|
|
|
32
32
|
* Declared entry point names, sorted.
|
|
33
33
|
*/
|
|
34
34
|
entryNames(): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Lower the artifact to a constrained-decoder grammar form
|
|
37
|
+
* (`target`: "xgrammar" | "llguidance"); `recovery` lowers each
|
|
38
|
+
* declared resync pattern as an escape alternative at the
|
|
39
|
+
* repetition spine. Rust is the authoritative lowering — TS
|
|
40
|
+
* inherits it through this surface instead of a per-language port.
|
|
41
|
+
*/
|
|
42
|
+
export(target: string, recovery: boolean): string;
|
|
35
43
|
/**
|
|
36
44
|
* Load and checksum-verify an artifact envelope.
|
|
37
45
|
*/
|
|
@@ -184,6 +192,7 @@ export interface InitOutput {
|
|
|
184
192
|
readonly pargartifactjs_applyBindings: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
185
193
|
readonly pargartifactjs_applyBindingsArtifact: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
186
194
|
readonly pargartifactjs_entryNames: (a: number) => [number, number];
|
|
195
|
+
readonly pargartifactjs_export: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
187
196
|
readonly pargartifactjs_new: (a: number, b: number) => [number, number, number];
|
|
188
197
|
readonly pargartifactjs_parseAndBind: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
189
198
|
readonly pargartifactjs_parseShape: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
@@ -204,6 +213,7 @@ export interface InitOutput {
|
|
|
204
213
|
readonly parsanol_grammar_new_with_error: (a: number, b: number) => number;
|
|
205
214
|
readonly parsanol_grammar_root: (a: number) => number;
|
|
206
215
|
readonly parsanol_parg_error: (a: number, b: number) => number;
|
|
216
|
+
readonly parsanol_parg_export: (a: number, b: number, c: number) => number;
|
|
207
217
|
readonly parsanol_parg_free: (a: number) => void;
|
|
208
218
|
readonly parsanol_parg_parse: (a: number, b: number) => number;
|
|
209
219
|
readonly parsanol_parg_parse_recovering: (a: number, b: number, c: number) => number;
|
package/parsanol.js
CHANGED
|
@@ -82,6 +82,26 @@ export class PargArtifactJs {
|
|
|
82
82
|
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
83
83
|
return v1;
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Lower the artifact to a constrained-decoder grammar form
|
|
87
|
+
* (`target`: "xgrammar" | "llguidance"); `recovery` lowers each
|
|
88
|
+
* declared resync pattern as an escape alternative at the
|
|
89
|
+
* repetition spine. Rust is the authoritative lowering — TS
|
|
90
|
+
* inherits it through this surface instead of a per-language port.
|
|
91
|
+
* @param {string} target
|
|
92
|
+
* @param {boolean} recovery
|
|
93
|
+
* @returns {string}
|
|
94
|
+
*/
|
|
95
|
+
export(target, recovery) {
|
|
96
|
+
const val2 = +recovery;
|
|
97
|
+
const ptr0 = passStringToWasm0(target, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
98
|
+
const len0 = WASM_VECTOR_LEN;
|
|
99
|
+
const ret = wasm.pargartifactjs_export(this.__wbg_ptr, ptr0, len0, val2);
|
|
100
|
+
if (ret[2]) {
|
|
101
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
102
|
+
}
|
|
103
|
+
return takeFromExternrefTable0(ret[0]);
|
|
104
|
+
}
|
|
85
105
|
/**
|
|
86
106
|
* Load and checksum-verify an artifact envelope.
|
|
87
107
|
* @param {string} artifact_json
|
package/parsanol_bg.wasm
CHANGED
|
Binary file
|
package/parsanol_bg.wasm.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export const compileSource: (a: number, b: number) => [number, number, number, n
|
|
|
7
7
|
export const pargartifactjs_applyBindings: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
8
8
|
export const pargartifactjs_applyBindingsArtifact: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
9
9
|
export const pargartifactjs_entryNames: (a: number) => [number, number];
|
|
10
|
+
export const pargartifactjs_export: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
10
11
|
export const pargartifactjs_new: (a: number, b: number) => [number, number, number];
|
|
11
12
|
export const pargartifactjs_parseAndBind: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
12
13
|
export const pargartifactjs_parseShape: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
@@ -27,6 +28,7 @@ export const parsanol_grammar_new: (a: number) => number;
|
|
|
27
28
|
export const parsanol_grammar_new_with_error: (a: number, b: number) => number;
|
|
28
29
|
export const parsanol_grammar_root: (a: number) => number;
|
|
29
30
|
export const parsanol_parg_error: (a: number, b: number) => number;
|
|
31
|
+
export const parsanol_parg_export: (a: number, b: number, c: number) => number;
|
|
30
32
|
export const parsanol_parg_free: (a: number) => void;
|
|
31
33
|
export const parsanol_parg_parse: (a: number, b: number) => number;
|
|
32
34
|
export const parsanol_parg_parse_recovering: (a: number, b: number, c: number) => number;
|