comparison src/urweb.grm @ 1265:e8d68fd8ed4b

Consider view declarations while shaking
author Adam Chlipala <adamc@hcoop.net>
date Thu, 27 May 2010 15:10:52 -0400
parents c316ca3c9ec6
children d008c4c43a0a
comparison
equal deleted inserted replaced
1264:79b2bcac6200 1265:e8d68fd8ed4b
182 fun patType loc (p : pat) = 182 fun patType loc (p : pat) =
183 case #1 p of 183 case #1 p of
184 PAnnot (_, t) => t 184 PAnnot (_, t) => t
185 | _ => (CWild (KType, loc), loc) 185 | _ => (CWild (KType, loc), loc)
186 186
187 fun tnamesOf (e, _) =
188 case e of
189 EApp (e1, e2) => tnamesOf e1 @ tnamesOf e2
190 | ECApp (e, c as (CName _, _)) =>
191 let
192 fun isFt (e, _) =
193 case e of
194 EVar (["Basis"], "sql_from_table", _) => true
195 | EVar ([], "sql_from_table", _) => true
196 | ECApp (e, _) => isFt e
197 | EApp (e, _) => isFt e
198 | EDisjointApp e => isFt e
199 | _ => false
200 in
201 (if isFt e then [c] else []) @ tnamesOf e
202 end
203 | ECApp (e, _) => tnamesOf e
204 | EDisjointApp e => tnamesOf e
205 | _ => []
206
187 %% 207 %%
188 %header (functor UrwebLrValsFn(structure Token : TOKEN)) 208 %header (functor UrwebLrValsFn(structure Token : TOKEN))
189 209
190 %term 210 %term
191 EOF 211 EOF
1538 (#1 fitem @ #1 tables, 1558 (#1 fitem @ #1 tables,
1539 (EApp (e, #2 tables), loc)) 1559 (EApp (e, #2 tables), loc))
1540 end) 1560 end)
1541 1561
1542 fitem : table' ([#1 table'], #2 table') 1562 fitem : table' ([#1 table'], #2 table')
1543 | LBRACE LBRACE eexp RBRACE RBRACE ([], eexp) 1563 | LBRACE LBRACE eexp RBRACE RBRACE (tnamesOf eexp, eexp)
1544 | fitem JOIN fitem ON sqlexp (let 1564 | fitem JOIN fitem ON sqlexp (let
1545 val loc = s (fitem1left, sqlexpright) 1565 val loc = s (fitem1left, sqlexpright)
1546 1566
1547 val e = (EVar (["Basis"], "sql_inner_join", Infer), loc) 1567 val e = (EVar (["Basis"], "sql_inner_join", Infer), loc)
1548 val e = (EApp (e, #2 fitem1), loc) 1568 val e = (EApp (e, #2 fitem1), loc)