[project @ 2000-04-20 15:18:58 by simonmar]
authorsimonmar <unknown>
Thu, 20 Apr 2000 15:18:58 +0000 (15:18 +0000)
committersimonmar <unknown>
Thu, 20 Apr 2000 15:18:58 +0000 (15:18 +0000)
add pprStringInCStyle :: String -> SDoc
(we already have a FAST_STRING version but not one for plain Strings).

ghc/compiler/absCSyn/CStrings.lhs

index 0b543d4..e231993 100644 (file)
@@ -6,7 +6,7 @@ module CStrings(
 
        cSEP, pp_cSEP,
 
-       stringToC, charToC, pprFSInCStyle,
+       stringToC, charToC, pprFSInCStyle, pprStringInCStyle,
        charToEasyHaskell
   ) where
 
@@ -38,6 +38,9 @@ pp_cSEP = char '_'
 pprFSInCStyle :: FAST_STRING -> SDoc
 pprFSInCStyle fs = doubleQuotes (text (stringToC (_UNPK_ fs)))
 
+pprStringInCStyle :: String -> SDoc
+pprStringInCStyle s = doubleQuotes (text (stringToC s))
+
 stringToC   :: String -> String
 -- Convert a string to the form required by C in a C literal string
 -- Tthe hassle is what to do w/ strings like "ESC 0"...