diff options
Diffstat (limited to 'src/prim.sml')
-rw-r--r-- | src/prim.sml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/prim.sml b/src/prim.sml index 3e8506a9..8c0e03f7 100644 --- a/src/prim.sml +++ b/src/prim.sml @@ -41,6 +41,24 @@ fun p_t t = | 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 |