aboutsummaryrefslogtreecommitdiff
path: root/test/dzrt.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-01 16:22:09 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-01 16:30:33 -0400
commit10b72d3a9a74cda526219bdc149dac8feb3f25e4 (patch)
treef6cd814796e5396677e5626f1beae2925fb02a1a /test/dzrt.bqn
parent0a5ec5b2c31eccda5e00239df80ae3675a51b0a2 (diff)
Move all dzaima/BQN-specific tools into test/
Diffstat (limited to 'test/dzrt.bqn')
-rw-r--r--test/dzrt.bqn23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/dzrt.bqn b/test/dzrt.bqn
new file mode 100644
index 00000000..ae217e07
--- /dev/null
+++ b/test/dzrt.bqn
@@ -0,0 +1,23 @@
+# Runtime hosted in dzaima/BQN
+
+⟨src,need⟩ ← •Import "../src/pr.bqn"
+⟨DRun⟩ ← •Import "dc.bqn"
+⟨DCompile⟩ ← need •Import "dc.bqn"
+glyphs ← ∾ gl ← •Import "../src/glyphs.bqn"
+
+GroupLen ← {(𝕨⌈≠)⊸↑0•FillFn≠¨⊔𝕩}
+extra ← ⟨ •Type, •FillFn, ⋆⁼, GroupLen, ∾⊔∘⊢, •_fillBy_ ⟩
+provide ← { g←𝕩∊glyphs ⋄ (⍋⍋g)⊏extra∾•BQN¨g/𝕩 } ∾need
+
+rt‿SetPrims ← •COMP ⟨provide,(•BQN"•"⊸∾)¨⟩ DCompile src
+PrimInd ← rt⊸⊐⌾<
+Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩
+SetPrims ⟨ Decompose, PrimInd ⟩
+
+sys ← {𝕩⊏˜𝕨⊸⊐}˝⍉>⟨
+ "bqn"‿{BQN𝕩}
+ "type"‿•Type
+ "glyph"‿(glyphs⊑˜PrimInd)
+ "decompose"‿Decompose
+⟩
+⟨rt,Sys⟩