changeset 1256:d7d5b167f267

Avoid reimplementing conversion to C strings
author Adam Chlipala <adamc@hcoop.net>
date Sat, 15 May 2010 12:52:34 -0400
parents 068f55543d03
children fd1a49b51db5
files src/prim.sml
diffstat 1 files changed, 1 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/prim.sml	Thu May 06 16:05:14 2010 -0400
+++ b/src/prim.sml	Sat May 15 12:52:34 2010 -0400
@@ -74,20 +74,7 @@
     else
         str ch ^ pad (n-1, ch, s)
 
-val gccify = String.translate (fn ch =>
-                                  case ch of
-                                      #"\"" => "\\\""
-                                    | #"\\" => "\\\\"
-                                    | #"'" => "\\'"
-                                    | #"\n" => "\\n"
-                                    | #"\r" => "\\r"
-                                    | #"\t" => "\\t"
-                                    | #" " => " "
-                                    | _ =>
-                                      if Char.isPrint ch then
-                                          str ch
-                                      else
-                                          "\\" ^ pad (3, #"0", Int.fmt StringCvt.OCT (ord ch)))
+val gccify = String.toCString
 
 fun p_t_GCC t =
     case t of