diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-09-14 19:03:55 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-09-14 19:03:55 -0400 |
commit | fe35c44cd34ceb2a2f02b27f56bf1607557bb89a (patch) | |
tree | 947cb1a65fa285087e64c14a5c08a9804bc83a7a /src/urweb.grm | |
parent | 7b9035e69d65f463da21a82d5f35deebaf1986ac (diff) |
Crud update form
Diffstat (limited to 'src/urweb.grm')
-rw-r--r-- | src/urweb.grm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/urweb.grm b/src/urweb.grm index d3e7fe5b..8219c35b 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -43,6 +43,7 @@ fun entable t = datatype select_item = Field of con * con | Exp of con * exp + | Fields of con * con datatype select = Star @@ -77,6 +78,22 @@ fun amend_select loc (si, (tabs, exps)) = (tabs, exps) end + | Fields (tx, fs) => + let + val (tabs, found) = ListUtil.foldlMap (fn ((tx', c'), found) => + if eqTnames (tx, tx') then + ((tx', (CConcat (fs, c'), loc)), true) + else + ((tx', c'), found)) + false tabs + in + if found then + () + else + ErrorMsg.errorAt loc "Select of field from unbound table"; + + (tabs, exps) + end | Exp (c, e) => (tabs, (c, e) :: exps) fun amend_group loc (gi, tabs) = @@ -1041,6 +1058,7 @@ fident : CSYMBOL (CName CSYMBOL, s (CSYMBOLleft, CSYMBOLr seli : tident DOT fident (Field (tident, fident)) | sqlexp AS fident (Exp (fident, sqlexp)) + | tident DOT LBRACE LBRACE cexp RBRACE RBRACE (Fields (tident, cexp)) selis : seli ([seli]) | seli COMMA selis (seli :: selis) |