# HG changeset patch # User Adam Chlipala # Date 1253641283 14400 # Node ID e30c2409c9d099b0ad080f9e51d66355c26915c0 # Parent 733f67bb64e7c380376e0234933dd128822697ad More interpreter debugging diff -r 733f67bb64e7 -r e30c2409c9d0 lib/js/urweb.js --- a/lib/js/urweb.js Tue Sep 22 13:27:47 2009 -0400 +++ b/lib/js/urweb.js Tue Sep 22 13:41:23 2009 -0400 @@ -883,7 +883,7 @@ stack = cons({c: "a3", env: env}, stack.next); break; default: - throw "Unknown Ur continuation kind"; + throw ("Unknown Ur continuation kind " + fr.c); } break; @@ -922,7 +922,7 @@ throw "Empty Ur record in interpretation"; var fs = {}; stack = cons({c: "r", n: e.l.data.n, fs: fs, l: e.l.next}, stack); - e = e.l.data; + e = e.l.data.v; break; case ".": stack = cons({c: ".", f: e.f}, stack); @@ -942,7 +942,7 @@ e = {c: "c", v: cs(function() { return exec0(env0, e0); })}; break; default: - throw "Unknown Ur expression kind"; + throw ("Unknown Ur expression kind " + e.c); } } } diff -r 733f67bb64e7 -r e30c2409c9d0 src/jscomp.sml --- a/src/jscomp.sml Tue Sep 22 13:27:47 2009 -0400 +++ b/src/jscomp.sml Tue Sep 22 13:41:23 2009 -0400 @@ -690,7 +690,7 @@ val (e, st) = jsE inner (e, st) in - (strcat [str ("{c:\"f\",f:" ^ name ^ ",:a:cons("), + (strcat [str ("{c:\"f\",f:" ^ name ^ ",a:cons("), e, str ",null)}"], st) @@ -728,7 +728,7 @@ let val (e, st) = jsE inner (e, st) in - (strcat [str ("cons({n:\"" ^ x ^ ",v:"), + (strcat [str ("cons({n:\"" ^ x ^ "\",v:"), e, str "},", es, diff -r 733f67bb64e7 -r e30c2409c9d0 tests/jscomp.ur --- a/tests/jscomp.ur Tue Sep 22 13:27:47 2009 -0400 +++ b/tests/jscomp.ur Tue Sep 22 13:41:23 2009 -0400 @@ -1,15 +1,30 @@ +fun fst [a] [b] (x : a) (y : b) = x +fun snd [a] [b] (x : a) (y : b) = y + fun main () = s <- source ""; - f <- source (plus 1); + s' <- source ""; + f <- source (plus 1); + f2 <- source fst; + r <- source {A = "x", B = "y"}; return -

+

Function: