summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-02-17 18:05:08 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-02-17 18:05:08 -0500
commit63ee618314e2ae8e3c890e95b0eada42270804c0 (patch)
tree8a81bc7a00e8f53fdc3afea10aa7757654acc1ed /src
parente83fb349397ec2ab8b92cb648576140a1fea4fab (diff)
Syntactic sugar for grouping by variable numbers of columns
Diffstat (limited to 'src')
-rw-r--r--src/urweb.grm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index 40cfd2de..c6f2587f 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -51,6 +51,7 @@ datatype select =
datatype group_item =
GField of con * con
+ | GFields of con * con
fun eqTnames ((c1, _), (c2, _)) =
case (c1, c2) of
@@ -107,13 +108,14 @@ fun amend_group loc (gi, tabs) =
let
val (tx, c) = case gi of
GField (tx, fx) => (tx, (CRecord ([(fx, (CWild (KType, loc), loc))]), loc))
+ | GFields (tx, fxs) => (tx, fxs)
val (tabs, found) = ListUtil.foldlMap (fn ((tx', c'), found) =>
if eqTnames (tx, tx') then
((tx', (CConcat (c, c'), loc)), true)
else
((tx', c'), found))
- false tabs
+ false tabs
in
if found then
()
@@ -1871,6 +1873,7 @@ wopt : (sql_inject (EVar (["Basis"], "True", In
| CWHERE sqlexp (sqlexp)
groupi : tident DOT fident (GField (tident, fident))
+ | tident DOT LBRACE LBRACE cexp RBRACE RBRACE (GFields (tident, cexp))
groupis: groupi ([groupi])
| groupi COMMA groupis (groupi :: groupis)