diff options
Diffstat (limited to 'compiler/GHC/Hs/Dump.hs')
-rw-r--r-- | compiler/GHC/Hs/Dump.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/GHC/Hs/Dump.hs b/compiler/GHC/Hs/Dump.hs index 5ba1df580b..de9848e139 100644 --- a/compiler/GHC/Hs/Dump.hs +++ b/compiler/GHC/Hs/Dump.hs @@ -12,6 +12,7 @@ module GHC.Hs.Dump ( -- * Dumping ASTs showAstData, + showAstDataFull, BlankSrcSpan(..), BlankEpAnnotations(..), ) where @@ -35,12 +36,18 @@ import GHC.Utils.Outputable import Data.Data hiding (Fixity) import qualified Data.ByteString as B +-- | Should source spans be removed from output. data BlankSrcSpan = BlankSrcSpan | BlankSrcSpanFile | NoBlankSrcSpan deriving (Eq,Show) +-- | Should EpAnnotations be removed from output. data BlankEpAnnotations = BlankEpAnnotations | NoBlankEpAnnotations deriving (Eq,Show) +-- | Show the full AST as the compiler sees it. +showAstDataFull :: Data a => a -> SDoc +showAstDataFull = showAstData NoBlankSrcSpan NoBlankEpAnnotations + -- | 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 |