diff lib/js/urweb.js @ 1057:eaba663fd6aa

Represent FFI function names as strings, to deal with cross-file recursion
author Adam Chlipala <adamc@hcoop.net>
date Sat, 05 Dec 2009 14:01:34 -0500
parents a8a825861397
children e8a35d710ab9
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Dec 03 14:32:47 2009 -0500
+++ b/lib/js/urweb.js	Sat Dec 05 14:01:34 2009 -0500
@@ -505,6 +505,7 @@
 function ts(x) { return x.toString() }
 function bs(b) { return (b ? "True" : "False") }
 
+function id(x) { return x; }
 function sub(s, i) { return s.charAt(i); }
 function suf(s, i) { return s.substring(i); }
 function slen(s) { return s.length; }
@@ -1049,10 +1050,10 @@
       break;
     case "f":
       if (e.a == null)
-        e = {c: "c", v: e.f()};
+        e = {c: "c", v: (eval(e.f))()};
       else {
         var args = [];
-        stack = cons({c: "f", f: e.f, args: args, pos: 0, a: e.a.next}, stack);
+        stack = cons({c: "f", f: eval(e.f), args: args, pos: 0, a: e.a.next}, stack);
         if (!e.a.data.c) alert("[2] fr.f = " + e.f + "; 0 = " + e.a.data);
         e = e.a.data;
       }