comparison src/mono_opt.sml @ 566:a152905c3c3b

Displayed an alert dialog
author Adam Chlipala <adamc@hcoop.net>
date Fri, 19 Dec 2008 12:38:11 -0500
parents 65d8541c130b
children 1901db85acb4
comparison
equal deleted inserted replaced
565:74800be65591 566:a152905c3c3b
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
363 | _ => e 368 | _ => e
364 369
365 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) 370 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)
366 371
367 val optimize = U.File.map {typ = typ, exp = exp, decl = decl} 372 val optimize = U.File.map {typ = typ, exp = exp, decl = decl}