if (key != null) {
Hashtable hash = byLength[key.length()];
- hash.put(key, (String)hash.get(key) + processLine(trimmed, false).replaceAll("//[^\"]*$", ""));
+ hash.put(key, (String)hash.get(key) + processLine(trimmed, false).replaceAll("//[^\"]*$", "").trim() + "\n");
} else {
out.print(processLine(trimmed, false));
}
for(int i=0; i<255; i++) {
if (byLength[i] == null) continue;
- out.print("case " + i + ": { switch(ccSwitch"+enumSwitch+".charAt(0)) {\n");
+ out.print("case " + i + ": { switch(ccSwitch"+enumSwitch+".charAt(0)) { ");
buildTrie("", byLength[i]);
- out.print("}; break; }\n");
+ out.print("}; break; } ");
}
out.print("} /* switch */ ");
- if (Default != null) out.print("\n" + Default);
- out.print(" } while(false); //OUTER\n");
+ if (Default != null) out.print(" " + Default);
+ out.print(" } while(false); /* OUTER */\n");
enumSwitch++;
} else {
} else {
out.print("case \'" + prefixPlusOne.charAt(prefixPlusOne.length() - 1) + "\': ");
String code = (String)cases.get(keys.elementAt(i));
- code = code.substring(0, code.length() - 1);
+ code = code.substring(0, code.length());
String key = (String)keys.elementAt(i);
out.print("if (\""+key+"\".equals(ccSwitch"+enumSwitch+")) { if (true) do { " + code + " } while(false); break SUCCESS; } break; ");
}