@hew-lang/wasm 0.6.0-rc7 → 0.6.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.
Files changed (4) hide show
  1. package/package.json +3 -3
  2. package/wasm.d.ts +33 -18
  3. package/wasm.js +194 -35
  4. package/wasm_bg.wasm +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hew-lang/wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Hew analysis and verified sandbox compilation",
5
- "version": "0.6.0-rc7",
5
+ "version": "0.6.1",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -26,8 +26,8 @@
26
26
  "webassembly"
27
27
  ],
28
28
  "hewSource": {
29
- "commit": "f09d3403587d1cf1bc33d00444bc76ae96861c17",
30
- "tag": "v0.6.0-rc7",
29
+ "commit": "6a446f773391f45d2c0ce0a799240b8b9afef54e",
30
+ "tag": "v0.6.1",
31
31
  "dirty": false
32
32
  },
33
33
  "publishConfig": {
package/wasm.d.ts CHANGED
@@ -2,15 +2,13 @@
2
2
  /* eslint-disable */
3
3
 
4
4
  /**
5
- * Analyze Hew source code and return diagnostics, tokens, and symbols as JSON.
6
- *
7
- * This is analysis-only and does not execute the program.
5
+ * Analyze source using the supplied browser input files.
8
6
  *
9
7
  * # Errors
10
8
  *
11
- * Returns a JavaScript error if the analysis result cannot be serialized.
9
+ * Returns a JavaScript error if an input is invalid or the result cannot be serialized.
12
10
  */
13
- export function analyze(source: string): string;
11
+ export function analyze(source: string, files?: Map<any, any> | null): string;
14
12
 
15
13
  /**
16
14
  * Get code actions for given diagnostics JSON. Returns JSON array of `CodeAction`.
@@ -43,8 +41,12 @@ export function compileTestsToSandboxBytecode(source: string, file: string): str
43
41
  *
44
42
  * `profile` should be `"sandbox-vm-export"` for the educational sandbox VM.
45
43
  * An unrecognised profile is reported as a diagnostic with `bytecode: null`.
44
+ *
45
+ * # Panics
46
+ *
47
+ * Panics if the compiled output cannot be serialized as JSON.
46
48
  */
47
- export function compileToSandboxBytecode(source: string, profile: string): string;
49
+ export function compileToSandboxBytecode(source: string, profile: string, files?: Map<any, any> | null): string;
48
50
 
49
51
  /**
50
52
  * Get completions at byte offset. Returns JSON array of `CompletionItem`.
@@ -64,6 +66,20 @@ export function complete(source: string, offset: number): string;
64
66
  */
65
67
  export function document_symbols(source: string): string;
66
68
 
69
+ /**
70
+ * Execute the compiler's typed codec plan using the shared native engine.
71
+ */
72
+ export function executeCodec(request: string): string;
73
+
74
+ /**
75
+ * Render the macro expansion at a byte offset using the shared frontend.
76
+ *
77
+ * # Errors
78
+ *
79
+ * Returns an error when loading or expansion fails, or no expansion covers the offset.
80
+ */
81
+ export function expand_macro(source: string, offset: number): string;
82
+
67
83
  /**
68
84
  * Find all references at offset. Returns JSON `{ name, spans }` or `"null"` if no symbol found.
69
85
  *
@@ -182,28 +198,26 @@ export function semantic_tokens(source: string): string;
182
198
  export function signature_help(source: string, offset: number): string;
183
199
 
184
200
  /**
185
- * Type-check Hew source code and return JSON `{ diagnostics, type_info }`.
186
- *
187
- * `diagnostics` includes parser and checker diagnostics. `type_info` contains
188
- * byte-span keyed, user-facing resolved types for hover/editor consumers; it is
189
- * empty when parsing fails and the checker is skipped.
201
+ * Type-check source using the supplied browser input files.
190
202
  *
191
203
  * # Errors
192
204
  *
193
- * Returns a JavaScript error if the type-check result cannot be serialized.
205
+ * Returns a JavaScript error if an input is invalid or the result cannot be serialized.
194
206
  */
195
- export function type_check(source: string): string;
207
+ export function type_check(source: string, files?: Map<any, any> | null): string;
196
208
 
197
209
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
198
210
 
199
211
  export interface InitOutput {
200
212
  readonly memory: WebAssembly.Memory;
201
- readonly analyze: (a: number, b: number, c: number) => void;
213
+ readonly analyze: (a: number, b: number, c: number, d: number) => void;
202
214
  readonly code_actions: (a: number, b: number, c: number, d: number, e: number) => void;
203
215
  readonly compileTestsToSandboxBytecode: (a: number, b: number, c: number, d: number, e: number) => void;
204
- readonly compileToSandboxBytecode: (a: number, b: number, c: number, d: number, e: number) => void;
216
+ readonly compileToSandboxBytecode: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
205
217
  readonly complete: (a: number, b: number, c: number, d: number) => void;
206
218
  readonly document_symbols: (a: number, b: number, c: number) => void;
219
+ readonly executeCodec: (a: number, b: number, c: number) => void;
220
+ readonly expand_macro: (a: number, b: number, c: number, d: number) => void;
207
221
  readonly find_references: (a: number, b: number, c: number, d: number) => void;
208
222
  readonly folding_ranges: (a: number, b: number, c: number) => void;
209
223
  readonly format_source: (a: number, b: number, c: number) => void;
@@ -216,11 +230,12 @@ export interface InitOutput {
216
230
  readonly rename: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
217
231
  readonly semantic_tokens: (a: number, b: number, c: number) => void;
218
232
  readonly signature_help: (a: number, b: number, c: number, d: number) => void;
219
- readonly type_check: (a: number, b: number, c: number) => void;
220
- readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
233
+ readonly type_check: (a: number, b: number, c: number, d: number) => void;
221
234
  readonly __wbindgen_export: (a: number, b: number) => number;
222
235
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
223
- readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
236
+ readonly __wbindgen_export3: (a: number) => void;
237
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
238
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
224
239
  }
225
240
 
226
241
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/wasm.js CHANGED
@@ -1,24 +1,23 @@
1
1
  /* @ts-self-types="./wasm.d.ts" */
2
2
 
3
3
  /**
4
- * Analyze Hew source code and return diagnostics, tokens, and symbols as JSON.
5
- *
6
- * This is analysis-only and does not execute the program.
4
+ * Analyze source using the supplied browser input files.
7
5
  *
8
6
  * # Errors
9
7
  *
10
- * Returns a JavaScript error if the analysis result cannot be serialized.
8
+ * Returns a JavaScript error if an input is invalid or the result cannot be serialized.
11
9
  * @param {string} source
10
+ * @param {Map<any, any> | null} [files]
12
11
  * @returns {string}
13
12
  */
14
- export function analyze(source) {
13
+ export function analyze(source, files) {
15
14
  let deferred3_0;
16
15
  let deferred3_1;
17
16
  try {
18
17
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
19
18
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
20
19
  const len0 = WASM_VECTOR_LEN;
21
- wasm.analyze(retptr, ptr0, len0);
20
+ wasm.analyze(retptr, ptr0, len0, isLikeNone(files) ? 0 : addHeapObject(files));
22
21
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
23
22
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
24
23
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -34,7 +33,7 @@ export function analyze(source) {
34
33
  return getStringFromWasm0(ptr2, len2);
35
34
  } finally {
36
35
  wasm.__wbindgen_add_to_stack_pointer(16);
37
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
36
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
38
37
  }
39
38
  }
40
39
 
@@ -77,7 +76,7 @@ export function code_actions(source, diagnostics_json) {
77
76
  return getStringFromWasm0(ptr3, len3);
78
77
  } finally {
79
78
  wasm.__wbindgen_add_to_stack_pointer(16);
80
- wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
79
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
81
80
  }
82
81
  }
83
82
 
@@ -106,7 +105,7 @@ export function compileTestsToSandboxBytecode(source, file) {
106
105
  return getStringFromWasm0(r0, r1);
107
106
  } finally {
108
107
  wasm.__wbindgen_add_to_stack_pointer(16);
109
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
108
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
110
109
  }
111
110
  }
112
111
 
@@ -121,11 +120,16 @@ export function compileTestsToSandboxBytecode(source, file) {
121
120
  *
122
121
  * `profile` should be `"sandbox-vm-export"` for the educational sandbox VM.
123
122
  * An unrecognised profile is reported as a diagnostic with `bytecode: null`.
123
+ *
124
+ * # Panics
125
+ *
126
+ * Panics if the compiled output cannot be serialized as JSON.
124
127
  * @param {string} source
125
128
  * @param {string} profile
129
+ * @param {Map<any, any> | null} [files]
126
130
  * @returns {string}
127
131
  */
128
- export function compileToSandboxBytecode(source, profile) {
132
+ export function compileToSandboxBytecode(source, profile, files) {
129
133
  let deferred3_0;
130
134
  let deferred3_1;
131
135
  try {
@@ -134,7 +138,7 @@ export function compileToSandboxBytecode(source, profile) {
134
138
  const len0 = WASM_VECTOR_LEN;
135
139
  const ptr1 = passStringToWasm0(profile, wasm.__wbindgen_export, wasm.__wbindgen_export2);
136
140
  const len1 = WASM_VECTOR_LEN;
137
- wasm.compileToSandboxBytecode(retptr, ptr0, len0, ptr1, len1);
141
+ wasm.compileToSandboxBytecode(retptr, ptr0, len0, ptr1, len1, isLikeNone(files) ? 0 : addHeapObject(files));
138
142
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
139
143
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
140
144
  deferred3_0 = r0;
@@ -142,7 +146,7 @@ export function compileToSandboxBytecode(source, profile) {
142
146
  return getStringFromWasm0(r0, r1);
143
147
  } finally {
144
148
  wasm.__wbindgen_add_to_stack_pointer(16);
145
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
149
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
146
150
  }
147
151
  }
148
152
 
@@ -179,7 +183,7 @@ export function complete(source, offset) {
179
183
  return getStringFromWasm0(ptr2, len2);
180
184
  } finally {
181
185
  wasm.__wbindgen_add_to_stack_pointer(16);
182
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
186
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
183
187
  }
184
188
  }
185
189
 
@@ -215,7 +219,68 @@ export function document_symbols(source) {
215
219
  return getStringFromWasm0(ptr2, len2);
216
220
  } finally {
217
221
  wasm.__wbindgen_add_to_stack_pointer(16);
218
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
222
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
223
+ }
224
+ }
225
+
226
+ /**
227
+ * Execute the compiler's typed codec plan using the shared native engine.
228
+ * @param {string} request
229
+ * @returns {string}
230
+ */
231
+ export function executeCodec(request) {
232
+ let deferred2_0;
233
+ let deferred2_1;
234
+ try {
235
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
236
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
237
+ const len0 = WASM_VECTOR_LEN;
238
+ wasm.executeCodec(retptr, ptr0, len0);
239
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
240
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
241
+ deferred2_0 = r0;
242
+ deferred2_1 = r1;
243
+ return getStringFromWasm0(r0, r1);
244
+ } finally {
245
+ wasm.__wbindgen_add_to_stack_pointer(16);
246
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Render the macro expansion at a byte offset using the shared frontend.
252
+ *
253
+ * # Errors
254
+ *
255
+ * Returns an error when loading or expansion fails, or no expansion covers the offset.
256
+ * @param {string} source
257
+ * @param {number} offset
258
+ * @returns {string}
259
+ */
260
+ export function expand_macro(source, offset) {
261
+ let deferred3_0;
262
+ let deferred3_1;
263
+ try {
264
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
265
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
266
+ const len0 = WASM_VECTOR_LEN;
267
+ wasm.expand_macro(retptr, ptr0, len0, offset);
268
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
269
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
270
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
271
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
272
+ var ptr2 = r0;
273
+ var len2 = r1;
274
+ if (r3) {
275
+ ptr2 = 0; len2 = 0;
276
+ throw takeObject(r2);
277
+ }
278
+ deferred3_0 = ptr2;
279
+ deferred3_1 = len2;
280
+ return getStringFromWasm0(ptr2, len2);
281
+ } finally {
282
+ wasm.__wbindgen_add_to_stack_pointer(16);
283
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
219
284
  }
220
285
  }
221
286
 
@@ -252,7 +317,7 @@ export function find_references(source, offset) {
252
317
  return getStringFromWasm0(ptr2, len2);
253
318
  } finally {
254
319
  wasm.__wbindgen_add_to_stack_pointer(16);
255
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
320
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
256
321
  }
257
322
  }
258
323
 
@@ -288,7 +353,7 @@ export function folding_ranges(source) {
288
353
  return getStringFromWasm0(ptr2, len2);
289
354
  } finally {
290
355
  wasm.__wbindgen_add_to_stack_pointer(16);
291
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
356
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
292
357
  }
293
358
  }
294
359
 
@@ -327,7 +392,7 @@ export function format_source(source) {
327
392
  return getStringFromWasm0(ptr2, len2);
328
393
  } finally {
329
394
  wasm.__wbindgen_add_to_stack_pointer(16);
330
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
395
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
331
396
  }
332
397
  }
333
398
 
@@ -360,7 +425,7 @@ export function get_keywords() {
360
425
  return getStringFromWasm0(ptr1, len1);
361
426
  } finally {
362
427
  wasm.__wbindgen_add_to_stack_pointer(16);
363
- wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
428
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
364
429
  }
365
430
  }
366
431
 
@@ -397,7 +462,7 @@ export function goto_definition(source, offset) {
397
462
  return getStringFromWasm0(ptr2, len2);
398
463
  } finally {
399
464
  wasm.__wbindgen_add_to_stack_pointer(16);
400
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
465
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
401
466
  }
402
467
  }
403
468
 
@@ -436,7 +501,7 @@ export function hover(source, offset) {
436
501
  return getStringFromWasm0(ptr2, len2);
437
502
  } finally {
438
503
  wasm.__wbindgen_add_to_stack_pointer(16);
439
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
504
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
440
505
  }
441
506
  }
