summaryrefslogtreecommitdiff
path: root/src/mono_shake.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-16 15:55:15 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-16 15:55:15 -0400
commit30b78a96ae699fa2282c07a2dbf3e6303f99e32c (patch)
tree42c21054472ff028fbeaba0f8af6534d23662ad0 /src/mono_shake.sml
parent41f7bb23ff2a9598f8f3bff1487f39f9e91f9f05 (diff)
Mutual datatypes through Pathcheck
Diffstat (limited to 'src/mono_shake.sml')
-rw-r--r--src/mono_shake.sml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mono_shake.sml b/src/mono_shake.sml
index 4764feb7..40b83934 100644
--- a/src/mono_shake.sml
+++ b/src/mono_shake.sml
@@ -48,8 +48,8 @@ fun shake file =
| ((DDatabase {expunge = n1, initialize = n2, ...}, _), page_es) => n1 :: n2 :: page_es
| (_, page_es) => page_es) [] file
- val (cdef, edef) = foldl (fn ((DDatatype (_, n, xncs), _), (cdef, edef)) =>
- (IM.insert (cdef, n, xncs), edef)
+ val (cdef, edef) = foldl (fn ((DDatatype dts, _), (cdef, edef)) =>
+ (foldl (fn ((_, n, xncs), cdef) => IM.insert (cdef, n, xncs)) cdef dts, edef)
| ((DVal (_, n, t, e, _), _), (cdef, edef)) =>
(cdef, IM.insert (edef, n, (t, e)))
| ((DValRec vis, _), (cdef, edef)) =>
@@ -111,7 +111,7 @@ fun shake file =
NONE => raise Fail "Shake: Couldn't find 'val'"
| SOME (t, e) => shakeExp s e) s page_es
in
- List.filter (fn (DDatatype (_, n, _), _) => IS.member (#con s, n)
+ List.filter (fn (DDatatype dts, _) => List.exists (fn (_, n, _) => IS.member (#con s, n)) dts
| (DVal (_, n, _, _, _), _) => IS.member (#exp s, n)
| (DValRec vis, _) => List.exists (fn (_, n, _, _, _) => IS.member (#exp s, n)) vis
| (DExport _, _) => true