diff src/mono_print.sml @ 288:4260ad920c36

Converting string to int
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 11:33:13 -0400
parents c0e4ac23522d
children df00701f2323
line wrap: on
line diff
--- a/src/mono_print.sml	Sun Sep 07 10:52:51 2008 -0400
+++ b/src/mono_print.sml	Sun Sep 07 11:33:13 2008 -0400
@@ -62,6 +62,11 @@
               string (#1 (E.lookupDatatype env n)))
          handle E.UnboundNamed _ => string ("UNBOUND_DATATYPE_" ^ Int.toString n))
       | TFfi (m, x) => box [string "FFI(", string m, string ".", string x, string ")"]
+      | TOption t =>
+        (case #1 t of
+             TDatatype _ => p_typ env t
+           | TFfi ("Basis", "string") => p_typ env t
+           | _ => box [p_typ env t, string "*"])
 
 and p_typ env = p_typ' false env
 
@@ -95,8 +100,8 @@
       | PPrim p => Prim.p_t p
       | PCon (_, n, NONE) => p_patCon env n
       | PCon (_, n, SOME p) => parenIf par (box [p_patCon env n,
-                                              space,
-                                              p_pat' true env p])
+                                                 space,
+                                                 p_pat' true env p])
       | PRecord xps =>
         box [string "{",
              p_list_sep (box [string ",", space]) (fn (x, p, _) =>
@@ -106,6 +111,10 @@
                                                            space,
                                                            p_pat env p]) xps,
              string "}"]
+      | PNone _ => string "None"
+      | PSome (_, p) => box [string "Some",
+                             space,
+                             p_pat' true env p]
 
 and p_pat x = p_pat' false x