# HG changeset patch # User Adam Chlipala # Date 1220187933 14400 # Node ID d5b12daa9b472a333d351fa7b36511f7bfc22668 # Parent 5c50b17f5e4a03fa4838a8b4056114385d2379ed Fix shaking of tables diff -r 5c50b17f5e4a -r d5b12daa9b47 src/shake.sml --- a/src/shake.sml Sun Aug 31 09:00:28 2008 -0400 +++ b/src/shake.sml Sun Aug 31 09:05:33 2008 -0400 @@ -45,9 +45,11 @@ fun shake file = let - val page_es = List.foldl - (fn ((DExport (_, n), _), page_es) => n :: page_es - | (_, page_es) => page_es) [] file + val (page_es, table_cs) = + List.foldl + (fn ((DExport (_, n), _), (page_es, table_cs)) => (n :: page_es, table_cs) + | ((DTable (_, _, c, _), _), (page_es, table_cs)) => (page_es, c :: table_cs) + | (_, acc) => acc) ([], []) file val (cdef, edef) = foldl (fn ((DCon (_, n, _, c), _), (cdef, edef)) => (IM.insert (cdef, n, [c]), edef) | ((DDatatype (_, n, _, xncs), _), (cdef, edef)) => @@ -104,6 +106,8 @@ case IM.find (edef, n) of NONE => raise Fail "Shake: Couldn't find 'val'" | SOME (t, e) => shakeExp (shakeCon s t) e) s page_es + + val s = foldl (fn (c, s) => shakeCon s c) s table_cs in List.filter (fn (DCon (_, n, _, _), _) => IS.member (#con s, n) | (DDatatype (_, n, _, _), _) => IS.member (#con s, n)