comparison src/core_util.sml @ 1073:b2311dfb3158

Initializers and setval
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 14:20:41 -0500
parents dfe34fad749d
children 0657e5adc938
comparison
equal deleted inserted replaced
1072:9001966ae1c8 1073:b2311dfb3158
969 | DCookie (x, n, c, s) => 969 | DCookie (x, n, c, s) =>
970 S.map2 (mfc ctx c, 970 S.map2 (mfc ctx c,
971 fn c' => 971 fn c' =>
972 (DCookie (x, n, c', s), loc)) 972 (DCookie (x, n, c', s), loc))
973 | DStyle _ => S.return2 dAll 973 | DStyle _ => S.return2 dAll
974 | DInitializer e =>
975 S.map2 (mfe ctx e,
976 fn e' =>
977 (DInitializer e', loc))
974 978
975 and mfvi ctx (x, n, t, e, s) = 979 and mfvi ctx (x, n, t, e, s) =
976 S.bind2 (mfc ctx t, 980 S.bind2 (mfc ctx t,
977 fn t' => 981 fn t' =>
978 S.map2 (mfe ctx e, 982 S.map2 (mfe ctx e,
1123 let 1127 let
1124 val t = (CFfi ("Basis", "css_class"), #2 d') 1128 val t = (CFfi ("Basis", "css_class"), #2 d')
1125 in 1129 in
1126 bind (ctx, NamedE (x, n, t, NONE, s)) 1130 bind (ctx, NamedE (x, n, t, NONE, s))
1127 end 1131 end
1132 | DInitializer _ => ctx
1128 in 1133 in
1129 S.map2 (mff ctx' ds', 1134 S.map2 (mff ctx' ds',
1130 fn ds' => 1135 fn ds' =>
1131 d' :: ds') 1136 d' :: ds')
1132 end) 1137 end)
1185 | DTable (_, n, _, _, _, _, _, _) => Int.max (n, count) 1190 | DTable (_, n, _, _, _, _, _, _) => Int.max (n, count)
1186 | DSequence (_, n, _) => Int.max (n, count) 1191 | DSequence (_, n, _) => Int.max (n, count)
1187 | DView (_, n, _, _, _) => Int.max (n, count) 1192 | DView (_, n, _, _, _) => Int.max (n, count)
1188 | DDatabase _ => count 1193 | DDatabase _ => count
1189 | DCookie (_, n, _, _) => Int.max (n, count) 1194 | DCookie (_, n, _, _) => Int.max (n, count)
1190 | DStyle (_, n, _) => Int.max (n, count)) 0 1195 | DStyle (_, n, _) => Int.max (n, count)
1196 | DInitializer _ => count) 0
1191 1197
1192 end 1198 end
1193 1199
1194 end 1200 end