@raviqqe/stak 0.11.12 → 0.11.13

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.11.12",
5
+ "version": "0.11.13",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/stak_wasm.d.ts CHANGED
@@ -4,14 +4,14 @@
4
4
  * Interprets bytecode with standard input and returns its standard output.
5
5
  */
6
6
  export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
7
- /**
8
- * Compiles source codes in Scheme.
9
- */
10
- export function compile(source: string): 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
+ * Compiles source codes in Scheme.
13
+ */
14
+ export function compile(source: string): Uint8Array;
15
15
  /**
16
16
  * Runs a REPL interpreter.
17
17
  */
package/stak_wasm.js CHANGED
@@ -237,41 +237,41 @@ export function interpret(bytecode, input, heap_size) {
237
237
  }
238
238
 
239
239
  /**
240
- * Compiles source codes in Scheme.
240
+ * Runs a Scheme script with standard input and returns its standard output.
241
241
  * @param {string} source
242
+ * @param {Uint8Array} input
243
+ * @param {number} heap_size
242
244
  * @returns {Uint8Array}
243
245
  */
244
- export function compile(source) {
246
+ export function run(source, input, heap_size) {
245
247
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
246
248
  const len0 = WASM_VECTOR_LEN;
247
- const ret = wasm.compile(ptr0, len0);
249
+ const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
250
+ const len1 = WASM_VECTOR_LEN;
251
+ const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
248
252
  if (ret[3]) {
249
253
  throw takeFromExternrefTable0(ret[2]);
250
254
  }
251
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
255
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
252
256
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
253
- return v2;
257
+ return v3;
254
258
  }
255
259
 
256
260
  /**
257
- * Runs a Scheme script with standard input and returns its standard output.
261
+ * Compiles source codes in Scheme.
258
262
  * @param {string} source
259
- * @param {Uint8Array} input
260
- * @param {number} heap_size
261
263
  * @returns {Uint8Array}
262
264
  */
263
- export function run(source, input, heap_size) {
265
+ export function compile(source) {
264
266
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
267
  const len0 = WASM_VECTOR_LEN;
266
- const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
267
- const len1 = WASM_VECTOR_LEN;
268
- const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
268
+ const ret = wasm.compile(ptr0, len0);
269
269
  if (ret[3]) {
270
270
  throw takeFromExternrefTable0(ret[2]);
271
271
  }
272
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
272
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
273
273
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
274
- return v3;
274
+ return v2;
275
275
  }
276
276
 
277
277
  /**
@@ -363,7 +363,7 @@ function __wbg_get_imports() {
363
363
  const ret = arg0.queueMicrotask;
364
364
  return ret;
365
365
  };
366
- imports.wbg.__wbg_readstdin_d63c3ab49946abeb = function() {
366
+ imports.wbg.__wbg_readstdin_c915a27fd1c7352b = function() {
367
367
  const ret = read_stdin();
368
368
  return ret;
369
369
  };
@@ -395,11 +395,11 @@ function __wbg_get_imports() {
395
395
  const ret = arg0.then(arg1, arg2);
396
396
  return ret;
397
397
  };
398
- imports.wbg.__wbg_writestderr_02b85646566a3530 = function(arg0) {
398
+ imports.wbg.__wbg_writestderr_2d5bb6d51cc64b0e = function(arg0) {
399
399
  const ret = write_stderr(arg0);
400
400
  return ret;
401
401
  };
402
- imports.wbg.__wbg_writestdout_b7d9c7ba3a509adb = function(arg0) {
402
+ imports.wbg.__wbg_writestdout_45c262fed2e28291 = function(arg0) {
403
403
  const ret = write_stdout(arg0);
404
404
  return ret;
405
405
  };
package/stak_wasm_bg.wasm CHANGED
Binary file