[Swift-commit] r7933 - trunk/src/org/griphyn/vdl/engine
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Sat Jun 28 13:52:47 CDT 2014
Author: hategan
Date: 2014-06-28 13:52:46 -0500 (Sat, 28 Jun 2014)
New Revision: 7933
Modified:
trunk/src/org/griphyn/vdl/engine/Karajan.java
Log:
some cleanups and removed UUID from concurrent mapper since each run gets its own directory now, so it's just useless noise
Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java 2014-06-28 18:50:40 UTC (rev 7932)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java 2014-06-28 18:52:46 UTC (rev 7933)
@@ -549,8 +549,7 @@
mappingST.setAttribute("descriptor", "ConcurrentMapper");
StringTemplate paramST = template("swift_parameter");
paramST.setAttribute("name", "prefix");
- paramST.setAttribute("expr", "\"" + var.getName() + "-"
- + UUIDGenerator.getInstance().generateRandomBasedUUID().toString() + "\"");
+ paramST.setAttribute("expr", "\"" + var.getName() + "-" + lineNumber(var.getSrc()) + "\"");
mappingST.setAttribute("params", paramST);
variableST.setAttribute("mapping", mappingST);
variableST.setAttribute("nil", Boolean.TRUE);
@@ -1142,7 +1141,7 @@
StringTemplate foreachST = template("foreach");
foreachST.setAttribute("var", foreach.getVar());
- foreachST.setAttribute("line", foreach.getSrc().substring(foreach.getSrc().indexOf(' ') + 1));
+ foreachST.setAttribute("line", lineNumber(foreach.getSrc()));
XmlObject in = foreach.getIn().getAbstractExpression();
StringTemplate inST = expressionToKarajan(in, scope);
@@ -2052,10 +2051,14 @@
private int fieldCounter = 1;
private String addInternedField(String name, String type) {
- String v = "swift.field." + name + "." + type.replace("[", ".array.").replace("]", "");
+ String v = internedFieldName(name, type);
usedFields.put(new InternedField(name, type), v);
return v;
}
+
+ public static String internedFieldName(String name, String type) {
+ return "swift.field." + name + "." + type.replace("[", ".array.").replace("]", "");
+ }
public void generateInternedConstants(StringTemplate programTemplate) {
generateInternedConstants(programTemplate, stringInternMap, "sConst");
@@ -2107,6 +2110,10 @@
public static String normalize(String type) {
return org.griphyn.vdl.type.Types.normalize(type);
}
+
+ public static String lineNumber(String src) {
+ return src.substring(src.indexOf(' ') + 1);
+ }
String datatype(StringTemplate st) {
try {
More information about the Swift-commit
mailing list