X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FName.lhs;h=29b2b3eb0dc7cb805a071a47e003e094344dff76;hb=4e3255388e8b99ccdae290bfcb6cd666b8c93d4a;hp=702b07ff158e337f9be61411ef511ae17998a7f8;hpb=d32c5227315009f38355fe3233f0f4e5b1f61dc6;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/Name.lhs b/ghc/compiler/basicTypes/Name.lhs index 702b07f..29b2b3e 100644 --- a/ghc/compiler/basicTypes/Name.lhs +++ b/ghc/compiler/basicTypes/Name.lhs @@ -300,17 +300,17 @@ instance Outputable Name where instance OutputableBndr Name where pprBndr _ name = pprName name -pprName name@(Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) +pprName (Name {n_sort = sort, n_uniq = uniq, n_occ = occ}) = getPprStyle $ \ sty -> case sort of - External mod mb_p -> pprExternal sty name uniq mod occ mb_p False - WiredIn mod mb_p thing -> pprExternal sty name uniq mod occ mb_p True + External mod mb_p -> pprExternal sty uniq mod occ mb_p False + WiredIn mod mb_p thing -> pprExternal sty uniq mod occ mb_p True System -> pprSystem sty uniq occ Internal -> pprInternal sty uniq occ -pprExternal sty name uniq mod occ mb_p is_wired - | codeStyle sty = ppr (moduleName mod) <> char '_' <> pprOccName occ - | debugStyle sty = sep [ppr (moduleName mod) <> dot <> pprOccName occ, +pprExternal sty uniq mod occ mb_p is_wired + | codeStyle sty = ppr mod_name <> char '_' <> pprOccName occ + | debugStyle sty = sep [ppr mod_name <> dot <> pprOccName occ, hsep [text "{-" , if is_wired then ptext SLIT("(w)") else empty , pprUnique uniq @@ -318,8 +318,10 @@ pprExternal sty name uniq mod occ mb_p is_wired -- Nothing -> empty -- Just n -> brackets (ppr n) , text "-}"]] - | unqualStyle sty name = pprOccName occ - | otherwise = ppr (moduleName mod) <> dot <> pprOccName occ + | unqualStyle sty mod_name occ = pprOccName occ + | otherwise = ppr mod_name <> dot <> pprOccName occ + where + mod_name = moduleName mod pprInternal sty uniq occ | codeStyle sty = pprUnique uniq