@raviqqe/stak 0.12.22 → 0.12.23

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.22",
5
+ "version": "0.12.23",
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
@@ -248,41 +248,41 @@ export function interpret(bytecode, input, heap_size) {
248
248
  }
249
249
 
250
250
  /**
251
- * Compiles source codes in Scheme.
251
+ * Runs a Scheme script with standard input and returns its standard output.
252
252
  * @param {string} source
253
+ * @param {Uint8Array} input
254
+ * @param {number} heap_size
253
255
  * @returns {Uint8Array}
254
256
  */
255
- export function compile(source) {
257
+ export function run(source, input, heap_size) {
256
258
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
257
259
  const len0 = WASM_VECTOR_LEN;
258
- const ret = wasm.compile(ptr0, len0);
260
+ const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
261
+ const len1 = WASM_VECTOR_LEN;
262
+ const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
259
263
  if (ret[3]) {
260
264
  throw takeFromExternrefTable0(ret[2]);
261
265
  }
262
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
266
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
263
267
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
264
- return v2;
268
+ return v3;
265
269
  }
266
270
 
267
271
  /**
268
- * Runs a Scheme script with standard input and returns its standard output.
272
+ * Compiles source codes in Scheme.
269
273
  * @param {string} source
270
- * @param {Uint8Array} input
271
- * @param {number} heap_size
272
274
  * @returns {Uint8Array}
273
275
  */
274
- export function run(source, input, heap_size) {
276
+ export function compile(source) {
275
277
  const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
278
  const len0 = WASM_VECTOR_LEN;
277
- const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
278
- const len1 = WASM_VECTOR_LEN;
279
- const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
279
+ const ret = wasm.compile(ptr0, len0);
280
280
  if (ret[3]) {
281
281
  throw takeFromExternrefTable0(ret[2]);
282
282
  }
283
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
283
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
284
284
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
285
- return v3;
285
+ return v2;
286
286
  }
287
287
 
288
288
  /**
@@ -413,7 +413,7 @@ function __wbg_get_imports() {
413
413
  imports.wbg.__wbg_queueMicrotask_9d76cacb20c84d58 = function(arg0) {
414
414
  queueMicrotask(arg0);
415
415
  };
416
- imports.wbg.__wbg_read_stdin_a5dd287112d4a636 = function() {
416
+ imports.wbg.__wbg_read_stdin_d8100defb5d83f08 = function() {
417
417
  const ret = read_stdin();
418
418
  return ret;
419
419
  };
@@ -445,11 +445,11 @@ function __wbg_get_imports() {
445
445
  const ret = arg0.then(arg1, arg2);
446
446
  return ret;
447
447
  };
448
- imports.wbg.__wbg_write_stderr_5a1e4e92452f0aa6 = function(arg0) {
448
+ imports.wbg.__wbg_write_stderr_b2a71bdc793cdeb2 = function(arg0) {
449
449
  const ret = write_stderr(arg0);
450
450
  return ret;
451
451
  };
452
- imports.wbg.__wbg_write_stdout_01bed16a860f2cfb = function(arg0) {
452
+ imports.wbg.__wbg_write_stdout_18710436edb6c757 = function(arg0) {
453
453
  const ret = write_stdout(arg0);
454
454
  return ret;
455
455
  };
package/stak_wasm_bg.wasm CHANGED
Binary file