Safe Haskell | None |
---|---|
Language | Haskell2010 |
A module for preparing the representation of the AST for pretty printing.
- prepareAST :: SourceInfoTraversal node => StringBuffer -> Ann node dom RangeStage -> Ann node dom SrcTemplateStage
- placeComments :: RangeInfo stage => Map SrcSpan [Located AnnotationComment] -> Ann UModule dom stage -> Ann UModule dom stage
- getNormalComments :: Map SrcSpan [Located AnnotationComment] -> Map SrcSpan [Located AnnotationComment]
- getPragmaComments :: Map SrcSpan [Located AnnotationComment] -> Map String [Located String]
- child :: SpanInfo SrcTemplateStage
- opt :: OptionalInfo SrcTemplateStage
- optBefore :: String -> OptionalInfo SrcTemplateStage
- optAfter :: String -> OptionalInfo SrcTemplateStage
- list :: ListInfo SrcTemplateStage
- indentedList :: ListInfo SrcTemplateStage
- indentedListBefore :: String -> ListInfo SrcTemplateStage
- indentedListAfter :: String -> ListInfo SrcTemplateStage
- listSep :: String -> ListInfo SrcTemplateStage
- listSepBefore :: String -> String -> ListInfo SrcTemplateStage
- listSepAfter :: String -> String -> ListInfo SrcTemplateStage
- listSepBeforeAfter :: String -> String -> String -> ListInfo SrcTemplateStage
- (<>) :: SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage
- sourceTemplateNodeRange :: Simple Lens (SpanInfo SrcTemplateStage) SrcSpan
- sourceTemplateNodeElems :: Simple Lens (SpanInfo SrcTemplateStage) [SourceTemplateElem]
- sourceTemplateListRange :: Simple Lens (ListInfo SrcTemplateStage) SrcSpan
- srcTmpListBefore :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpListAfter :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpDefaultSeparator :: Simple Lens (ListInfo SrcTemplateStage) String
- srcTmpIndented :: Simple Lens (ListInfo SrcTemplateStage) Bool
- srcTmpSeparators :: Simple Lens (ListInfo SrcTemplateStage) [String]
- sourceTemplateOptRange :: Simple Lens (OptionalInfo SrcTemplateStage) SrcSpan
- srcTmpOptBefore :: Simple Lens (OptionalInfo SrcTemplateStage) String
- srcTmpOptAfter :: Simple Lens (OptionalInfo SrcTemplateStage) String
- rangeToSource :: SourceInfoTraversal node => StringBuffer -> Ann node dom RngTemplateStage -> Ann node dom SrcTemplateStage
- fixRanges :: SourceInfoTraversal node => Ann node dom RangeStage -> Ann node dom NormRangeStage
- cutUpRanges :: forall node dom. SourceInfoTraversal node => Ann node dom NormRangeStage -> Ann node dom RngTemplateStage
- getLocIndices :: SourceInfoTraversal e => Ann e dom RngTemplateStage -> Map OrdSrcSpan Int
- mapLocIndices :: Ord k => StringBuffer -> Map OrdSrcSpan k -> Map k String
Documentation
prepareAST :: SourceInfoTraversal node => StringBuffer -> Ann node dom RangeStage -> Ann node dom SrcTemplateStage Source #
Prepares the AST for pretty printing
placeComments :: RangeInfo stage => Map SrcSpan [Located AnnotationComment] -> Ann UModule dom stage -> Ann UModule 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.
getNormalComments :: Map SrcSpan [Located AnnotationComment] -> Map SrcSpan [Located AnnotationComment] Source #
getPragmaComments :: Map SrcSpan [Located AnnotationComment] -> Map String [Located String] Source #
listSepBefore :: String -> String -> ListInfo SrcTemplateStage Source #
listSepAfter :: String -> String -> ListInfo SrcTemplateStage Source #
listSepBeforeAfter :: String -> String -> String -> ListInfo SrcTemplateStage Source #
(<>) :: SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage Source #
Concatenates two source templates to produce a new template with all child elements.
sourceTemplateNodeElems :: Simple Lens (SpanInfo SrcTemplateStage) [SourceTemplateElem] Source #
rangeToSource :: SourceInfoTraversal node => StringBuffer -> Ann node dom RngTemplateStage -> Ann node dom SrcTemplateStage Source #
fixRanges :: SourceInfoTraversal node => Ann node dom RangeStage -> Ann node dom NormRangeStage Source #
Modifies ranges to contain their children
cutUpRanges :: forall node dom. SourceInfoTraversal node => Ann node dom NormRangeStage -> Ann node dom RngTemplateStage Source #
Creates a source template from the ranges and the input file. All source ranges must be good ranges.
getLocIndices :: SourceInfoTraversal e => Ann e dom RngTemplateStage -> Map OrdSrcSpan Int Source #
Assigns an index (in the order they are used) for each range
mapLocIndices :: Ord k => StringBuffer -> Map OrdSrcSpan k -> Map k String Source #
Partitions the source file in the order where the parts are used in the AST