comparison src/elab_util.sml @ 1294:b4480a56cab7

Server-side 'onError'
author Adam Chlipala <adam@chlipala.net>
date Tue, 07 Sep 2010 08:28:07 -0400
parents 56bd4a4f6e66
children d008c4c43a0a
comparison
equal deleted inserted replaced
1293:acabf3935060 1294:b4480a56cab7
881 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc), 881 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc),
882 c), loc))) 882 c), loc)))
883 | DStyle (tn, x, n) => 883 | DStyle (tn, x, n) =>
884 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc))) 884 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc)))
885 | DTask _ => ctx 885 | DTask _ => ctx
886 | DPolicy _ => ctx, 886 | DPolicy _ => ctx
887 | DOnError _ => ctx,
887 mfd ctx d)) ctx ds, 888 mfd ctx d)) ctx ds,
888 fn ds' => (StrConst ds', loc)) 889 fn ds' => (StrConst ds', loc))
889 | StrVar _ => S.return2 strAll 890 | StrVar _ => S.return2 strAll
890 | StrProj (str, x) => 891 | StrProj (str, x) =>
891 S.map2 (mfst ctx str, 892 S.map2 (mfst ctx str,
1016 (DTask (e1', e2'), loc))) 1017 (DTask (e1', e2'), loc)))
1017 | DPolicy e1 => 1018 | DPolicy e1 =>
1018 S.map2 (mfe ctx e1, 1019 S.map2 (mfe ctx e1,
1019 fn e1' => 1020 fn e1' =>
1020 (DPolicy e1', loc)) 1021 (DPolicy e1', loc))
1022 | DOnError _ => S.return2 dAll
1021 1023
1022 and mfvi ctx (x, n, c, e) = 1024 and mfvi ctx (x, n, c, e) =
1023 S.bind2 (mfc ctx c, 1025 S.bind2 (mfc ctx c,
1024 fn c' => 1026 fn c' =>
1025 S.map2 (mfe ctx e, 1027 S.map2 (mfe ctx e,
1160 | DDatabase _ => 0 1162 | DDatabase _ => 0
1161 | DCookie (n1, _, n2, _) => Int.max (n1, n2) 1163 | DCookie (n1, _, n2, _) => Int.max (n1, n2)
1162 | DStyle (n1, _, n2) => Int.max (n1, n2) 1164 | DStyle (n1, _, n2) => Int.max (n1, n2)
1163 | DTask _ => 0 1165 | DTask _ => 0
1164 | DPolicy _ => 0 1166 | DPolicy _ => 0
1167 | DOnError _ => 0
1165 and maxNameStr (str, _) = 1168 and maxNameStr (str, _) =
1166 case str of 1169 case str of
1167 StrConst ds => maxName ds 1170 StrConst ds => maxName ds
1168 | StrVar n => n 1171 | StrVar n => n
1169 | StrProj (str, _) => maxNameStr str 1172 | StrProj (str, _) => maxNameStr str