projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug 362: preprocessor not preserving line numbers
[org.ibex.core.git]
/
src
/
org
/
ibex
/
util
/
Preprocessor.java
diff --git
a/src/org/ibex/util/Preprocessor.java
b/src/org/ibex/util/Preprocessor.java
index
54c2b1c
..
875416d
100644
(file)
--- a/
src/org/ibex/util/Preprocessor.java
+++ b/
src/org/ibex/util/Preprocessor.java
@@
-191,7
+191,7
@@
PROCESS:
if (key != null) {
Hashtable hash = byLength[key.length()];
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));
}
} else {
out.print(processLine(trimmed, false));
}
@@
-199,13
+199,13
@@
PROCESS:
for(int i=0; i<255; i++) {
if (byLength[i] == null) continue;
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]);
buildTrie("", byLength[i]);
- out.print("}; break; }\n");
+ out.print("}; break; } ");
}
out.print("} /* switch */ ");
}
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 {
enumSwitch++;
} else {
@@
-237,7
+237,7
@@
PROCESS:
} else {
out.print("case \'" + prefixPlusOne.charAt(prefixPlusOne.length() - 1) + "\': ");
String code = (String)cases.get(keys.elementAt(i));
} 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; ");
}
String key = (String)keys.elementAt(i);
out.print("if (\""+key+"\".equals(ccSwitch"+enumSwitch+")) { if (true) do { " + code + " } while(false); break SUCCESS; } break; ");
}