diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-06-26 12:58:02 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-12 03:50:12 -0400 |
commit | accbc242e555822a2060091af7188ce6e9b0144e (patch) | |
tree | 641ced97452a46a0ff17f6754d2150e283c9b9ca /utils | |
parent | f1088b3f31ceddf918a319c97557fb1f08a9a387 (diff) | |
download | haskell-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')
-rw-r--r-- | utils/check-api-annotations/Main.hs | 4 | ||||
-rw-r--r-- | utils/check-ppr/Main.hs | 7 | ||||
m--------- | utils/haddock | 0 |
3 files changed, 6 insertions, 5 deletions
diff --git a/utils/check-api-annotations/Main.hs b/utils/check-api-annotations/Main.hs index 9358359f6d..7fd6180182 100644 --- a/utils/check-api-annotations/Main.hs +++ b/utils/check-api-annotations/Main.hs @@ -3,7 +3,7 @@ import Data.Data import Data.List import GHC -import GHC.Driver.Session +import GHC.Driver.Ppr import GHC.Utils.Outputable import GHC.Types.SrcLoc import System.Environment( getArgs ) @@ -96,7 +96,7 @@ showAnnsList annsList = "[\n" ++ (intercalate ",\n" ++ "\n]\n" pp :: (Outputable a) => a -> String -pp a = showPpr unsafeGlobalDynFlags a +pp a = showPprUnsafe a -- --------------------------------------------------------------------- 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 diff --git a/utils/haddock b/utils/haddock -Subproject 7e6628febc482b4ad451f49ad416722375d1b17 +Subproject 7de9589e0191bbd79521597d35c2a0c68d2c9ad |