diff src/prim.sml @ 276:ed4af33681d8

Switch base types to 64-bit versions
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Sep 2008 14:59:27 -0400
parents c0ea24dcb86f
children e89076c41c39
line wrap: on
line diff
--- a/src/prim.sml	Tue Sep 02 14:40:57 2008 -0400
+++ b/src/prim.sml	Tue Sep 02 14:59:27 2008 -0400
@@ -41,6 +41,24 @@
       | Float n => string (Real64.toString n)
       | String s => box [string "\"", string (String.toString s), string "\""]
 
+fun int2s n =
+    if Int64.compare (n, Int64.fromInt 0) = LESS then
+        "-" ^ Int64.toString (Int64.~ n) ^ "LL"
+    else
+        Int64.toString n ^ "LL"
+
+fun float2s n =
+    if Real64.compare (n, Real64.fromInt 0) = LESS then
+        "-" ^ Real64.toString (Real64.~ n) ^ "L"
+    else
+        Real64.toString n ^ "L"
+
+fun p_t_GCC t =
+    case t of
+        Int n => string (int2s n)
+      | Float n => string (float2s n)
+      | String s => box [string "\"", string (String.toString s), string "\""]
+
 fun equal x =
     case x of
         (Int n1, Int n2) => n1 = n2