diff src/urweb.grm @ 705:e6706a1df013

Track uniqueness sets in table types
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 14:11:32 -0400
parents 70cbdcf5989b
children 1fb318c17546
line wrap: on
line diff
--- a/src/urweb.grm	Tue Apr 07 12:24:31 2009 -0400
+++ b/src/urweb.grm	Tue Apr 07 14:11:32 2009 -0400
@@ -294,9 +294,9 @@
  | query1 of exp
  | tables of (con * exp) list
  | tname of con
- | tnameW of (con * con)
- | tnames of con
- | tnames' of (con * con) list
+ | tnameW of con * con
+ | tnames of (con * con) * (con * con) list
+ | tnames' of (con * con) * (con * con) list
  | table of con * exp
  | tident of con
  | fident of con
@@ -493,7 +493,9 @@
                                              val loc = s (UNIQUEleft, tnamesright)
                                                        
                                              val e = (EVar (["Basis"], "unique", Infer), loc)
-                                             val e = (ECApp (e, tnames), loc)
+                                             val e = (ECApp (e, #1 (#1 tnames)), loc)
+                                             val e = (ECApp (e, (CRecord (#2 tnames), loc)), loc)
+                                             val e = (EDisjointApp e, loc)
                                          in
                                              (EDisjointApp e, loc)
                                          end)
@@ -505,12 +507,11 @@
                                              (tname, (CWild (KType, loc), loc))
                                          end)
 
-tnames : tnameW                         (CRecord [tnameW], s (tnameWleft, tnameWright))
-       | LPAREN tnames' RPAREN          (CRecord tnames', s (LPARENleft, RPARENright))
-       | LBRACE LBRACE cexp RBRACE RBRACE (cexp)
+tnames : tnameW                         (tnameW, [])
+       | LPAREN tnames' RPAREN          (tnames')
 
-tnames': tnameW                         ([tnameW])
-       | tnameW COMMA tnames'           (tnameW :: tnames')
+tnames': tnameW                         (tnameW, [])
+       | tnameW COMMA tnames'           (#1 tnames', tnameW :: #2 tnames')
 
 valis  : vali                           ([vali])
        | vali AND valis                 (vali :: valis)