Mercurial > urweb
comparison src/elab_util.sml @ 2010:403f0cc65b9c
New lessSafeFfi
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 02 May 2014 19:19:09 -0400 |
parents | 1aa9629e3a4c |
children | 22117edf8fd3 |
comparison
equal
deleted
inserted
replaced
2009:799be3911ce3 | 2010:403f0cc65b9c |
---|---|
925 c), loc))) | 925 c), loc))) |
926 | DStyle (tn, x, n) => | 926 | DStyle (tn, x, n) => |
927 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc))) | 927 bind (ctx, NamedE (x, (CModProj (n, [], "css_class"), loc))) |
928 | DTask _ => ctx | 928 | DTask _ => ctx |
929 | DPolicy _ => ctx | 929 | DPolicy _ => ctx |
930 | DOnError _ => ctx, | 930 | DOnError _ => ctx |
931 | DFfi (x, _, _, t) => bind (ctx, NamedE (x, t)), | |
931 mfd ctx d)) ctx ds, | 932 mfd ctx d)) ctx ds, |
932 fn ds' => (StrConst ds', loc)) | 933 fn ds' => (StrConst ds', loc)) |
933 | StrVar _ => S.return2 strAll | 934 | StrVar _ => S.return2 strAll |
934 | StrProj (str, x) => | 935 | StrProj (str, x) => |
935 S.map2 (mfst ctx str, | 936 S.map2 (mfst ctx str, |
1054 | DPolicy e1 => | 1055 | DPolicy e1 => |
1055 S.map2 (mfe ctx e1, | 1056 S.map2 (mfe ctx e1, |
1056 fn e1' => | 1057 fn e1' => |
1057 (DPolicy e1', loc)) | 1058 (DPolicy e1', loc)) |
1058 | DOnError _ => S.return2 dAll | 1059 | DOnError _ => S.return2 dAll |
1060 | DFfi (x, n, modes, t) => | |
1061 S.map2 (mfc ctx t, | |
1062 fn t' => | |
1063 (DFfi (x, n, modes, t'), loc)) | |
1059 | 1064 |
1060 and mfvi ctx (x, n, c, e) = | 1065 and mfvi ctx (x, n, c, e) = |
1061 S.bind2 (mfc ctx c, | 1066 S.bind2 (mfc ctx c, |
1062 fn c' => | 1067 fn c' => |
1063 S.map2 (mfe ctx e, | 1068 S.map2 (mfe ctx e, |
1232 | DCookie (n1, _, n2, _) => Int.max (n1, n2) | 1237 | DCookie (n1, _, n2, _) => Int.max (n1, n2) |
1233 | DStyle (n1, _, n2) => Int.max (n1, n2) | 1238 | DStyle (n1, _, n2) => Int.max (n1, n2) |
1234 | DTask _ => 0 | 1239 | DTask _ => 0 |
1235 | DPolicy _ => 0 | 1240 | DPolicy _ => 0 |
1236 | DOnError _ => 0 | 1241 | DOnError _ => 0 |
1242 | DFfi (_, n, _, _) => n | |
1237 and maxNameStr (str, _) = | 1243 and maxNameStr (str, _) = |
1238 case str of | 1244 case str of |
1239 StrConst ds => maxName ds | 1245 StrConst ds => maxName ds |
1240 | StrVar n => n | 1246 | StrVar n => n |
1241 | StrProj (str, _) => maxNameStr str | 1247 | StrProj (str, _) => maxNameStr str |