haskell-token-utils-0.0.0.6: Utilities to tie up tokens to an AST

Safe HaskellNone

Language.Haskell.TokenUtils.DualTree

Contents

Synopsis

Documentation

renderLines :: IsToken a => [Line a] -> StringSource

type SourceTree a = DUALTree Transformation (Up a) Annot (Prim a)Source

The main data structure for this module

data Line a Source

Constructors

Line Row Col RowOffset Source LineOpt [a] 

Instances

IsToken a => Show (Line a) 
IsToken a => Outputable (Line a) 
Outputable (Line GhcPosToken)

Extract the layout-sensitive parts of the GHC AST.

data Source Source

Constructors

SOriginal 
SAdded 
SWasAdded 

Instances

Eq Source 
Show Source 
Outputable Source 
Outputable Source 

to enable pretty printing

data Alignment Source

Constructors

ANone 
AVertical 

data LineOpt Source

Constructors

ONone 
OGroup

This line needs to be grouped with the next in terms of layout, so any column offsets need to be propagated

Instances

Eq LineOpt 
Show LineOpt 
Outputable LineOpt 
Outputable LineOpt 

data Up a Source

The value that bubbles up. This is the Span occupied by the subtree, together with a string representation of the subtree. The origin of the string is the start of the span.

Constructors

Up DtSimpSpan Alignment (NonEmpty (Line a)) [DeletedSpan] 
UDeleted [DeletedSpan]