From 91d25cf9ee703506ff198bd899d0cd40c4cba0cd Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 3 Dec 2009 13:55:20 +0000 Subject: [PATCH] Fix HPC column numbers, following the column number changes in GHC --- compiler/deSugar/Coverage.lhs | 4 ++-- utils/hpc/HpcLexer.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index 2136d01..b161a21 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -742,9 +742,9 @@ mkHpcPos pos start = srcSpanStart pos end = srcSpanEnd pos hpcPos = toHpcPos ( srcLocLine start - , srcLocCol start + 1 + , srcLocCol start , srcLocLine end - , srcLocCol end + , srcLocCol end - 1 ) hpcSrcSpan :: SrcSpan diff --git a/utils/hpc/HpcLexer.hs b/utils/hpc/HpcLexer.hs index db886a3..feeb35a 100644 --- a/utils/hpc/HpcLexer.hs +++ b/utils/hpc/HpcLexer.hs @@ -11,11 +11,11 @@ data Token deriving (Eq,Show) initLexer :: String -> [Token] -initLexer str = [ t | (_,_,t) <- lexer str 1 0 ] +initLexer str = [ t | (_,_,t) <- lexer str 1 1 ] lexer :: String -> Int -> Int -> [(Int,Int,Token)] lexer (c:cs) line column - | c == '\n' = lexer cs (succ line) 0 + | c == '\n' = lexer cs (succ line) 1 | c == '\"' = lexerSTR cs line (succ column) | c == '[' = lexerCAT cs "" line (succ column) | c `elem` "{};-:" -- 1.7.10.4