rename compile → compileAll
This commit is contained in:
parent
40a164a43e
commit
da5280021c
10
src/load.c
10
src/load.c
@ -109,8 +109,8 @@ Block* load_compObj(B x, B src, B path, Scope* sc) { // consumes x,src
|
|||||||
SGet(x)
|
SGet(x)
|
||||||
usz xia = IA(x);
|
usz xia = IA(x);
|
||||||
if (xia!=6 & xia!=4) thrM("load_compObj: bad item count");
|
if (xia!=6 & xia!=4) thrM("load_compObj: bad item count");
|
||||||
Block* r = xia==6? compile(Get(x,0),Get(x,1),Get(x,2),Get(x,3),Get(x,4),Get(x,5), src, inc(path), sc)
|
Block* r = xia==6? compileAll(Get(x,0),Get(x,1),Get(x,2),Get(x,3),Get(x,4),Get(x,5), src, inc(path), sc)
|
||||||
: compile(Get(x,0),Get(x,1),Get(x,2),Get(x,3),bi_N, bi_N, src, inc(path), sc);
|
: compileAll(Get(x,0),Get(x,1),Get(x,2),Get(x,3),bi_N, bi_N, src, inc(path), sc);
|
||||||
decG(x);
|
decG(x);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -121,11 +121,11 @@ Block* load_compObj(B x, B src, B path, Scope* sc) { // consumes x,src
|
|||||||
|
|
||||||
#if RT_SRC
|
#if RT_SRC
|
||||||
Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies, B inds, B src) { // consumes all
|
Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies, B inds, B src) { // consumes all
|
||||||
return compile(bc, objs, blocks, bodies, inds, bi_N, src, m_c8vec_0(name), NULL);
|
return compileAll(bc, objs, blocks, bodies, inds, bi_N, src, m_c8vec_0(name), NULL);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies) { // consumes all
|
Block* load_compImport(char* name, B bc, B objs, B blocks, B bodies) { // consumes all
|
||||||
return compile(bc, objs, blocks, bodies, bi_N, bi_N, bi_N, m_c8vec_0(name), NULL);
|
return compileAll(bc, objs, blocks, bodies, bi_N, bi_N, bi_N, m_c8vec_0(name), NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ void load_init() { // very last init function
|
|||||||
|
|
||||||
|
|
||||||
#ifdef PRECOMP
|
#ifdef PRECOMP
|
||||||
Block* c = compile(
|
Block* c = compileAll(
|
||||||
#include "../build/interp"
|
#include "../build/interp"
|
||||||
, bi_N, bi_N, bi_N, bi_N, NULL
|
, bi_N, bi_N, bi_N, bi_N, NULL
|
||||||
);
|
);
|
||||||
|
|||||||
2
src/vm.c
2
src/vm.c
@ -444,7 +444,7 @@ Block* compileBlock(B block, Comp* comp, bool* bDone, u32* bc, usz bcIA, B allBl
|
|||||||
|
|
||||||
// consumes all; assumes arguments are valid (verifies some stuff, but definitely not everything)
|
// consumes all; assumes arguments are valid (verifies some stuff, but definitely not everything)
|
||||||
// if sc isn't NULL, this block must only be evaluated directly in that scope precisely once
|
// if sc isn't NULL, this block must only be evaluated directly in that scope precisely once
|
||||||
NOINLINE Block* compile(B bcq, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B path, Scope* sc) {
|
NOINLINE Block* compileAll(B bcq, B objs, B allBlocks, B allBodies, B indices, B tokenInfo, B src, B path, Scope* sc) {
|
||||||
usz bIA = IA(allBlocks);
|
usz bIA = IA(allBlocks);
|
||||||
I32Arr* bca = toI32Arr(bcq);
|
I32Arr* bca = toI32Arr(bcq);
|
||||||
u32* bc = (u32*)bca->a;
|
u32* bc = (u32*)bca->a;
|
||||||
|
|||||||
2
src/vm.h
2
src/vm.h
@ -154,7 +154,7 @@ struct Scope {
|
|||||||
|
|
||||||
Block* bqn_comp(B str, B path, B args); // consumes all
|
Block* bqn_comp(B str, B path, B args); // consumes all
|
||||||
Block* bqn_compSc(B str, B path, B args, Scope* sc, bool repl); // consumes str,path,args
|
Block* bqn_compSc(B str, B path, B args, Scope* sc, bool repl); // consumes str,path,args
|
||||||
Block* compile(B bcq, B objs, B blocks, B bodies, B indices, B tokenInfo, B src, B path, Scope* sc);
|
Block* compileAll(B bcq, B objs, B blocks, B bodies, B indices, B tokenInfo, B src, B path, Scope* sc);
|
||||||
Scope* m_scope(Body* body, Scope* psc, u16 varAm, i32 initVarAm, B* initVars);
|
Scope* m_scope(Body* body, Scope* psc, u16 varAm, i32 initVarAm, B* initVars);
|
||||||
Body* m_body(i32 vam, i32 pos, u32 maxStack, u16 maxPSC); // leaves varData uninitialized
|
Body* m_body(i32 vam, i32 pos, u32 maxStack, u16 maxPSC); // leaves varData uninitialized
|
||||||
void init_comp(B* set, B prim, B sys); // doesn't consume; writes into first 3 elements of set
|
void init_comp(B* set, B prim, B sys); // doesn't consume; writes into first 3 elements of set
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user