diff options
author | Adam Chlipala <adamc@hcoop.net> | 2010-05-27 15:10:52 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2010-05-27 15:10:52 -0400 |
commit | 0091af30d2d24940404e49b30a6d0e2a0e4ba4e7 (patch) | |
tree | c31b9042cedaabf6f1c471ed2595caefbed49543 /src/urweb.grm | |
parent | f2bb854da19b535ab4590eaccfb1696bcffb42e8 (diff) |
Consider view declarations while shaking
Diffstat (limited to 'src/urweb.grm')
-rw-r--r-- | src/urweb.grm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/urweb.grm b/src/urweb.grm index 3df9554f..dfc22112 100644 --- a/src/urweb.grm +++ b/src/urweb.grm @@ -184,6 +184,26 @@ fun patType loc (p : pat) = PAnnot (_, t) => t | _ => (CWild (KType, loc), loc) +fun tnamesOf (e, _) = + case e of + EApp (e1, e2) => tnamesOf e1 @ tnamesOf e2 + | ECApp (e, c as (CName _, _)) => + let + fun isFt (e, _) = + case e of + EVar (["Basis"], "sql_from_table", _) => true + | EVar ([], "sql_from_table", _) => true + | ECApp (e, _) => isFt e + | EApp (e, _) => isFt e + | EDisjointApp e => isFt e + | _ => false + in + (if isFt e then [c] else []) @ tnamesOf e + end + | ECApp (e, _) => tnamesOf e + | EDisjointApp e => tnamesOf e + | _ => [] + %% %header (functor UrwebLrValsFn(structure Token : TOKEN)) @@ -1540,7 +1560,7 @@ tables : fitem (fitem) end) fitem : table' ([#1 table'], #2 table') - | LBRACE LBRACE eexp RBRACE RBRACE ([], eexp) + | LBRACE LBRACE eexp RBRACE RBRACE (tnamesOf eexp, eexp) | fitem JOIN fitem ON sqlexp (let val loc = s (fitem1left, sqlexpright) |