[Swift-commit] r7002 - branches/release-0.94/src/org/griphyn/vdl/engine

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Mon Aug 26 03:25:22 CDT 2013


Author: hategan
Date: 2013-08-26 03:25:18 -0500 (Mon, 26 Aug 2013)
New Revision: 7002

Modified:
   branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
Log:
fixed a few issues with last commits

Modified: branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java	2013-08-26 07:27:31 UTC (rev 7001)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java	2013-08-26 08:25:18 UTC (rev 7002)
@@ -799,13 +799,14 @@
 				int noOfMandArgs = 0;
 				for (int i = 0; i < call.sizeOfInputArray(); i++) {
 					ActualParameter input = call.getInputArray(i);
-					StringTemplate argST = actualParameter(input, scope);
+					if (!inArgs.containsKey(input.getBind()))
+                        throw new CompilationException("Formal argument " + input.getBind() + " doesn't exist");
+                    FormalArgumentSignature formalArg = inArgs.get(input.getBind());
+                    String formalType = formalArg.getType();
+					
+					StringTemplate argST = actualParameter(input, scope, false, formalType);
 					callST.setAttribute("inputs", argST);
 
-					if (!inArgs.containsKey(input.getBind()))
-						throw new CompilationException("Formal argument " + input.getBind() + " doesn't exist");
-					FormalArgumentSignature formalArg = inArgs.get(input.getBind());
-					String formalType = formalArg.getType();
 					String actualType = datatype(argST);
 					if (!formalArg.isAnyType() && !actualType.equals(formalType))
 						throw new CompilationException("Wrong type for parameter number " + i +
@@ -868,13 +869,14 @@
 				/* if ALL arguments are specified by name=value */
 				for (int i = 0; i < call.sizeOfOutputArray(); i++) {
 					ActualParameter output = call.getOutputArray(i);
-					StringTemplate argST = actualParameter(output, scope);
+					if (!outArgs.containsKey(output.getBind()))
+                        throw new CompilationException("Formal argument " + output.getBind() + " doesn't exist");
+                    FormalArgumentSignature formalArg = outArgs.get(output.getBind());
+                    String formalType = formalArg.getType();
+					
+					StringTemplate argST = actualParameter(output, scope, false, formalType);
 					callST.setAttribute("outputs", argST);
 
-					if (!outArgs.containsKey(output.getBind()))
-						throw new CompilationException("Formal argument " + output.getBind() + " doesn't exist");
-					FormalArgumentSignature formalArg = outArgs.get(output.getBind());
-					String formalType = formalArg.getType();
 					String actualType = datatype(argST);
 					if (!formalArg.isAnyType() && !actualType.equals(formalType))
 						throw new CompilationException("Wrong type for output parameter number " + i +
@@ -885,7 +887,7 @@
 			} else { /* Positional arguments */
 				for (int i = 0; i < call.sizeOfOutputArray(); i++) {
 					ActualParameter output = call.getOutputArray(i);
-					FormalArgumentSignature formalArg =proceduresMap.get(procName).getOutputArray(i);
+					FormalArgumentSignature formalArg = proceduresMap.get(procName).getOutputArray(i);
 					StringTemplate argST = actualParameter(output, scope, true, formalArg.getType());
 					callST.setAttribute("outputs", argST);
 
@@ -1220,7 +1222,10 @@
 					arguments.length + " and should be " + funcSignature.sizeOfInputArray());
 
 		for(int i = 0; i < arguments.length; i++ ) {
-		    String type = funcSignature.getInputArray(i).getType();
+		    String type = null;
+		    if (!funcSignature.getAnyNumOfInputArgs()) {
+		        funcSignature.getInputArray(i).getType();
+		    }
 			StringTemplate exprST = expressionToKarajan(arguments[i], scope, false, type);
 			funcST.setAttribute("args", exprST);
 




More information about the Swift-commit mailing list