Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Comment = Comment Bool Span String
- data DComment = DComment Int Bool (DeltaPos, DeltaPos) String
- type Pos = (Int, Int)
- type Span = (Pos, Pos)
- type PosToken = (Located Token, String)
- newtype DeltaPos = DP (Int, Int)
- data Annotation = Ann {
- ann_comments :: ![DComment]
- ann_delta :: !DeltaPos
- annNone :: Annotation
- type Anns = (AnnsEP, AnnsFinal)
- anEP :: Anns -> AnnsEP
- anF :: Anns -> AnnsFinal
- type AnnsEP = Map (SrcSpan, AnnConName) Annotation
- type AnnsFinal = Map (SrcSpan, KeywordId) [DeltaPos]
- data KeywordId
- data AnnConName = CN String
- annGetConstr :: Data a => a -> AnnConName
- unConName :: AnnConName -> String
- data ResTyGADTHook name = ResTyGADTHook [LHsTyVarBndr name]
- type AnnKey = (SrcSpan, AnnConName)
- type AnnKeyF = (SrcSpan, KeywordId)
- mkAnnKeyEP :: Data a => Located a -> AnnKey
- getAnnotationEP :: Data a => AnnsEP -> Located a -> Maybe Annotation
- getAndRemoveAnnotationEP :: Data a => AnnsEP -> Located a -> (Maybe Annotation, AnnsEP)
Documentation
Delta version of the comment. The initial Int is the column offset that was force when the DeltaPos values were calculated. If this is different when it is output, they deltas must be updated.
data Annotation Source
Ann | |
|
type AnnsEP = Map (SrcSpan, AnnConName) Annotation Source
For every Located a
, use the SrcSpan
and constructor name of
a as the key, to store the standard annotation.
These are used to maintain context in the AP and EP monads
type AnnsFinal = Map (SrcSpan, KeywordId) [DeltaPos] Source
The offset values used for actually outputing the source. For a
given
, in a context managed by the AP or EP monads,
store a list of offsets for a particular KeywordId. Mostly there
will only be one, but in certain circumstances they are multiple,
e.g. semi colons as separators, which can be repeated.SrcSpan
We need our own version of keywordid to distinguish between a semi-colon appearing within an AST element and one separating AST elements in a list.
data AnnConName Source
annGetConstr :: Data a => a -> AnnConName Source
unConName :: AnnConName -> String Source
data ResTyGADTHook name Source
ResTyGADTHook [LHsTyVarBndr name] |
DataId name => Data (ResTyGADTHook name) Source | |
Show (LHsTyVarBndr name) => Show (ResTyGADTHook name) Source | |
OutputableBndr name => Outputable (ResTyGADTHook name) Source | |
ExactP (ResTyGADTHook RdrName) Source |
type AnnKey = (SrcSpan, AnnConName) Source
mkAnnKeyEP :: Data a => Located a -> AnnKey Source
getAnnotationEP :: Data a => AnnsEP -> Located a -> Maybe Annotation Source
getAndRemoveAnnotationEP :: Data a => AnnsEP -> Located a -> (Maybe Annotation, AnnsEP) Source