diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-27 16:02:34 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-27 16:05:28 -0500 |
| commit | 021fb5911afe12e8f0085a1c1ce6ad397719fe11 (patch) | |
| tree | 5a7b18cc303efb1473b20c014ebdbf13eb027f3f /dzref_full | |
| parent | b9a41bf4639343573dbd3b9a25ca3a6e3930cd6b (diff) | |
Allow testing the runtime in dz_comp, making dzref_full and dz_rt unnecessary
Diffstat (limited to 'dzref_full')
| -rwxr-xr-x | dzref_full | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/dzref_full b/dzref_full deleted file mode 100755 index ab1c9886..00000000 --- a/dzref_full +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env dbqn - -# This version of dzref defines every primitive that spec/reference.bqn -# does. It's intended to test out these implementations for use in the -# BQN runtime; use plain dzref if you just want to run BQN as it's much -# faster and supports inverses better. - -impl ← •LNS "src/r.bqn" - -X←Raw←{F:≤4} -{v: - chrs←⟨ - "!+-×÷⋆√⌊⌈∧∨¬|=≠≤<>≥≡≢⊣⊢⥊∾≍↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔" - "˙˜˘¨⌜⁼´˝`" - "∘⊸⟜○⌾⎉⚇⍟◶⊘" - ⟩ - nc ← ≠¨chrs - chr ← ∾chrs - itr ← 0⥊˜≠chr - - init ← " "⊸∾¨(/⟜"_"¨nc/0‿1‿1)∾¨(nc/"FMD")∾¨(nc+´⊸↑⥊"ABC"∾⌜•a) - post ← ∾⟜" "¨/⟜"_"¨nc/0‿0‿1 - names ← init∾¨'0'∾¨post - - Inc ← { - i←⊑chr⊐𝕩 - n←0 ⋄ itr↩{n↩1+𝕩}⌾(i⊑⊢)itr - names↩((i⊑init)∾('0'+n)∾i⊑post)⌾(i⊑⊢)names - } - - # built-in assumptions - Mod ← {((⊑chr⊐𝕨)⊑names) ∾ " ← " ∾ 𝕩} - - ⍎¨ ⟨ - "IsArray ← 0≠≡" - "Type ← ⊑⟨⟩⥊0⊸⥊" - "Log ← ⋆⁼" - "GroupLen← ≠¨⊔" - "GroupOrd← ∾⊔∘⊢" - '!' Mod "{𝕩 ⋄ ≤1}⍟(1≢⊢)" - ⟩∾Mod⟜⥊¨ "+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘" - - - # checks if line is a builtin redefinition - E_isdef ← (3≤≠)◶⟨0,∧´⟨chr," ","←↩"⟩∊˜¨3⊸↑⟩ - - # removes comments and replaces built-ins with names - E_proc ← { - l←≠chr - q←≠`𝕩='"' ⋄ q∨↩≠`q<𝕩=''' ⋄ f←¬∨`q<𝕩='#' - ∾ (((l×f/q)+chr⊸⊐) (≥⟜l)◶⟨⊑⟜names,⥊∘⊢⟩¨ ⊢) f/𝕩 - } - - E_redef ← { # handles [fmd] [←↩] - tail ← E_proc 3↓𝕩 # must use old def - Inc ⊑𝕩 - (E_proc 1↑𝕩) ∾ "←" ∾ tail - } - - lf ← @+10 - pre ← E_isdef◶E_proc‿E_redef¨ impl - Raw↩⍎ - ExecFile←{Raw ∾ ∾⟜lf¨ E_proc¨ •LNS 𝕩} - X↩Raw∘E_proc - ⍎ ∾ ∾⟜lf¨ pre - ≠◶X‿{ExecFile ⊑𝕩}‿{ExecFile ⊑𝕩 ⋄ X 1⊑𝕩} •args -} |
