Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
8b072e93
Commit
8b072e93
authored
Aug 11, 2008
by
simonpj@microsoft.com
Browse files
When suppressing uniques, don't print the separating underscore
parent
3d9d59ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/basicTypes/Name.lhs
View file @
8b072e93
...
...
@@ -77,6 +77,7 @@ import SrcLoc
import Unique
import Maybes
import Binary
import StaticFlags
import FastTypes
import FastString
import Outputable
...
...
@@ -418,7 +419,7 @@ pprInternal sty uniq occ
| codeStyle sty = pprUnique uniq
| debugStyle sty = ppr_occ_name occ <> braces (hsep [pprNameSpaceBrief (occNameSpace occ),
pprUnique uniq])
| dumpStyle sty = ppr_occ_name occ <>
char '_' <> pprU
nique uniq
| dumpStyle sty = ppr_occ_name occ <>
ppr_underscore_u
nique uniq
-- For debug dumps, we're not necessarily dumping
-- tidied code, so we need to print the uniques.
| otherwise = ppr_occ_name occ -- User style
...
...
@@ -427,13 +428,20 @@ pprInternal sty uniq occ
pprSystem :: PprStyle -> Unique -> OccName -> SDoc
pprSystem sty uniq occ
| codeStyle sty = pprUnique uniq
| debugStyle sty = ppr_occ_name occ <>
char '_' <> pprU
nique uniq
| debugStyle sty = ppr_occ_name occ <>
ppr_underscore_u
nique uniq
<> braces (pprNameSpaceBrief (occNameSpace occ))
| otherwise = ppr_occ_name occ <>
char '_' <> pprU
nique uniq
| otherwise = ppr_occ_name occ <>
ppr_underscore_u
nique uniq
-- If the tidy phase hasn't run, the OccName
-- is unlikely to be informative (like 's'),
-- so print the unique
ppr_underscore_unique :: Unique -> SDoc
-- Print an underscore separating the name from its unique
-- But suppress it if we aren't printing the uniques anyway
ppr_underscore_unique uniq
| opt_SuppressUniques = empty
| otherwise = char '_' <> pprUnique uniq
ppr_occ_name :: OccName -> SDoc
ppr_occ_name occ = ftext (occNameFS occ)
-- Don't use pprOccName; instead, just print the string of the OccName;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment