haskell-tools-prettyprint-0.3.0.0: Pretty printing of Haskell-Tools AST

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Transform

Description

A module for preparing the representation of the AST for pretty printing.

Synopsis

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.

(<>) :: SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage -> SpanInfo SrcTemplateStage Source #

Concatenates two source templates to produce a new template with all child elements.

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