comparison src/unnest.sml @ 450:07f6576aeb0a

Wrapping works in Blog
author Adam Chlipala <adamc@hcoop.net>
date Sat, 01 Nov 2008 16:46:16 -0400
parents 85819353a84f
children 787d4931fb07
comparison
equal deleted inserted replaced
449:89f766f19d5b 450:07f6576aeb0a
204 204
205 val subs = map (fn (n, e) => (n + nr, E.liftExpInExp nr e)) subs 205 val subs = map (fn (n, e) => (n + nr, E.liftExpInExp nr e)) subs
206 206
207 val subs' = ListUtil.mapi (fn (i, (_, n, _, _)) => 207 val subs' = ListUtil.mapi (fn (i, (_, n, _, _)) =>
208 let 208 let
209 val e = apply (ENamed n, loc) 209 val dummy = (EError, ErrorMsg.dummySpan)
210
211 fun repeatLift k =
212 if k = 0 then
213 apply (ENamed n, loc)
214 else
215 E.liftExpInExp 0 (repeatLift (k - 1))
210 in 216 in
211 (0, E.liftExpInExp (nr - i - 1) e) 217 (0, repeatLift i)
212 end) 218 end)
213 vis 219 vis
220
214 val subs' = rev subs' 221 val subs' = rev subs'
215 222
216 val cfv = IS.listItems cfv 223 val cfv = IS.listItems cfv
217 val efv = IS.listItems efv 224 val efv = IS.listItems efv
218 val efn = length efv 225 val efn = length efv
219
220 (*val subsInner = subs
221 @ map (fn (i, e) =>
222 (i + efn,
223 E.liftExpInExp efn e)) subs'*)
224 226
225 val subs = subs @ subs' 227 val subs = subs @ subs'
226 228
227 val vis = map (fn (x, n, t, e) => 229 val vis = map (fn (x, n, t, e) =>
228 let 230 let
229 (*val () = Print.prefaces "preSubst" 231 (*val () = Print.prefaces "preSubst"
230 [("e", ElabPrint.p_exp E.empty e)]*) 232 [("e", ElabPrint.p_exp E.empty e)]*)
231 val e = doSubst e subs(*Inner*) 233 val e = doSubst e subs
232 234
233 (*val () = Print.prefaces "squishCon" 235 (*val () = Print.prefaces "squishCon"
234 [("t", ElabPrint.p_con E.empty t)]*) 236 [("t", ElabPrint.p_con E.empty t)]*)
235 val t = squishCon cfv t 237 val t = squishCon cfv t
236 (*val () = Print.prefaces "squishExp" 238 (*val () = Print.prefaces "squishExp"