2 % (c) The AQUA Project, Glasgow University, 1996
4 \section[PprStyle]{Pretty-printing `styles'}
7 #include "HsVersions.h"
11 codeStyle, ifaceStyle, userStyle
14 CHK_Ubiq() -- debugging consistency check
19 = PprForUser -- Pretty-print in a way that will
20 -- make sense to the ordinary user;
21 -- must be very close to Haskell
23 | PprQuote -- Like PprForUser, but also quote the whole thing
25 | PprDebug -- Standard debugging output
26 | PprShowAll -- Debugging output which leaves
27 -- nothing to the imagination
29 | PprInterface -- Interface generation
31 | PprForC -- must print out C-acceptable names
33 | PprForAsm -- must print out assembler-acceptable names
34 Bool -- prefix CLabel with underscore?
35 (String -> String) -- format AsmTempLabel
39 Orthogonal to the above printing styles are (possibly) some
40 command-line flags that affect printing (often carried with the
41 style). The most likely ones are variations on how much type info is
44 The following test decides whether or not we are actually generating
45 code (either C or assembly), or generating interface files.
47 codeStyle :: PprStyle -> Bool
48 codeStyle PprForC = True
49 codeStyle (PprForAsm _ _) = True
52 ifaceStyle :: PprStyle -> Bool
53 ifaceStyle PprInterface = True
54 ifaceStyle other = False
56 userStyle :: PprStyle -> Bool
57 userStyle PprQuote = True
58 userStyle PprForUser = True
59 userStyle other = False