summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-07 14:19:05 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-07 14:19:05 -0400
commita8bc278b2a46d93bec4bf88cd7e56f12a253f061 (patch)
tree48c44ad97ea69969e20c00c13a9ae26ec6cf0ad2
parent95eb24dfa2e3285c3745677acf481fe19b39ee0a (diff)
Parsing DELETE
-rw-r--r--src/urweb.grm9
-rw-r--r--tests/delete.ur2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index c67035de..61e8d179 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -758,6 +758,15 @@ eterm : LPAREN eexp RPAREN (#1 eexp, s (LPARENleft, RPARENright))
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))
diff --git a/tests/delete.ur b/tests/delete.ur
index 45df15ab..e2109f61 100644
--- a/tests/delete.ur
+++ b/tests/delete.ur
@@ -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>