summaryrefslogtreecommitdiff
path: root/compiler/utils/Pretty.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-05-08 16:13:33 +0100
committerIan Lynagh <igloo@earth.li>2011-05-08 16:13:33 +0100
commitd45197aabb22178066a8ec50d29331786a0c518c (patch)
treefeac564466e2d1182b8d0ee7691580f564cf5b17 /compiler/utils/Pretty.lhs
parentc5f7496604b096277e3ba57fcb6ed85422613c75 (diff)
parentdaead6bf93cc751417461507048db9b1aa8b669a (diff)
downloadhaskell-coloured-core.tar.gz
Merge branch 'coloured-core' of https://github.com/nominolo/ghc into coloured-corecoloured-core
Diffstat (limited to 'compiler/utils/Pretty.lhs')
-rw-r--r--compiler/utils/Pretty.lhs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index a518c0b6f6..f0ca69cbb9 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -163,7 +163,7 @@ module Pretty (
empty, isEmpty, nest,
- char, text, ftext, ptext,
+ char, text, ftext, ptext, zeroWidthText,
int, integer, float, double, rational,
parens, brackets, braces, quotes, doubleQuotes,
semi, comma, colon, space, equals,
@@ -224,6 +224,10 @@ The primitive @Doc@ values
\begin{code}
empty :: Doc
isEmpty :: Doc -> Bool
+-- | Some text, but without any width. Use for non-printing text
+-- such as a HTML or Latex tags
+zeroWidthText :: String -> Doc
+
text :: String -> Doc
char :: Char -> Doc
@@ -560,6 +564,7 @@ ftext s = case iUnbox (lengthFS s) of {sl -> textBeside_ (PStr s) sl Empty}
ptext :: LitString -> Doc
ptext s_= case iUnbox (lengthLS s) of {sl -> textBeside_ (LStr s sl) sl Empty}
where s = {-castPtr-} s_
+zeroWidthText s = textBeside_ (Str s) (_ILIT(0)) Empty
#if defined(__GLASGOW_HASKELL__)
-- RULE that turns (text "abc") into (ptext (A# "abc"#)) to avoid the