comparison src/elab_util.sml @ 1075:0657e5adc938

Convert to task syntax
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Dec 2009 10:19:05 -0500
parents b2311dfb3158
children c316ca3c9ec6
comparison
equal deleted inserted replaced
1074:d89f98f0b4bb 1075:0657e5adc938
852 | DCookie (tn, x, n, c) => 852 | DCookie (tn, x, n, c) =>
853 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc), 853 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc),
854 c), loc))) 854 c), loc)))
855 | DStyle (tn, x, n) => 855 | DStyle (tn, x, n) =>
856 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc))) 856 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc)))
857 | DInitializer _ => ctx, 857 | DTask _ => ctx,
858 mfd ctx d)) ctx ds, 858 mfd ctx d)) ctx ds,
859 fn ds' => (StrConst ds', loc)) 859 fn ds' => (StrConst ds', loc))
860 | StrVar _ => S.return2 strAll 860 | StrVar _ => S.return2 strAll
861 | StrProj (str, x) => 861 | StrProj (str, x) =>
862 S.map2 (mfst ctx str, 862 S.map2 (mfst ctx str,
977 | DCookie (tn, x, n, c) => 977 | DCookie (tn, x, n, c) =>
978 S.map2 (mfc ctx c, 978 S.map2 (mfc ctx c,
979 fn c' => 979 fn c' =>
980 (DCookie (tn, x, n, c'), loc)) 980 (DCookie (tn, x, n, c'), loc))
981 | DStyle _ => S.return2 dAll 981 | DStyle _ => S.return2 dAll
982 | DInitializer e => 982 | DTask (e1, e2) =>
983 S.map2 (mfe ctx e, 983 S.bind2 (mfe ctx e1,
984 fn e' => 984 fn e1' =>
985 (DInitializer e', loc)) 985 S.map2 (mfe ctx e2,
986 fn e2' =>
987 (DTask (e1', e2'), loc)))
986 988
987 and mfvi ctx (x, n, c, e) = 989 and mfvi ctx (x, n, c, e) =
988 S.bind2 (mfc ctx c, 990 S.bind2 (mfc ctx c,
989 fn c' => 991 fn c' =>
990 S.map2 (mfe ctx e, 992 S.map2 (mfe ctx e,
1123 | DSequence (n1, _, n2) => Int.max (n1, n2) 1125 | DSequence (n1, _, n2) => Int.max (n1, n2)
1124 | DView (n1, _, n2, _, _) => Int.max (n1, n2) 1126 | DView (n1, _, n2, _, _) => Int.max (n1, n2)
1125 | DDatabase _ => 0 1127 | DDatabase _ => 0
1126 | DCookie (n1, _, n2, _) => Int.max (n1, n2) 1128 | DCookie (n1, _, n2, _) => Int.max (n1, n2)
1127 | DStyle (n1, _, n2) => Int.max (n1, n2) 1129 | DStyle (n1, _, n2) => Int.max (n1, n2)
1128 | DInitializer _ => 0 1130 | DTask _ => 0
1129 and maxNameStr (str, _) = 1131 and maxNameStr (str, _) =
1130 case str of 1132 case str of
1131 StrConst ds => maxName ds 1133 StrConst ds => maxName ds
1132 | StrVar n => n 1134 | StrVar n => n
1133 | StrProj (str, _) => maxNameStr str 1135 | StrProj (str, _) => maxNameStr str