[Swift-commit] r4799 - trunk/src/org/griphyn/vdl/engine

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Thu Jul 7 15:52:59 CDT 2011


Author: hategan
Date: 2011-07-07 15:52:58 -0500 (Thu, 07 Jul 2011)
New Revision: 4799

Modified:
   trunk/src/org/griphyn/vdl/engine/Karajan.java
Log:
don't clean up the iteration variable since it's just an alias to stuff that's in a parent scope

Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java	2011-07-07 18:57:30 UTC (rev 4798)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java	2011-07-07 20:52:58 UTC (rev 4799)
@@ -805,7 +805,9 @@
 			        foreachST.setAttribute("selfClose", "true");
 			}
 			scope.appendStatement(foreachST);
-			foreachST.setAttribute("cleanups", innerScope.getCleanups());
+			Collection<String> cleanups = innerScope.getCleanups();
+			cleanups.remove(foreach.getVar());
+			foreachST.setAttribute("cleanups", cleanups);
 		} catch(CompilationException re) {
 			throw new CompilationException("Compile error in foreach statement at "+foreach.getSrc()+": "+re.getMessage(),re);
 		}




More information about the Swift-commit mailing list