diff src/cjr_print.sml @ 1298:e665527fce1c

Support empty datatypes, which can now be generated via 'variant []'
author Adam Chlipala <adam@chlipala.net>
date Thu, 09 Sep 2010 12:42:25 -0400
parents 929981850d9d
children d2ad997ca157
line wrap: on
line diff
--- a/src/cjr_print.sml	Tue Sep 07 09:47:06 2010 -0400
+++ b/src/cjr_print.sml	Thu Sep 09 12:42:25 2010 -0400
@@ -2011,8 +2011,11 @@
                      space,
                      string "{",
                      space,
-                     p_list_sep (box [string ",", space]) (fn (x, n, _) =>
-                                                              string ("__uwc_" ^ ident x ^ "_" ^ Int.toString n)) xncs,
+                     case xncs of
+                         [] => string ("__uwec_" ^ ident x ^ "_" ^ Int.toString n)
+                       | _ =>
+                         p_list_sep (box [string ",", space]) (fn (x, n, _) =>
+                                                                  string ("__uwc_" ^ ident x ^ "_" ^ Int.toString n)) xncs,
                      space,
                      string "};"]
               | p_one (Option, _, _, _) = box []