comparison src/mono_opt.sml @ 910:8e540df3294d

grid1 compiles but gets stuck in JS
author Adam Chlipala <adamc@hcoop.net>
date Tue, 25 Aug 2009 13:57:56 -0400
parents 7a4b026e45dd
children 552c989c1601
comparison
equal deleted inserted replaced
909:1d3f60e74ec7 910:8e540df3294d
28 structure MonoOpt :> MONO_OPT = struct 28 structure MonoOpt :> MONO_OPT = struct
29 29
30 open Mono 30 open Mono
31 structure U = MonoUtil 31 structure U = MonoUtil
32 32
33 val removeServerCalls = ref false
34
35 fun typ t = t 33 fun typ t = t
36 fun decl d = d 34 fun decl d = d
37 35
38 fun attrifyInt n = 36 fun attrifyInt n =
39 if n < 0 then 37 if n < 0 then
480 (case rev es of 478 (case rev es of
481 (e as (_, loc)) :: es => #1 (foldl (fn (e, es) => (EStrcat (e, es), loc)) e es) 479 (e as (_, loc)) :: es => #1 (foldl (fn (e, es) => (EStrcat (e, es), loc)) e es)
482 | [] => raise Fail "MonoOpt impossible nil") 480 | [] => raise Fail "MonoOpt impossible nil")
483 | NONE => e 481 | NONE => e
484 end 482 end
485
486 | EServerCall (_, _, _, _, ue) =>
487 if !removeServerCalls then
488 optExp ue
489 else
490 e
491 483
492 | _ => e 484 | _ => e
493 485
494 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) 486 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)
495 487