From 4dc9ecd3905f75adb6bcfb818fbc163c724d4545 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Mon, 16 Jul 2012 21:22:48 +0100 Subject: Fix haddock following some GHC changes Passing _|_ as the Settings for defaultDynFlags no longer works well enough --- src/Main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index b80c0e96..a22f1ae4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -218,7 +218,7 @@ render dflags flags 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 @@ -404,13 +404,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) -- cgit v1.2.3