X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FPretty.lhs;h=f611d7a13cb754b34e29eb4b29c2e05b50eb7fe7;hb=317fc69d18eda68fd65f5ba634feafbe4a3923da;hp=31d65f26cbeae7d894712bad34e8f9b53e93d81d;hpb=046ee54f048ddd721dcee41916d6a6f68db3b15b;p=ghc-hetmet.git diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs index 31d65f2..f611d7a 100644 --- a/compiler/utils/Pretty.lhs +++ b/compiler/utils/Pretty.lhs @@ -225,6 +225,7 @@ allow you to use either GHC or Hugs. To get GHC, just set the CPP variable #define GR ># #define GREQ >=# #define LT <# +#define LTEQ <=# #define DIV `quotInt#` @@ -994,11 +995,11 @@ cant_fail = error "easy_display: NoDoc" indent n | n GREQ ILIT(8) = '\t' : indent (n MINUS ILIT(8)) | otherwise = spaces n -multi_ch ILIT(0) ch = "" -multi_ch n ch = ch : multi_ch (n MINUS ILIT(1)) ch +multi_ch n ch | n LTEQ ILIT(0) = "" + | otherwise = ch : multi_ch (n MINUS ILIT(1)) ch -spaces ILIT(0) = "" -spaces n = ' ' : spaces (n MINUS ILIT(1)) +spaces n | n LTEQ ILIT(0) = "" + | otherwise = ' ' : spaces (n MINUS ILIT(1)) \end{code} \begin{code} @@ -1021,11 +1022,7 @@ printDoc mode hdl doc -- some versions of hPutBuf will barf if the length is zero hPutLitString handle a# 0# = return () hPutLitString handle a# l# -#if __GLASGOW_HASKELL__ < 411 - = hPutBuf handle (A# a#) (I# l#) -#else = hPutBuf handle (Ptr a#) (I# l#) -#endif -- Printing output in LeftMode is performance critical: it's used when -- dumping C and assembly output, so we allow ourselves a few dirty @@ -1065,9 +1062,4 @@ layLeft b (TextBeside s sl p) = put b s >> layLeft b p put b (Str s) = bPutStr b s put b (PStr s) = bPutFS b s put b (LStr s l) = bPutLitString b s l - -#if __GLASGOW_HASKELL__ < 503 -hPutBuf = hPutBufFull -#endif - \end{code}