aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-12 22:03:37 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-12 22:05:46 -0500
commit624c8d09f2f8a0268865b326dbfcae5ff0f054d7 (patch)
tree764009ada6964960a32a7c2bb0de825ad714bf0c
parente068da960323526bd7221e2a3a3c09a81c0a72a6 (diff)
Adjust Decompose and Glyph in the runtime under dzaima/BQN to search for runtime primitives
-rwxr-xr-xsrc/pr.bqn2
-rwxr-xr-xtest/dz_comp20
2 files changed, 12 insertions, 10 deletions
diff --git a/src/pr.bqn b/src/pr.bqn
index 70d7771b..25a3e138 100755
--- a/src/pr.bqn
+++ b/src/pr.bqn
@@ -10,7 +10,7 @@ chrs←⟨
"∘○⊸⟜⌾⊘◶⎉⚇⍟"
nc ← ≠¨chrs
-chr ← ∾chrs
+glyphs ⇐ chr ← ∾chrs
itr ← 0⥊˜≠chr
init ← " "⊸∾¨(/⟜"_"¨nc/0‿1‿1)∾¨(nc/"FMD")∾¨(nc+´⊸↑⥊"ABC"∾⌜•a)
diff --git a/test/dz_comp b/test/dz_comp
index ebdee6a0..67fef043 100755
--- a/test/dz_comp
+++ b/test/dz_comp
@@ -6,18 +6,20 @@ nc‿rt‿prim ← "-nocomp"‿"-rt"‿"-prim" ∊ •args
⟨DRun,DCompile⟩ ← •Import "../dc.bqn"
GetRT ← {𝕤:
- ⟨ref⟩ ← •Import "../src/pr.bqn"
+ ⟨ref,glyphs⟩ ← •Import "../src/pr.bqn"
+ PrimInd ← {⊑rt⊐<𝕩}
+ Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩
provide ← ⟨
- •Type # Type
- •Decompose # Decompose
- •Glyph # Glyph
- ⊑⟨⟩⥊0⊸⥊ # GetFill
- ⋆⁼ # Log
- ≠¨⊔ # GroupLen
- ∾⊔∘⊢ # GroupOrd
+ •Type # Type
+ Decompose # Decompose
+ glyphs⊑˜PrimInd # Glyph
+ ⊑⟨⟩⥊0⊸⥊ # GetFill
+ ⋆⁼ # Log
+ ≠¨⊔ # GroupLen
+ ∾⊔∘⊢ # GroupOrd
!,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,⊘
- •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref
+ rt ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref
}
Native ← {⍎𝕩}