[Swift-commit] r3011 - in trunk: src/org/griphyn/vdl/karajan/lib src/org/griphyn/vdl/mapping tests/language-behaviour

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Jul 15 09:00:48 CDT 2009


Author: benc
Date: 2009-07-15 09:00:48 -0500 (Wed, 15 Jul 2009)
New Revision: 3011

Added:
   trunk/tests/language-behaviour/07555-ext-mapper-twostruct.sh
   trunk/tests/language-behaviour/07555-ext-mapper-twostruct.swift
   trunk/tests/language-behaviour/075551-ext-mapper-twostruct-singleproducer.swift
Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
   trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
Log:
Fix incorrect attempt to map paths that don't map to filenames.

Two additional tests:

07555-ext-mapper-twostruct passed before this commit.

075551-ext-mapper-twostruct-singleproducer failed before this commit but
passes now.

Modified: trunk/src/org/griphyn/vdl/karajan/lib/VDLFunction.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2009-07-15 14:00:13 UTC (rev 3010)
+++ trunk/src/org/griphyn/vdl/karajan/lib/VDLFunction.java	2009-07-15 14:00:48 UTC (rev 3011)
@@ -196,8 +196,9 @@
 		try {
 			if (var.getType().isArray()) {
 				return leavesFileNames(var);
-			}
-			else {
+			} else if(var.getType().getFields().size()>0) {
+				return leavesFileNames(var);
+			} else {
 				return new String[] { leafFileName(var) };
 			}
 		}

Modified: trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2009-07-15 14:00:13 UTC (rev 3010)
+++ trunk/src/org/griphyn/vdl/mapping/AbstractDataNode.java	2009-07-15 14:00:48 UTC (rev 3011)
@@ -378,7 +378,7 @@
 				// Path fullPath =
 				// parentPath.addLast(mapper.getField().getName());
 				Path fullPath = parentPath.addLast(field.getName());
-				if (!mapper.field.getType().isPrimitive() && !mapper.isArray()) {
+				if (!mapper.field.getType().isPrimitive() && !mapper.isArray() && mapper.field.getType().getFields().size() == 0) {
 					list.add(fullPath);
 				}
 				else {

Added: trunk/tests/language-behaviour/07555-ext-mapper-twostruct.sh
===================================================================
--- trunk/tests/language-behaviour/07555-ext-mapper-twostruct.sh	                        (rev 0)
+++ trunk/tests/language-behaviour/07555-ext-mapper-twostruct.sh	2009-07-15 14:00:48 UTC (rev 3011)
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "eerste 07555-ext-mapper-twostruct.a.out"
+echo "twede 07555-ext-mapper-twostruct.b.out"
+echo "derde.links 07555-ext-mapper-twostruct.cl.out"
+echo "derde.rechts 07555-ext-mapper-twostruct.cr.out"


Property changes on: trunk/tests/language-behaviour/07555-ext-mapper-twostruct.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/tests/language-behaviour/07555-ext-mapper-twostruct.swift
===================================================================
--- trunk/tests/language-behaviour/07555-ext-mapper-twostruct.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/07555-ext-mapper-twostruct.swift	2009-07-15 14:00:48 UTC (rev 3011)
@@ -0,0 +1,26 @@
+type file;
+
+type structInner {
+    file links;
+    file rechts;
+}
+
+type struct {
+    file eerste;
+    file twede;
+    structInner derde;
+};
+
+(file t) write(string s) { 
+    app {
+        echo s stdout=@filename(t);
+    }
+}
+
+struct outfiles <ext; exec="./07555-ext-mapper-twostruct.sh">;
+
+outfiles.eerste = write("1st");
+outfiles.twede = write("2nd");
+outfiles.derde.links = write("3l");
+outfiles.derde.rechts = write("3r");
+

Added: trunk/tests/language-behaviour/075551-ext-mapper-twostruct-singleproducer.swift
===================================================================
--- trunk/tests/language-behaviour/075551-ext-mapper-twostruct-singleproducer.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/075551-ext-mapper-twostruct-singleproducer.swift	2009-07-15 14:00:48 UTC (rev 3011)
@@ -0,0 +1,23 @@
+type file;
+
+type structInner {
+    file links;
+    file rechts;
+}
+
+type struct {
+    file eerste;
+    file twede;
+    structInner derde;
+};
+
+(struct t) singlewrite() { 
+    app {
+        touch @filenames(t);
+    }
+}
+
+struct outfiles <ext; exec="./07555-ext-mapper-twostruct.sh">;
+
+outfiles = singlewrite();
+




More information about the Swift-commit mailing list