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 :: RangeInfo stage => Map SrcSpan [Located AnnotationComment] -> Ann Module dom stage -> Ann Module dom stage
- allElemSpans :: (SourceInfoTraversal node, RangeInfo stage) => Ann node dom stage -> [SrcSpan]
- resizeAnnots :: RangeInfo stage => [((SrcLoc, SrcLoc), Located AnnotationComment)] -> Ann Module dom stage -> Ann Module dom stage
- type ExpandType elem dom stage = Ann elem dom stage -> State [((SrcLoc, SrcLoc), Located AnnotationComment)] (Ann elem dom stage)
- expandTopLevelDecl :: RangeInfo stage => ExpandType Decl dom stage
- expandTypeSig :: RangeInfo stage => ExpandType TypeSignature dom stage
- expandClsElement :: RangeInfo stage => ExpandType ClassElement dom stage
- expandValueBind :: RangeInfo stage => ExpandType ValueBind dom stage
- expandLocalBind :: RangeInfo stage => ExpandType LocalBind dom stage
- expandConDecl :: RangeInfo stage => ExpandType ConDecl dom stage
- expandGadtConDecl :: RangeInfo stage => ExpandType GadtConDecl dom stage
- expandAnnot :: forall elem dom stage. RangeInfo stage => ExpandType elem dom stage
- applicableComments :: SrcLoc -> SrcLoc -> [((SrcLoc, SrcLoc), Located AnnotationComment)] -> [((SrcLoc, SrcLoc), Located AnnotationComment)]
- isCommentOnNext :: AnnotationComment -> Bool
- isCommentOnPrev :: AnnotationComment -> Bool
- firstNonspaceCharIs :: Char -> String -> Bool
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 :: RangeInfo stage => Map SrcSpan [Located AnnotationComment] -> Ann Module dom stage -> Ann Module dom stage 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 :: (SourceInfoTraversal node, RangeInfo stage) => Ann node dom stage -> [SrcSpan] Source #
resizeAnnots :: RangeInfo stage => [((SrcLoc, SrcLoc), Located AnnotationComment)] -> Ann Module dom stage -> Ann Module dom stage Source #
type ExpandType elem dom stage = Ann elem dom stage -> State [((SrcLoc, SrcLoc), Located AnnotationComment)] (Ann elem dom stage) Source #
expandTopLevelDecl :: RangeInfo stage => ExpandType Decl dom stage Source #
expandTypeSig :: RangeInfo stage => ExpandType TypeSignature dom stage Source #
expandClsElement :: RangeInfo stage => ExpandType ClassElement dom stage Source #
expandValueBind :: RangeInfo stage => ExpandType ValueBind dom stage Source #
expandLocalBind :: RangeInfo stage => ExpandType LocalBind dom stage Source #
expandConDecl :: RangeInfo stage => ExpandType ConDecl dom stage Source #
expandGadtConDecl :: RangeInfo stage => ExpandType GadtConDecl dom stage Source #
expandAnnot :: forall elem dom stage. RangeInfo stage => ExpandType elem dom stage 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.