diff src/cjrize.sml @ 165:e52dfb1e6b19

Datatypes through cjrize, modulo decoding
author Adam Chlipala <adamc@hcoop.net>
date Tue, 29 Jul 2008 13:50:53 -0400
parents 6847741e1f5f
children a991431b77eb
line wrap: on
line diff
--- a/src/cjrize.sml	Tue Jul 29 13:32:07 2008 -0400
+++ b/src/cjrize.sml	Tue Jul 29 13:50:53 2008 -0400
@@ -160,7 +160,20 @@
 
 fun cifyDecl ((d, loc), sm) =
     case d of
-        L.DDatatype _ => raise Fail "Cjrize DDatatype"
+        L.DDatatype (x, n, xncs) =>
+        let
+            val (xncs, sm) = ListUtil.foldlMap (fn ((x, n, to), sm) =>
+                                                   case to of
+                                                       NONE => ((x, n, NONE), sm)
+                                                     | SOME t =>
+                                                       let
+                                                           val (t, sm) = cifyTyp (t, sm)
+                                                       in
+                                                           ((x, n, SOME t), sm)
+                                                       end) sm xncs
+        in
+            (SOME (L'.DDatatype (x, n, xncs), loc), NONE, sm)
+        end
 
       | L.DVal (x, n, t, e, _) =>
         let