@raviqqe/stak 0.12.13 → 0.12.14

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": "@raviqqe/stak",
3
3
  "type": "module",
4
4
  "description": "Stak Scheme in WebAssembly",
5
- "version": "0.12.13",
5
+ "version": "0.12.14",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/stak_wasm.d.ts CHANGED
@@ -4,14 +4,14 @@
4
4
  * Compiles source codes in Scheme.
5
5
  */
6
6
  export function compile(source: string): Uint8Array;
7
- /**
8
- * Runs a Scheme script with standard input and returns its standard output.
9
- */
10
- export function run(source: string, input: Uint8Array, heap_size: number): Uint8Array;
11
7
  /**
12
8
  * Interprets bytecode with standard input and returns its standard output.
13
9
  */
14
10
  export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
11
+ /**
12
+ * Runs a Scheme script with standard input and returns its standard output.
13
+ */
14
+ export function run(source: string, input: Uint8Array, heap_size: number): Uint8Array;
15
15
  /**
16
16
  * Runs a REPL interpreter.
17
17
  */
package/stak_wasm.js CHANGED
@@ -232,18 +232,18 @@ function passArray8ToWasm0(arg, malloc) {
232
232
  return ptr;
233
233
  }
234
234
  /**
235
- * Runs a Scheme script with standard input and returns its standard output.
236
- * @param {string} source
235
+ * Interprets bytecode with standard input and returns its standard output.
236
+ * @param {Uint8Array} bytecode
237
237
  * @param {Uint8Array} input
238
238
  * @param {number} heap_size
239
239
  * @returns {Uint8Array}
240
240
  */
241
- export function run(source, input, heap_size) {
242
- const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
241
+ export function interpret(bytecode, input, heap_size) {
242
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
243
243
  const len0 = WASM_VECTOR_LEN;
244
244
  const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
245
245
  const len1 = WASM_VECTOR_LEN;
246
- const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
246
+ const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
247
247
  if (ret[3]) {
248
248
  throw takeFromExternrefTable0(ret[2]);
249
249
  }
@@ -253,18 +253,18 @@ export function run(source, input, heap_size) {
253
253
  }
254
254
 
255
255
  /**
256
- * Interprets bytecode with standard input and returns its standard output.
257
- * @param {Uint8Array} bytecode
256
+ * Runs a Scheme script with standard input and returns its standard output.
257
+ * @param {string} source
258
258
  * @param {Uint8Array} input
259
259
  * @param {number} heap_size
260
260
  * @returns {Uint8Array}
261
261
  */
262
- export function interpret(bytecode, input, heap_size) {
263
- const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
262
+ export function run(source, input, heap_size) {
263
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
264
264
  const len0 = WASM_VECTOR_LEN;
265
265
  const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
266
266
  const len1 = WASM_VECTOR_LEN;
267
- const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
267
+ const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
268
268
  if (ret[3]) {
269
269
  throw takeFromExternrefTable0(ret[2]);
270
270
  }
@@ -287,7 +287,7 @@ function __wbg_adapter_24(arg0, arg1, arg2) {
287
287
  wasm.closure26_externref_shim(arg0, arg1, arg2);
288
288
  }
289
289
 
290
- function __wbg_adapter_45(arg0, arg1, arg2, arg3) {
290
+ function __wbg_adapter_39(arg0, arg1, arg2, arg3) {
291
291
  wasm.closure50_externref_shim(arg0, arg1, arg2, arg3);
292
292
  }
293
293
 
@@ -340,7 +340,7 @@ function __wbg_get_imports() {
340
340
  const a = state0.a;
341
341
  state0.a = 0;
342
342
  try {
343
- return __wbg_adapter_45(a, state0.b, arg0, arg1);
343
+ return __wbg_adapter_39(a, state0.b, arg0, arg1);
344
344
  } finally {
345
345
  state0.a = a;
346
346
  }
@@ -362,7 +362,7 @@ function __wbg_get_imports() {
362
362
  const ret = arg0.queueMicrotask;
363
363
  return ret;
364
364
  };
365
- imports.wbg.__wbg_readstdin_6cc8e9d720ba99de = function() {
365
+ imports.wbg.__wbg_readstdin_676c1614412f2916 = function() {
366
366
  const ret = read_stdin();
367
367
  return ret;
368
368
  };
@@ -394,11 +394,11 @@ function __wbg_get_imports() {
394
394
  const ret = arg0.then(arg1, arg2);
395
395
  return ret;
396
396
  };
397
- imports.wbg.__wbg_writestderr_5cba6e829e173645 = function(arg0) {
397
+ imports.wbg.__wbg_writestderr_5e57e8a45c060c3b = function(arg0) {
398
398
  const ret = write_stderr(arg0);
399
399
  return ret;
400
400
  };
401
- imports.wbg.__wbg_writestdout_a6c135cb9a864005 = function(arg0) {
401
+ imports.wbg.__wbg_writestdout_508916e56ccc3abc = function(arg0) {
402
402
  const ret = write_stdout(arg0);
403
403
  return ret;
404
404
  };
package/stak_wasm_bg.wasm CHANGED
Binary file