Mercurial > urweb
comparison src/monoize.sml @ 2221:278e10629ba1
Basic field-resolution invalidation.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sat, 29 Nov 2014 03:37:59 -0500 |
parents | 794017f378de |
children | 9410959d296f |
comparison
equal
deleted
inserted
replaced
2220:794017f378de | 2221:278e10629ba1 |
---|---|
679 end | 679 end |
680 | 680 |
681 val attrifyExp = fooifyExp Attr | 681 val attrifyExp = fooifyExp Attr |
682 val urlifyExp = fooifyExp Url | 682 val urlifyExp = fooifyExp Url |
683 | 683 |
684 val urlifiedUnit = | |
685 let | |
686 val loc = ErrorMsg.dummySpan | |
687 (* Urlifies [ERel 0] to match the [sqlcacheInfo] field of [EQuery]s. *) | |
688 val (urlified, _) = urlifyExp CoreEnv.empty (Fm.empty 0) | |
689 ((L'.ERel 0, loc), (L'.TRecord [], loc)) | |
690 in | |
691 urlified | |
692 end | |
693 | |
684 datatype 'a failable_search = | 694 datatype 'a failable_search = |
685 Found of 'a | 695 Found of 'a |
686 | NotFound | 696 | NotFound |
687 | Error | 697 | Error |
688 | 698 |
1955 val ft = (L'.TFun ((L'.TRecord rt, loc), | 1965 val ft = (L'.TFun ((L'.TRecord rt, loc), |
1956 (L'.TFun (state, | 1966 (L'.TFun (state, |
1957 (L'.TFun (un, state), loc)), | 1967 (L'.TFun (un, state), loc)), |
1958 loc)), loc) | 1968 loc)), loc) |
1959 | 1969 |
1960 val body'' = (L'.EApp ( | 1970 val body' = (L'.EApp ( |
1961 (L'.EApp ( | 1971 (L'.EApp ( |
1962 (L'.EApp ((L'.ERel 4, loc), | 1972 (L'.EApp ((L'.ERel 4, loc), |
1963 (L'.ERel 1, loc)), loc), | 1973 (L'.ERel 1, loc)), loc), |
1964 (L'.ERel 0, loc)), loc), | 1974 (L'.ERel 0, loc)), loc), |
1965 (L'.ERecord [], loc)), loc) | 1975 (L'.ERecord [], loc)), loc) |
1966 val body' = (L'.EQuery {exps = exps, | 1976 val (urlifiedRel0, fm) = urlifyExp env fm ((L'.ERel 0, loc), state) |
1967 tables = tables, | 1977 val body = (L'.EQuery {exps = exps, |
1968 state = state, | 1978 tables = tables, |
1969 query = (L'.ERel 3, loc), | 1979 state = state, |
1970 body = body'', | 1980 query = (L'.ERel 3, loc), |
1971 initial = (L'.ERel 1, loc)}, | 1981 body = body', |
1972 loc) | 1982 initial = (L'.ERel 1, loc), |
1973 val (body, fm) = if Settings.getSqlcache () then | 1983 sqlcacheInfo = urlifiedRel0}, |
1974 let | 1984 loc) |
1975 val (urlifiedRel0, fm) = urlifyExp env fm ((L'.ERel 0, loc), state) | 1985 val body = if Settings.getSqlcache () |
1976 in | 1986 then Sqlcache.instrumentQuery (body, urlifiedRel0) |
1977 (Sqlcache.instrumentQuery (body', urlifiedRel0), fm) | 1987 else body |
1978 end | |
1979 else (body', fm) | |
1980 in | 1988 in |
1981 ((L'.EAbs ("q", s, (L'.TFun (ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc)), loc), | 1989 ((L'.EAbs ("q", s, (L'.TFun (ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc)), loc), |
1982 (L'.EAbs ("f", ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc), | 1990 (L'.EAbs ("f", ft, (L'.TFun (state, (L'.TFun (un, state), loc)), loc), |
1983 (L'.EAbs ("i", state, (L'.TFun (un, state), loc), | 1991 (L'.EAbs ("i", state, (L'.TFun (un, state), loc), |
1984 (L'.EAbs ("_", un, state, | 1992 (L'.EAbs ("_", un, state, |