comparison src/monoize.sml @ 886:5805fa825fe8

Most of demo working with SQLite
author Adam Chlipala <adamc@hcoop.net>
date Fri, 17 Jul 2009 17:03:37 -0400
parents dae141d911d9
children 034eeb099564
comparison
equal deleted inserted replaced
885:e6070333d8a8 886:5805fa825fe8
1604 fun sc s = (L'.EPrim (Prim.String s), loc) 1604 fun sc s = (L'.EPrim (Prim.String s), loc)
1605 in 1605 in
1606 ((L'.EAbs ("fs", rt, (L'.TFun (s, (L'.TFun (s, s), loc)), loc), 1606 ((L'.EAbs ("fs", rt, (L'.TFun (s, (L'.TFun (s, s), loc)), loc),
1607 (L'.EAbs ("tab", s, (L'.TFun (s, s), loc), 1607 (L'.EAbs ("tab", s, (L'.TFun (s, s), loc),
1608 (L'.EAbs ("e", s, s, 1608 (L'.EAbs ("e", s, s,
1609 strcat [sc "UPDATE ", 1609 if #supportsUpdateAs (Settings.currentDbms ()) then
1610 (L'.ERel 1, loc), 1610 strcat [sc "UPDATE ",
1611 sc " AS T SET ", 1611 (L'.ERel 1, loc),
1612 strcatComma (map (fn (x, _) => 1612 sc " AS T SET ",
1613 strcat [sc ("uw_" ^ x 1613 strcatComma (map (fn (x, _) =>
1614 ^ " = "), 1614 strcat [sc ("uw_" ^ x
1615 (L'.EField 1615 ^ " = "),
1616 ((L'.ERel 2, 1616 (L'.EField
1617 loc), 1617 ((L'.ERel 2,
1618 x), loc)]) 1618 loc),
1619 changed), 1619 x), loc)])
1620 sc " WHERE ", 1620 changed),
1621 (L'.ERel 0, loc)]), loc)), loc)), loc), 1621 sc " WHERE ",
1622 (L'.ERel 0, loc)]
1623 else
1624 strcat [sc "UPDATE ",
1625 (L'.ERel 1, loc),
1626 sc " SET ",
1627 strcatComma (map (fn (x, _) =>
1628 strcat [sc ("uw_" ^ x
1629 ^ " = "),
1630 (L'.EField
1631 ((L'.ERel 2,
1632 loc),
1633 x), loc)])
1634 changed),
1635 sc " WHERE ",
1636 (L'.EFfiApp ("Basis", "unAs", [(L'.ERel 0, loc)]), loc)]),
1637 loc)), loc)), loc),
1622 fm) 1638 fm)
1623 end 1639 end
1624 | _ => poly ()) 1640 | _ => poly ())
1625 1641
1626 | L.ECApp ((L.ECApp ((L.EFfi ("Basis", "delete"), _), _), _), _) => 1642 | L.ECApp ((L.ECApp ((L.EFfi ("Basis", "delete"), _), _), _), _) =>