diff 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
line wrap: on
line diff
--- a/src/unnest.sml	Sat Nov 01 16:08:39 2008 -0400
+++ b/src/unnest.sml	Sat Nov 01 16:46:16 2008 -0400
@@ -206,29 +206,31 @@
 
                             val subs' = ListUtil.mapi (fn (i, (_, n, _, _)) =>
                                                           let
-                                                              val e = apply (ENamed n, loc)
+                                                              val dummy = (EError, ErrorMsg.dummySpan)
+                                                                          
+                                                              fun repeatLift k =
+                                                                  if k = 0 then
+                                                                      apply (ENamed n, loc)
+                                                                  else
+                                                                      E.liftExpInExp 0 (repeatLift (k - 1))
                                                           in
-                                                              (0, E.liftExpInExp (nr - i - 1) e)
+                                                              (0, repeatLift i)
                                                           end)
-                                            vis
+                                                      vis
+
                             val subs' = rev subs'
 
                             val cfv = IS.listItems cfv
                             val efv = IS.listItems efv
                             val efn = length efv
 
-                            (*val subsInner = subs
-                                            @ map (fn (i, e) =>
-                                                      (i + efn,
-                                                       E.liftExpInExp efn e)) subs'*)
-
                             val subs = subs @ subs'
 
                             val vis = map (fn (x, n, t, e) =>
                                               let
                                                   (*val () = Print.prefaces "preSubst"
                                                                           [("e", ElabPrint.p_exp E.empty e)]*)
-                                                  val e = doSubst e subs(*Inner*)
+                                                  val e = doSubst e subs
 
                                                   (*val () = Print.prefaces "squishCon"
                                                                           [("t", ElabPrint.p_con E.empty t)]*)