diff options
-rw-r--r-- | src/corify.sml | 32 | ||||
-rw-r--r-- | tests/rec.lac | 4 | ||||
-rw-r--r-- | tests/rec2.lac | 7 |
3 files changed, 29 insertions, 14 deletions
diff --git a/src/corify.sml b/src/corify.sml index 41b0e825..13db0685 100644 --- a/src/corify.sml +++ b/src/corify.sml @@ -387,18 +387,26 @@ fun corifyDecl ((d, loc : EM.span), st) = | L.DValRec vis => let val (vis, st) = ListUtil.foldlMap - (fn ((x, n, t, e), st) => - let - val (st, n) = St.bindVal st x n - val s = - if String.isPrefix "wrap_" x then - String.extract (x, 5, NONE) - else - x - in - ((x, n, corifyCon st t, corifyExp st e, s), st) - end) - st vis + (fn ((x, n, t, e), st) => + let + val (st, n) = St.bindVal st x n + in + ((x, n, t, e), st) + end) + st vis + + val vis = map + (fn (x, n, t, e) => + let + val s = + if String.isPrefix "wrap_" x then + String.extract (x, 5, NONE) + else + x + in + (x, n, corifyCon st t, corifyExp st e, s) + end) + vis in ([(L'.DValRec vis, loc)], st) end diff --git a/tests/rec.lac b/tests/rec.lac index e86b832a..6131337e 100644 --- a/tests/rec.lac +++ b/tests/rec.lac @@ -1,3 +1,3 @@ -val rec looper = fn () => <html><body> - <a link={looper ()}>Ride again!</a> +val rec main = fn () => <html><body> + <a link={main ()}>Ride again!</a> </body></html> diff --git a/tests/rec2.lac b/tests/rec2.lac new file mode 100644 index 00000000..e5f208c9 --- /dev/null +++ b/tests/rec2.lac @@ -0,0 +1,7 @@ +val rec main = fn () => <html><body> + <a link={aux ()}>See another page</a> +</body></html> + +and aux = fn () => <html><body> + <a link={main ()}>Back to square one</a> +</body></html> |