comparison src/elab_util.sml @ 718:f152f215a02c

style declarations
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Apr 2009 10:08:11 -0400
parents 7292bcb7c02d
children acb8537f58f0
comparison
equal deleted inserted replaced
717:e28637743279 718:f152f215a02c
794 | DClass (x, n, k, _) => 794 | DClass (x, n, k, _) =>
795 bind (ctx, NamedC (x, n, (KArrow (k, (KType, loc)), loc))) 795 bind (ctx, NamedC (x, n, (KArrow (k, (KType, loc)), loc)))
796 | DDatabase _ => ctx 796 | DDatabase _ => ctx
797 | DCookie (tn, x, n, c) => 797 | DCookie (tn, x, n, c) =>
798 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc), 798 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "cookie"), loc),
799 c), loc)))
800 | DStyle (tn, x, n, c) =>
801 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "css_class"), loc),
799 c), loc))), 802 c), loc))),
800 mfd ctx d)) ctx ds, 803 mfd ctx d)) ctx ds,
801 fn ds' => (StrConst ds', loc)) 804 fn ds' => (StrConst ds', loc))
802 | StrVar _ => S.return2 strAll 805 | StrVar _ => S.return2 strAll
803 | StrProj (str, x) => 806 | StrProj (str, x) =>
909 912
910 | DCookie (tn, x, n, c) => 913 | DCookie (tn, x, n, c) =>
911 S.map2 (mfc ctx c, 914 S.map2 (mfc ctx c,
912 fn c' => 915 fn c' =>
913 (DCookie (tn, x, n, c'), loc)) 916 (DCookie (tn, x, n, c'), loc))
917 | DStyle (tn, x, n, c) =>
918 S.map2 (mfc ctx c,
919 fn c' =>
920 (DStyle (tn, x, n, c'), loc))
914 921
915 and mfvi ctx (x, n, c, e) = 922 and mfvi ctx (x, n, c, e) =
916 S.bind2 (mfc ctx c, 923 S.bind2 (mfc ctx c,
917 fn c' => 924 fn c' =>
918 S.map2 (mfe ctx e, 925 S.map2 (mfe ctx e,
1048 | DExport _ => 0 1055 | DExport _ => 0
1049 | DTable (n1, _, n2, _, _, _, _, _) => Int.max (n1, n2) 1056 | DTable (n1, _, n2, _, _, _, _, _) => Int.max (n1, n2)
1050 | DSequence (n1, _, n2) => Int.max (n1, n2) 1057 | DSequence (n1, _, n2) => Int.max (n1, n2)
1051 | DDatabase _ => 0 1058 | DDatabase _ => 0
1052 | DCookie (n1, _, n2, _) => Int.max (n1, n2) 1059 | DCookie (n1, _, n2, _) => Int.max (n1, n2)
1060 | DStyle (n1, _, n2, _) => Int.max (n1, n2)
1053 1061
1054 and maxNameStr (str, _) = 1062 and maxNameStr (str, _) =
1055 case str of 1063 case str of
1056 StrConst ds => maxName ds 1064 StrConst ds => maxName ds
1057 | StrVar n => n 1065 | StrVar n => n