Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Source position and span information
Mostly taken from purescript's SourcePos definition.
Documentation
A Span of position information
Instances
Semigroup Span Source # | |
Generic Span Source # | |
Show Span Source # | |
NFData Span Source # | |
Defined in Source.Span | |
Eq Span Source # | |
Ord Span Source # | |
Hashable Span Source # | |
Defined in Source.Span | |
HasSpan Span Source # | |
FromJSON Span Source # | |
Defined in Source.Span parseJSON :: Value -> Parser Span parseJSONList :: Value -> Parser [Span] | |
ToJSON Span Source # | |
Defined in Source.Span | |
type Rep Span Source # | |
Defined in Source.Span type Rep Span = D1 ('MetaData "Span" "Source.Span" "semantic-source-0.2.0.0-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
Generic Pos Source # | |
Show Pos Source # | |
NFData Pos Source # | |
Defined in Source.Span | |
Eq Pos Source # | |
Ord Pos Source # | |
Hashable 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 | |
type Rep Pos Source # | |
Defined in Source.Span type Rep Pos = D1 ('MetaData "Pos" "Source.Span" "semantic-source-0.2.0.0-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))) |