diff options
author | David Waern <david.waern@gmail.com> | 2008-10-20 20:25:50 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2008-10-20 20:25:50 +0000 |
commit | 7fc7a177035d450566c375e361ed0961c1d3fa0d (patch) | |
tree | 051d7fa58c2f1522a1c91644c9d93676d6509db3 /src/Haddock | |
parent | 5ddb372746432ff0e1026f62171c1e0e3a705a6f (diff) |
Make renamer consistent
Instead of explicitly making some binders Undocumented, treat all names the
same way (that is, try to find a Documented name).
Diffstat (limited to 'src/Haddock')
-rw-r--r-- | src/Haddock/Interface/Rename.hs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 3675f0b4..0e0da5a6 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -130,10 +130,6 @@ runRnFM env rn = unRn rn lkp -------------------------------------------------------------------------------- -keep n = Undocumented n -keepL (L loc n) = L loc (Undocumented n) - - rename = lookupRn id renameL (L loc name) = return . L loc =<< rename name @@ -341,12 +337,13 @@ renameTyClD d = case d of where renameLCon (L loc con) = return . L loc =<< renameCon con renameCon (ConDecl lname expl ltyvars lcontext details restype mbldoc) = do + lname' <- renameL lname ltyvars' <- mapM renameLTyVarBndr ltyvars lcontext' <- renameLContext lcontext details' <- renameDetails details restype' <- renameResType restype mbldoc' <- mapM renameLDoc mbldoc - return (ConDecl (keepL lname) expl ltyvars' lcontext' details' restype' mbldoc') + return (ConDecl lname' expl ltyvars' lcontext' details' restype' mbldoc') renameDetails (RecCon fields) = return . RecCon =<< mapM renameField fields renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps @@ -356,14 +353,18 @@ renameTyClD d = case d of return (InfixCon a' b') renameField (ConDeclField name t doc) = do + name' <- renameL name t' <- renameLType t doc' <- mapM renameLDoc doc - return (ConDeclField (keepL name) t' doc') + return (ConDeclField name' t' doc') renameResType (ResTyH98) = return ResTyH98 renameResType (ResTyGADT t) = return . ResTyGADT =<< renameLType t - renameLFunDep (L loc (xs, ys)) = return (L loc (map keep xs, map keep ys)) + renameLFunDep (L loc (xs, ys)) = do + xs' <- mapM rename xs + ys' <- mapM rename ys + return (L loc (xs', ys')) renameLSig (L loc sig) = return . L loc =<< renameSig sig @@ -377,11 +378,13 @@ renameSig sig = case sig of renameForD (ForeignImport lname ltype x) = do + lname' <- renameL lname ltype' <- renameLType ltype - return (ForeignImport (keepL lname) ltype' x) + return (ForeignImport lname' ltype' x) renameForD (ForeignExport lname ltype x) = do + lname' <- renameL lname ltype' <- renameLType ltype - return (ForeignExport (keepL lname) ltype' x) + return (ForeignExport lname' ltype' x) renameInstD (InstDecl ltype _ _ lATs) = do |