[Swift-commit] r4251 - in trunk: libexec src/org/griphyn/vdl/engine src/org/griphyn/vdl/karajan/lib/swiftscript tests/functions
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Sun Apr 3 16:25:44 CDT 2011
Author: wozniak
Date: 2011-04-03 16:25:44 -0500 (Sun, 03 Apr 2011)
New Revision: 4251
Modified:
trunk/libexec/vdl-lib.xml
trunk/src/org/griphyn/vdl/engine/ProcedureSignature.java
trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
trunk/tests/functions/500-exists.swift
Log:
Rename @exists_file to @exists
Modified: trunk/libexec/vdl-lib.xml
===================================================================
--- trunk/libexec/vdl-lib.xml 2011-04-03 21:12:42 UTC (rev 4250)
+++ trunk/libexec/vdl-lib.xml 2011-04-03 21:25:44 UTC (rev 4251)
@@ -7,7 +7,6 @@
<export name="readdata2"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.ReadData2"/></export>
<export name="writedata"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.WriteData"/></export>
<export name="strcat"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
- <export name="exists_file"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
<export name="strcut"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
<export name="strstr"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
<export name="strsplit"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
@@ -28,6 +27,7 @@
<export name="fileNames"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.FileNames"/></export>
<export name="dirname"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
<export name="length"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
+ <export name="exists"><elementDef classname="org.griphyn.vdl.karajan.lib.swiftscript.Misc"/></export>
<export name="arg">
<import file="sys.xml"/>
<if>
Modified: trunk/src/org/griphyn/vdl/engine/ProcedureSignature.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/ProcedureSignature.java 2011-04-03 21:12:42 UTC (rev 4250)
+++ trunk/src/org/griphyn/vdl/engine/ProcedureSignature.java 2011-04-03 21:25:44 UTC (rev 4251)
@@ -307,11 +307,11 @@
java.addOutputArg(output);
functionsMap.put(java.getName(), java);
- ProcedureSignature exists_file = new ProcedureSignature("exists_file");
- exists_file.setAnyNumOfInputArgs();
- FormalArgumentSignature exists_fileOut1 = new FormalArgumentSignature("boolean");
- exists_file.addOutputArg(exists_fileOut1);
- functionsMap.put(exists_file.getName(), exists_file);
+ ProcedureSignature exists = new ProcedureSignature("exists");
+ exists.setAnyNumOfInputArgs();
+ FormalArgumentSignature existsOut1 = new FormalArgumentSignature("boolean");
+ exists.addOutputArg(existsOut1);
+ functionsMap.put(exists.getName(), exists);
return functionsMap;
}
Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2011-04-03 21:12:42 UTC (rev 4250)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java 2011-04-03 21:25:44 UTC (rev 4251)
@@ -38,7 +38,7 @@
static {
setArguments("swiftscript_trace", new Arg[] { Arg.VARGS });
setArguments("swiftscript_strcat", new Arg[] { Arg.VARGS });
- setArguments("swiftscript_exists_file", new Arg[] { Arg.VARGS });
+ setArguments("swiftscript_exists", new Arg[] { Arg.VARGS });
setArguments("swiftscript_strcut", new Arg[] { PA_INPUT, PA_PATTERN });
setArguments("swiftscript_strstr", new Arg[] { PA_INPUT, PA_PATTERN });
setArguments("swiftscript_strsplit", new Arg[] { PA_INPUT, PA_PATTERN });
@@ -98,7 +98,7 @@
return handle;
}
- public DSHandle swiftscript_exists_file(VariableStack stack)
+ public DSHandle swiftscript_exists(VariableStack stack)
throws ExecutionException {
logger.debug(stack);
Object[] args = SwiftArg.VARGS.asArray(stack);
@@ -106,13 +106,13 @@
if (args.length != 1)
throw new ExecutionException
- ("Wrong number of arguments to @exists_file()");
+ ("Wrong number of arguments to @exists()");
String filename = TypeUtil.toString(args[0]);
DSHandle handle = new RootDataNode(Types.BOOLEAN);
AbsFile file = new AbsFile(filename);
- logger.debug("exists_file: " + file);
+ logger.debug("exists: " + file);
handle.setValue(file.exists());
handle.closeShallow();
@@ -125,11 +125,11 @@
(provid, provArgs[i], ""+i);
}
VDLFunction.logProvenanceResult
- (provid, handle, "exists_file");
+ (provid, handle, "exists");
}
} catch (IOException ioe) {
throw new ExecutionException
- ("When logging provenance for exists_file",
+ ("When logging provenance for exists",
ioe);
}
Modified: trunk/tests/functions/500-exists.swift
===================================================================
--- trunk/tests/functions/500-exists.swift 2011-04-03 21:12:42 UTC (rev 4250)
+++ trunk/tests/functions/500-exists.swift 2011-04-03 21:25:44 UTC (rev 4251)
@@ -4,8 +4,8 @@
boolean b1, b2;
-b1 = @exists_file(s1);
-b2 = @exists_file(s2);
+b1 = @exists(s1);
+b2 = @exists(s2);
tracef("%s: %p\n%s: %p\n",
s1, b1, s2, b2);
More information about the Swift-commit
mailing list