Safe Haskell | None |
---|---|
Language | Haskell2010 |
Source position and span information
Mostly taken from purescript's SourcePos definition.
Documentation
A Span of position information
Instances
Eq Span Source # | |
Ord Span Source # | |
Show Span Source # | |
Generic Span Source # | |
Semigroup Span Source # | |
NFData Span Source # | |
Defined in Source.Span | |
FromJSON Span Source # | |
Defined in Source.Span parseJSON :: Value -> Parser Span parseJSONList :: Value -> Parser [Span] | |
ToJSON Span Source # | |
Defined in Source.Span | |
Hashable Span Source # | |
Defined in Source.Span | |
HasSpan Span Source # | |
type Rep Span Source # | |
Defined in Source.Span type Rep Span = D1 ('MetaData "Span" "Source.Span" "semantic-source-0.1.0.1-inplace" 'False) (C1 ('MetaCons "Span" 'PrefixI 'True) (S1 ('MetaSel ('Just "start") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Pos) :*: S1 ('MetaSel ('Just "end") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Pos))) |
Construct a Span with a given value for both its start and end positions.
spanFromSrcLoc :: SrcLoc -> Span Source #
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.
Instances
Eq Pos Source # | |
Ord Pos Source # | |
Show Pos Source # | |
Generic Pos Source # | |
NFData Pos Source # | |
Defined in Source.Span | |
FromJSON Pos Source # | |
Defined in Source.Span parseJSON :: Value -> Parser Pos parseJSONList :: Value -> Parser [Pos] | |
ToJSON Pos Source # | |
Defined in Source.Span | |
Hashable Pos Source # | |
Defined in Source.Span | |
type Rep Pos Source # | |
Defined in Source.Span type Rep Pos = D1 ('MetaData "Pos" "Source.Span" "semantic-source-0.1.0.1-inplace" 'False) (C1 ('MetaCons "Pos" 'PrefixI 'True) (S1 ('MetaSel ('Just "line") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "column") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Int))) |