diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-05 22:33:04 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-05 22:41:33 -0400 |
| commit | ed5fbd5e72c3a20de4bb321a3923fc7e7e87a596 (patch) | |
| tree | 80fb6b1f4550be29d6647e43bb39c93d34a3ccd9 /src | |
| parent | 6bb849d6cfc00791acb72017ac0e7f7dea7bdc08 (diff) | |
Merge JS and dbqn versions into UTF-16-independent (!) compiler
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,5 +1,3 @@ -#! ./dzref - nl←@+10 charSet←∾charGroups←⟨ chF←"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!" # Function @@ -10,11 +8,12 @@ charSet←∾charGroups←⟨ "(){}⟨⟩" # Bracket "‿" # Ligature "·" # nOthing - "𝕊𝕏𝕎𝔽𝔾𝕤𝕩𝕨𝕗𝕘" # Input (𝕣 pending; ℝ not allowed) + ¯1⊏˘10‿∘⥊"𝕊𝕏𝕎𝔽𝔾𝕤𝕩𝕨𝕗𝕘" # Input (𝕣 pending; ℝ not allowed) "@" # nUll character '0'+↕10 # Digit "¯.π∞" # Numeric "_"∾˜⥊"aA"+⌜↕na←26 # Alphabetic + ¯1↓"𝕨" # Prefix for input (hack around UTF-16) " "∾@+9 # Whitespace # #'" eliminated during tokenization ⟩ @@ -26,7 +25,7 @@ CharCode←charSet{ Chk ← ⊢⊣ErrUnknownChars∘(≠/⊣)⍟≢⟜(⊏⟜𝕗) g←⍋𝕗 ⋄ ⊢ Chk g⊏˜1-˜1⌈(g⊏𝕗)⍋⊢ } -bF‿bM‿bC‿bS‿bG‿bB‿bL‿bO‿bI‿bU‿bD‿bN‿bA‿bW←≍¨˜⟜(+`≠↑0∾⊢)≠¨charGroups +bF‿bM‿bC‿bS‿bG‿bB‿bL‿bO‿bI‿bU‿bD‿bN‿bA‿bP‿bW←≍¨˜⟜(+`≠↑0∾⊢)≠¨charGroups bA_e←4+⊑bA M←1⊸⊑(0⊸≤∧>)-⟜⊑ vi←+´≠¨9↑charGroups @@ -54,7 +53,7 @@ Tokenize←{ iu←(≠↑¯1∾⌈`)⊸<is←⊐id⋄ni←≠in←0>iu/ti ti↩(us/˜(1↓0∾˜⊢)⊸<l)(⊢+∧⟜(2⊸=))0⌈ti - c↩(w∨¬l∨c M bW)/(vi+is⊏⍋⍋in)⌾(w⊸/)(vi+ni+lu⊐lit)⌾(cl⊸/)c + c↩(w∨¬l∨c M (⊑bP)≍+´1⊑¨bP‿bW)/(vi+is⊏⍋⍋in)⌾(w⊸/)(vi+ni+lu⊐lit)⌾(cl⊸/)c c/˜↩¬(≠↑1∾(c∊2‿4+⊑bB)∨⊢)⊸∧c M bS⋄c/˜↩¬(1↓1∾˜c∊3‿5+⊑bB)∧c M bS ic←(0⊸≤∧<⟜ni)c-vi⋄t←ti⌾(ic⊸/)(vi⌊c)⊏charRole c+↩5×c M 5≍˜⊑bI |
