projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
59300a7
)
Correct the advanceSrcLoc calculation for tabs
author
Ian Lynagh
<igloo@earth.li>
Sun, 29 Nov 2009 15:39:33 +0000
(15:39 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sun, 29 Nov 2009 15:39:33 +0000
(15:39 +0000)
It was off-by-one
compiler/basicTypes/SrcLoc.lhs
patch
|
blob
|
history
diff --git
a/compiler/basicTypes/SrcLoc.lhs
b/compiler/basicTypes/SrcLoc.lhs
index
e213bef
..
e1a2a43
100644
(file)
--- a/
compiler/basicTypes/SrcLoc.lhs
+++ b/
compiler/basicTypes/SrcLoc.lhs
@@
-138,7
+138,7
@@
srcLocCol _other = panic "srcLocCol: unknown col"
-- character in any other case
advanceSrcLoc :: SrcLoc -> Char -> SrcLoc
advanceSrcLoc (SrcLoc f l _) '\n' = SrcLoc f (l + 1) 1
-advanceSrcLoc (SrcLoc f l c) '\t' = SrcLoc f l ((((c `shiftR` 3) + 1)
+advanceSrcLoc (SrcLoc f l c) '\t' = SrcLoc f l (((((c - 1) `shiftR` 3) + 1)
`shiftL` 3) + 1)
advanceSrcLoc (SrcLoc f l c) _ = SrcLoc f l (c + 1)
advanceSrcLoc loc _ = loc -- Better than nothing