Correct the advanceSrcLoc calculation for tabs
[ghc-hetmet.git] / compiler / basicTypes / SrcLoc.lhs
index e213bef..e1a2a43 100644 (file)
@@ -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