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

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Jul 5 13:25:03 CDT 2011


Author: hategan
Date: 2011-07-05 13:25:03 -0500 (Tue, 05 Jul 2011)
New Revision: 4770

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
Log:
print ints as integers rather than doubles; prettyPrint should evolve to nicely print structs and arrays

Modified: trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2011-07-05 18:16:43 UTC (rev 4769)
+++ trunk/src/org/griphyn/vdl/karajan/lib/swiftscript/Misc.java	2011-07-05 18:25:03 UTC (rev 4770)
@@ -81,9 +81,16 @@
 	    }
 	    else {
     	    if (h.getType().isPrimitive()) {
-    	        buf.append(o);
+    	        if (h.getType().equals(Types.INT)) {
+    	            buf.append(((Number) o).intValue());
+    	        }
+    	        else {
+    	            buf.append(o);
+    	        }
     	    }
-    	    
+    	    else {
+    	        buf.append(h);
+    	    }
 	    }
     }
 




More information about the Swift-commit mailing list