aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/corify.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 10:23:04 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 10:23:04 -0400
commite3313edc92a73932ff57b1c803fe7e408283406f (patch)
tree285b8ca2c5c71dfb0c48b0b8e56727cf37592129 /src/corify.sml
parent1e03bdf0b6f423870abcf5e54ae7f2bdf08e3e49 (diff)
Corifying (non-mutual) 'val rec'
Diffstat (limited to 'src/corify.sml')
-rw-r--r--src/corify.sml20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/corify.sml b/src/corify.sml
index b17cad24..41b0e825 100644
--- a/src/corify.sml
+++ b/src/corify.sml
@@ -384,8 +384,24 @@ fun corifyDecl ((d, loc : EM.span), st) =
in
([(L'.DVal (x, n, corifyCon st t, corifyExp st e, s), loc)], st)
end
- | L.DValRec _ => raise Fail "Explify DValRec"
-
+ | 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
+ in
+ ([(L'.DValRec vis, loc)], st)
+ end
| L.DSgn _ => ([], st)
| L.DStr (x, n, _, (L.StrFun (_, na, _, _, str), _)) =>