comparison src/elab_util.sml @ 704:70cbdcf5989b

UNIQUE constraints
author Adam Chlipala <adamc@hcoop.net>
date Tue, 07 Apr 2009 12:24:31 -0400
parents 12b73f3c108e
children e6706a1df013
comparison
equal deleted inserted replaced
703:a5d8b470d7ca 704:70cbdcf5989b
764 bind (ctx, Str (x, sgn)) 764 bind (ctx, Str (x, sgn))
765 | DFfiStr (x, _, sgn) => 765 | DFfiStr (x, _, sgn) =>
766 bind (ctx, Str (x, sgn)) 766 bind (ctx, Str (x, sgn))
767 | DConstraint _ => ctx 767 | DConstraint _ => ctx
768 | DExport _ => ctx 768 | DExport _ => ctx
769 | DTable (tn, x, n, c) => 769 | DTable (tn, x, n, c, _) =>
770 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "sql_table"), loc), 770 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "sql_table"), loc),
771 c), loc))) 771 c), loc)))
772 | DSequence (tn, x, n) => 772 | DSequence (tn, x, n) =>
773 bind (ctx, NamedE (x, (CModProj (n, [], "sql_sequence"), loc))) 773 bind (ctx, NamedE (x, (CModProj (n, [], "sql_sequence"), loc)))
774 | DClass (x, n, k, _) => 774 | DClass (x, n, k, _) =>
862 fn sgn' => 862 fn sgn' =>
863 S.map2 (mfst ctx str, 863 S.map2 (mfst ctx str,
864 fn str' => 864 fn str' =>
865 (DExport (en, sgn', str'), loc))) 865 (DExport (en, sgn', str'), loc)))
866 866
867 | DTable (tn, x, n, c) => 867 | DTable (tn, x, n, c, e) =>
868 S.map2 (mfc ctx c, 868 S.bind2 (mfc ctx c,
869 fn c' => 869 fn c' =>
870 (DTable (tn, x, n, c'), loc)) 870 S.map2 (mfe ctx e,
871 fn e' =>
872 (DTable (tn, x, n, c', e'), loc)))
871 | DSequence _ => S.return2 dAll 873 | DSequence _ => S.return2 dAll
872 874
873 | DClass (x, n, k, c) => 875 | DClass (x, n, k, c) =>
874 S.bind2 (mfk ctx k, 876 S.bind2 (mfk ctx k,
875 fn k' => 877 fn k' =>
1016 | DSgn (_, n, sgn) => Int.max (n, maxNameSgn sgn) 1018 | DSgn (_, n, sgn) => Int.max (n, maxNameSgn sgn)
1017 | DFfiStr (_, n, sgn) => Int.max (n, maxNameSgn sgn) 1019 | DFfiStr (_, n, sgn) => Int.max (n, maxNameSgn sgn)
1018 | DConstraint _ => 0 1020 | DConstraint _ => 0
1019 | DClass (_, n, _, _) => n 1021 | DClass (_, n, _, _) => n
1020 | DExport _ => 0 1022 | DExport _ => 0
1021 | DTable (n1, _, n2, _) => Int.max (n1, n2) 1023 | DTable (n1, _, n2, _, _) => Int.max (n1, n2)
1022 | DSequence (n1, _, n2) => Int.max (n1, n2) 1024 | DSequence (n1, _, n2) => Int.max (n1, n2)
1023 | DDatabase _ => 0 1025 | DDatabase _ => 0
1024 | DCookie (n1, _, n2, _) => Int.max (n1, n2) 1026 | DCookie (n1, _, n2, _) => Int.max (n1, n2)
1025 1027
1026 and maxNameStr (str, _) = 1028 and maxNameStr (str, _) =