@raviqqe/stak 0.12.1 → 0.12.2

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.1",
5
+ "version": "0.12.2",
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
- * Interprets bytecode with standard input and returns its standard output.
9
- */
10
- export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
11
7
  /**
12
8
  * Runs a Scheme script with standard input and returns its standard output.
13
9
  */
14
10
  export function run(source: string, input: Uint8Array, heap_size: number): Uint8Array;
11
+ /**
12
+ * Interprets bytecode with standard input and returns its standard output.
13
+ */
14
+ export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
15
15
  /**
16
16
  * Runs a REPL interpreter.
17
17
  */
@@ -33,8 +33,8 @@ export interface InitOutput {
33
33
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
34
34
  readonly __externref_table_dealloc: (a: number) => void;
35
35
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
36
- readonly closure25_externref_shim: (a: number, b: number, c: any) => void;
37
- readonly closure49_externref_shim: (a: number, b: number, c: any, d: any) => void;
36
+ readonly closure26_externref_shim: (a: number, b: number, c: any) => void;
37
+ readonly closure50_externref_shim: (a: number, b: number, c: any, d: any) => void;
38
38
  readonly __wbindgen_start: () => void;
39
39
  }
40
40
 
package/stak_wasm.js CHANGED
@@ -232,18 +232,18 @@ function passArray8ToWasm0(arg, malloc) {
232
232
  return ptr;
233
233
  }
234
234
  /**
235
- * Interprets bytecode with standard input and returns its standard output.
236
- * @param {Uint8Array} bytecode
235
+ * Runs a Scheme script with standard input and returns its standard output.
236
+ * @param {string} source
237
237
  * @param {Uint8Array} input
238
238
  * @param {number} heap_size
239
239
  * @returns {Uint8Array}
240
240
  */
241
- export function interpret(bytecode, input, heap_size) {
242
- const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
241
+ export function run(source, input, heap_size) {
242
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
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.interpret(ptr0, len0, ptr1, len1, heap_size);
246
+ const ret = wasm.run(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 interpret(bytecode, input, heap_size) {
253
253
  }
254
254
 
255
255
  /**
256
- * Runs a Scheme script with standard input and returns its standard output.
257
- * @param {string} source
256
+ * Interprets bytecode with standard input and returns its standard output.
257
+ * @param {Uint8Array} bytecode
258
258
  * @param {Uint8Array} input
259
259
  * @param {number} heap_size
260
260
  * @returns {Uint8Array}
261
261
  */
262
- export function run(source, input, heap_size) {
263
- const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262
+ export function interpret(bytecode, input, heap_size) {
263
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
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.run(ptr0, len0, ptr1, len1, heap_size);
267
+ const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
268
268
  if (ret[3]) {
269
269
  throw takeFromExternrefTable0(ret[2]);
270
270
  }
@@ -284,11 +284,11 @@ export function repl(heap_size) {
284
284
  }
285
285
 
286
286
  function __wbg_adapter_24(arg0, arg1, arg2) {
287
- wasm.closure25_externref_shim(arg0, arg1, arg2);
287
+ wasm.closure26_externref_shim(arg0, arg1, arg2);
288
288
  }
289
289
 
290
290
  function __wbg_adapter_39(arg0, arg1, arg2, arg3) {
291
- wasm.closure49_externref_shim(arg0, arg1, arg2, arg3);
291
+ wasm.closure50_externref_shim(arg0, arg1, arg2, arg3);
292
292
  }
293
293
 
294
294
  async function __wbg_load(module, imports) {
@@ -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_0be460b46d3bbfd9 = function() {
365
+ imports.wbg.__wbg_readstdin_9d4a8989e1a9e0b1 = 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_1fbdefab7867c61b = function(arg0) {
397
+ imports.wbg.__wbg_writestderr_74642c810f1eb4ad = function(arg0) {
398
398
  const ret = write_stderr(arg0);
399
399
  return ret;
400
400
  };
401
- imports.wbg.__wbg_writestdout_f917e0ba7ef0c671 = function(arg0) {
401
+ imports.wbg.__wbg_writestdout_0596e95422044d34 = function(arg0) {
402
402
  const ret = write_stdout(arg0);
403
403
  return ret;
404
404
  };
@@ -411,8 +411,8 @@ function __wbg_get_imports() {
411
411
  const ret = false;
412
412
  return ret;
413
413
  };
414
- imports.wbg.__wbindgen_closure_wrapper94 = function(arg0, arg1, arg2) {
415
- const ret = makeMutClosure(arg0, arg1, 26, __wbg_adapter_24);
414
+ imports.wbg.__wbindgen_closure_wrapper97 = function(arg0, arg1, arg2) {
415
+ const ret = makeMutClosure(arg0, arg1, 27, __wbg_adapter_24);
416
416
  return ret;
417
417
  };
418
418
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/stak_wasm_bg.wasm CHANGED
Binary file