make precompiled.bqn work

This commit is contained in:
dzaima 2021-10-14 18:34:28 +03:00
parent 1816b6cd5d
commit 5c59f0de6f
3 changed files with 6 additions and 12 deletions

View File

@ -14,16 +14,9 @@ tests ← •FLines path∾"/test/cases/prim.bqn"
'%'{𝕤
•Out 𝕩
"src/gen/interp" •FChars 1,path,𝕩 •Import "cc.bqn"
(×)@{𝕤•Out "############ Failed to compile! ############" •Out¨1𝕩}{env<"PATH="envP}•SH"./debugBuild""-DPRECOMP"
(×)@{𝕤•Out "############ Failed to compile! ############" •Out¨1𝕩}{env<"PATH="envP}•SH"make""f=-DPRECOMP""t=precomp""c"
codeouterr•SH"./BQN"
•Out out
{𝕤•Out"exit code "(code) •Out err}(×code) err
}{𝕤
# •Out 𝕩
# "src/interp" •FChars ⟨1,path,3↓𝕩⟩ •Import "cc.bqn"
# (×⊑)◶@‿{𝕤⋄•Out "############ Failed to compile! ############" ⋄ •Out¨1↓𝕩}{env⇐<"PATH="∾envP}•SH"./debugBuild"
# code‿out‿err←•SH"./BQN"
# •Out out
# {𝕤⋄•Out"exit code "∾(⍕code) ⋄ •Out err}⍟(×code) err
}
}
}¨tests

View File

@ -93,6 +93,7 @@ char* pm2_repr(u8 u) {
B r1Objs[rtLen];
B rtWrap_wrap(B x); // consumes
void rtWrap_print(void);
_Thread_local i64 comp_currEnvPos;
@ -322,9 +323,9 @@ void load_init() { // very last init function
#ifdef PRECOMP
Block* c = load_compObj(
Block* c = compile(
#include "gen/interp"
, bi_N, bi_N
, bi_N, bi_N, bi_N, bi_N, NULL
);
B interp = m_funBlock(c, 0); ptr_dec(c);
print(interp);
@ -368,7 +369,6 @@ B bqn_execFile(B path, B args) { // consumes both
return bqn_exec(file_chars(inc(path)), path, args);
}
void rtWrap_print(void);
void bqn_exit(i32 code) {
rtWrap_print();
CTR_FOR(CTR_PRINT)

View File

@ -1094,6 +1094,7 @@ NOINLINE void vm_printPos(Comp* comp, i32 bcPos, i64 pos) {
B s = emptyCVec();
printRaw(vm_fmtPoint(src, s, comp->path, cs, ce));
putchar('\n');
//printBCStream((u32*)i32arr_ptr(comp->bc)+bcPos);
} else {
#ifdef DEBUG
if (pos!=-1) printf(N64d": ", pos);