ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Hs.Dump

Contents

- Dumping ASTs

Description

Contains a debug function to dump parts of the GHC.Hs AST. It uses a syb traversal which falls back to displaying based on the constructor name, so can be used to dump anything having a `Data.Data` instance.

Synopsis

- showAstData :: Data a => BlankSrcSpan -> BlankEpAnnotations -> a -> SDoc
- showAstDataFull :: Data a => a -> SDoc
- data BlankSrcSpan
  - = BlankSrcSpan
  - | BlankSrcSpanFile
  - | NoBlankSrcSpan
- data BlankEpAnnotations
  - = BlankEpAnnotations
  - | NoBlankEpAnnotations

# Dumping ASTs

showAstData :: Data a => BlankSrcSpan -> BlankEpAnnotations -> a -> SDoc #

Show a GHC syntax tree. This parameterised because it is also used for comparing ASTs in ppr roundtripping tests, where the SrcSpan's are blanked out, to avoid comparing locations, only structure

showAstDataFull :: Data a => a -> SDoc #

Show the full AST as the compiler sees it.

data BlankSrcSpan #

Should source spans be removed from output.

Constructors

BlankSrcSpan |
BlankSrcSpanFile |
NoBlankSrcSpan |

#### Instances

Instances details

Show BlankSrcSpan # |
Instance details Defined in GHC.Hs.Dump Methods showsPrec :: Int -> BlankSrcSpan -> ShowS # show :: BlankSrcSpan -> String # showList :: [BlankSrcSpan] -> ShowS #
Eq BlankSrcSpan # |
Instance details Defined in GHC.Hs.Dump Methods (==) :: BlankSrcSpan -> BlankSrcSpan -> Bool # (/=) :: BlankSrcSpan -> BlankSrcSpan -> Bool #

data BlankEpAnnotations #

Should EpAnnotations be removed from output.

Constructors

BlankEpAnnotations |
NoBlankEpAnnotations |

#### Instances

Instances details

Show BlankEpAnnotations # |
Instance details Defined in GHC.Hs.Dump Methods showsPrec :: Int -> BlankEpAnnotations -> ShowS # show :: BlankEpAnnotations -> String # showList :: [BlankEpAnnotations] -> ShowS #
Eq BlankEpAnnotations # |
Instance details Defined in GHC.Hs.Dump Methods (==) :: BlankEpAnnotations -> BlankEpAnnotations -> Bool # (/=) :: BlankEpAnnotations -> BlankEpAnnotations -> Bool #