summaryrefslogtreecommitdiff
path: root/utils/check-ppr
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-06-26 12:58:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-08-12 03:50:12 -0400
commitaccbc242e555822a2060091af7188ce6e9b0144e (patch)
tree641ced97452a46a0ff17f6754d2150e283c9b9ca /utils/check-ppr
parentf1088b3f31ceddf918a319c97557fb1f08a9a387 (diff)
downloadhaskell-accbc242e555822a2060091af7188ce6e9b0144e.tar.gz
DynFlags: disentangle Outputable
- put panic related functions into GHC.Utils.Panic - put trace related functions using DynFlags in GHC.Driver.Ppr One step closer making Outputable fully independent of DynFlags. Bump haddock submodule
Diffstat (limited to 'utils/check-ppr')
-rw-r--r--utils/check-ppr/Main.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/check-ppr/Main.hs b/utils/check-ppr/Main.hs
index 9bc776d4d5..9d025633ef 100644
--- a/utils/check-ppr/Main.hs
+++ b/utils/check-ppr/Main.hs
@@ -9,6 +9,7 @@ import GHC.Types.SrcLoc
import GHC hiding (moduleName)
import GHC.Hs.Dump
import GHC.Driver.Session
+import GHC.Driver.Ppr
import GHC.Utils.Outputable hiding (space)
import System.Environment( getArgs )
import System.Exit
@@ -33,7 +34,7 @@ testOneFile :: FilePath -> String -> IO ()
testOneFile libdir fileName = do
p <- parseOneFile libdir fileName
let
- origAst = showSDoc unsafeGlobalDynFlags
+ origAst = showPprUnsafe
$ showAstData BlankSrcSpan
$ eraseLayoutInfo (pm_parsed_source p)
pped = pragmas ++ "\n" ++ pp (pm_parsed_source p)
@@ -50,7 +51,7 @@ testOneFile libdir fileName = do
p' <- parseOneFile libdir newFile
let newAstStr :: String
- newAstStr = showSDoc unsafeGlobalDynFlags
+ newAstStr = showPprUnsafe
$ showAstData BlankSrcSpan
$ eraseLayoutInfo (pm_parsed_source p')
writeFile newAstFile newAstStr
@@ -102,7 +103,7 @@ getPragmas anns = pragmaStr
pragmaStr = intercalate "\n" pragmas
pp :: (Outputable a) => a -> String
-pp a = showPpr unsafeGlobalDynFlags a
+pp a = showPprUnsafe a
eraseLayoutInfo :: ParsedSource -> ParsedSource
eraseLayoutInfo = everywhere go