From 5ee58ab372255fea4b1180b7af3c7fc5485ccb1c Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 9 Sep 2010 12:42:25 -0400 Subject: Support empty datatypes, which can now be generated via 'variant []' --- src/cjr_print.sml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/cjr_print.sml') diff --git a/src/cjr_print.sml b/src/cjr_print.sml index 5282ddc2..ae347eb2 100644 --- a/src/cjr_print.sml +++ b/src/cjr_print.sml @@ -2011,8 +2011,11 @@ fun p_decl env (dAll as (d, _) : decl) = 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 [] -- cgit v1.2.3