summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-25 15:29:21 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-25 15:29:21 -0400
commit2385b6b946eb1215d75a3dddccb05aaf8f605ba3 (patch)
treee7763596f996cbc602dfbefff837b20da643bbba /src/jscomp.sml
parent5a88b41a6655f601c989ae94ce1fc8bb391ca630 (diff)
Use call/cc for recv and sleep
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 9d456c5c..c6b8e7b9 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -918,31 +918,35 @@ fun process file =
st)
end
- | ERecv (e, ek, t) =>
+ | ERecv (e, t) =>
let
val (e, st) = jsE inner (e, st)
- val (ek, st) = jsE inner (ek, st)
val (unurl, st) = unurlifyExp loc (t, st)
in
(strcat [str ("{c:\"f\",f:rv,a:cons("),
e,
str (",cons({c:\"c\",v:function(s){var t=s.split(\"/\");var i=0;return "
- ^ unurl ^ "}},cons("),
- ek,
- str (",null)))}")],
+ ^ unurl ^ "}},cons({c:\"K\"},null)))}")],
st)
end
- | ESleep (e, ek) =>
+ | ESleep e =>
let
val (e, st) = jsE inner (e, st)
- val (ek, st) = jsE inner (ek, st)
in
(strcat [str "{c:\"f\",f:sl,a:cons(",
e,
- str ",cons(",
- ek,
- str ",null))}"],
+ str ",cons({c:\"K\"},null))}"],
+ st)
+ end
+
+ | ESpawn e =>
+ let
+ val (e, st) = jsE inner (e, st)
+ in
+ (strcat [str "{c:\"f\",f:sp,a:cons(",
+ e,
+ str ",null)}"],
st)
end
end
@@ -1168,19 +1172,23 @@ fun process file =
in
((EServerCall (e1, t, ef), loc), st)
end
- | ERecv (e1, e2, t) =>
+ | ERecv (e1, t) =>
let
val (e1, st) = exp outer (e1, st)
- val (e2, st) = exp outer (e2, st)
in
- ((ERecv (e1, e2, t), loc), st)
+ ((ERecv (e1, t), loc), st)
end
- | ESleep (e1, e2) =>
+ | ESleep e1 =>
+ let
+ val (e1, st) = exp outer (e1, st)
+ in
+ ((ESleep e1, loc), st)
+ end
+ | ESpawn e1 =>
let
val (e1, st) = exp outer (e1, st)
- val (e2, st) = exp outer (e2, st)
in
- ((ESleep (e1, e2), loc), st)
+ ((ESpawn e1, loc), st)
end)
fun decl (d as (_, loc), st) =