diff --git a/src/builtins/internal.c b/src/builtins/internal.c index 943c8234..c80cb2c1 100644 --- a/src/builtins/internal.c +++ b/src/builtins/internal.c @@ -302,7 +302,7 @@ B internalTemp_c1(B t, B x) { #endif #if NATIVE_COMPILER switchComp(); - B r = bqn_exec(x, bi_N, bi_N); + B r = bqn_exec(x, bi_N); switchComp(); return r; #endif diff --git a/src/h.h b/src/h.h index fe7c9c5e..517d3621 100644 --- a/src/h.h +++ b/src/h.h @@ -376,8 +376,7 @@ B withFill(B x, B f); // consumes both void cbqn_init(void); NORETURN void bqn_exit(i32 code); -B bqn_exec(B str, B state); // consumes all -B bqn_execFile(B path, B args); // consumes +B bqn_exec(B str, B state); // consumes both B bqn_fmt(B x); // consumes B bqn_repr(B x); // consumes diff --git a/src/load.h b/src/load.h index 36f26f13..f9f058af 100644 --- a/src/load.h +++ b/src/load.h @@ -23,7 +23,9 @@ void comps_getSysvals(B* res); typedef struct Block Block; typedef struct Scope Scope; -Block* bqn_comp (B str, B state); // consumes all +B bqn_explain(B str); // consumes str +B bqn_execFile(B path, B args); // consumes both +Block* bqn_comp (B str, B state); // consumes both Block* bqn_compSc (B str, B state, Scope* sc, bool repl); // consumes str,state Block* bqn_compScc(B str, B state, B re, Scope* sc, bool loose, bool noNS); // consumes str,state B rebqn_exec (B str, B state, B re); // consumes str,state; runs in a new environment diff --git a/src/main.c b/src/main.c index 8333669c..e3348172 100644 --- a/src/main.c +++ b/src/main.c @@ -605,7 +605,6 @@ bool ryu_s2d_n(u8* buffer, int len, f64* result); #endif void heap_printInfoStr(char* str); -B bqn_explain(B str); extern bool gc_log_enabled, mem_log_enabled; void cbqn_runLine0(char* ln, i64 read) { if (ln[0]==0 || read==0) return; @@ -900,9 +899,7 @@ void cbqn_runLine(char* ln, i64 len) { #if WASM void cbqn_evalSrc(char* src, i64 len) { B code = utf8Decode(src, len); - B res = bqn_exec(code, bi_N, bi_N); - - B resFmt = bqn_fmt(res); + B resFmt = bqn_fmt(bqn_exec(code, bi_N)); printsB(resFmt); dec(resFmt); putchar('\n'); }