aboutsummaryrefslogtreecommitdiff
path: root/dc.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-11-21 14:29:33 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-11-21 14:29:33 -0500
commit175cb13c13ad3bb323e4ee9332600f09a302d351 (patch)
treea70a96912dad5ca9234d00374fb596052ba72a6d /dc.bqn
parent622ea6cd39fb57ab98b61d92e4277eb5514ade64 (diff)
dzaima/BQN no longer uses LEB128
Diffstat (limited to 'dc.bqn')
-rwxr-xr-xdc.bqn13
1 files changed, 2 insertions, 11 deletions
diff --git a/dc.bqn b/dc.bqn
index fb9399ac..ad0b4235 100755
--- a/dc.bqn
+++ b/dc.bqn
@@ -11,23 +11,14 @@ prims ← (•Import "dzref"){𝔽} "⟨
∘,○,⊸,⟜,⌾,⊘,◶,⎉,⚇,⍟
⟩"
-LEB←{
- b←128
- s←+`»i←1+l←⌊b⋆⁼1⌈𝕩
- o←⍋⍋↕∘≠⊸-i/s
- v←o⊏l{f←×𝕨⋄(𝕨-1)(b⊸(×⟜f+|)∾𝕊⟜(⌊÷⟜b)○(f⊸/))⍟(∨´f)𝕩}𝕩
- v‿s‿i
-}
-
special←<˘∘‿2⥊"𝕤𝕩𝕨𝕣𝕗𝕘"
DCompile⇐{
⟨bc,o,fblk,ind⟩ ← 4 ↑ prims Compile 𝕩
- bcl‿el‿ol←LEB bc
blk‿bdy ← <˘⍉>(↕≠fblk){
⟨t,i,l,n⟩←𝕩
s←(3×i)↓(t⊑3‿5‿6)↑special
- ⟨⟨t,i,𝕨,𝕨⟩ ⋄ ⟨l⊑el, s∾⥊¨'a'+↕n-≠s⟩⟩
+ ⟨⟨t,i,𝕨,𝕨⟩ ⋄ ⟨l, s∾⥊¨'a'+↕n-≠s⟩⟩
}¨fblk
- ⟨bcl,o,blk,⊑blk,bdy,ol/⊑ind,ol/1⊑ind,𝕩⟩
+ ⟨bc,o,blk,⊑blk,bdy,⊑ind,1⊑ind,𝕩⟩
}
DRun⇐•COMP∘DCompile