From cdc696d1aad6239ae526b7cd6c4e5cd3069db9e1 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 10 Mar 2011 20:22:03 -0500 Subject: Ignore JavaScript events in Effectize; allow extra spaces for 'jsFunc'; eat carriage returns at line ends in .urp files --- src/effectize.sml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'src/effectize.sml') diff --git a/src/effectize.sml b/src/effectize.sml index 3fb85f7b..03a14ec0 100644 --- a/src/effectize.sml +++ b/src/effectize.sml @@ -87,26 +87,38 @@ fun effectize file = con = fn _ => false, exp = exp evs} + val dejs = U.Exp.map {kind = fn x => x, + con = fn c => c, + exp = fn ERecord xets => ERecord (List.filter (fn ((CName x, _), _ , _) => x = "Onload" orelse not (String.isPrefix "On" x) + | _ => true) xets) + | e => e} + fun doDecl (d, evs as (writers, readers, pushers)) = case #1 d of DVal (x, n, t, e, s) => - (d, (if couldWrite writers e then - IM.insert (writers, n, (#2 d, s)) - else - writers, - if couldReadCookie readers e then - IM.insert (readers, n, (#2 d, s)) - else - readers, - if couldWriteWithRpc writers readers pushers e then - IM.insert (pushers, n, (#2 d, s)) - else - pushers)) + let + val e = dejs e + in + (d, (if couldWrite writers e then + IM.insert (writers, n, (#2 d, s)) + else + writers, + if couldReadCookie readers e then + IM.insert (readers, n, (#2 d, s)) + else + readers, + if couldWriteWithRpc writers readers pushers e then + IM.insert (pushers, n, (#2 d, s)) + else + pushers)) + end | DValRec vis => let fun oneRound evs = foldl (fn ((_, n, _, e, s), (changed, (writers, readers, pushers))) => let + val e = dejs e + val (changed, writers) = if couldWrite writers e andalso not (IM.inDomain (writers, n)) then (true, IM.insert (writers, n, (#2 d, s))) -- cgit v1.2.3