diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-01-16 15:49:10 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-01-16 15:49:10 -0500 |
commit | ed56c462bf4131b7e179c72bfafb4f6967bc27dc (patch) | |
tree | ee402a827eb239b280a93f70202795980b0d1dce /src | |
parent | c6f717a90ca7cede8af4fd7aefd7b69cf069592e (diff) |
dlist example working
Diffstat (limited to 'src')
-rw-r--r-- | src/jscomp.sml | 12 | ||||
-rw-r--r-- | src/monoize.sml | 8 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml index 1b675abd..f61ec3f0 100644 --- a/src/jscomp.sml +++ b/src/jscomp.sml @@ -486,7 +486,6 @@ fun process file = maxName = #maxName st} val (e, st) = jsExp mode skip [] 0 (e, st) - val () = Print.prefaces "Pre-e" [("e", MonoPrint.p_exp MonoEnv.empty e)] val e = deStrcat 0 e val sc = "_n" ^ Int.toString n ^ "=" ^ e ^ ";\n" @@ -759,7 +758,11 @@ fun process file = end | EJavaScript (Source _, _, SOME _) => (e, st) - | EJavaScript (_, _, SOME e) => ((EFfiApp ("Basis", "jsifyString", [e]), loc), st) + | EJavaScript (_, _, SOME e) => + (strcat [str "\"cr(\"+ca(function(){return ", + e, + str "})+\")\""], + st) | EClosure _ => unsupported "EClosure" | EQuery _ => unsupported "Query" @@ -770,7 +773,10 @@ fun process file = let val (e, st) = jsE inner (e, st) in - ((EFfiApp ("Basis", "jsifyString", [e]), loc), st) + (strcat [str "\"cr(\"+ca(function(){return ", + e, + str "})+\")\""], + st) end | ESignalReturn e => diff --git a/src/monoize.sml b/src/monoize.sml index 993034e4..8d5ed36c 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -1910,9 +1910,9 @@ fun monoExp (env, st, fm) (all as (e, loc)) = e), _), _)] => (e, fm) | [("Signal", e, _)] => ((L'.EStrcat - ((L'.EPrim (Prim.String "<script>dyn("), loc), + ((L'.EPrim (Prim.String "<span><script type=\"text/javascript\">dyn("), loc), (L'.EStrcat ((L'.EJavaScript (L'.Script, e, NONE), loc), - (L'.EPrim (Prim.String ")</script>"), loc)), loc)), loc), + (L'.EPrim (Prim.String ")</script></span>"), loc)), loc)), loc), fm) | _ => raise Fail "Monoize: Bad dyn attributes") @@ -1932,7 +1932,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = loc)), loc), fm) end | SOME (_, src, _) => - (strcat [str "<script>inp(\"input\",", + (strcat [str "<script type=\"text/javascript\">inp(\"input\",", (L'.EJavaScript (L'.Script, src, NONE), loc), str ")</script>"], fm)) @@ -2002,7 +2002,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = loc), fm) end | SOME (_, src, _) => - (strcat [str "<script>inp(\"input\",", + (strcat [str "<script type=\"text/javascript\">inp(\"input\",", (L'.EJavaScript (L'.Script, src, NONE), loc), str ")</script>"], fm)) |