git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #330 from garyb/unicode-in-strings

Fix other escape sequences

commit29348e8c9e118a7b7992f0fab18f16a2077c59c1 authorPhil Freeman <paf31@cantab.net> dateThu 27 Mar 2014, 15:02 (13 years ago) parent642d0f25fa93a3
1 file changed+7−1
src/Language/PureScript/Pretty/JS.hs+7−1
src/Language/PureScript/Pretty/JS.hs+7−1
@@ -142,8 +142,14 @@ literals = mkPattern' match
142142 match _ = mzero
143143
144144 encodeChar :: Char -> String
145− encodeChar '\r' = "\\r"
145+ encodeChar '\b' = "\\b"
146+ encodeChar '\t' = "\\t"
146147 encodeChar '\n' = "\\n"
148+ encodeChar '\v' = "\\v"
149+ encodeChar '\f' = "\\f"
150+ encodeChar '\r' = "\\r"
151+ encodeChar '"' = "\\\""
152+ encodeChar '\\' = "\\\\"
147153 encodeChar c | fromEnum c > 0xFFF = "\\u" ++ showHex (fromEnum c) ""
148154 encodeChar c | fromEnum c > 0xFF = "\\u0" ++ showHex (fromEnum c) ""
149155 encodeChar c = [c]