comparison src/elab_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 19e5791923d0
children eec65c11d3e2
comparison
equal deleted inserted replaced
270:b9b02613c0c2 271:42dfb0d61cf0
636 | DExport _ => ctx 636 | DExport _ => ctx
637 | DTable (tn, x, n, c) => 637 | DTable (tn, x, n, c) =>
638 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "table"), loc), 638 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "table"), loc),
639 c), loc))) 639 c), loc)))
640 | DClass (x, _, _) => 640 | DClass (x, _, _) =>
641 bind (ctx, NamedC (x, (KArrow ((KType, loc), (KType, loc)), loc))), 641 bind (ctx, NamedC (x, (KArrow ((KType, loc), (KType, loc)), loc)))
642 | DDatabase _ => ctx,
642 mfd ctx d)) ctx ds, 643 mfd ctx d)) ctx ds,
643 fn ds' => (StrConst ds', loc)) 644 fn ds' => (StrConst ds', loc))
644 | StrVar _ => S.return2 strAll 645 | StrVar _ => S.return2 strAll
645 | StrProj (str, x) => 646 | StrProj (str, x) =>
646 S.map2 (mfst ctx str, 647 S.map2 (mfst ctx str,
734 | DClass (x, n, c) => 735 | DClass (x, n, c) =>
735 S.map2 (mfc ctx c, 736 S.map2 (mfc ctx c,
736 fn c' => 737 fn c' =>
737 (DClass (x, n, c'), loc)) 738 (DClass (x, n, c'), loc))
738 739
740 | DDatabase _ => S.return2 dAll
741
739 and mfvi ctx (x, n, c, e) = 742 and mfvi ctx (x, n, c, e) =
740 S.bind2 (mfc ctx c, 743 S.bind2 (mfc ctx c,
741 fn c' => 744 fn c' =>
742 S.map2 (mfe ctx e, 745 S.map2 (mfe ctx e,
743 fn e' => 746 fn e' =>