[Swift-commit] r6255 - in trunk: src/org/griphyn/vdl/engine tests/language-behaviour/arrays

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sun Feb 10 02:44:52 CST 2013


Author: hategan
Date: 2013-02-10 02:44:51 -0600 (Sun, 10 Feb 2013)
New Revision: 6255

Added:
   trunk/tests/language-behaviour/arrays/210-closing-if-full-xor-partial.swift
Modified:
   trunk/src/org/griphyn/vdl/engine/VariableScope.java
Log:
fixed bug 927

Modified: trunk/src/org/griphyn/vdl/engine/VariableScope.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/VariableScope.java	2013-02-09 05:30:50 UTC (rev 6254)
+++ trunk/src/org/griphyn/vdl/engine/VariableScope.java	2013-02-10 08:44:51 UTC (rev 6255)
@@ -650,6 +650,9 @@
 	}
 			
 	private void setPreClose(String name, int count) {
+	    if (inhibitClosing != null && inhibitClosing.contains(name)) {
+	        return;
+	    }
 	    setCount("preClose", name, count, 
 	        new RefCountSetter<StringTemplate>() {
 	            @Override
@@ -1035,7 +1038,8 @@
 		}
 		presentStatementPostStatements.clear();
 		outputs.clear();
-		inhibitClosing = null;
+		// Cannot set inhibitClosing to null here, since
+		// it may break then/else linked closing. See bug 927
 	}
 
 	private String join(List<String> l) {

Added: trunk/tests/language-behaviour/arrays/210-closing-if-full-xor-partial.swift
===================================================================
--- trunk/tests/language-behaviour/arrays/210-closing-if-full-xor-partial.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/arrays/210-closing-if-full-xor-partial.swift	2013-02-10 08:44:51 UTC (rev 6255)
@@ -0,0 +1,22 @@
+type file;
+
+app (file o) echo ()
+{
+   echo "foo.txt" stdout=@o;
+}
+
+(file fileList[]) createFileArray() {
+  foreach i in [1:5] {
+     fileList[i]=echo();
+  }
+}
+
+file myFileArray[];
+
+
+
+ if (1 == 1) {
+   myFileArray = createFileArray();
+ } else {
+   myFileArray[0] = echo();
+}
\ No newline at end of file




More information about the Swift-commit mailing list