diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-03-10 20:22:03 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-03-10 20:22:03 -0500 |
commit | 1fe0be9d980e9a4a47874680e4ac4ee1de6dd374 (patch) | |
tree | aacb1636006c4769a35985cd865b599a4ff6d8f9 /src/effectize.sml | |
parent | c824364cb48385480667ce646425d37ec0ad87b0 (diff) |
Ignore JavaScript events in Effectize; allow extra spaces for 'jsFunc'; eat carriage returns at line ends in .urp files
Diffstat (limited to 'src/effectize.sml')
-rw-r--r-- | src/effectize.sml | 36 |
1 files changed, 24 insertions, 12 deletions
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))) |