[Swift-commit] r7093 - branches/release-0.94/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sat Sep 21 18:27:28 CDT 2013


Author: hategan
Date: 2013-09-21 18:27:28 -0500 (Sat, 21 Sep 2013)
New Revision: 7093

Modified:
   branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
Log:
cannot assume that the destination or source names don't change since you can have something like a[i]; the best way to implement this would be to simply copy the assignment text from the source

Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-09-20 21:38:32 UTC (rev 7092)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-09-21 23:27:28 UTC (rev 7093)
@@ -50,7 +50,7 @@
 		setArguments(SetFieldValue.class, new Arg[] { OA_PATH, PA_VAR, PA_VALUE });
 	}
 	
-	private String src, dest;
+	private String dst;
 	private Tracer tracer;
 
 	@Override
@@ -66,13 +66,17 @@
 			DSHandle leaf = var.getField(path);
 			AbstractDataNode value = (AbstractDataNode) PA_VALUE.getValue(stack);
 			
-			if (src == null) {
-			    dest = Tracer.getVarName(var);
-			    src = Tracer.getVarName(value);
+			String mdst = dst;
+			
+			if (mdst == null) {
+			    mdst = Tracer.getVarName(var);
+			    if (var.getParent() == null) {
+			        dst = mdst;
+			    }
 			}
 			
 			if (tracer.isEnabled()) {
-			    log(leaf, value, stack);
+			    log(leaf, value, stack, mdst);
 			}
 			    
             // TODO want to do a type check here, for runtime type checking
@@ -96,8 +100,8 @@
 		}
 	}
 
-    private void log(DSHandle leaf, DSHandle value, VariableStack stack) throws VariableNotFoundException {
-        tracer.trace(stack, dest + " = " + Tracer.unwrapHandle(value));
+    private void log(DSHandle leaf, DSHandle value, VariableStack stack, String dst) throws VariableNotFoundException {
+        tracer.trace(stack, dst + " = " + Tracer.unwrapHandle(value));
     }
 
 	String unpackHandles(DSHandle handle, Map<Comparable<?>, DSHandle> handles) { 
@@ -139,12 +143,7 @@
 
     @Override
     public String getTextualName() {
-        if (src == null) {
-            return "assignment";
-        }
-        else {
-            return dest + " = " + src;
-        }
+        return "assignment";
     }
 
     @SuppressWarnings("unchecked")




More information about the Swift-commit mailing list