From 70945271f1f4deab363c1acfef3ce51a1b7f617d Mon Sep 17 00:00:00 2001 From: Isaac Dupree Date: Sun, 23 Aug 2009 03:08:03 +0000 Subject: Move doc parsing/lexing into Haddock for ghc>=6.11 --- src/Haddock/Interface/Rename.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Interface/Rename.hs') diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 8145d63a..b377b4fb 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -144,6 +144,13 @@ renameExportItems = mapM renameExportItem renameMaybeDoc :: Maybe (HsDoc Name) -> RnM (Maybe (HsDoc DocName)) renameMaybeDoc = mapM renameDoc +#if __GLASGOW_HASKELL__ >= 611 +renameLDocHsSyn :: LHsDocString -> RnM LHsDocString +renameLDocHsSyn = return +#else +renameLDocHsSyn :: LHsDoc Name -> RnM (LHsDoc DocName) +renameLDocHsSyn = renameLDoc +#endif renameLDoc :: LHsDoc Name -> RnM (LHsDoc DocName) renameLDoc = mapM renameDoc @@ -259,7 +266,7 @@ renameType t = case t of HsDocTy ty doc -> do ty' <- renameLType ty - doc' <- renameLDoc doc + doc' <- renameLDocHsSyn doc return (HsDocTy ty' doc') _ -> error "renameType" @@ -363,7 +370,7 @@ renameTyClD d = case d of lcontext' <- renameLContext lcontext details' <- renameDetails details restype' <- renameResType restype - mbldoc' <- mapM renameLDoc mbldoc + mbldoc' <- mapM renameLDocHsSyn mbldoc return (decl { con_name = lname', con_qvars = ltyvars', con_cxt = lcontext' , con_details = details', con_res = restype', con_doc = mbldoc' }) @@ -377,7 +384,7 @@ renameTyClD d = case d of renameField (ConDeclField name t doc) = do name' <- renameL name t' <- renameLType t - doc' <- mapM renameLDoc doc + doc' <- mapM renameLDocHsSyn doc return (ConDeclField name' t' doc') renameResType (ResTyH98) = return ResTyH98 -- cgit v1.2.3