diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-05 20:34:44 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-11-05 20:47:24 -0500 |
| commit | bbd23dc8051e3de7e97bc36fe76098572383e1fb (patch) | |
| tree | 17f731f39b0bfba4fdb46f3e6c6e458739a0c7a3 /src/c.bqn | |
| parent | 723f0863d62a2ee9fcf6da65aef3b0b4d679eedd (diff) | |
Fix token index for the newline after a comment (and crash when there was none)
Diffstat (limited to 'src/c.bqn')
| -rw-r--r-- | src/c.bqn | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -51,7 +51,8 @@ Tokenize←{ str←1↓¨𝕩⊔˜1-˜(+`si←a>»qe)×≠`dm∧ab # Strings (indices /si) # Extract words: identifiers and numbers - is←/1»f⋄ie←/f⋄Fs←{is/˜↩𝕨⋄𝕨/𝕩} # Token start and end + ie←/f⋄is←ie≠⊸↑/1»f⋄Fs←{is/˜↩𝕨⋄𝕨/𝕩} # Token start and end + is-↩is(-×⊏⟜c)ie # Comment → ending newline only t←CharCode ie⊏𝕩 w←»⊸<l←t M bD(⊣≍-˜)○⊑bW⋄us←t=¯1++´bA # Word chars l, start w wk←na⌊∘÷˜(⊑bA)-˜w/t # Kind of word from first char |
