aboutsummaryrefslogtreecommitdiff
path: root/src/c.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-12 17:30:38 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-07-12 20:39:08 -0400
commitff5c390e759c76728e14b104eb60a218384589cb (patch)
treead0e50a94e9abdb926f1f4b767a4de8dae25e7e9 /src/c.bqn
parent5138b2f0436d99b55224e2a1f8d1b38c685314af (diff)
Support two lists of function start indices; use for deferred blocks that require 𝕨
Diffstat (limited to 'src/c.bqn')
-rw-r--r--src/c.bqn5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/c.bqn b/src/c.bqn
index dcbc5c27..e95e79d1 100644
--- a/src/c.bqn
+++ b/src/c.bqn
@@ -248,8 +248,6 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn
fl←(dy×⊏⟜os)⊸+fa+dy # Function application site
dr∾↩((1+dy)×fn←2=fm←fa⊏ne)/fl # Turn function applications on · to drops
fn↩¬fn⋄fa/˜↩fn⋄fl/˜↩fn # And remove them
- idor∾˜↩5/1+g⊏˜fw/¯1∾rt
- idbc∾˜↩(+´fw)⥊⟨21‿0‿2‿18‿14⟩
# Bytecode generation: numbers bc ordered by source location (after rev) oi
or←⍋oi←idor∾g⊏˜∾⟨cn,cn,bk,bk,2/l,dr,af/at,al+1,al+1,oa+1⌈oa⊏os,fl,rt⟩
@@ -260,7 +258,8 @@ Parse ← {r‿vn‿i‿e‿def←𝕨⋄nv←≠vn
MI←-⊸↓˜⟜≠∾g⊏˜⊢⋄oj←(rt-∘≠⊸⌽oi⌊1-˜≠i)Mi∾⟨1-˜af/at,oa,fa⟩
ind←⟨oj,oj Mi fa⊏IT»¬ro∨ma⟩(¯1∾˜or⊏(≠rt)⊸⌽)⊸⊏¨i‿e
# Function metadata and overall output
- ⟨bc∾¯1⊑rc,u,⟨ft,¬fx,/1∾or≥bc-○≠rt,fsc+≠¨dn,dn,dx⟩,ind⟩
+ fs←fw↑∘⥊⍟⊣¨⌾(fx⊸/)/1∾or≥bc-○≠rt # Function start indices
+ ⟨bc∾¯1⊑rc,u,⟨ft,¬fx,fs,fsc+≠¨dn,dn,dx⟩,ind⟩
}
Compile←{