1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Reverted a previous change that caused a breakage in AST2UtilTests.testSimpleParameter. The change itself was innocent since it simply removed unnecessary spaces, but I decided not to mess with it since the code is used for building function signatures.

This commit is contained in:
Sergey Prigogin 2008-03-20 22:02:21 +00:00
parent 4ef0990365
commit 1a05e6b75b
2 changed files with 9 additions and 12 deletions

View file

@ -438,13 +438,17 @@ public class ASTTypeUtil {
// pop all of the types off of the stack, and build the string representation while doing so // pop all of the types off of the stack, and build the string representation while doing so
for (int j = types.length - 1; j >= 0; j--) { for (int j = types.length - 1; j >= 0; j--) {
if (types[j] != null && result.length() > 0)
result.append(SPACE); // only add a space if this is not the first type being added
if (types[j] != null) { if (types[j] != null) {
if (j > 0 && types[j - 1] instanceof IQualifierType) { if (j > 0 && types[j - 1] instanceof IQualifierType) {
smartAppend(result, getTypeString(types[j - 1])); result.append(getTypeString(types[j - 1]));
smartAppend(result, getTypeString(types[j])); result.append(SPACE);
result.append(getTypeString(types[j]));
--j; --j;
} else { } else {
smartAppend(result, getTypeString(types[j])); result.append(getTypeString(types[j]));
} }
} }
} }
@ -452,13 +456,6 @@ public class ASTTypeUtil {
return result.toString(); return result.toString();
} }
private static void smartAppend(StringBuilder buf, String str) {
if (buf.length() > 0 && str.length() > 0 && "&*".indexOf(str.charAt(0)) < 0) { //$NON-NLS-1$
buf.append(SPACE);
}
buf.append(str);
}
/** /**
* Returns the type representation of the declarator (including parameters) as a String. * Returns the type representation of the declarator (including parameters) as a String.
* *