aboutsummaryrefslogtreecommitdiff
path: root/dc.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-04 20:42:32 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-04 20:42:32 -0400
commit5a477b9cfe4653cd33a67ac5004eeb3565018e25 (patch)
treede6b1296a5df8bfb34bf816f61013c09892d7b70 /dc.bqn
parent7732a337032257b72ee09ee8b26fd79c5a539668 (diff)
Support namespace creation in the compiler
Diffstat (limited to 'dc.bqn')
-rwxr-xr-xdc.bqn7
1 files changed, 4 insertions, 3 deletions
diff --git a/dc.bqn b/dc.bqn
index 6c286e82..60e8fd55 100755
--- a/dc.bqn
+++ b/dc.bqn
@@ -9,11 +9,12 @@ compile ← glyphs •Import "src/c.bqn"
special←<˘∘‿2⥊"𝕤𝕩𝕨𝕣𝕗𝕘"
DCompile⇐{
- ⟨bc,o,fblk,ind⟩ ← 4 ↑ (𝕨 •BQN∘⥊¨∘∾⊘⊣ glyphs) Compile 𝕩
+ ⟨bc,o,fblk,ind,tok⟩ ← 5 ↑ (𝕨 •BQN∘⥊¨∘∾⊘⊣ glyphs) Compile 𝕩
+ name ← ⊑2⊑tok
blk‿bdy ← <˘⍉>(↕≠fblk){
- ⟨t,i,l,n⟩←𝕩
+ ⟨t,i,l,n,d,e⟩←𝕩
s←(3×i)↓(t⊑3‿5‿6)↑special
- ⟨⟨t,i,𝕨,𝕨⟩ ⋄ ⟨l, s∾⥊¨'a'+↕n-≠s⟩⟩
+ ⟨⟨t,i,𝕨,𝕨⟩ ⋄ ⟨l, s∾d⊏name, (0¨s)∾e⟩⟩
}¨fblk
⟨bc,o,blk,⊑blk,bdy,⊑ind,1⊑ind,𝕩⟩
}