Commit 952a3281 authored by simonmar's avatar simonmar

[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).
parent 1dcb0eec
......@@ -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"...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment