comparison src/jscomp.sml @ 808:d8f58d488cfb

Mutual datatypes through Pathcheck
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 May 2009 15:55:15 -0400
parents 5f49a6b759cb
children c1f8963ebb18
comparison
equal deleted inserted replaced
807:61a1f5c5ae2c 808:d8f58d488cfb
174 val (someTs, nameds) = 174 val (someTs, nameds) =
175 foldl (fn ((DVal (_, n, t, e, _), _), (someTs, nameds)) => (someTs, IM.insert (nameds, n, e)) 175 foldl (fn ((DVal (_, n, t, e, _), _), (someTs, nameds)) => (someTs, IM.insert (nameds, n, e))
176 | ((DValRec vis, _), (someTs, nameds)) => 176 | ((DValRec vis, _), (someTs, nameds)) =>
177 (someTs, foldl (fn ((_, n, _, e, _), nameds) => IM.insert (nameds, n, e)) 177 (someTs, foldl (fn ((_, n, _, e, _), nameds) => IM.insert (nameds, n, e))
178 nameds vis) 178 nameds vis)
179 | ((DDatatype (_, _, cs), _), state as (someTs, nameds)) => 179 | ((DDatatype dts, _), state as (someTs, nameds)) =>
180 if ElabUtil.classifyDatatype cs = Option then 180 (foldl (fn ((_, _, cs), someTs) =>
181 (foldl (fn ((_, n, SOME t), someTs) => IM.insert (someTs, n, t) 181 if ElabUtil.classifyDatatype cs = Option then
182 | (_, someTs) => someTs) someTs cs, 182 foldl (fn ((_, n, SOME t), someTs) => IM.insert (someTs, n, t)
183 nameds) 183 | (_, someTs) => someTs) someTs cs
184 else 184 else
185 state 185 someTs) someTs dts,
186 nameds)
186 | (_, state) => state) 187 | (_, state) => state)
187 (IM.empty, IM.empty) file 188 (IM.empty, IM.empty) file
188 189
189 fun str loc s = (EPrim (Prim.String s), loc) 190 fun str loc s = (EPrim (Prim.String s), loc)
190 191