From 95eb24dfa2e3285c3745677acf481fe19b39ee0a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 7 Sep 2008 14:15:16 -0400 Subject: Parsing UPDATE --- src/urweb.grm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/urweb.grm') diff --git a/src/urweb.grm b/src/urweb.grm index 1d47f36c..c67035de 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -283,6 +283,7 @@ fun native_op (oper, e1, e2, loc) = | texp of exp | fields of con list | sqlexps of exp list + | fsets of (con * exp) list %verbose (* print summary of errors *) @@ -747,6 +748,16 @@ eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright)) (); (EApp (e, (ERecord (ListPair.zip (fields, sqlexps)), loc)), loc) end) + | LPAREN UPDATE texp SET fsets CWHERE sqlexp RPAREN + (let + val loc = s (LPARENleft, RPARENright) + + val e = (EVar (["Basis"], "update"), loc) + val e = (EApp (e, (ERecord fsets, loc)), loc) + val e = (EApp (e, texp), loc) + in + (EApp (e, sqlexp), loc) + end) | UNDER (EWild, s (UNDERleft, UNDERright)) @@ -759,6 +770,9 @@ fields : fident ([fident]) sqlexps: sqlexp ([sqlexp]) | sqlexp COMMA sqlexps (sqlexp :: sqlexps) +fsets : fident EQ sqlexp ([(fident, sqlexp)]) + | fident EQ sqlexp COMMA fsets ((fident, sqlexp) :: fsets) + idents : ident ([ident]) | ident DOT idents (ident :: idents) -- cgit v1.2.3