diff src/core_util.sml @ 247:5c50b17f5e4a

Corify tables
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 09:00:28 -0400
parents 766b5475477f
children 98f551ddd54b
line wrap: on
line diff
--- a/src/core_util.sml	Sun Aug 31 08:46:22 2008 -0400
+++ b/src/core_util.sml	Sun Aug 31 09:00:28 2008 -0400
@@ -621,6 +621,10 @@
                             (DValRec vis', loc))
                 end
               | DExport _ => S.return2 dAll
+              | DTable (x, n, c, s) =>
+                S.map2 (mfc ctx c,
+                        fn c' =>
+                           (DTable (x, n, c', s), loc))
 
         and mfvi ctx (x, n, t, e, s) =
             S.bind2 (mfc ctx t,
@@ -703,6 +707,12 @@
                                         foldl (fn ((x, n, t, e, s), ctx) => bind (ctx, NamedE (x, n, t, NONE, s)))
                                         ctx vis
                                       | DExport _ => ctx
+                                      | DTable (x, n, c, s) =>
+                                        let
+                                            val t = (CApp ((CFfi ("Basis", "table"), #2 d'), c), #2 d')
+                                        in
+                                            bind (ctx, NamedE (x, n, t, NONE, s))
+                                        end
                             in
                                 S.map2 (mff ctx' ds',
                                      fn ds' =>
@@ -750,7 +760,8 @@
                           | DDatatype (_, n, _, _) => Int.max (n, count)
                           | DVal (_, n, _, _, _) => Int.max (n, count)
                           | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
-                          | DExport _ => count) 0
+                          | DExport _ => count
+                          | DTable (_, n, _, _) => Int.max (n, count)) 0
               
 end