diff src/core_util.sml @ 707:d8217b4cb617

PRIMARY KEY
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 16:14:31 -0400
parents e6706a1df013
children f152f215a02c
line wrap: on
line diff
--- a/src/core_util.sml	Tue Apr 07 15:04:07 2009 -0400
+++ b/src/core_util.sml	Tue Apr 07 16:14:31 2009 -0400
@@ -933,14 +933,18 @@
                             (DValRec vis', loc))
                 end
               | DExport _ => S.return2 dAll
-              | DTable (x, n, c, s, e, cc) =>
+              | DTable (x, n, c, s, pe, pc, ce, cc) =>
                 S.bind2 (mfc ctx c,
                      fn c' =>
-                        S.bind2 (mfe ctx e,
-                                fn e' =>
-                                   S.map2 (mfc ctx cc,
-                                           fn cc' =>
-                                              (DTable (x, n, c', s, e', cc'), loc))))
+                        S.bind2 (mfe ctx pe,
+                                fn pe' =>
+                                   S.bind2 (mfc ctx pc,
+                                           fn pc' =>
+                                              S.bind2 (mfe ctx ce,
+                                                    fn ce' =>
+                                                       S.map2 (mfc ctx cc,
+                                                            fn cc' =>
+                                                               (DTable (x, n, c', s, pe', pc', ce', cc'), loc))))))
               | DSequence _ => S.return2 dAll
               | DDatabase _ => S.return2 dAll
               | DCookie (x, n, c, s) =>
@@ -1062,11 +1066,11 @@
                                         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, _, cc) =>
+                                      | DTable (x, n, c, s, _, pc, _, cc) =>
                                         let
                                             val loc = #2 d'
                                             val ct = (CFfi ("Basis", "sql_table"), loc)
-                                            val ct = (CApp (ct, c), loc)
+                                            val ct = (CApp (ct, (CConcat (pc, cc), loc)), loc)
                                             val ct = (CApp (ct, cc), loc)
                                         in
                                             bind (ctx, NamedE (x, n, ct, NONE, s))
@@ -1141,7 +1145,7 @@
                           | DVal (_, n, _, _, _) => Int.max (n, count)
                           | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
                           | DExport _ => count
-                          | DTable (_, n, _, _, _, _) => Int.max (n, count)
+                          | DTable (_, n, _, _, _, _, _, _) => Int.max (n, count)
                           | DSequence (_, n, _) => Int.max (n, count)
                           | DDatabase _ => count
                           | DCookie (_, n, _, _) => Int.max (n, count)) 0