mirror of
https://github.com/github/semantic.git
synced 2024-12-28 17:32:05 +03:00
use fromIntegral
This commit is contained in:
parent
5bda74b2ea
commit
1dd8d93ce1
@ -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 }
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user