diff options
author | Adam Chlipala <adamc@hcoop.net> | 2010-05-15 12:52:34 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2010-05-15 12:52:34 -0400 |
commit | 986eed1b84de490b264d8eac48a9aa405ea8eec0 (patch) | |
tree | 7107e57ffd6d9076a4de952bccc6af680c1ee9ba /src | |
parent | 3206bc0e84b0336353f56592b9cd3a9a4a4b6a70 (diff) |
Avoid reimplementing conversion to C strings
Diffstat (limited to 'src')
-rw-r--r-- | src/prim.sml | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/prim.sml b/src/prim.sml index e094e0b1..849518f4 100644 --- a/src/prim.sml +++ b/src/prim.sml @@ -74,20 +74,7 @@ fun pad (n, ch, s) = 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 |