442
507
 
@@ -472,7 +537,7 @@ export function inlay_hints(source) {
472
537
  return getStringFromWasm0(ptr2, len2);
473
538
  } finally {
474
539
  wasm.__wbindgen_add_to_stack_pointer(16);
475
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
540
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
476
541
  }
477
542
  }
478
543
 
@@ -512,7 +577,7 @@ export function parse_source(source) {
512
577
  return getStringFromWasm0(ptr2, len2);
513
578
  } finally {
514
579
  wasm.__wbindgen_add_to_stack_pointer(16);
515
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
580
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
516
581
  }
517
582
  }
518
583
 
@@ -549,7 +614,7 @@ export function prepare_rename(source, offset) {
549
614
  return getStringFromWasm0(ptr2, len2);
550
615
  } finally {
551
616
  wasm.__wbindgen_add_to_stack_pointer(16);
552
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
617
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
553
618
  }
554
619
  }
555
620
 
@@ -589,7 +654,7 @@ export function rename(source, offset, new_name) {
589
654
  return getStringFromWasm0(ptr3, len3);
590
655
  } finally {
591
656
  wasm.__wbindgen_add_to_stack_pointer(16);
592
- wasm.__wbindgen_export3(deferred4_0, deferred4_1, 1);
657
+ wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
593
658
  }
