summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-24 10:42:59 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-24 10:42:59 -0400
commit19754bcfbe11a079957aeb9f012f3ee70b31bb84 (patch)
tree4fca46ab109a2ef7f17bb130f1b00a26b41f0c91 /lib
parentf93acbb03f1ea669499bfb39d201ae8dd48f101b (diff)
demo/increment works with interpretation
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 8170249b..5f9a0a13 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -618,7 +618,8 @@ function requestUri(xhr, uri, needsSig) {
xhr.send(null);
}
-function rc(uri, parse, k, needsSig) {
+function rc(prefix, uri, parse, k, needsSig) {
+ uri = cat(prefix, uri);
uri = flattenLocal(uri);
var xhr = getXHR();
@@ -790,6 +791,10 @@ function rv(chn, parse, k) {
}
}
+function sl(ms, k) {
+ window.setTimeout(function() { execF(k, null); }, ms);
+}
+
// Key events
@@ -854,9 +859,6 @@ function exec0(env, e) {
var stack = null;
while (true) {
- if (!e.c)
- throw ("Trace: " + trace);
- trace += "|" + e.c;
switch (e.c) {
case "c":
var v = e.v;
@@ -879,6 +881,7 @@ function exec0(env, e) {
e = {c: "c", v: fr.f.apply(null, fr.args)};
stack = stack.next;
} else {
+ trace += "" + fr.pos;
e = fr.a.data;
fr.a = fr.a.next;
}
@@ -891,7 +894,7 @@ function exec0(env, e) {
if (fr.f == null)
throw "Ur: applying null function";
else if (fr.f.body) {
- stack = cons({c: "a3", env: env}, stack.next);
+ stack = cons({c: "<", env: env}, stack.next);
env = cons(v, fr.f.env);
e = fr.f.body;
} else {
@@ -899,7 +902,7 @@ function exec0(env, e) {
stack = stack.next;
}
break;
- case "a3":
+ case "<":
env = fr.env;
stack = stack.next;
break;
@@ -923,7 +926,7 @@ function exec0(env, e) {
stack = stack.next;
break;
case "=":
- stack = cons({c: "a3", env: env}, stack.next);
+ stack = cons({c: "<", env: env}, stack.next);
env = cons(v, env);
e = fr.e2;
break;
@@ -932,7 +935,7 @@ function exec0(env, e) {
for (ps = fr.p; ps != null; ps = ps.next) {
var r = execP(env, ps.data.p, v);
if (r != false) {
- stack = cons({c: "a3", env: env}, stack.next);
+ stack = cons({c: "<", env: env}, stack.next);
env = r;
e = ps.data.b;
break;