diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-25 15:16:29 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-10-25 15:16:29 -0400 |
| commit | 7c539384346b0a05f558969f689a779c90ba6bfa (patch) | |
| tree | d3a57a22d7b86fbf194715b6c34a171f1f2c1aae /src | |
| parent | b59e45b1c3f266cab079ca2c0ad735e7e8c1ece6 (diff) | |
Return all multi-character token values (including identifiers) from Tokenize
Diffstat (limited to 'src')
| -rw-r--r-- | src/c.bqn | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -69,7 +69,7 @@ Tokenize←{ c/˜↩¬(1«c∊3‿5+⊑bB)∧c=sep # ...and trailing ones. In sequence for repeated trailing. cr←ir⌾((c M vi∾≠⊑k)⊸/)(vi⌊c)⊏charRole∾0 # Role c+↩5×c M⟨⊑bI,5⟩ # Case-insensitive special names - ⟨c,cr,≠⊑k,∾1↓k⟩ + ⟨c,cr,k⟩ } # 𝕩 is a list of tokens that contains the numeric literals, each @@ -194,7 +194,7 @@ LEB←{ } Compile←{ - ⟨t,r,nVar,const⟩←Tokenize𝕩 - ⟨bc,pr,blk⟩←r‿nVar Parse t - ⟨bc,(pr⊏𝕨)∾const,<˘⍉>blk⟩ + ⟨tok,role,val⟩←Tokenize 𝕩 + ⟨bc,prim,blk⟩←⟨role,≠⊑val⟩ Parse tok + ⟨bc, ∾⟨prim⊏𝕨⟩∾1↓val, <˘⍉>blk⟩ } |