594
659
  }
595
660
 
@@ -625,7 +690,7 @@ export function semantic_tokens(source) {
625
690
  return getStringFromWasm0(ptr2, len2);
626
691
  } finally {
627
692
  wasm.__wbindgen_add_to_stack_pointer(16);
628
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
693
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
629
694
  }
630
695
  }
631
696
 
@@ -662,31 +727,28 @@ export function signature_help(source, offset) {
662
727
  return getStringFromWasm0(ptr2, len2);
663
728
  } finally {
664
729
  wasm.__wbindgen_add_to_stack_pointer(16);
665
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
730
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
666
731
  }
667
732
  }
668
733
 
669
734
  /**
670
- * Type-check Hew source code and return JSON `{ diagnostics, type_info }`.
671
- *
672
- * `diagnostics` includes parser and checker diagnostics. `type_info` contains
673
- * byte-span keyed, user-facing resolved types for hover/editor consumers; it is
674
- * empty when parsing fails and the checker is skipped.
735
+ * Type-check source using the supplied browser input files.
675
736
  *
676
737
  * # Errors
677
738
  *
678
- * Returns a JavaScript error if the type-check result cannot be serialized.
739
+ * Returns a JavaScript error if an input is invalid or the result cannot be serialized.
679
740
  * @param {string} source
741
+ * @param {Map<any, any> | null} [files]
680
742
  * @returns {string}
681
743
  */
