summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:36:15 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:36:15 -0400
commit1d2a33433b530bdfe2c4cf7c7f0e6bc7190d87c5 (patch)
tree438e4fa54e6e8a7a8450cc051c374262c0d60250 /src
parentdcd7b7d304959739432b3e2497491c36f14f2b4f (diff)
Monoize HAVING
Diffstat (limited to 'src')
-rw-r--r--src/mono_opt.sml4
-rw-r--r--src/monoize.sml10
2 files changed, 12 insertions, 2 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml
index 1430dfe2..3946684a 100644
--- a/src/mono_opt.sml
+++ b/src/mono_opt.sml
@@ -84,7 +84,9 @@ val urlifyString = String.translate (fn #" " => "+"
val sqlifyInt = attrifyInt
val sqlifyFloat = attrifyFloat
-fun sqlifyString s = "E'" ^ String.toString s ^ "'"
+fun sqlifyString s = "E'" ^ String.translate (fn #"'" => "\\'"
+ | ch => str ch)
+ (String.toString s) ^ "'"
fun exp e =
case e of
diff --git a/src/monoize.sml b/src/monoize.sml
index 9846d8ba..35d474e6 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -637,7 +637,15 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
(map (fn (x', _) =>
sc (x ^ "." ^ x'))
xts)) grouped)
- ]
+ ],
+
+ (L'.ECase (gf "Having",
+ [((L'.PPrim (Prim.String "TRUE"), loc),
+ sc ""),
+ ((L'.PWild, loc),
+ strcat loc [sc " HAVING ", gf "Having"])],
+ {disc = s,
+ result = s}), loc)
]), loc),
fm)
| _ => poly ()