X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Futils%2FPretty.lhs;h=5219484569c7b817e16f270b7d46764cd4977f88;hb=cee4bfd3a0c0852946966333bbff47654e9e35b2;hp=bebb6b2df885fb479b5eb5bff8d95fa7782049de;hpb=82dc0d197b39b6462d1a19e4c556f7acdf376ee9;p=ghc-hetmet.git diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs index bebb6b2..5219484 100644 --- a/compiler/utils/Pretty.lhs +++ b/compiler/utils/Pretty.lhs @@ -175,8 +175,6 @@ module Pretty ( render, fullRender, printDoc, showDocWith ) where -#include "HsVersions.h" - import BufWrite import FastString import FastTypes @@ -974,7 +972,7 @@ display mode page_width ribbon_width txt end doc lay2 _ _ = panic "display/lay2: Unhandled case" -- optimise long indentations using LitString chunks of 8 spaces - indent n r | n >=# _ILIT(8) = LStr SLIT(" ") (_ILIT(8)) `txt` + indent n r | n >=# _ILIT(8) = LStr (sLit " ") (_ILIT(8)) `txt` indent (n -# _ILIT(8)) r | otherwise = Str (spaces n) `txt` r in @@ -998,6 +996,10 @@ spaces n | n <=# _ILIT(0) = "" pprCols :: Int pprCols = 120 -- could make configurable +-- NB. printDoc prints FastStrings in UTF-8: hPutFS below does no decoding. +-- This is what we usually want, because the IO library has no encoding +-- functionality, and we're assuming UTF-8 source code so we might as well +-- assume UTF-8 output too. printDoc :: Mode -> Handle -> Doc -> IO () printDoc LeftMode hdl doc = do { printLeftRender hdl doc; hFlush hdl }