Safe Haskell | None |
---|---|
Language | Haskell2010 |
This transformation expands nodes to contain the comments that should be attached to them. After this, a normalizing transformation should be performed that expands parents to contain their children.
- getNormalComments :: Map SrcSpan [Located AnnotationComment] -> Map SrcSpan [Located AnnotationComment]
- getPragmaComments :: Map SrcSpan [Located AnnotationComment] -> Map String [Located String]
- isPragma :: AnnotationComment -> Bool
- placeComments :: (StructuralTraversable node, Data sema, Data (node (NodeInfo sema SpanInfo)), Typeable node) => Map SrcSpan [Located AnnotationComment] -> Ann node (NodeInfo sema SpanInfo) -> Ann node (NodeInfo sema SpanInfo)
- allElemSpans :: StructuralTraversable node => Ann node (NodeInfo sema SpanInfo) -> [SrcSpan]
- resizeAnnots :: forall node sema. (Data sema, Data (node (NodeInfo sema SpanInfo)), Typeable node) => [((SrcLoc, SrcLoc), Located AnnotationComment)] -> Ann node (NodeInfo sema SpanInfo) -> Ann node (NodeInfo sema SpanInfo)
- type ExpandType elem sema = Ann elem (NodeInfo sema SpanInfo) -> State [((SrcLoc, SrcLoc), Located AnnotationComment)] (Ann elem (NodeInfo sema SpanInfo))
- expandAnnot :: forall elem sema. ExpandType elem sema
- applicableComments :: SrcLoc -> SrcLoc -> [((SrcLoc, SrcLoc), Located AnnotationComment)] -> [((SrcLoc, SrcLoc), Located AnnotationComment)]
- isCommentOnNext :: AnnotationComment -> Bool
- isCommentOnPrev :: AnnotationComment -> Bool
- firstNonspaceCharIs :: Char -> String -> Bool
- expandAnnotToFunArgs :: ExpandType TypeSignature sema
Documentation
getNormalComments :: Map SrcSpan [Located AnnotationComment] -> Map SrcSpan [Located AnnotationComment] Source #
getPragmaComments :: Map SrcSpan [Located AnnotationComment] -> Map String [Located String] Source #
isPragma :: AnnotationComment -> Bool Source #
placeComments :: (StructuralTraversable node, Data sema, Data (node (NodeInfo sema SpanInfo)), Typeable node) => Map SrcSpan [Located AnnotationComment] -> Ann node (NodeInfo sema SpanInfo) -> Ann node (NodeInfo sema SpanInfo) Source #
Puts comments in the nodes they should be attached to. Leaves the AST in a state where parent nodes does not contain all of their children.
allElemSpans :: StructuralTraversable node => Ann node (NodeInfo sema SpanInfo) -> [SrcSpan] Source #
resizeAnnots :: forall node sema. (Data sema, Data (node (NodeInfo sema SpanInfo)), Typeable node) => [((SrcLoc, SrcLoc), Located AnnotationComment)] -> Ann node (NodeInfo sema SpanInfo) -> Ann node (NodeInfo sema SpanInfo) Source #
type ExpandType elem sema = Ann elem (NodeInfo sema SpanInfo) -> State [((SrcLoc, SrcLoc), Located AnnotationComment)] (Ann elem (NodeInfo sema SpanInfo)) Source #
expandAnnot :: forall elem sema. ExpandType elem sema Source #
Expands tree elements to contain the comments that should be attached to them.
applicableComments :: SrcLoc -> SrcLoc -> [((SrcLoc, SrcLoc), Located AnnotationComment)] -> [((SrcLoc, SrcLoc), Located AnnotationComment)] Source #
GHC mistakenly parses -- ^ and -- | comments as simple line comments.
isCommentOnNext :: AnnotationComment -> Bool Source #
Checks if a doc comment belongs to the next definition.
isCommentOnPrev :: AnnotationComment -> Bool Source #
Checks if a doc comment belongs to the previous definition.
expandAnnotToFunArgs :: ExpandType TypeSignature sema Source #