comparison src/monoize.sml @ 813:7b380e2b9e68

Corify FFI datatypes properly; eliminate nested JavaScript markers
author Adam Chlipala <adamc@hcoop.net>
date Sun, 17 May 2009 13:25:57 -0400
parents d8f58d488cfb
children 493f44759879
comparison
equal deleted inserted replaced
812:2fbd1ac2f04b 813:7b380e2b9e68
2536 SOME (L.EFfiApp ("Basis", "get_script", [(L.ERecord [], loc)]), loc)) 2536 SOME (L.EFfiApp ("Basis", "get_script", [(L.ERecord [], loc)]), loc))
2537 end 2537 end
2538 2538
2539 | "dyn" => 2539 | "dyn" =>
2540 (case attrs of 2540 (case attrs of
2541 [("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _), 2541 (*[("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _),
2542 e), _), _)] => (e, fm) 2542 e), _), _)] => (e, fm)
2543 | [("Signal", e, _)] => 2543 |*) [("Signal", e, _)] =>
2544 ((L'.EStrcat 2544 ((L'.EStrcat
2545 ((L'.EPrim (Prim.String "<span><script type=\"text/javascript\">dyn("), loc), 2545 ((L'.EPrim (Prim.String "<span><script type=\"text/javascript\">dyn("), loc),
2546 (L'.EStrcat ((L'.EJavaScript (L'.Script, e, NONE), loc), 2546 (L'.EStrcat ((L'.EJavaScript (L'.Script, e, NONE), loc),
2547 (L'.EPrim (Prim.String ")</script></span>"), loc)), loc)), loc), 2547 (L'.EPrim (Prim.String ")</script></span>"), loc)), loc)), loc),
2548 fm) 2548 fm)
3186 3186
3187 datatype expungable = Client | Channel 3187 datatype expungable = Client | Channel
3188 3188
3189 fun monoize env file = 3189 fun monoize env file =
3190 let 3190 let
3191
3192
3193 (* Calculate which exported functions need cookie signature protection *) 3191 (* Calculate which exported functions need cookie signature protection *)
3194 val rcook = foldl (fn ((d, _), rcook) => 3192 val rcook = foldl (fn ((d, _), rcook) =>
3195 case d of 3193 case d of
3196 L.DExport (L.Action L.ReadCookieWrite, n) => IS.add (rcook, n) 3194 L.DExport (L.Action L.ReadCookieWrite, n) => IS.add (rcook, n)
3197 | L.DExport (L.Rpc L.ReadCookieWrite, n) => IS.add (rcook, n) 3195 | L.DExport (L.Rpc L.ReadCookieWrite, n) => IS.add (rcook, n)