From: simonmar Date: Thu, 20 Apr 2000 15:18:58 +0000 (+0000) Subject: [project @ 2000-04-20 15:18:58 by simonmar] X-Git-Tag: Approximately_9120_patches~4641 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=952a3281857c932ced9a7e6cbb08a0b5094ccc85 [project @ 2000-04-20 15:18:58 by simonmar] add pprStringInCStyle :: String -> SDoc (we already have a FAST_STRING version but not one for plain Strings). --- diff --git a/ghc/compiler/absCSyn/CStrings.lhs b/ghc/compiler/absCSyn/CStrings.lhs index 0b543d4..e231993 100644 --- a/ghc/compiler/absCSyn/CStrings.lhs +++ b/ghc/compiler/absCSyn/CStrings.lhs @@ -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"...