682
- export function type_check(source) {
744
+ export function type_check(source, files) {
683
745
  let deferred3_0;
684
746
  let deferred3_1;
685
747
  try {
686
748
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
687
749
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
688
750
  const len0 = WASM_VECTOR_LEN;
689
- wasm.type_check(retptr, ptr0, len0);
751
+ wasm.type_check(retptr, ptr0, len0, isLikeNone(files) ? 0 : addHeapObject(files));
690
752
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
691
753
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
692
754
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -702,17 +764,97 @@ export function type_check(source) {
702
764
  return getStringFromWasm0(ptr2, len2);
703
765
  } finally {
704
766
  wasm.__wbindgen_add_to_stack_pointer(16);
705
- wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
767
+ wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
706
768
  }
707
769
  }
708
770
  function __wbg_get_imports() {
709
771
  const import0 = {
710
772
  __proto__: null,
773
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
774
+ const ret = typeof(getObject(arg0)) === 'function';
775
+ return ret;
776
+ },
777
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
778
+ const val = getObject(arg0);
779
+ const ret = typeof(val) === 'object' && val !== null;
780
+ return ret;
781
+ },
782
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
783
+ const obj = getObject(arg1);
784
+ const ret = typeof(obj) === 'string' ? obj : undefined;
785
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
786
+ var len1 = WASM_VECTOR_LEN;
787
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
788
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
789
+ },
790
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
791
+ throw new Error(getStringFromWasm0(arg0, arg1));
792
+ },
793
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
794
+ const ret = getObject(arg0).call(getObject(arg1));
795
+ return addHeapObject(ret);
796
+ }, arguments); },
797
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
798
+ const ret = getObject(arg0).done;
799
+ return ret;
800
+ },
801
+ __wbg_from_296ca31f8d0f1c52: function(arg0) {
802
+ const ret = Array.from(getObject(arg0));
803
+ return addHeapObject(ret);
804
+ },
805
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
806
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
807
+ return addHeapObject(ret);
808
+ }, arguments); },
809
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
810
+ const ret = getObject(arg0)[arg1 >>> 0];
811
+ return addHeapObject(ret);
812
+ },
813
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
814
+ let result;
815
+ try {
816
+ result = getObject(arg0) instanceof Uint8Array;
817
+ } catch (_) {
818
+ result = false;
819
+ }
820
+ const ret = result;
821
+ return ret;
822
+ },
823
+ __wbg_iterator_e3c31c892080e444: function() {
824
+ const ret = Symbol.iterator;
825
+ return addHeapObject(ret);
826
+ },
827
+ __wbg_length_7f3c00c40364105e: function(arg0) {
828
+ const ret = getObject(arg0).length;
829
+ return ret;
830
+ },
831
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
832
+ const ret = new Uint8Array(getObject(arg0));
833
+ return addHeapObject(ret);
834
+ },
835
+ __wbg_next_33784799010f1bbe: function(arg0) {
836
+ const ret = getObject(arg0).next;
837
+ return addHeapObject(ret);
838
+ },
839
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
840
+ const ret = getObject(arg0).next();
841
+ return addHeapObject(ret);
842
+ }, arguments); },
843
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
844
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
845
+ },
846
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
847
+ const ret = getObject(arg0).value;
848
+ return addHeapObject(ret);
849
+ },
711
850
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
712
851
  // Cast intrinsic for `Ref(String) -> Externref`.
