diff options
author | Isaac Dupree <id@isaac.cedarswampstudios.org> | 2009-08-23 03:08:03 +0000 |
---|---|---|
committer | Isaac Dupree <id@isaac.cedarswampstudios.org> | 2009-08-23 03:08:03 +0000 |
commit | 70945271f1f4deab363c1acfef3ce51a1b7f617d (patch) | |
tree | 81d518f2ca4dde1a1c72072b8a67290de2952388 /src/Haddock/Interface/Rename.hs | |
parent | 9dc98d20af5bbcb8bff7624b3d8c4d840ed6bb4e (diff) |
Move doc parsing/lexing into Haddock for ghc>=6.11
Diffstat (limited to 'src/Haddock/Interface/Rename.hs')
-rw-r--r-- | src/Haddock/Interface/Rename.hs | 13 |
1 files changed, 10 insertions, 3 deletions
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 |