tools/pas2c.hs
changeset 7043 7c080e5ac8d0
parent 7042 de20086a6bcc
child 7046 acc6b5159cde
--- a/tools/pas2c.hs	Thu May 10 23:51:05 2012 +0400
+++ b/tools/pas2c.hs	Fri May 11 00:28:06 2012 +0400
@@ -692,7 +692,10 @@
 expr2C (HexNumber s) = return $ text "0x" <> (text . map toLower $ s)
 expr2C (StringLiteral [a]) = do
     modify(\s -> s{lastType = BTChar})
-    return . quotes $ text [a]
+    return . quotes . text $ escape a
+    where
+        escape '\'' = "\\\'"
+        escape a = [a]
 expr2C (StringLiteral s) = addStringConst s
 expr2C (Reference ref) = ref2CF ref
 expr2C (PrefixOp op expr) = do