713
852
  const ret = getStringFromWasm0(arg0, arg1);
714
853
  return addHeapObject(ret);
715
854
  },
855
+ __wbindgen_object_drop_ref: function(arg0) {
856
+ takeObject(arg0);
857
+ },
716
858
  };
717
859
  return {
718
860
  __proto__: null,
@@ -735,6 +877,11 @@ function dropObject(idx) {
735
877
  heap_next = idx;
736
878
  }
737
879
 
880
+ function getArrayU8FromWasm0(ptr, len) {
881
+ ptr = ptr >>> 0;
882
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
883
+ }
884
+
738
885
  let cachedDataViewMemory0 = null;
739
886
  function getDataViewMemory0() {
740
887
  if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
@@ -757,11 +904,23 @@ function getUint8ArrayMemory0() {
757
904
 
758
905
  function getObject(idx) { return heap[idx]; }
759
906
 
907
+ function handleError(f, args) {
908
+ try {
909
+ return f.apply(this, args);
910
+ } catch (e) {
911
+ wasm.__wbindgen_export3(addHeapObject(e));
912
+ }
913
+ }
914
+
760
915
  let heap = new Array(1024).fill(undefined);
761
916
  heap.push(undefined, null, true, false);
762
917
 
763
918
  let heap_next = heap.length;
764
919
 
920
+ function isLikeNone(x) {
921
+ return x === undefined || x === null;
922
+ }
923
+
765
924
  function passStringToWasm0(arg, malloc, realloc) {
766
925
  if (realloc === undefined) {
767
926
  const buf = cachedTextEncoder.encode(arg);
package/wasm_bg.wasm CHANGED
Binary file