@raviqqe/stak 0.11.10 → 0.11.11
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 +1 -1
- package/stak_wasm.d.ts +4 -4
- package/stak_wasm.js +13 -13
- package/stak_wasm_bg.wasm +0 -0
package/package.json
CHANGED
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
|
-
* Runs a Scheme script with standard input and returns its standard output.
|
|
9
|
-
*/
|
|
10
|
-
export function run(source: string, input: Uint8Array, heap_size: number): Uint8Array;
|
|
11
7
|
/**
|
|
12
8
|
* Interprets bytecode with standard input and returns its standard output.
|
|
13
9
|
*/
|
|
14
10
|
export function interpret(bytecode: Uint8Array, input: Uint8Array, heap_size: number): Uint8Array;
|
|
11
|
+
/**
|
|
12
|
+
* Runs a Scheme script with standard input and returns its standard output.
|
|
13
|
+
*/
|
|
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
|
@@ -232,18 +232,18 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
232
232
|
return ptr;
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
|
-
*
|
|
236
|
-
* @param {
|
|
235
|
+
* Interprets bytecode with standard input and returns its standard output.
|
|
236
|
+
* @param {Uint8Array} bytecode
|
|
237
237
|
* @param {Uint8Array} input
|
|
238
238
|
* @param {number} heap_size
|
|
239
239
|
* @returns {Uint8Array}
|
|
240
240
|
*/
|
|
241
|
-
export function
|
|
242
|
-
const ptr0 =
|
|
241
|
+
export function interpret(bytecode, input, heap_size) {
|
|
242
|
+
const ptr0 = passArray8ToWasm0(bytecode, wasm.__wbindgen_malloc);
|
|
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.
|
|
246
|
+
const ret = wasm.interpret(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 run(source, input, heap_size) {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
257
|
-
* @param {
|
|
256
|
+
* Runs a Scheme script with standard input and returns its standard output.
|
|
257
|
+
* @param {string} source
|
|
258
258
|
* @param {Uint8Array} input
|
|
259
259
|
* @param {number} heap_size
|
|
260
260
|
* @returns {Uint8Array}
|
|
261
261
|
*/
|
|
262
|
-
export function
|
|
263
|
-
const ptr0 =
|
|
262
|
+
export function run(source, input, heap_size) {
|
|
263
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
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.
|
|
267
|
+
const ret = wasm.run(ptr0, len0, ptr1, len1, heap_size);
|
|
268
268
|
if (ret[3]) {
|
|
269
269
|
throw takeFromExternrefTable0(ret[2]);
|
|
270
270
|
}
|
|
@@ -362,7 +362,7 @@ function __wbg_get_imports() {
|
|
|
362
362
|
const ret = arg0.queueMicrotask;
|
|
363
363
|
return ret;
|
|
364
364
|
};
|
|
365
|
-
imports.wbg.
|
|
365
|
+
imports.wbg.__wbg_readstdin_3bf4dcd8f2b8f9d7 = 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.
|
|
397
|
+
imports.wbg.__wbg_writestderr_a813e552f8d790ee = function(arg0) {
|
|
398
398
|
const ret = write_stderr(arg0);
|
|
399
399
|
return ret;
|
|
400
400
|
};
|
|
401
|
-
imports.wbg.
|
|
401
|
+
imports.wbg.__wbg_writestdout_80b2bfe386799c6e = function(arg0) {
|
|
402
402
|
const ret = write_stdout(arg0);
|
|
403
403
|
return ret;
|
|
404
404
|
};
|
package/stak_wasm_bg.wasm
CHANGED
|
Binary file
|