diff --git a/app/Main.hs b/app/Main.hs index 232044ebe..92cb2d4ef 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -129,10 +129,12 @@ range :: Ptr TSNode -> IO Range range node = do pos <- ts_node_p_pos_chars node size <- ts_node_p_size_chars node - return Range { start = fromEnum $ toInteger pos, end = (fromEnum $ toInteger pos) + (fromEnum $ toInteger size) } + let start = fromIntegral pos + end = start + fromIntegral size + return Range { start = start, end = end } getLineRange :: Ptr TSNode -> IO Range getLineRange node = do startLine <- ts_node_p_start_point node endLine <- ts_node_p_end_point node - return Range { start = fromEnum $ toInteger startLine, end = fromEnum $ toInteger endLine } + return Range { start = fromIntegral startLine, end = fromIntegral endLine } diff --git a/src/Diff.hs b/src/Diff.hs index c1d300bf5..21394b180 100644 --- a/src/Diff.hs +++ b/src/Diff.hs @@ -15,7 +15,7 @@ data Range = Range { start :: Int, end :: Int } type Category = String -data Info = Info { characterRange:: Range, lineRange :: Range, categories :: (Set Category) } +data Info = Info { characterRange :: Range, lineRange :: Range, categories :: (Set Category) } deriving (Eq, Show) instance Categorizable Info where