@raviqqe/stak 0.12.6 → 0.12.8
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 +26 -26
- package/stak_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/stak_wasm.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
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;
|
|
3
7
|
/**
|
|
4
8
|
* Runs a Scheme script with standard input and returns its standard output.
|
|
5
9
|
*/
|
|
@@ -8,10 +12,6 @@ export function run(source: string, input: Uint8Array, heap_size: number): Uint8
|
|
|
8
12
|
* Compiles source codes in Scheme.
|
|
9
13
|
*/
|
|
10
14
|
export function compile(source: string): 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
|
@@ -216,18 +216,18 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
216
216
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
220
|
-
* @param {
|
|
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
|
|
226
|
-
const ptr0 =
|
|
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.
|
|
230
|
+
const ret = wasm.interpret(ptr0, len0, ptr1, len1, heap_size);
|
|
231
231
|
if (ret[3]) {
|
|
232
232
|
throw takeFromExternrefTable0(ret[2]);
|
|
233
233
|
}
|
|
@@ -237,41 +237,41 @@ export function run(source, input, heap_size) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
|
-
*
|
|
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
|
|
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
|
|
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
|
|
255
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
252
256
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
253
|
-
return
|
|
257
|
+
return v3;
|
|
254
258
|
}
|
|
255
259
|
|
|
256
260
|
/**
|
|
257
|
-
*
|
|
258
|
-
* @param {
|
|
259
|
-
* @param {Uint8Array} input
|
|
260
|
-
* @param {number} heap_size
|
|
261
|
+
* Compiles source codes in Scheme.
|
|
262
|
+
* @param {string} source
|
|
261
263
|
* @returns {Uint8Array}
|
|
262
264
|
*/
|
|
263
|
-
export function
|
|
264
|
-
const ptr0 =
|
|
265
|
+
export function compile(source) {
|
|
266
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
267
|
const len0 = WASM_VECTOR_LEN;
|
|
266
|
-
const
|
|
267
|
-
const len1 = WASM_VECTOR_LEN;
|
|
268
|
-
const ret = wasm.interpret(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
|
|
272
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
273
273
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
274
|
-
return
|
|
274
|
+
return v2;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
/**
|
|
@@ -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
|
|
291
|
+
function __wbg_adapter_39(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
|
|
344
|
+
return __wbg_adapter_39(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.
|
|
366
|
+
imports.wbg.__wbg_readstdin_60fa3efea88b5d9e = 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.
|
|
398
|
+
imports.wbg.__wbg_writestderr_798552edf58e3393 = function(arg0) {
|
|
399
399
|
const ret = write_stderr(arg0);
|
|
400
400
|
return ret;
|
|
401
401
|
};
|
|
402
|
-
imports.wbg.
|
|
402
|
+
imports.wbg.__wbg_writestdout_e5b433d438f897a4 = function(arg0) {
|
|
403
403
|
const ret = write_stdout(arg0);
|
|
404
404
|
return ret;
|
|
405
405
|
};
|
package/stak_wasm_bg.wasm
CHANGED
|
Binary file
|