[commit: ghc] master: Improve debug printing of Names (respect opt_SuppressModulePrefixes) (20ceffb)
Simon Peyton Jones
simonpj at microsoft.com
Tue Aug 16 12:47:46 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/20ceffb6505f3a148edc9150f5f07584f945ab95
>---------------------------------------------------------------
commit 20ceffb6505f3a148edc9150f5f07584f945ab95
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Aug 16 10:19:22 2011 +0100
Improve debug printing of Names (respect opt_SuppressModulePrefixes)
>---------------------------------------------------------------
compiler/basicTypes/Name.lhs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/compiler/basicTypes/Name.lhs b/compiler/basicTypes/Name.lhs
index fbe86bd..b9f96e7 100644
--- a/compiler/basicTypes/Name.lhs
+++ b/compiler/basicTypes/Name.lhs
@@ -440,12 +440,15 @@ pprExternal sty uniq mod occ is_wired is_builtin
-- In code style, always qualify
-- ToDo: maybe we could print all wired-in things unqualified
-- in code style, to reduce symbol table bloat?
- | debugStyle sty = ppr mod <> dot <> ppr_occ_name occ
+ | debugStyle sty = pp_mod <> ppr_occ_name occ
<> braces (hsep [if is_wired then ptext (sLit "(w)") else empty,
pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| BuiltInSyntax <- is_builtin = ppr_occ_name occ -- Never qualify builtin syntax
| otherwise = pprModulePrefix sty mod occ <> ppr_occ_name occ
+ where
+ pp_mod | opt_SuppressModulePrefixes = empty
+ | otherwise = ppr mod <> dot
pprInternal :: PprStyle -> Unique -> OccName -> SDoc
pprInternal sty uniq occ
More information about the Cvs-ghc
mailing list