@raviqqe/stak 0.12.10 → 0.12.12

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.10",
5
+ "version": "0.12.12",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/stak_wasm.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Runs a Scheme script with standard input and returns its standard output.
4
+ * Interprets bytecode with standard input and returns its standard output.
5
5
  */
6
- export function run(source: string, input: Uint8Array, heap_size: number): Uint8Array;
6
+ export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
7
7
  /**
8
8
  * Compiles source codes in Scheme.
9
9
  */
10
10
  export function compile(source: string): Uint8Array;
11
11
  /**
12
- * Interprets bytecode with standard input and returns its standard output.
12
+ * Runs a Scheme script with standard input and returns its standard output.
13
13
  */
14
- export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
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
@@ -216,18 +216,18 @@ function getArrayU8FromWasm0(ptr, len) {
216
216
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
217
217
  }
218
218
  /**
219
- * Runs a Scheme script with standard input and returns its standard output.
220
- * @param {string} source
219
+ * Interprets bytecode with standard input and returns its standard output.
220
+ * @param {Uint8Array} bytecode
221
221
  * @param {Uint8Array} input
222
222
  * @param {number} heap_size
223
223
  * @returns {Uint8Array}
224
224
  */
225
- export function run(source, input, heap_size) {
226
- const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
225
+ export function interpret(bytecode, input, heap_size) {
226
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
227
227
  const len0 = WASM_VECTOR_LEN;
228
228
  const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
229
229
  const len1 = WASM_VECTOR_LEN;
230
- const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
230
+ const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
231
231
  if (ret[3]) {
232
232
  throw takeFromExternrefTable0(ret[2]);
233
233
  }
@@ -254,18 +254,18 @@ export function compile(source) {
254
254
  }
255
255
 
256
256
  /**
257
- * Interprets bytecode with standard input and returns its standard output.
258
- * @param {Uint8Array} bytecode
257
+ * Runs a Scheme script with standard input and returns its standard output.
258
+ * @param {string} source
259
259
  * @param {Uint8Array} input
260
260
  * @param {number} heap_size
261
261
  * @returns {Uint8Array}
262
262
  */
263
- export function interpret(bytecode, input, heap_size) {
264
- const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
263
+ export function run(source, input, heap_size) {
264
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
265
  const len0 = WASM_VECTOR_LEN;
266
266
  const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
267
267
  const len1 = WASM_VECTOR_LEN;
268
- const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
268
+ const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
269
269
  if (ret[3]) {
270
270
  throw takeFromExternrefTable0(ret[2]);
271
271
  }
@@ -288,7 +288,7 @@ function __wbg_adapter_24(arg0, arg1, arg2) {
288
288
  wasm.closure26_externref_shim(arg0, arg1, arg2);
289
289
  }
290
290
 
291
- function __wbg_adapter_39(arg0, arg1, arg2, arg3) {
291
+ function __wbg_adapter_45(arg0, arg1, arg2, arg3) {
292
292
  wasm.closure50_externref_shim(arg0, arg1, arg2, arg3);
293
293
  }
294
294
 
@@ -341,7 +341,7 @@ function __wbg_get_imports() {
341
341
  const a = state0.a;
342
342
  state0.a = 0;
343
343
  try {
344
- return __wbg_adapter_39(a, state0.b, arg0, arg1);
344
+ return __wbg_adapter_45(a, state0.b, arg0, arg1);
345
345
  } finally {
346
346
  state0.a = a;
347
347
  }
@@ -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_78c3c35c87bf5283 = function() {
366
+ imports.wbg.__wbg_readstdin_4a3ccfe639546971 = 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_0985d40474c2d0db = function(arg0) {
398
+ imports.wbg.__wbg_writestderr_ebecde2673fbabfa = function(arg0) {
399
399
  const ret = write_stderr(arg0);
400
400
  return ret;
401
401
  };
402
- imports.wbg.__wbg_writestdout_2ae37e32295721eb = function(arg0) {
402
+ imports.wbg.__wbg_writestdout_34782e5ec71f9d08 = function(arg0) {
403
403
  const ret = write_stdout(arg0);
404
404
  return ret;
405
405
  };
@@ -412,7 +412,7 @@ function __wbg_get_imports() {
412
412
  const ret = false;
413
413
  return ret;
414
414
  };
415
- imports.wbg.__wbindgen_closure_wrapper97 = function(arg0, arg1, arg2) {
415
+ imports.wbg.__wbindgen_closure_wrapper98 = function(arg0, arg1, arg2) {
416
416
  const ret = makeMutClosure(arg0, arg1, 27, __wbg_adapter_24);
417
417
  return ret;
418
418
  };
package/stak_wasm_bg.wasm CHANGED
Binary file