summaryrefslogtreecommitdiff
path: root/src/mono_opt.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/mono_opt.sml')
-rw-r--r--src/mono_opt.sml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mono_opt.sml b/src/mono_opt.sml
index 373f5b27..64eef7e3 100644
--- a/src/mono_opt.sml
+++ b/src/mono_opt.sml
@@ -280,6 +280,19 @@ fun exp e =
{disc = disc,
result = (TRecord [], loc)}), loc)
+ | EWrite (EQuery {exps, tables, state, query,
+ initial = (EPrim (Prim.String ""), _),
+ body = (EStrcat ((EPrim (Prim.String s), _),
+ (EStrcat ((ERel 0, _),
+ e'), _)), _)}, loc) =>
+ if CharVector.all Char.isSpace s then
+ EQuery {exps = exps, tables = tables, query = query,
+ state = (TRecord [], loc),
+ initial = (ERecord [], loc),
+ body = (optExp (EWrite e', loc), loc)}
+ else
+ e
+
| _ => e
and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)