comparison 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
comparison
equal deleted inserted replaced
1721:5df85275c0d4 1722:f7d9dc5d57eb
298 | dtype of string * string list * (string * con option) list 298 | dtype of string * string list * (string * con option) list
299 | dtypes of (string * string list * (string * con option) list) list 299 | dtypes of (string * string list * (string * con option) list) list
300 | dcon of string * con option 300 | dcon of string * con option
301 301
302 | pkopt of exp 302 | pkopt of exp
303 | pk of exp
303 | commaOpt of unit 304 | commaOpt of unit
304 305
305 | cst of exp 306 | cst of exp
306 | csts of exp 307 | csts of exp
307 | cstopt of exp 308 | cstopt of exp
705 | pmode pmodes (pmode :: pmodes) 706 | pmode pmodes (pmode :: pmodes)
706 707
707 commaOpt: () 708 commaOpt: ()
708 | COMMA () 709 | COMMA ()
709 710
710 pkopt : (EVar (["Basis"], "no_primary_key", Infer), dummy) 711 pk : LBRACE LBRACE eexp RBRACE RBRACE (eexp)
711 | PRIMARY KEY tnames (let 712 | tnames (let
712 val loc = s (PRIMARYleft, tnamesright) 713 val loc = s (tnamesleft, tnamesright)
713 714
714 val e = (EVar (["Basis"], "primary_key", TypesOnly), loc) 715 val e = (EVar (["Basis"], "primary_key", TypesOnly), loc)
715 val e = (ECApp (e, #1 (#1 tnames)), loc) 716 val e = (ECApp (e, #1 (#1 tnames)), loc)
716 val e = (ECApp (e, (CRecord (#2 tnames), loc)), loc) 717 val e = (ECApp (e, (CRecord (#2 tnames), loc)), loc)
717 val e = (EDisjointApp e, loc) 718 val e = (EDisjointApp e, loc)
722 (#1 tnames :: #2 tnames) 723 (#1 tnames :: #2 tnames)
723 val witness = (ERecord witness, loc) 724 val witness = (ERecord witness, loc)
724 in 725 in
725 (EApp (e, witness), loc) 726 (EApp (e, witness), loc)
726 end) 727 end)
728
729 pkopt : (EVar (["Basis"], "no_primary_key", Infer), dummy)
730 | PRIMARY KEY pk (pk)
727 731
728 valis : vali ([vali]) 732 valis : vali ([vali])
729 | vali AND valis (vali :: valis) 733 | vali AND valis (vali :: valis)
730 734
731 sgn : sgntm (sgntm) 735 sgn : sgntm (sgntm)