[Swift-commit] r5142 - trunk/src/org/griphyn/vdl/engine

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Sep 20 21:15:17 CDT 2011


Author: hategan
Date: 2011-09-20 21:15:16 -0500 (Tue, 20 Sep 2011)
New Revision: 5142

Modified:
   trunk/src/org/griphyn/vdl/engine/Karajan.java
Log:
also escape underscores in names when mangling to avoid conflicts

Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java	2011-09-21 02:07:40 UTC (rev 5141)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java	2011-09-21 02:15:16 UTC (rev 5142)
@@ -386,13 +386,15 @@
 
     /**
      * Convert to a case-insensitive representation by
-     * pre-pending a '^' to upper case letters
+     * pre-pending a '_' to upper case letters. If the
+     * original name contains a '_' it will be converted 
+     * to "__" (two underscores).
      */
 	private String mangle(String name) {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < name.length(); i++) {
             char c = name.charAt(i);
-            if (Character.isUpperCase(c)) {
+            if (Character.isUpperCase(c) || c == '_') {
                 sb.append('_');
             }
             sb.append(Character.toLowerCase(c));




More information about the Swift-commit mailing list