mirror of
https://github.com/github/semantic.git
synced 2024-11-23 16:37:50 +03:00
parent
70252f613c
commit
91a1a1720b
@ -1,4 +1,6 @@
|
||||
{-# LANGUAGE DeriveGeneric, OverloadedStrings, RankNTypes #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE RankNTypes #-}
|
||||
-- | Source position and span information
|
||||
--
|
||||
-- Mostly taken from purescript's SourcePos definition.
|
||||
@ -56,7 +58,11 @@ spanFromSrcLoc :: SrcLoc -> Span
|
||||
spanFromSrcLoc s = Span (Pos (srcLocStartLine s) (srcLocStartCol s)) (Pos (srcLocEndLine s) (srcLocEndCol s))
|
||||
|
||||
|
||||
-- | Source position information (1-indexed)
|
||||
-- | Source position information.
|
||||
-- The 'Pos' values associated with ASTs returned from tree-sitter
|
||||
-- 'Unmarshal' instances are zero-indexed. Unless you are displaying
|
||||
-- span information to a user, you should write your code assuming
|
||||
-- zero-indexing.
|
||||
data Pos = Pos
|
||||
{ line :: {-# UNPACK #-} !Int
|
||||
, column :: {-# UNPACK #-} !Int
|
||||
|
Loading…
Reference in New Issue
Block a user