[Swift-commit] r7096 - trunk/src/org/griphyn/vdl/karajan/lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Sat Sep 21 22:29:22 CDT 2013


Author: hategan
Date: 2013-09-21 22:29:22 -0500 (Sat, 21 Sep 2013)
New Revision: 7096

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
Log:
fixed tracing of variable assignment

Modified: trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-09-22 00:43:40 UTC (rev 7095)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SetFieldValue.java	2013-09-22 03:29:22 UTC (rev 7096)
@@ -64,7 +64,7 @@
         return new Signature(params("var", "value", optional("path", Path.EMPTY_PATH), optional("_traceline", null)));
     }
 
-    private String src, dest;
+    private String dst;
 	private Tracer tracer;
 	
 	protected VarRef<State> state;
@@ -129,13 +129,17 @@
 			DSHandle leaf = var.getField(path);
 			AbstractDataNode value = this.value.getValue(stack);
 			
-			if (src == null) {
-			    dest = Tracer.getVarName(var);
-			    src = Tracer.getVarName(value);
+			String mdst = this.dst;
+			
+			if (mdst == null) {
+			    mdst = Tracer.getVarName(var);
+			    if (var.getParent() == null) {
+			        this.dst = mdst;
+			    }
 			}
 			
 			if (tracer.isEnabled()) {
-			    log(leaf, value, LWThread.currentThread());
+			    log(leaf, value, LWThread.currentThread(), mdst);
 			}
 			    
             // TODO want to do a type check here, for runtime type checking
@@ -161,7 +165,7 @@
 		}
 	}
 
-    private void log(DSHandle leaf, DSHandle value, LWThread thr) throws VariableNotFoundException {
+    private void log(DSHandle leaf, DSHandle value, LWThread thr, String dest) throws VariableNotFoundException {
         tracer.trace(thr, dest + " = " + Tracer.unwrapHandle(value));
     }
 
@@ -223,12 +227,7 @@
 
     @Override
     public String getTextualName() {
-        if (src == null) {
-            return "assignment";
-        }
-        else {
-            return dest + " = " + src;
-        }
+        return "assignment";
     }
 
     private void copyStructure(DSHandle dest, DSHandle source, State state, int level) {




More information about the Swift-commit mailing list