diff src/urweb.grm @ 1722:f7d9dc5d57eb

Antiquote for PRIMARY KEY
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Apr 2012 15:47:02 -0400
parents 9dd8d47c3e58
children 4a03aa3251cb
line wrap: on
line diff
--- a/src/urweb.grm	Sat Apr 21 15:19:00 2012 -0400
+++ b/src/urweb.grm	Sat Apr 21 15:47:02 2012 -0400
@@ -300,6 +300,7 @@
  | dcon of string * con option
 
  | pkopt of exp
+ | pk of exp
  | commaOpt of unit
 
  | cst of exp
@@ -707,9 +708,9 @@
 commaOpt:                               ()
         | COMMA                         ()
 
-pkopt  :                                (EVar (["Basis"], "no_primary_key", Infer), dummy)
-       | PRIMARY KEY tnames             (let
-                                             val loc = s (PRIMARYleft, tnamesright)
+pk     : LBRACE LBRACE eexp RBRACE RBRACE (eexp)
+       | tnames                         (let
+                                             val loc = s (tnamesleft, tnamesright)
 
                                              val e = (EVar (["Basis"], "primary_key", TypesOnly), loc)
                                              val e = (ECApp (e, #1 (#1 tnames)), loc)
@@ -725,6 +726,9 @@
                                              (EApp (e, witness), loc)
                                          end)
 
+pkopt  :                                (EVar (["Basis"], "no_primary_key", Infer), dummy)
+       | PRIMARY KEY pk                 (pk)
+
 valis  : vali                           ([vali])
        | vali AND valis                 (vali :: valis)