comparison src/shake.sml @ 271:42dfb0d61cf0

'database' declaration threaded through compiler
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Sep 2008 10:51:41 -0400
parents d5b12daa9b47
children e976b187d73a
comparison
equal deleted inserted replaced
270:b9b02613c0c2 271:42dfb0d61cf0
57 | ((DVal (_, n, t, e, _), _), (cdef, edef)) => (cdef, IM.insert (edef, n, (t, e))) 57 | ((DVal (_, n, t, e, _), _), (cdef, edef)) => (cdef, IM.insert (edef, n, (t, e)))
58 | ((DValRec vis, _), (cdef, edef)) => 58 | ((DValRec vis, _), (cdef, edef)) =>
59 (cdef, foldl (fn ((_, n, t, e, _), edef) => IM.insert (edef, n, (t, e))) edef vis) 59 (cdef, foldl (fn ((_, n, t, e, _), edef) => IM.insert (edef, n, (t, e))) edef vis)
60 | ((DExport _, _), acc) => acc 60 | ((DExport _, _), acc) => acc
61 | ((DTable (_, n, c, _), _), (cdef, edef)) => 61 | ((DTable (_, n, c, _), _), (cdef, edef)) =>
62 (cdef, IM.insert (edef, n, (c, dummye)))) 62 (cdef, IM.insert (edef, n, (c, dummye)))
63 | ((DDatabase _, _), acc) => acc)
63 (IM.empty, IM.empty) file 64 (IM.empty, IM.empty) file
64 65
65 fun kind (_, s) = s 66 fun kind (_, s) = s
66 67
67 fun con (c, s) = 68 fun con (c, s) =
112 List.filter (fn (DCon (_, n, _, _), _) => IS.member (#con s, n) 113 List.filter (fn (DCon (_, n, _, _), _) => IS.member (#con s, n)
113 | (DDatatype (_, n, _, _), _) => IS.member (#con s, n) 114 | (DDatatype (_, n, _, _), _) => IS.member (#con s, n)
114 | (DVal (_, n, _, _, _), _) => IS.member (#exp s, n) 115 | (DVal (_, n, _, _, _), _) => IS.member (#exp s, n)
115 | (DValRec vis, _) => List.exists (fn (_, n, _, _, _) => IS.member (#exp s, n)) vis 116 | (DValRec vis, _) => List.exists (fn (_, n, _, _, _) => IS.member (#exp s, n)) vis
116 | (DExport _, _) => true 117 | (DExport _, _) => true
117 | (DTable _, _) => true) file 118 | (DTable _, _) => true
119 | (DDatabase _, _) => true) file
118 end 120 end
119 121
120 end 122 end