diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-04 19:13:53 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | eb2e1e80b11825102c6fb80e04b0a0fffd4e63fb (patch) | |
| tree | ed685b7cdf72320d0758904846df1a5747393853 /src/Tokenizer.hs | |
| parent | 77117fa515c5853b5f756d899db0ec9b502298e7 (diff) | |
Fix line numbers in script file tokens
Diffstat (limited to 'src/Tokenizer.hs')
| -rw-r--r-- | src/Tokenizer.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Tokenizer.hs b/src/Tokenizer.hs index 777bedb..b38e568 100644 --- a/src/Tokenizer.hs +++ b/src/Tokenizer.hs @@ -97,10 +97,10 @@ tokenize' (row, col) fileName src = do .> filter (\t -> length (tokenContent t) > 0) where - augment row col ('\r':'\n':rest) = - TChar '\n' row col : augment (row + 1) 1 rest - augment row col ('\n':rest) = - TChar '\n' row col : augment (row + 1) 1 rest - augment row col (c:rest) = - TChar c row col : augment row (col + 1) rest + augment row' col' ('\r':'\n':rest) = + TChar '\n' row' col' : augment (row' + 1) 1 rest + augment row' col' ('\n':rest) = + TChar '\n' row' col' : augment (row' + 1) 1 rest + augment row' col' (c:rest) = + TChar c row' col' : augment row' (col' + 1) rest augment _ _ [] = [] |
