diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-03 12:36:05 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-03 12:36:05 -0400 |
| commit | d48d315a184d3d7110eebb24dc886b86d7d0e00f (patch) | |
| tree | 185f2cbb8571a4005d56741fdfffcf01c2a35ec9 /src | |
| parent | c0970253b650961ea519d053536eaf923726bb6b (diff) | |
Use affine characters to make alphabet and digits in the compiler
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -2,9 +2,6 @@ tab←' '⋄nl←' ' -dig ← "0123456789" -alph ← "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -alow ← "abcdefghijklmnopqrstuvwxyz" charSet←∾charGroups←⟨ chF←"+-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!" # Function "˙˜˘¨⌜⁼´˝`" # Modifier @@ -15,9 +12,9 @@ charSet←∾charGroups←⟨ "‿" # Ligature "·" # nOthing "𝕊𝕏𝕎𝔽𝔾𝕤𝕩𝕨𝕗𝕘" # Input (𝕣 pending; ℝ not allowed) - dig # Digit + '0'+↕10 # Digit "¯.π∞" # Numeric - alow∾alph∾"_" # Alphabetic + "_"∾˜⥊"aA"+⌜↕na←26 # Alphabetic " "∾tab # Whitespace # #'" eliminated during tokenization ⟩ @@ -50,7 +47,7 @@ Tokenize←{ c←cl-˜CharCode(⊑charSet)¨⌾(cl⊸/)f/𝕩 w←(≠↑0∾⊢)⊸<l←c M (⊑bD)≍+´1⊑¨bD‿bN‿bA - na←≠alph⋄us←c=¯1++´bA + us←c=¯1++´bA id←(1-˜(us<l)×+`w)⊔na(⊢-⊣×+⟜(⊑bA)⊸≤)c ti←na⌊∘÷˜(⊑bA)-˜w/c iu←(≠↑¯1∾⌈`)⊸<is←⊐id⋄ni←≠in←0>iu/ti |
