comparison src/elab_util.sml @ 205:cb8f69556975

Elaborating 'SELECT *' queries
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 Aug 2008 15:24:59 -0400
parents dd82457fda82
children cc68da3801bc
comparison
equal deleted inserted replaced
204:241c9a0e3397 205:cb8f69556975
434 S.bind2 (con ctx c1, 434 S.bind2 (con ctx c1,
435 fn c1' => 435 fn c1' =>
436 S.map2 (con ctx c2, 436 S.map2 (con ctx c2,
437 fn c2' => 437 fn c2' =>
438 (SgiConstraint (c1', c2'), loc))) 438 (SgiConstraint (c1', c2'), loc)))
439 | SgiTable (x, n, c) => 439 | SgiTable (tn, x, n, c) =>
440 S.map2 (con ctx c, 440 S.map2 (con ctx c,
441 fn c' => 441 fn c' =>
442 (SgiTable (x, n, c'), loc)) 442 (SgiTable (tn, x, n, c'), loc))
443 443
444 and sg ctx s acc = 444 and sg ctx s acc =
445 S.bindP (sg' ctx s acc, sgn ctx) 445 S.bindP (sg' ctx s acc, sgn ctx)
446 446
447 and sg' ctx (sAll as (s, loc)) = 447 and sg' ctx (sAll as (s, loc)) =
598 bind (ctx, Str (x, sgn)) 598 bind (ctx, Str (x, sgn))
599 | DFfiStr (x, _, sgn) => 599 | DFfiStr (x, _, sgn) =>
600 bind (ctx, Str (x, sgn)) 600 bind (ctx, Str (x, sgn))
601 | DConstraint _ => ctx 601 | DConstraint _ => ctx
602 | DExport _ => ctx 602 | DExport _ => ctx
603 | DTable _ => ctx, 603 | DTable (tn, x, n, c) =>
604 bind (ctx, NamedE (x, (CApp ((CModProj (n, [], "table"), loc),
605 c), loc))),
604 mfd ctx d)) ctx ds, 606 mfd ctx d)) ctx ds,
605 fn ds' => (StrConst ds', loc)) 607 fn ds' => (StrConst ds', loc))
606 | StrVar _ => S.return2 strAll 608 | StrVar _ => S.return2 strAll
607 | StrProj (str, x) => 609 | StrProj (str, x) =>
608 S.map2 (mfst ctx str, 610 S.map2 (mfst ctx str,
686 fn sgn' => 688 fn sgn' =>
687 S.map2 (mfst ctx str, 689 S.map2 (mfst ctx str,
688 fn str' => 690 fn str' =>
689 (DExport (en, sgn', str'), loc))) 691 (DExport (en, sgn', str'), loc)))
690 692
691 | DTable (x, n, c) => 693 | DTable (tn, x, n, c) =>
692 S.map2 (mfc ctx c, 694 S.map2 (mfc ctx c,
693 fn c' => 695 fn c' =>
694 (DTable (x, n, c'), loc)) 696 (DTable (tn, x, n, c'), loc))
695 697
696 and mfvi ctx (x, n, c, e) = 698 and mfvi ctx (x, n, c, e) =
697 S.bind2 (mfc ctx c, 699 S.bind2 (mfc ctx c,
698 fn c' => 700 fn c' =>
699 S.map2 (mfe ctx e, 701 S.map2 (mfe ctx e,