Commit 120bd329 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix Trac #7146, by displaying a "\n" in a multi-line string

parent 7e01e076
......@@ -390,12 +390,12 @@ showMultiLineString :: String -> [String]
-- * break the string into multiple lines
-- * wrap the entire thing in double quotes
-- Example: @showMultiLineString "hello\ngoodbye\nblah"@
-- returns @["\"hello\\", "\\goodbye\\", "\\blah\""]@
-- returns @["\"hello\\n\\", "\\goodbye\n\\", "\\blah\""]@
showMultiLineString str
= go '\"' str
where
go ch s = case break (== '\n') s of
(l, _:s'@(_:_)) -> (ch : showLitString l "\\") : go '\\' s'
(l, _:s'@(_:_)) -> (ch : showLitString l "\\n\\") : go '\\' s'
(l, _) -> [ch : showLitString l "\""]
isDec :: Char -> Bool
......
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