diff options
author | 2009-10-06 15:39:27 -0400 | |
---|---|---|
committer | 2009-10-06 15:39:27 -0400 | |
commit | 5765efc372a628ede62d8b27c799708f530a3456 (patch) | |
tree | fa80b1891097e60c758ecb12fd8c441f37a03c85 /src/urweb.grm | |
parent | 37f1efc23e011927873cfc5871ac7686eac5a745 (diff) |
SELECT DISTINCT; eta expansion during Cjrization
Diffstat (limited to 'src/urweb.grm')
-rw-r--r-- | src/urweb.grm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/urweb.grm b/src/urweb.grm index 111b1854..edd93d96 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -208,7 +208,7 @@ fun patType loc (p : pat) = | NOTAGS of string | BEGIN_TAG of string | END_TAG of string - | SELECT | FROM | AS | CWHERE | GROUP | ORDER | BY | HAVING + | SELECT | DISTINCT | FROM | AS | CWHERE | GROUP | ORDER | BY | HAVING | UNION | INTERSECT | EXCEPT | LIMIT | OFFSET | ALL | TRUE | FALSE | CAND | OR | NOT @@ -314,6 +314,7 @@ fun patType loc (p : pat) = | query of exp | query1 of exp + | dopt of exp | tables of con list * exp | fitem of con list * exp | tname of con @@ -625,7 +626,7 @@ pmodes : ([]) commaOpt: () | COMMA () -pkopt : (EVar (["Basis"], "no_primary_key", Infer), ErrorMsg.dummySpan) +pkopt : (EVar (["Basis"], "no_primary_key", Infer), dummy) | PRIMARY KEY tnames (let val loc = s (PRIMARYleft, tnamesright) @@ -1410,8 +1411,12 @@ query : query1 obopt lopt ofopt (let in (EApp ((EVar (["Basis"], "sql_query", Infer), loc), re), loc) end) - -query1 : SELECT select FROM tables wopt gopt hopt + +dopt : (EVar (["Basis"], "False", Infer), dummy) + | DISTINCT (EVar (["Basis"], "True", Infer), + s (DISTINCTleft, DISTINCTright)) + +query1 : SELECT dopt select FROM tables wopt gopt hopt (let val loc = s (SELECTleft, tablesright) @@ -1460,7 +1465,9 @@ query1 : SELECT select FROM tables wopt gopt hopt end val e = (EVar (["Basis"], "sql_query1", Infer), loc) - val re = (ERecord [((CName "From", loc), + val re = (ERecord [((CName "Distinct", loc), + dopt), + ((CName "From", loc), #2 tables), ((CName "Where", loc), wopt), |