@raviqqe/stak 0.12.12 → 0.12.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.12.12",
5
+ "version": "0.12.13",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/stak_wasm.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Interprets bytecode with standard input and returns its standard output.
5
- */
6
- export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
7
3
  /**
8
4
  * Compiles source codes in Scheme.
9
5
  */
@@ -12,6 +8,10 @@ export function compile(source: string): Uint8Array;
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
  */
package/stak_wasm.js CHANGED
@@ -198,13 +198,6 @@ function getDataViewMemory0() {
198
198
  return cachedDataViewMemory0;
199
199
  }
200
200
 
201
- function passArray8ToWasm0(arg, malloc) {
202
- const ptr = malloc(arg.length * 1, 1) >>> 0;
203
- getUint8ArrayMemory0().set(arg, ptr / 1);
204
- WASM_VECTOR_LEN = arg.length;
205
- return ptr;
206
- }
207
-
208
201
  function takeFromExternrefTable0(idx) {
209
202
  const value = wasm.__wbindgen_export_2.get(idx);
210
203
  wasm.__externref_table_dealloc(idx);
@@ -215,27 +208,6 @@ function getArrayU8FromWasm0(ptr, len) {
215
208
  ptr = ptr >>> 0;
216
209
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
217
210
  }
218
- /**
219
- * Interprets bytecode with standard input and returns its standard output.
220
- * @param {Uint8Array} bytecode
221
- * @param {Uint8Array} input
222
- * @param {number} heap_size
223
- * @returns {Uint8Array}
224
- */
225
- export function interpret(bytecode, input, heap_size) {
226
- const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
227
- const len0 = WASM_VECTOR_LEN;
228
- const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
229
- const len1 = WASM_VECTOR_LEN;
230
- const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
231
- if (ret[3]) {
232
- throw takeFromExternrefTable0(ret[2]);
233
- }
234
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
235
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
236
- return v3;
237
- }
238
-
239
211
  /**
240
212
  * Compiles source codes in Scheme.
241
213
  * @param {string} source
@@ -253,6 +225,12 @@ export function compile(source) {
253
225
  return v2;
254
226
  }
255
227
 
228
+ function passArray8ToWasm0(arg, malloc) {
229
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
230
+ getUint8ArrayMemory0().set(arg, ptr / 1);
231
+ WASM_VECTOR_LEN = arg.length;
232
+ return ptr;
233
+ }
256
234
  /**
257
235
  * Runs a Scheme script with standard input and returns its standard output.
258
236
  * @param {string} source
@@ -274,6 +252,27 @@ export function run(source, input, heap_size) {
274
252
  return v3;
275
253
  }
276
254
 
255
+ /**
256
+ * Interprets bytecode with standard input and returns its standard output.
257
+ * @param {Uint8Array} bytecode
258
+ * @param {Uint8Array} input
259
+ * @param {number} heap_size
260
+ * @returns {Uint8Array}
261
+ */
262
+ export function interpret(bytecode, input, heap_size) {
263
+ const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
264
+ const len0 = WASM_VECTOR_LEN;
265
+ const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
266
+ const len1 = WASM_VECTOR_LEN;
267
+ const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
268
+ if (ret[3]) {
269
+ throw takeFromExternrefTable0(ret[2]);
270
+ }
271
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
272
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
273
+ return v3;
274
+ }
275
+
277
276
  /**
278
277
  * Runs a REPL interpreter.
279
278
  * @param {number} heap_size
@@ -363,7 +362,7 @@ function __wbg_get_imports() {
363
362
  const ret = arg0.queueMicrotask;
364
363
  return ret;
365
364
  };
366
- imports.wbg.__wbg_readstdin_4a3ccfe639546971 = function() {
365
+ imports.wbg.__wbg_readstdin_6cc8e9d720ba99de = function() {
367
366
  const ret = read_stdin();
368
367
  return ret;
369
368
  };
@@ -395,11 +394,11 @@ function __wbg_get_imports() {
395
394
  const ret = arg0.then(arg1, arg2);
396
395
  return ret;
397
396
  };
398
- imports.wbg.__wbg_writestderr_ebecde2673fbabfa = function(arg0) {
397
+ imports.wbg.__wbg_writestderr_5cba6e829e173645 = function(arg0) {
399
398
  const ret = write_stderr(arg0);
400
399
  return ret;
401
400
  };
402
- imports.wbg.__wbg_writestdout_34782e5ec71f9d08 = function(arg0) {
401
+ imports.wbg.__wbg_writestdout_a6c135cb9a864005 = function(arg0) {
403
402
  const ret = write_stdout(arg0);
404
403
  return ret;
405
404
  };
@@ -412,7 +411,7 @@ function __wbg_get_imports() {
412
411
  const ret = false;
413
412
  return ret;
414
413
  };
415
- imports.wbg.__wbindgen_closure_wrapper98 = function(arg0, arg1, arg2) {
414
+ imports.wbg.__wbindgen_closure_wrapper99 = function(arg0, arg1, arg2) {
416
415
  const ret = makeMutClosure(arg0, arg1, 27, __wbg_adapter_24);
417
416
  return ret;
418
417
  };
package/stak_wasm_bg.wasm CHANGED
Binary file