aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-12-20 16:19:26 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-12-20 16:19:26 -0500
commitec745f90fc97e10948dc32ec4f44aabf5c6908db (patch)
tree295a6cbc7787518188dbf6c5c2144c32154ab116 /src/jscomp.sml
parent80be553bea33f3d9cb19f399f64eed36017048a3 (diff)
Successfully generated a page element from a signal
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index b0842c6b..95c18016 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -285,7 +285,7 @@ fun jsExp mode outer =
in
(strcat [str "document.write(",
e,
- str ")"], st)
+ str ".v)"], st)
end
| ESeq (e1, e2) =>
@@ -317,9 +317,9 @@ fun jsExp mode outer =
let
val (e, st) = jsE inner (e, st)
in
- (strcat [(*str "sreturn(",*)
- e(*,
- str ")"*)],
+ (strcat [str "sreturn(",
+ e,
+ str ")"],
st)
end
end
@@ -369,8 +369,16 @@ fun process file =
{decls = [],
script = ""}
file
+
+ val inf = TextIO.openIn (OS.Path.joinDirFile {dir = Config.libJs, file = "urweb.js"})
+ fun lines acc =
+ case TextIO.inputLine inf of
+ NONE => String.concat (rev acc)
+ | SOME line => lines (line :: acc)
+ val lines = lines []
in
- ds
+ TextIO.closeIn inf;
+ (DJavaScript lines, ErrorMsg.dummySpan) :: ds
end
end