comparison src/mono_opt.sml @ 567:1901db85acb4

Start of JsComp
author Adam Chlipala <adamc@hcoop.net>
date Sat, 20 Dec 2008 14:19:21 -0500
parents a152905c3c3b
children 57018f21cd5c
comparison
equal deleted inserted replaced
566:a152905c3c3b 567:1901db85acb4
358 optExp (ELet (x, t, e1, (EWrite e2, loc)), loc) 358 optExp (ELet (x, t, e1, (EWrite e2, loc)), loc)
359 359
360 | EWrite (EPrim (Prim.String ""), loc) => 360 | EWrite (EPrim (Prim.String ""), loc) =>
361 ERecord [] 361 ERecord []
362 362
363 | EJavaScript (EAbs (_, (TRecord [], _), _, (EFfiApp ("Basis", "alert", [s]), _)), loc) =>
364 EStrcat ((EPrim (Prim.String "alert("), loc),
365 (EStrcat ((EFfiApp ("Basis", "jsifyString", [s]), loc),
366 (EPrim (Prim.String ")"), loc)), loc))
367
368 | _ => e 363 | _ => e
369 364
370 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) 365 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)
371 366
372 val optimize = U.File.map {typ = typ, exp = exp, decl = decl} 367 val optimize = U.File.map {typ = typ, exp = exp, decl = decl}