diff options
author | sof <unknown> | 1997-05-18 04:54:28 +0000 |
---|---|---|
committer | sof <unknown> | 1997-05-18 04:54:28 +0000 |
commit | 708b68cb55a3cf85e2a1ccd5a75e9a6770cf6306 (patch) | |
tree | ee85ae52ef3cb763025f1974cfe1e47f4c96b091 /ghc/compiler/utils | |
parent | ccd4105eb4a3d8bca062bacc3664086b4e940704 (diff) | |
download | haskell-708b68cb55a3cf85e2a1ccd5a75e9a6770cf6306.tar.gz |
[project @ 1997-05-18 04:54:28 by sof]
Added PprQuote style
Diffstat (limited to 'ghc/compiler/utils')
-rw-r--r-- | ghc/compiler/utils/PprStyle.lhs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/ghc/compiler/utils/PprStyle.lhs b/ghc/compiler/utils/PprStyle.lhs index 3471485aab..9f406054a5 100644 --- a/ghc/compiler/utils/PprStyle.lhs +++ b/ghc/compiler/utils/PprStyle.lhs @@ -8,30 +8,32 @@ module PprStyle ( PprStyle(..), - codeStyle, ifaceStyle, - showUserishTypes + codeStyle, ifaceStyle, userStyle ) where CHK_Ubiq() -- debugging consistency check -IMP_FASTSTRING() -- cheat to force fast string dependency. + +import FastString data PprStyle = PprForUser -- Pretty-print in a way that will -- make sense to the ordinary user; -- must be very close to Haskell - -- syntax, etc. ToDo: how diff is - -- this from what pprInterface must - -- do? + -- syntax, etc. + | PprQuote -- Like PprForUser, but also quote the whole thing + | PprDebug -- Standard debugging output | PprShowAll -- Debugging output which leaves -- nothing to the imagination + | PprInterface -- Interface generation + | PprForC -- must print out C-acceptable names - | PprUnfolding -- for non-interface intermodule info - -- the compiler writes/reads + | PprForAsm -- must print out assembler-acceptable names Bool -- prefix CLabel with underscore? (String -> String) -- format AsmTempLabel + \end{code} Orthogonal to the above printing styles are (possibly) some @@ -43,7 +45,6 @@ The following test decides whether or not we are actually generating code (either C or assembly), or generating interface files. \begin{code} codeStyle :: PprStyle -> Bool - codeStyle PprForC = True codeStyle (PprForAsm _ _) = True codeStyle _ = False @@ -51,11 +52,9 @@ codeStyle _ = False ifaceStyle :: PprStyle -> Bool ifaceStyle PprInterface = True ifaceStyle other = False -\end{code} -\begin{code} --- True means types like (Eq a, Text b) => a -> b --- False means types like _forall_ a b => Eq a -> Text b -> a -> b -showUserishTypes PprForUser = True -showUserishTypes other = False +userStyle :: PprStyle -> Bool +userStyle PprQuote = True +userStyle PprForUser = True +userStyle other = False \end{code} |