@parsanol/wasm 1.5.3 → 1.5.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parsanol/wasm",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "Parsanol PEG parser — WebAssembly bindings",
5
5
  "repository": {
6
6
  "type": "git",
package/parsanol.d.ts CHANGED
@@ -71,6 +71,12 @@ export class PargArtifactJs {
71
71
  * it does not claim best-effort recovery captures.
72
72
  */
73
73
  parseShapeWithCompatibility(entry: string, input: string, compatibility: string): string;
74
+ /**
75
+ * Explicit reporter without changing existing parseShape defaults.
76
+ * Compatibility is "strict" or "parslet"; reporter is "default" or
77
+ * "deepest". The owned JSON result uses the existing shape/error envelope.
78
+ */
79
+ parseShapeWithReporter(entry: string, input: string, compatibility: string, reporter: string): string;
74
80
  /**
75
81
  * Parse an entry with the native engine; returns the parsanol-shape
76
82
  * tree as JSON text.
@@ -207,6 +213,7 @@ export interface InitOutput {
207
213
  readonly pargartifactjs_parseShape: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
208
214
  readonly pargartifactjs_parseShapeRecovering: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
209
215
  readonly pargartifactjs_parseShapeWithCompatibility: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
216
+ readonly pargartifactjs_parseShapeWithReporter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
210
217
  readonly pargartifactjs_runTests: (a: number) => [number, number, number];
211
218
  readonly pargartifactjs_schema: (a: number) => [number, number, number];
212
219
  readonly pargartifactjs_schemaTypescript: (a: number) => [number, number, number];
@@ -228,6 +235,7 @@ export interface InitOutput {
228
235
  readonly parsanol_parg_parse: (a: number, b: number) => number;
229
236
  readonly parsanol_parg_parse_recovering: (a: number, b: number, c: number) => number;
230
237
  readonly parsanol_parg_parse_with_compatibility: (a: number, b: number, c: number, d: number) => number;
238
+ readonly parsanol_parg_parse_with_reporter: (a: number, b: number, c: number, d: number, e: number) => number;
231
239
  readonly parsanol_parse: (a: number, b: number, c: number) => number;
232
240
  readonly parsanol_parse_end_pos: (a: number, b: number) => number;
233
241
  readonly parsanol_parse_simple: (a: number, b: number) => number;
package/parsanol.js CHANGED
@@ -228,6 +228,40 @@ export class PargArtifactJs {
228
228
  }
229
229
  return takeFromExternrefTable0(ret[0]);
230
230
  }
231
+ /**
232
+ * Explicit reporter without changing existing parseShape defaults.
233
+ * Compatibility is "strict" or "parslet"; reporter is "default" or
234
+ * "deepest". The owned JSON result uses the existing shape/error envelope.
235
+ * @param {string} entry
236
+ * @param {string} input
237
+ * @param {string} compatibility
238
+ * @param {string} reporter
239
+ * @returns {string}
240
+ */
241
+ parseShapeWithReporter(entry, input, compatibility, reporter) {
242
+ let ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3;
243
+ try {
244
+ ptr0 = passStringToWasm0(entry, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
245
+ len0 = WASM_VECTOR_LEN;
246
+ ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
247
+ len1 = WASM_VECTOR_LEN;
248
+ ptr2 = passStringToWasm0(compatibility, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
249
+ len2 = WASM_VECTOR_LEN;
250
+ ptr3 = passStringToWasm0(reporter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
251
+ len3 = WASM_VECTOR_LEN;
252
+ } catch (e) {
253
+ if (ptr3) { wasm.__wbindgen_free(ptr3, len3 * 1, 1); }
254
+ if (ptr2) { wasm.__wbindgen_free(ptr2, len2 * 1, 1); }
255
+ if (ptr1) { wasm.__wbindgen_free(ptr1, len1 * 1, 1); }
256
+ if (ptr0) { wasm.__wbindgen_free(ptr0, len0 * 1, 1); }
257
+ throw e;
258
+ }
259
+ const ret = wasm.pargartifactjs_parseShapeWithReporter(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
260
+ if (ret[2]) {
261
+ throw takeFromExternrefTable0(ret[1]);
262
+ }
263
+ return takeFromExternrefTable0(ret[0]);
264
+ }
231
265
  /**
232
266
  * Parse an entry with the native engine; returns the parsanol-shape
233
267
  * tree as JSON text.
package/parsanol_bg.wasm CHANGED
Binary file
@@ -14,6 +14,7 @@ export const pargartifactjs_parseAndBind: (a: number, b: number, c: number, d: n
14
14
  export const pargartifactjs_parseShape: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
15
15
  export const pargartifactjs_parseShapeRecovering: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
16
16
  export const pargartifactjs_parseShapeWithCompatibility: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
17
+ export const pargartifactjs_parseShapeWithReporter: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
17
18
  export const pargartifactjs_runTests: (a: number) => [number, number, number];
18
19
  export const pargartifactjs_schema: (a: number) => [number, number, number];
19
20
  export const pargartifactjs_schemaTypescript: (a: number) => [number, number, number];
@@ -35,6 +36,7 @@ export const parsanol_parg_generate: (a: number, b: number, c: number) => number
35
36
  export const parsanol_parg_parse: (a: number, b: number) => number;
36
37
  export const parsanol_parg_parse_recovering: (a: number, b: number, c: number) => number;
37
38
  export const parsanol_parg_parse_with_compatibility: (a: number, b: number, c: number, d: number) => number;
39
+ export const parsanol_parg_parse_with_reporter: (a: number, b: number, c: number, d: number, e: number) => number;
38
40
  export const parsanol_parse: (a: number, b: number, c: number) => number;
39
41
  export const parsanol_parse_end_pos: (a: number, b: number) => number;
40
42
  export const parsanol_parse_simple: (a: number, b: number) => number;