diff options
author | simonpj <unknown> | 1999-01-27 14:52:25 +0000 |
---|---|---|
committer | simonpj <unknown> | 1999-01-27 14:52:25 +0000 |
commit | 18976e614fd90a8d81ced2c3e9cd8e38d72a1f40 (patch) | |
tree | ba006e4eab248358b818f771064df1a37e43cc16 /ghc/compiler/utils/Outputable.lhs | |
parent | f3bed25cb37981ef391f750cae58280e71cd80bc (diff) | |
download | haskell-18976e614fd90a8d81ced2c3e9cd8e38d72a1f40.tar.gz |
[project @ 1999-01-27 14:51:14 by simonpj]
Finally! This commits the ongoing saga of Simon's hygiene sweep
FUNCTIONALITY
~~~~~~~~~~~~~
a) The 'unused variable' warnings from the renamer work.
b) Better error messages here and there, esp type checker
c) Fixities for Haskell 98 (maybe I'd done that before)
d) Lazy reporting of name clashes for Haskell 98 (ditto)
HYGIENE
~~~~~~~
a) type OccName has its own module. OccNames are represented
by a single FastString, not three as in the last round. This
string is held in Z-encoded form; a decoding function decodes
for printing in user error messages. There's a nice tight
encoding for (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)
b) type Module is a proper ADT, in module OccName
c) type RdrName is a proper ADT, in its own module
d) type Name has a new, somwhat tidier, representation
e) much grunting in the renamer to get Provenances right.
This makes error messages look better (no spurious qualifiers)
Diffstat (limited to 'ghc/compiler/utils/Outputable.lhs')
-rw-r--r-- | ghc/compiler/utils/Outputable.lhs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ghc/compiler/utils/Outputable.lhs b/ghc/compiler/utils/Outputable.lhs index 582a0b63bf..dfefd854b3 100644 --- a/ghc/compiler/utils/Outputable.lhs +++ b/ghc/compiler/utils/Outputable.lhs @@ -41,8 +41,8 @@ module Outputable ( -- error handling - pprPanic, pprPanic#, pprError, pprTrace, assertPprPanic, - trace, panic, panic#, assertPanic, warnPprTrace + pprPanic, pprPanic#, pprError, pprTrace, assertPprPanic, warnPprTrace, + trace, panic, panic#, assertPanic ) where #include "HsVersions.h" @@ -207,9 +207,17 @@ rational n sty = Pretty.rational n parens d sty = Pretty.parens (d sty) braces d sty = Pretty.braces (d sty) brackets d sty = Pretty.brackets (d sty) -quotes d sty = Pretty.quotes (d sty) doubleQuotes d sty = Pretty.doubleQuotes (d sty) +-- quotes encloses something in single quotes... +-- but it omits them if the thing ends in a single quote +-- so that we don't get `foo''. Instead we just have foo'. +quotes d sty = case show pp_d of + ('\'' : _) -> pp_d + other -> Pretty.quotes pp_d + where + pp_d = d sty + semi sty = Pretty.semi comma sty = Pretty.comma colon sty = Pretty.colon |