| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Haskell.GHC.ExactPrint.Internal.Types
- type Comment = PComment Span
- type DComment = PComment DeltaPos
- data PComment a = Comment {
- commentPos :: !a
- commentContents :: !String
- commentIdentifier :: !SrcSpan
- commentOrigin :: !(Maybe AnnKeywordId)
- type Pos = (Int, Int)
- type Span = (Pos, Pos)
- type PosToken = (Located Token, String)
- newtype DeltaPos = DP (Int, Int)
- deltaRow :: DeltaPos -> Int
- deltaColumn :: DeltaPos -> Int
- addDP :: DeltaPos -> DeltaPos -> DeltaPos
- newtype LayoutStartCol = LayoutStartCol {}
- newtype ColDelta = ColDelta {
- getColDelta :: Int
- data Annotation = Ann {
- annEntryDelta :: !DeltaPos
- annPriorComments :: ![(DComment, DeltaPos)]
- annFollowingComments :: ![(DComment, DeltaPos)]
- annsDP :: ![(KeywordId, DeltaPos)]
- annSortKey :: !(Maybe [SrcSpan])
- annCapturedSpan :: !(Maybe AnnKey)
- annTrueEntryDelta :: Annotation -> DeltaPos
- annNone :: Annotation
- data Anns = Anns {}
- data AnnKey = AnnKey SrcSpan AnnConName
- emptyAnns :: Anns
- getKeywordDeltas :: Anns -> Map AnnKey Annotation
- modifyKeywordDeltas :: (Map AnnKey Annotation -> Map AnnKey Annotation) -> Anns -> Anns
- data KeywordId
- mkAnnKey :: Data a => Located a -> AnnKey
- data AnnConName = CN {}
- annGetConstr :: Data a => a -> AnnConName
- data ResTyGADTHook name = ResTyGADTHook [LHsTyVarBndr name]
- data WildCardAnon = WildCardAnon
- getAnnotationEP :: Data a => Located a -> Anns -> Maybe Annotation
- getAndRemoveAnnotationEP :: Data a => Located a -> Anns -> (Maybe Annotation, Anns)
- showGhc :: Outputable a => a -> String
Documentation
data PComment a
A Haskell comment. The AnnKeywordId is present if it has been converted
from an AnnKeywordId because the annotation must be interleaved into the
stream and does not have a well-defined position
Constructors
| Comment | |
Fields
| |
newtype DeltaPos
A relative positions, row then column
deltaColumn :: DeltaPos -> Int
newtype LayoutStartCol
Marks the start column of a layout block.
Constructors
| LayoutStartCol | |
Fields | |
Instances
newtype ColDelta
Marks the distance from the start of the layout block to the element.
Constructors
| ColDelta | |
Fields
| |
data Annotation
Constructors
| Ann | |
Fields
| |
Instances
data Anns
This structure holds a complete set of annotations for an AST
Constructors
| Anns | |
Fields | |
Instances
data AnnKey
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
Constructors
| AnnKey SrcSpan AnnConName |
getKeywordDeltas :: Anns -> Map AnnKey Annotation
modifyKeywordDeltas :: (Map AnnKey Annotation -> Map AnnKey Annotation) -> Anns -> Anns
data KeywordId
We need our own version of keywordid to manage various special cases
Constructors
| G AnnKeywordId | |
| AnnSpanEntry | Marks the entry position of a SrcSpan, does not generate specific output but does adjust last output position, and cause comment processing. |
| AnnSemiSep | |
| AnnComment DComment | |
| AnnString String | Used to pass information from Delta to Print when we have to work out details from the original SrcSpan. |
| AnnUnicode AnnKeywordId | Used to indicate that we should print using unicode syntax if possible. |
data AnnConName
Instances
annGetConstr :: Data a => a -> AnnConName
data ResTyGADTHook name
Constructors
| ResTyGADTHook [LHsTyVarBndr name] |
Instances
| DataId name => Data (ResTyGADTHook name) | |
| Show (LHsTyVarBndr name) => Show (ResTyGADTHook name) | |
| OutputableBndr name => Outputable (ResTyGADTHook name) | |
| (DataId name, OutputableBndr name, HasOccName name, Annotate name) => Annotate (ResTyGADTHook name) |
getAnnotationEP :: Data a => Located a -> Anns -> Maybe Annotation
getAndRemoveAnnotationEP :: Data a => Located a -> Anns -> (Maybe Annotation, Anns)
showGhc :: Outputable a => a -> String
Show a GHC.Outputable structure