comparison src/monoize.sml @ 311:9ad92047a499

Rename 'lw' prefixes to 'uw'
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 15:40:42 -0400
parents ea62b15da922
children a07f476d9b61
comparison
equal deleted inserted replaced
310:0aee86b8a6d6 311:9ad92047a499
613 ((L'.EAbs ("tab", s, (L'.TFun (rt, s), loc), 613 ((L'.EAbs ("tab", s, (L'.TFun (rt, s), loc),
614 (L'.EAbs ("fs", rt, s, 614 (L'.EAbs ("fs", rt, s,
615 strcat loc [sc "INSERT INTO ", 615 strcat loc [sc "INSERT INTO ",
616 (L'.ERel 1, loc), 616 (L'.ERel 1, loc),
617 sc " (", 617 sc " (",
618 strcatComma loc (map (fn (x, _) => sc ("lw_" ^ x)) fields), 618 strcatComma loc (map (fn (x, _) => sc ("uw_" ^ x)) fields),
619 sc ") VALUES (", 619 sc ") VALUES (",
620 strcatComma loc (map (fn (x, _) => 620 strcatComma loc (map (fn (x, _) =>
621 (L'.EField ((L'.ERel 0, loc), 621 (L'.EField ((L'.ERel 0, loc),
622 x), loc)) fields), 622 x), loc)) fields),
623 sc ")"]), loc)), loc), 623 sc ")"]), loc)), loc),
639 (L'.EAbs ("e", s, s, 639 (L'.EAbs ("e", s, s,
640 strcat loc [sc "UPDATE ", 640 strcat loc [sc "UPDATE ",
641 (L'.ERel 1, loc), 641 (L'.ERel 1, loc),
642 sc " AS T SET ", 642 sc " AS T SET ",
643 strcatComma loc (map (fn (x, _) => 643 strcatComma loc (map (fn (x, _) =>
644 strcat loc [sc ("lw_" ^ x 644 strcat loc [sc ("uw_" ^ x
645 ^ " = "), 645 ^ " = "),
646 (L'.EField 646 (L'.EField
647 ((L'.ERel 2, 647 ((L'.ERel 2,
648 loc), 648 loc),
649 x), loc)]) 649 x), loc)])
799 sc (" AS _" ^ x) 799 sc (" AS _" ^ x)
800 ]) sexps 800 ]) sexps
801 @ map (fn (x, xts) => 801 @ map (fn (x, xts) =>
802 strcatComma loc 802 strcatComma loc
803 (map (fn (x', _) => 803 (map (fn (x', _) =>
804 sc (x ^ ".lw_" ^ x')) 804 sc (x ^ ".uw_" ^ x'))
805 xts)) stables), 805 xts)) stables),
806 sc " FROM ", 806 sc " FROM ",
807 strcatComma loc (map (fn (x, _) => strcat loc [(L'.EField (gf "From", x), loc), 807 strcatComma loc (map (fn (x, _) => strcat loc [(L'.EField (gf "From", x), loc),
808 sc (" AS " ^ x)]) tables), 808 sc (" AS " ^ x)]) tables),
809 (L'.ECase (gf "Where", 809 (L'.ECase (gf "Where",
826 strcat loc [ 826 strcat loc [
827 sc " GROUP BY ", 827 sc " GROUP BY ",
828 strcatComma loc (map (fn (x, xts) => 828 strcatComma loc (map (fn (x, xts) =>
829 strcatComma loc 829 strcatComma loc
830 (map (fn (x', _) => 830 (map (fn (x', _) =>
831 sc (x ^ ".lw_" ^ x')) 831 sc (x ^ ".uw_" ^ x'))
832 xts)) grouped) 832 xts)) grouped)
833 ], 833 ],
834 834
835 (L'.ECase (gf "Having", 835 (L'.ECase (gf "Having",
836 [((L'.PPrim (Prim.String "TRUE"), loc), 836 [((L'.PPrim (Prim.String "TRUE"), loc),
1047 _), _), 1047 _), _),
1048 _), _), 1048 _), _),
1049 _), _), 1049 _), _),
1050 _), _), 1050 _), _),
1051 (L.CName tab, _)), _), 1051 (L.CName tab, _)), _),
1052 (L.CName field, _)) => ((L'.EPrim (Prim.String (tab ^ ".lw_" ^ field)), loc), fm) 1052 (L.CName field, _)) => ((L'.EPrim (Prim.String (tab ^ ".uw_" ^ field)), loc), fm)
1053 1053
1054 | L.ECApp ( 1054 | L.ECApp (
1055 (L.ECApp ( 1055 (L.ECApp (
1056 (L.ECApp ( 1056 (L.ECApp (
1057 (L.ECApp ( 1057 (L.ECApp (
1602 end 1602 end
1603 | L.DTable (x, n, (L.CRecord (_, xts), _), s) => 1603 | L.DTable (x, n, (L.CRecord (_, xts), _), s) =>
1604 let 1604 let
1605 val t = (L.CFfi ("Basis", "string"), loc) 1605 val t = (L.CFfi ("Basis", "string"), loc)
1606 val t' = (L'.TFfi ("Basis", "string"), loc) 1606 val t' = (L'.TFfi ("Basis", "string"), loc)
1607 val s = "lw_" ^ s 1607 val s = "uw_" ^ s
1608 val e = (L'.EPrim (Prim.String s), loc) 1608 val e = (L'.EPrim (Prim.String s), loc)
1609 1609
1610 val xts = map (fn (x, t) => (monoName env x, monoType env t)) xts 1610 val xts = map (fn (x, t) => (monoName env x, monoType env t)) xts
1611 in 1611 in
1612 SOME (Env.pushENamed env x n t NONE s, 1612 SOME (Env.pushENamed env x n t NONE s,