aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parser/CC/Parser.hs2
-rw-r--r--utils/CC/Types.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/parser/CC/Parser.hs b/parser/CC/Parser.hs
index d9e5b40..856a7b9 100644
--- a/parser/CC/Parser.hs
+++ b/parser/CC/Parser.hs
@@ -131,4 +131,4 @@ whitespace = void (many (char ' '))
getPosition :: Parser SourcePos
getPosition = do
pos <- Text.Parsec.getPosition
- return (SourcePos (sourceLine pos) (sourceColumn pos))
+ return (SourcePos (sourceLine pos - 1) (sourceColumn pos - 1))
diff --git a/utils/CC/Types.hs b/utils/CC/Types.hs
index dc1b0e5..b377045 100644
--- a/utils/CC/Types.hs
+++ b/utils/CC/Types.hs
@@ -24,7 +24,7 @@ data SourceRange = SourceRange SourcePos SourcePos
instance Pretty SourceRange where
pretty (SourceRange from@(SourcePos fromLine fromCol) to@(SourcePos toLine toCol))
| fromLine == toLine =
- show (fromLine + 1) ++ ":" ++ show (fromCol + 1) ++ "-" ++ show (toCol + 1)
+ show (fromLine + 1) ++ ":" ++ show (fromCol + 1) ++ "-" ++ show toCol
| otherwise =
show from ++ "-" ++ show to