comparison src/core_util.sml @ 271:42dfb0d61cf0

'database' declaration threaded through compiler
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Sep 2008 10:51:41 -0400
parents 98f551ddd54b
children e976b187d73a
comparison
equal deleted inserted replaced
270:b9b02613c0c2 271:42dfb0d61cf0
629 | DExport _ => S.return2 dAll 629 | DExport _ => S.return2 dAll
630 | DTable (x, n, c, s) => 630 | DTable (x, n, c, s) =>
631 S.map2 (mfc ctx c, 631 S.map2 (mfc ctx c,
632 fn c' => 632 fn c' =>
633 (DTable (x, n, c', s), loc)) 633 (DTable (x, n, c', s), loc))
634 | DDatabase _ => S.return2 dAll
634 635
635 and mfvi ctx (x, n, t, e, s) = 636 and mfvi ctx (x, n, t, e, s) =
636 S.bind2 (mfc ctx t, 637 S.bind2 (mfc ctx t,
637 fn t' => 638 fn t' =>
638 S.map2 (mfe ctx e, 639 S.map2 (mfe ctx e,
717 let 718 let
718 val t = (CApp ((CFfi ("Basis", "table"), #2 d'), c), #2 d') 719 val t = (CApp ((CFfi ("Basis", "table"), #2 d'), c), #2 d')
719 in 720 in
720 bind (ctx, NamedE (x, n, t, NONE, s)) 721 bind (ctx, NamedE (x, n, t, NONE, s))
721 end 722 end
723 | DDatabase _ => ctx
722 in 724 in
723 S.map2 (mff ctx' ds', 725 S.map2 (mff ctx' ds',
724 fn ds' => 726 fn ds' =>
725 d' :: ds') 727 d' :: ds')
726 end) 728 end)
765 DCon (_, n, _, _) => Int.max (n, count) 767 DCon (_, n, _, _) => Int.max (n, count)
766 | DDatatype (_, n, _, _) => Int.max (n, count) 768 | DDatatype (_, n, _, _) => Int.max (n, count)
767 | DVal (_, n, _, _, _) => Int.max (n, count) 769 | DVal (_, n, _, _, _) => Int.max (n, count)
768 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis 770 | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis
769 | DExport _ => count 771 | DExport _ => count
770 | DTable (_, n, _, _) => Int.max (n, count)) 0 772 | DTable (_, n, _, _) => Int.max (n, count)
773 | DDatabase _ => count) 0
771 774
772 end 775 end
773 776
774 end 777 end