@parsanol/wasm 0.19.1 → 0.19.3
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 +3 -2
- package/parsanol.d.ts +11 -3
- package/parsanol.js +31 -3
- package/parsanol_bg.wasm +0 -0
- package/parsanol_bg.wasm.d.ts +1 -0
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"Ribose Inc. <open.source@ribose.com>"
|
|
6
6
|
],
|
|
7
7
|
"description": "Parsanol PEG parser — WebAssembly bindings",
|
|
8
|
-
"version": "0.19.
|
|
8
|
+
"version": "0.19.3",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
".": {
|
|
35
35
|
"types": "./parsanol.d.ts",
|
|
36
36
|
"default": "./parsanol.js"
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
38
39
|
}
|
|
39
40
|
}
|
package/parsanol.d.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* A verified PARG artifact exposed to JavaScript: checksum-verified
|
|
13
|
-
* native parse, bindings application, embedded-suite runs and
|
|
14
|
-
* binding-requirements schema (PN 2/4).
|
|
12
|
+
* A verified PARG artifact exposed to JavaScript: checksum-verified
|
|
13
|
+
* load, native parse, bindings application, embedded-suite runs and
|
|
14
|
+
* the binding-requirements schema (PN 2/4).
|
|
15
15
|
*/
|
|
16
16
|
export class PargArtifactJs {
|
|
17
17
|
free(): void;
|
|
@@ -134,6 +134,13 @@ export class WasmParser {
|
|
|
134
134
|
parse_json(input: string): string;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Compile PARG source to a checksummed artifact — the playground's
|
|
139
|
+
* compiler-in-the-browser (site#19). Single-file grammars: `use`
|
|
140
|
+
* imports have no filesystem here and reject with the merge error.
|
|
141
|
+
*/
|
|
142
|
+
export function compileSource(source: string): string;
|
|
143
|
+
|
|
137
144
|
/**
|
|
138
145
|
* Install the panic hook (better panic messages in the console).
|
|
139
146
|
*
|
|
@@ -152,6 +159,7 @@ export interface InitOutput {
|
|
|
152
159
|
readonly memory: WebAssembly.Memory;
|
|
153
160
|
readonly __wbg_pargartifactjs_free: (a: number, b: number) => void;
|
|
154
161
|
readonly __wbg_wasmparser_free: (a: number, b: number) => void;
|
|
162
|
+
readonly compileSource: (a: number, b: number) => [number, number, number, number];
|
|
155
163
|
readonly pargartifactjs_applyBindings: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
156
164
|
readonly pargartifactjs_entryNames: (a: number) => [number, number];
|
|
157
165
|
readonly pargartifactjs_new: (a: number, b: number) => [number, number, number];
|
package/parsanol.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* @ts-self-types="./parsanol.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* A verified PARG artifact exposed to JavaScript: checksum-verified
|
|
5
|
-
* native parse, bindings application, embedded-suite runs and
|
|
6
|
-
* binding-requirements schema (PN 2/4).
|
|
4
|
+
* A verified PARG artifact exposed to JavaScript: checksum-verified
|
|
5
|
+
* load, native parse, bindings application, embedded-suite runs and
|
|
6
|
+
* the binding-requirements schema (PN 2/4).
|
|
7
7
|
*/
|
|
8
8
|
export class PargArtifactJs {
|
|
9
9
|
__destroy_into_raw() {
|
|
@@ -307,6 +307,34 @@ export class WasmParser {
|
|
|
307
307
|
}
|
|
308
308
|
if (Symbol.dispose) WasmParser.prototype[Symbol.dispose] = WasmParser.prototype.free;
|
|
309
309
|
|
|
310
|
+
/**
|
|
311
|
+
* Compile PARG source to a checksummed artifact — the playground's
|
|
312
|
+
* compiler-in-the-browser (site#19). Single-file grammars: `use`
|
|
313
|
+
* imports have no filesystem here and reject with the merge error.
|
|
314
|
+
* @param {string} source
|
|
315
|
+
* @returns {string}
|
|
316
|
+
*/
|
|
317
|
+
export function compileSource(source) {
|
|
318
|
+
let deferred3_0;
|
|
319
|
+
let deferred3_1;
|
|
320
|
+
try {
|
|
321
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
323
|
+
const ret = wasm.compileSource(ptr0, len0);
|
|
324
|
+
var ptr2 = ret[0];
|
|
325
|
+
var len2 = ret[1];
|
|
326
|
+
if (ret[3]) {
|
|
327
|
+
ptr2 = 0; len2 = 0;
|
|
328
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
329
|
+
}
|
|
330
|
+
deferred3_0 = ptr2;
|
|
331
|
+
deferred3_1 = len2;
|
|
332
|
+
return getStringFromWasm0(ptr2, len2);
|
|
333
|
+
} finally {
|
|
334
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
310
338
|
/**
|
|
311
339
|
* Install the panic hook (better panic messages in the console).
|
|
312
340
|
*
|
package/parsanol_bg.wasm
CHANGED
|
Binary file
|
package/parsanol_bg.wasm.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_pargartifactjs_free: (a: number, b: number) => void;
|
|
5
5
|
export const __wbg_wasmparser_free: (a: number, b: number) => void;
|
|
6
|
+
export const compileSource: (a: number, b: number) => [number, number, number, number];
|
|
6
7
|
export const pargartifactjs_applyBindings: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
7
8
|
export const pargartifactjs_entryNames: (a: number) => [number, number];
|
|
8
9
|
export const pargartifactjs_new: (a: number, b: number) => [number, number, number];
|