diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-06-13 14:29:36 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-06-13 14:29:36 -0400 |
commit | afe50be2ed547e0b8d83200bbec77b6037334678 (patch) | |
tree | 1f400f83f20ef1f54d68e1e7b674a08f29abb4d4 /src/monoize.sml | |
parent | f6cfaea8a7eb777dae12337178c3b9a268459995 (diff) |
<dyn> inside <table>; fix Specialize bug with datatype decls generating other mutually-recursive datatype decls
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index d3eb4874..91160e02 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -2595,11 +2595,24 @@ fun monoExp (env, st, fm) (all as (e, loc)) = | "dyn" => (case attrs of [("Signal", e, _)] => - ((L'.EStrcat - ((L'.EPrim (Prim.String "<span><script type=\"text/javascript\">dyn("), loc), - (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), - (L'.EPrim (Prim.String ")</script></span>"), loc)), loc)), loc), - fm) + let + val inTable = case targs of + (L.CRecord (_, ctx), _) :: _ => + List.exists (fn ((L.CName "Table", _), _) => true + | _ => false) ctx + | _ => false + + val tag = if inTable then + "tbody" + else + "span" + in + ((L'.EStrcat + ((L'.EPrim (Prim.String ("<" ^ tag ^ "><script type=\"text/javascript\">dyn(")), loc), + (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), + (L'.EPrim (Prim.String (")</script></" ^ tag ^ ">")), loc)), loc)), loc), + fm) + end | _ => raise Fail "Monoize: Bad dyn attributes") | "submit" => normal ("input type=\"submit\"", NONE, NONE) |