@hew-lang/wasm 0.7.1 → 0.9.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.
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.7.1",
5
+ "version": "0.9.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": "7b489ef7392ed3baced2a4d119e1e4741995ece2",
30
- "tag": "v0.7.1",
29
+ "commit": "17e06579cb14a167be1e369bdda5388e14e95f80",
30
+ "tag": "v0.9.1",
31
31
  "dirty": false
32
32
  },
33
33
  "publishConfig": {
package/wasm.d.ts CHANGED
@@ -88,13 +88,14 @@ export function executeCalendar(request: string): string;
88
88
  export function executeCodec(request: string): string;
89
89
 
90
90
  /**
91
- * Render the macro expansion at a byte offset using the shared frontend.
91
+ * Render an expansion at a UTF-8 byte offset, or the complete expanded document
92
+ * when the offset is omitted, using the shared frontend.
92
93
  *
93
94
  * # Errors
94
95
  *
95
96
  * Returns an error when loading or expansion fails, or no expansion covers the offset.
96
97
  */
97
- export function expand_macro(source: string, offset: number): string;
98
+ export function expand_macro(source: string, offset?: number | null): string;
98
99
 
99
100
  /**
100
101
  * Find all references at offset. Returns JSON `{ name, spans }` or `"null"` if no symbol found.
package/wasm.js CHANGED
@@ -305,13 +305,14 @@ export function executeCodec(request) {
305
305
  }
306
306
 
307
307
  /**
308
- * Render the macro expansion at a byte offset using the shared frontend.
308
+ * Render an expansion at a UTF-8 byte offset, or the complete expanded document
309
+ * when the offset is omitted, using the shared frontend.
309
310
  *
310
311
  * # Errors
311
312
  *
312
313
  * Returns an error when loading or expansion fails, or no expansion covers the offset.
313
314
  * @param {string} source
314
- * @param {number} offset
315
+ * @param {number | null} [offset]
315
316
  * @returns {string}
316
317
  */
317
318
  export function expand_macro(source, offset) {
@@ -321,7 +322,7 @@ export function expand_macro(source, offset) {
321
322
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
322
323
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export, wasm.__wbindgen_export2);
323
324
  const len0 = WASM_VECTOR_LEN;
324
- wasm.expand_macro(retptr, ptr0, len0, offset);
325
+ wasm.expand_macro(retptr, ptr0, len0, isLikeNone(offset) ? Number.MAX_SAFE_INTEGER : (offset) >>> 0);
325
326
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
326
327
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
327
328
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
package/wasm_bg.wasm CHANGED
Binary file