make precompiled.bqn work
This commit is contained in:
parent
1816b6cd5d
commit
5c59f0de6f
@ -14,16 +14,9 @@ tests ← •FLines path∾"/test/cases/prim.bqn"
|
|||||||
'%'⊸∊◶{𝕤
|
'%'⊸∊◶{𝕤
|
||||||
•Out 𝕩
|
•Out 𝕩
|
||||||
"src/gen/interp" •FChars ⟨1,path,𝕩⟩ •Import "cc.bqn"
|
"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"
|
||||||
code‿out‿err←•SH"./BQN"
|
code‿out‿err←•SH"./BQN"
|
||||||
•Out out
|
•Out out
|
||||||
{𝕤⋄•Out"exit code "∾(⍕code) ⋄ •Out err}⍟(×code) err
|
{𝕤⋄•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
|
}¨tests
|
||||||
@ -93,6 +93,7 @@ char* pm2_repr(u8 u) {
|
|||||||
|
|
||||||
B r1Objs[rtLen];
|
B r1Objs[rtLen];
|
||||||
B rtWrap_wrap(B x); // consumes
|
B rtWrap_wrap(B x); // consumes
|
||||||
|
void rtWrap_print(void);
|
||||||
|
|
||||||
|
|
||||||
_Thread_local i64 comp_currEnvPos;
|
_Thread_local i64 comp_currEnvPos;
|
||||||
@ -322,9 +323,9 @@ void load_init() { // very last init function
|
|||||||
|
|
||||||
|
|
||||||
#ifdef PRECOMP
|
#ifdef PRECOMP
|
||||||
Block* c = load_compObj(
|
Block* c = compile(
|
||||||
#include "gen/interp"
|
#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);
|
B interp = m_funBlock(c, 0); ptr_dec(c);
|
||||||
print(interp);
|
print(interp);
|
||||||
@ -368,7 +369,6 @@ B bqn_execFile(B path, B args) { // consumes both
|
|||||||
return bqn_exec(file_chars(inc(path)), path, args);
|
return bqn_exec(file_chars(inc(path)), path, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtWrap_print(void);
|
|
||||||
void bqn_exit(i32 code) {
|
void bqn_exit(i32 code) {
|
||||||
rtWrap_print();
|
rtWrap_print();
|
||||||
CTR_FOR(CTR_PRINT)
|
CTR_FOR(CTR_PRINT)
|
||||||
|
|||||||
1
src/vm.c
1
src/vm.c
@ -1094,6 +1094,7 @@ NOINLINE void vm_printPos(Comp* comp, i32 bcPos, i64 pos) {
|
|||||||
B s = emptyCVec();
|
B s = emptyCVec();
|
||||||
printRaw(vm_fmtPoint(src, s, comp->path, cs, ce));
|
printRaw(vm_fmtPoint(src, s, comp->path, cs, ce));
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
//printBCStream((u32*)i32arr_ptr(comp->bc)+bcPos);
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (pos!=-1) printf(N64d": ", pos);
|
if (pos!=-1) printf(N64d": ", pos);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user