comparison src/mono_shake.sml @ 1199:c316ca3c9ec6

Pushing policies through
author Adam Chlipala <adamc@hcoop.net>
date Sun, 04 Apr 2010 12:29:34 -0400
parents 72670131dace
children 648e6b087dfb
comparison
equal deleted inserted replaced
1197:6d8e3dcb9713 1199:c316ca3c9ec6
56 List.foldl 56 List.foldl
57 (fn ((DExport (_, _, n, _, _, _), _), (page_cs, page_es)) => (page_cs, IS.add (page_es, n)) 57 (fn ((DExport (_, _, n, _, _, _), _), (page_cs, page_es)) => (page_cs, IS.add (page_es, n))
58 | ((DDatabase {expunge = n1, initialize = n2, ...}, _), (page_cs, page_es)) => 58 | ((DDatabase {expunge = n1, initialize = n2, ...}, _), (page_cs, page_es)) =>
59 (page_cs, IS.addList (page_es, [n1, n2])) 59 (page_cs, IS.addList (page_es, [n1, n2]))
60 | ((DTask (e1, e2), _), st) => usedVars (usedVars st e2) e1 60 | ((DTask (e1, e2), _), st) => usedVars (usedVars st e2) e1
61 | ((DPolicy pol, _), st) =>
62 let
63 val e1 = case pol of
64 PolQuery e1 => e1
65 in
66 usedVars st e1
67 end
61 | (_, st) => st) (IS.empty, IS.empty) file 68 | (_, st) => st) (IS.empty, IS.empty) file
62 69
63 val (cdef, edef) = foldl (fn ((DDatatype dts, _), (cdef, edef)) => 70 val (cdef, edef) = foldl (fn ((DDatatype dts, _), (cdef, edef)) =>
64 (foldl (fn ((_, n, xncs), cdef) => IM.insert (cdef, n, xncs)) cdef dts, edef) 71 (foldl (fn ((_, n, xncs), cdef) => IM.insert (cdef, n, xncs)) cdef dts, edef)
65 | ((DVal (_, n, t, e, _), _), (cdef, edef)) => 72 | ((DVal (_, n, t, e, _), _), (cdef, edef)) =>
72 | ((DView _, _), acc) => acc 79 | ((DView _, _), acc) => acc
73 | ((DDatabase _, _), acc) => acc 80 | ((DDatabase _, _), acc) => acc
74 | ((DJavaScript _, _), acc) => acc 81 | ((DJavaScript _, _), acc) => acc
75 | ((DCookie _, _), acc) => acc 82 | ((DCookie _, _), acc) => acc
76 | ((DStyle _, _), acc) => acc 83 | ((DStyle _, _), acc) => acc
77 | ((DTask _, _), acc) => acc) 84 | ((DTask _, _), acc) => acc
85 | ((DPolicy _, _), acc) => acc)
78 (IM.empty, IM.empty) file 86 (IM.empty, IM.empty) file
79 87
80 fun typ (c, s) = 88 fun typ (c, s) =
81 case c of 89 case c of
82 TDatatype (n, _) => 90 TDatatype (n, _) =>
139 | (DView _, _) => true 147 | (DView _, _) => true
140 | (DDatabase _, _) => true 148 | (DDatabase _, _) => true
141 | (DJavaScript _, _) => true 149 | (DJavaScript _, _) => true
142 | (DCookie _, _) => true 150 | (DCookie _, _) => true
143 | (DStyle _, _) => true 151 | (DStyle _, _) => true
144 | (DTask _, _) => true) file 152 | (DTask _, _) => true
153 | (DPolicy _, _) => true) file
145 end 154 end
146 155
147 end 156 end