changeset 304:148ba06f3e67

Parsing DELETE
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 14:19:05 -0400
parents 7204fab29486
children 55eedecb6c50
files src/urweb.grm tests/delete.ur
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/urweb.grm	Sun Sep 07 14:15:16 2008 -0400
+++ b/src/urweb.grm	Sun Sep 07 14:19:05 2008 -0400
@@ -758,6 +758,15 @@
                                          in
                                              (EApp (e, sqlexp), loc)
                                          end)
+       | LPAREN DELETE FROM texp CWHERE sqlexp RPAREN
+                                        (let
+                                             val loc = s (LPARENleft, RPARENright)
+
+                                             val e = (EVar (["Basis"], "delete"), loc)
+                                             val e = (EApp (e, texp), loc)
+                                         in
+                                             (EApp (e, sqlexp), loc)
+                                         end)
 
        | UNDER                          (EWild, s (UNDERleft, UNDERright))
 
--- a/tests/delete.ur	Sun Sep 07 14:15:16 2008 -0400
+++ b/tests/delete.ur	Sun Sep 07 14:19:05 2008 -0400
@@ -1,5 +1,5 @@
 table t1 : {A : int, B : string, C : float, D : bool}
 
 fun main () : transaction page =
-        () <- dml (delete t1 (WHERE T.A = 5));
+        () <- dml (DELETE FROM t1 WHERE T.A = 5);
         return <html><body>Deleted.</body></html>