summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-12-10 16:09:09 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-12-10 16:09:09 +0000
commitf4b727487a65e6b611bbaafbd2207bd63a8df706 (patch)
treec0b78c8983d7fc0e434403bd90f96c9fc8a81b58 /compiler/cmm
parent3e17c05b0550e8cbf47a4e9659e40826e364eb81 (diff)
downloadhaskell-f4b727487a65e6b611bbaafbd2207bd63a8df706.tar.gz
Fix #3741, simplifying things in the process
The problem in #3741 was that we had confused column numbers with byte offsets, which fails in the case of UTF-8 (amongst other things). Fortunately we're tracking correct column offsets now, so we didn't have to make a calculation based on a byte offset. I got rid of two fields from the PState (last_line_len and last_offs).and one field from the AI (alex input) constructor.
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CmmLex.x4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x
index bfc18c1844..42243258c5 100644
--- a/compiler/cmm/CmmLex.x
+++ b/compiler/cmm/CmmLex.x
@@ -300,7 +300,7 @@ lexToken = do
sc <- getLexState
case alexScan inp sc of
AlexEOF -> do let span = mkSrcSpan loc1 loc1
- setLastToken span 0 0
+ setLastToken span 0
return (L span CmmT_EOF)
AlexError (loc2,_) -> do failLocMsgP loc1 loc2 "lexical error"
AlexSkip inp2 _ -> do
@@ -309,7 +309,7 @@ lexToken = do
AlexToken inp2@(end,buf2) len t -> do
setInput inp2
let span = mkSrcSpan loc1 end
- span `seq` setLastToken span len len
+ span `seq` setLastToken span len
t span buf len
-- -----------------------------------------------------------------------------