diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-25 21:26:27 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-25 21:26:27 -0400 |
| commit | c15a166a65d55c806aea9f28f8b5bfc36954a757 (patch) | |
| tree | a5d3ccf952d4d6e39594c5f128f5cc3442548029 /src/cjs.bqn | |
| parent | 676bc61b903c9c3201913ac1b11ae2d3e0ad6e1d (diff) | |
Use a custom primitive set to compile the runtime
Diffstat (limited to 'src/cjs.bqn')
| -rwxr-xr-x | src/cjs.bqn | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cjs.bqn b/src/cjs.bqn index efe6cb87..cb7b1a79 100755 --- a/src/cjs.bqn +++ b/src/cjs.bqn @@ -19,21 +19,24 @@ FP ← ∞⊸=◶⟨F,"Infinity"⟩ # Format positive number Num ← 0⊸≤◶⟨"-"∾FP∘|,FP⟩ # Format number glyphs ← •Import "glyphs.bqn" -compile ← glyphs •Import "c.bqn" +_getComp ← { (3+useInd) ↑ (𝕗 •Import "c.bqn"){𝔽} } useInd ← "-i"≡⊑args←•args ⋄ args↓˜↩useInd -Comp ← (3+useInd) ↑ ((<"runtime" Ind F)¨↕62)⊸Compile +Comp ← ((<"runtime" Ind F)¨↕62) glyphs _getComp ⊢ J ← ∾∾⟜(@+10)¨ Fconst ← ≡◶⟨@⊸≤◶Num‿Char, Str, ⊑⟩ Fout ← (≠↑⟨F,Fconst,L F¨,F⟩˙) {L𝕎¨𝕩}¨ ⊢ -Frun ← "provide"⊸Cat⌾(1⊸⊑) Fout Long ← ∾ (≠↑1‿3/⟨" "⊸∾⋄((@+10)∾" ,")⊸∾⟩˙) {𝕎𝕩}¨ ⊢ LFC ← Long∘Fout∘Comp -SVG ← {∾⟨"Modify←GetHighlights←⊢⋄"⟩∾ •FChars∘∾⟜".bqn"¨ "../svg"‿𝕩} +RT ← {𝕩 + prims‿ref←•Import"pr.bqn" ⋄ l←≠∾prims + Long "provide"⊸Cat⌾(1⊸⊑) Fout l⊸↓⌾(1⊸⊑) (↕l) prims _getComp ref +} CArg ← {J (¯5⊸↓∾𝕩˙)⌾⊑ •FLines "c.bqn"} +SVG ← {∾⟨"Modify←GetHighlights←⊢⋄"⟩∾ •FChars∘∾⟜".bqn"¨ "../svg"‿𝕩} •Out (⊑"r"‿"c"‿"cc"‿"f"‿"e"‿"p"⊐⊏)◶⟨ - {𝕩⋄ref‿len←•Import"pr.bqn"⋄Long Frun len⊸↓⌾(1⊸⊑)Comp ref} + RT {𝕩⋄LFC CArg "⟨"∾"⟩"«∾","⊸∾¨'"'(⊣∾∾˜)¨glyphs} {𝕩⋄LFC "{"∾"}"∾˜CArg"𝕩"} {𝕩⋄LFC •FChars "f.bqn"} |
