accept new compiler output
This commit is contained in:
parent
a5022c8755
commit
386cb75a1a
2
cc.bqn
2
cc.bqn
@ -33,7 +33,7 @@ useInd ← "-i"≡⊑args ⋄ args↓˜↩useInd
|
|||||||
Comp ← ((<"inc(runtime["∾⍕∾"])"˙)¨↕62) glyphs _getComp ⊢
|
Comp ← ((<"inc(runtime["∾⍕∾"])"˙)¨↕62) glyphs _getComp ⊢
|
||||||
J ← ∾∾⟜\n¨
|
J ← ∾∾⟜\n¨
|
||||||
Fconst ← ≡◶⟨@⊸≤◶Num‿Char, Str, ⊑⟩
|
Fconst ← ≡◶⟨@⊸≤◶Num‿Char, Str, ⊑⟩
|
||||||
Fout ← {((≠𝕩)↑⟨LI F¨,L Fconst¨,L (LI F¨)¨,L (L F¨)¨⟩) {𝕎𝕩}¨ 𝕩}
|
Fout ← {((≠𝕩)↑⟨LI F¨,L Fconst¨,L (LI ·F¨ 4↑⊢)¨,L (L F¨)¨⟩) {𝕎𝕩}¨ 𝕩}
|
||||||
Frun ← 1⊸Fout
|
Frun ← 1⊸Fout
|
||||||
Long ← {¯2↓∾𝕩∾¨<","∾\n}
|
Long ← {¯2↓∾𝕩∾¨<","∾\n}
|
||||||
|
|
||||||
|
|||||||
11
src/vm.c
11
src/vm.c
@ -143,8 +143,8 @@ typedef struct Md2Block { struct Md2; Scope* sc; Block* bl; } Md2Block;
|
|||||||
|
|
||||||
|
|
||||||
Block* compile(B bcq, B objs, B blocksq) { // consumes all
|
Block* compile(B bcq, B objs, B blocksq) { // consumes all
|
||||||
HArr* h = toHArr(blocksq);
|
HArr* blocksH = toHArr(blocksq);
|
||||||
usz bam = h->ia;
|
usz bam = blocksH->ia;
|
||||||
|
|
||||||
// B* objPtr = harr_ptr(objs); usz objIA = a(objs)->ia;
|
// B* objPtr = harr_ptr(objs); usz objIA = a(objs)->ia;
|
||||||
// for (usz i = 0; i < objIA; i++) objPtr[i] = c2(bi_fill, c1(bi_pick, inc(objPtr[i])), objPtr[i]);
|
// for (usz i = 0; i < objIA; i++) objPtr[i] = c2(bi_fill, c1(bi_pick, inc(objPtr[i])), objPtr[i]);
|
||||||
@ -156,11 +156,12 @@ Block* compile(B bcq, B objs, B blocksq) { // consumes all
|
|||||||
comp->bc = tag(bca, ARR_TAG);
|
comp->bc = tag(bca, ARR_TAG);
|
||||||
comp->objs = toHArr(objs);
|
comp->objs = toHArr(objs);
|
||||||
comp->blockAm = bam;
|
comp->blockAm = bam;
|
||||||
B* blockDefs = h->a;
|
B* blockDefs = blocksH->a;
|
||||||
|
|
||||||
for (usz i = 0; i < bam; i++) {
|
for (usz i = 0; i < bam; i++) {
|
||||||
B cbld = blockDefs[i];
|
B cbld = blockDefs[i];
|
||||||
if (a(cbld)->ia != 4) thrM("bad compile block");
|
usz cbia = a(cbld)->ia;
|
||||||
|
if (cbia!=4 && cbia!=6) thrM("bad compile block");
|
||||||
BS2B bget = TI(cbld).get;
|
BS2B bget = TI(cbld).get;
|
||||||
usz ty = o2s(bget(cbld,0)); if (ty>2) thrM("bad block type");
|
usz ty = o2s(bget(cbld,0)); if (ty>2) thrM("bad block type");
|
||||||
bool imm = o2s(bget(cbld,1)); // todo o2b or something
|
bool imm = o2s(bget(cbld,1)); // todo o2b or something
|
||||||
@ -201,7 +202,7 @@ Block* compile(B bcq, B objs, B blocksq) { // consumes all
|
|||||||
// TODO store blocks in each body, then decrement each of comp->blocks; also then move temp block list out of Comp as it's useless then
|
// TODO store blocks in each body, then decrement each of comp->blocks; also then move temp block list out of Comp as it's useless then
|
||||||
// for (usz i = 0; i < bam; i++) ptr_dec(comp->blocks[i]);
|
// for (usz i = 0; i < bam; i++) ptr_dec(comp->blocks[i]);
|
||||||
ptr_dec(comp);
|
ptr_dec(comp);
|
||||||
ptr_dec(h);
|
ptr_dec(blocksH);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user