From 8cb87328256a7143c6d6d2c70d7c0ed6a8d50eb6 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 29 Nov 2009 15:39:33 +0000 Subject: [PATCH] Correct the advanceSrcLoc calculation for tabs It was off-by-one --- compiler/basicTypes/SrcLoc.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/basicTypes/SrcLoc.lhs b/compiler/basicTypes/SrcLoc.lhs index e213bef..e1a2a43 100644 --- 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 -- 1.7.10.4