Mercurial > urweb
comparison src/mono_reduce.sml @ 572:57018f21cd5c
Handling singnal bind
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 21 Dec 2008 12:30:57 -0500 |
parents | 55fc747a67dc |
children | ac947e2f29ff |
comparison
equal
deleted
inserted
replaced
571:86d324061ddc | 572:57018f21cd5c |
---|---|
75 | ELet (_, _, e1, e2) => impure e1 orelse impure e2 | 75 | ELet (_, _, e1, e2) => impure e1 orelse impure e2 |
76 | 76 |
77 | EClosure (_, es) => List.exists impure es | 77 | EClosure (_, es) => List.exists impure es |
78 | EJavaScript (_, e) => impure e | 78 | EJavaScript (_, e) => impure e |
79 | ESignalReturn e => impure e | 79 | ESignalReturn e => impure e |
80 | ESignalBind (e1, e2) => impure e1 orelse impure e2 | |
80 | 81 |
81 | 82 |
82 val liftExpInExp = Monoize.liftExpInExp | 83 val liftExpInExp = Monoize.liftExpInExp |
83 | 84 |
84 val subExpInExp' = | 85 val subExpInExp' = |
331 | EDml e => summarize d e @ [WriteDb] | 332 | EDml e => summarize d e @ [WriteDb] |
332 | ENextval e => summarize d e @ [WriteDb] | 333 | ENextval e => summarize d e @ [WriteDb] |
333 | EUnurlify (e, _) => summarize d e | 334 | EUnurlify (e, _) => summarize d e |
334 | EJavaScript (_, e) => summarize d e | 335 | EJavaScript (_, e) => summarize d e |
335 | ESignalReturn e => summarize d e | 336 | ESignalReturn e => summarize d e |
337 | ESignalBind (e1, e2) => summarize d e1 @ summarize d e2 | |
336 | 338 |
337 | 339 |
338 fun exp env e = | 340 fun exp env e = |
339 let | 341 let |
340 (*val () = Print.prefaces "exp" [("e", MonoPrint.p_exp env (e, ErrorMsg.dummySpan))]*) | 342 (*val () = Print.prefaces "exp" [("e", MonoPrint.p_exp env (e, ErrorMsg.dummySpan))]*) |
476 end | 478 end |
477 | 479 |
478 | EStrcat ((EPrim (Prim.String s1), _), (EPrim (Prim.String s2), _)) => | 480 | EStrcat ((EPrim (Prim.String s1), _), (EPrim (Prim.String s2), _)) => |
479 EPrim (Prim.String (s1 ^ s2)) | 481 EPrim (Prim.String (s1 ^ s2)) |
480 | 482 |
483 | ESignalBind ((ESignalReturn e1, loc), e2) => | |
484 #1 (reduceExp env (EApp (e2, e1), loc)) | |
485 | |
481 | _ => e | 486 | _ => e |
482 in | 487 in |
483 (*Print.prefaces "exp'" [("r", MonoPrint.p_exp env (r, ErrorMsg.dummySpan))];*) | 488 (*Print.prefaces "exp'" [("r", MonoPrint.p_exp env (r, ErrorMsg.dummySpan))];*) |
484 r | 489 r |
485 end | 490 end |