summaryrefslogtreecommitdiff
path: root/src/urweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-28 11:05:28 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-28 11:05:28 -0400
commit008b594412606bbf78fff76daff219a102ce2daa (patch)
tree3fd436b0d0eff217ce878cae73dd070a73f12835 /src/urweb.grm
parent04dd6b3727c7786a4824897e78b0b2982ecd6f5b (diff)
LEFT JOIN
Diffstat (limited to 'src/urweb.grm')
-rw-r--r--src/urweb.grm14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 723ed8b1..c1f0b1ca 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -213,7 +213,7 @@ datatype attr = Class of exp | Normal of con * exp
| CURRENT_TIMESTAMP
| NE | LT | LE | GT | GE
| CCONSTRAINT | UNIQUE | CHECK | PRIMARY | FOREIGN | KEY | ON | NO | ACTION | RESTRICT | CASCADE | REFERENCES
- | JOIN | INNER | CROSS
+ | JOIN | INNER | CROSS | LEFT
%nonterm
file of decl list
@@ -361,7 +361,7 @@ datatype attr = Class of exp | Normal of con * exp
%nonassoc DCOLON TCOLON
%left UNION INTERSECT EXCEPT
%right COMMA
-%right JOIN INNER CROSS
+%right JOIN INNER CROSS LEFT
%right OR
%right CAND
%nonassoc EQ NE LT LE GT GE IS
@@ -1468,6 +1468,16 @@ fitem : table' ([#1 table'], #2 table')
(#1 fitem1 @ #1 fitem2,
(EApp (e, tru), loc))
end)
+ | fitem LEFT JOIN fitem ON sqlexp (let
+ val loc = s (fitem1left, sqlexpright)
+
+ val e = (EVar (["Basis"], "sql_left_join", Infer), loc)
+ val e = (EApp (e, #2 fitem1), loc)
+ val e = (EApp (e, #2 fitem2), loc)
+ in
+ (#1 fitem1 @ #1 fitem2,
+ (EApp (e, sqlexp), loc))
+ end)
tname : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLright))
| LBRACE cexp RBRACE (cexp)