From eb2e1e80b11825102c6fb80e04b0a0fffd4e63fb Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 4 Dec 2022 19:13:53 +0200 Subject: Fix line numbers in script file tokens --- src/Tokenizer.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Tokenizer.hs') 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 _ _ [] = [] -- cgit v1.3