aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Haddock.hs')
-rw-r--r--src/Haddock.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Haddock.hs b/src/Haddock.hs
index f79f3470..3b31c756 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -54,11 +54,11 @@ import qualified GHC.Paths as GhcPaths
import Paths_haddock
#endif
-import GHC hiding (flags, verbosity)
+import GHC hiding (verbosity)
import Config
-import DynFlags hiding (flags, verbosity)
+import DynFlags hiding (verbosity)
import StaticFlags (saveStaticFlagGlobals, restoreStaticFlagGlobals)
-import Panic (panic, handleGhcException)
+import Panic (handleGhcException)
import Module
--------------------------------------------------------------------------------
@@ -229,7 +229,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do
sourceUrls' = (srcBase, srcModule, srcMap')
libDir <- getHaddockLibDir flags
- prologue <- getPrologue flags
+ prologue <- getPrologue dflags flags
themes <- getThemes libDir flags >>= either bye return
when (Flag_GenIndex `elem` flags) $ do
@@ -299,7 +299,7 @@ withGhc libDir flags ghcActs = saveStaticFlagGlobals >>= \savedFlags -> do
(restFlags, _) <- parseStaticFlags (map noLoc flags)
runGhc (Just libDir) $ do
dynflags <- getSessionDynFlags
- let dynflags' = dopt_set dynflags Opt_Haddock
+ let dynflags' = gopt_set dynflags Opt_Haddock
let dynflags'' = dynflags' {
hscTarget = HscNothing,
ghcMode = CompManager,
@@ -314,7 +314,7 @@ withGhc libDir flags ghcActs = saveStaticFlagGlobals >>= \savedFlags -> do
ghcActs dynflags'''
`finally` restoreStaticFlagGlobals savedFlags
where
- parseGhcFlags :: Monad m => DynFlags -> [Located String]
+ parseGhcFlags :: MonadIO m => DynFlags -> [Located String]
-> [String] -> m DynFlags
parseGhcFlags dynflags flags_ origFlags = do
-- TODO: handle warnings?
@@ -407,13 +407,13 @@ updateHTMLXRefs packages = do
mapping' = [ (moduleName m, html) | (m, html) <- mapping ]
-getPrologue :: [Flag] -> IO (Maybe (Doc RdrName))
-getPrologue flags =
+getPrologue :: DynFlags -> [Flag] -> IO (Maybe (Doc RdrName))
+getPrologue dflags flags =
case [filename | Flag_Prologue filename <- flags ] of
[] -> return Nothing
[filename] -> do
str <- readFile filename
- case parseParas (tokenise (defaultDynFlags (panic "No settings")) str
+ case parseParas (tokenise dflags str
(1,0) {- TODO: real position -}) of
Nothing -> throwE $ "failed to parse haddock prologue from file: " ++ filename
Just doc -> return (Just doc)