mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Removed an obsolete method.
This commit is contained in:
parent
033e61ab6f
commit
ed9db92e40
1 changed files with 0 additions and 89 deletions
|
@ -1683,95 +1683,6 @@ public class Scribe {
|
|||
printComment(BASIC_TRAILING_COMMENT);
|
||||
}
|
||||
|
||||
public void printTrailingComment_() {
|
||||
// if we have a space between two tokens we ensure it will be dumped in
|
||||
// the formatted string
|
||||
int currentTokenStartPosition= scanner.getCurrentPosition();
|
||||
if (shouldSkip(currentTokenStartPosition)) {
|
||||
return;
|
||||
}
|
||||
boolean hasWhitespaces= false;
|
||||
boolean hasComment= false;
|
||||
boolean hasLineComment= false;
|
||||
int count= 0;
|
||||
while ((currentToken= scanner.nextToken()) != null) {
|
||||
switch (currentToken.type) {
|
||||
case Token.tWHITESPACE:
|
||||
char[] whiteSpaces= scanner.getCurrentTokenSource();
|
||||
for (int i= 0, max= whiteSpaces.length; i < max; i++) {
|
||||
switch (whiteSpaces[i]) {
|
||||
case '\r':
|
||||
if ((i + 1) < max) {
|
||||
if (whiteSpaces[i + 1] == '\n') {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
count++;
|
||||
break;
|
||||
case '\n':
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (hasLineComment) {
|
||||
if (count >= 1) {
|
||||
currentTokenStartPosition= scanner.getCurrentTokenStartPosition();
|
||||
preserveEmptyLines(count - 1, currentTokenStartPosition);
|
||||
addDeleteEdit(currentTokenStartPosition, scanner.getCurrentTokenEndPosition());
|
||||
scanner.resetTo(scanner.getCurrentPosition(), scannerEndPosition - 1);
|
||||
return;
|
||||
} else {
|
||||
scanner.resetTo(currentTokenStartPosition, scannerEndPosition - 1);
|
||||
return;
|
||||
}
|
||||
} else if (count >= 1) {
|
||||
if (hasComment) {
|
||||
printNewLine(scanner.getCurrentTokenStartPosition());
|
||||
}
|
||||
scanner.resetTo(currentTokenStartPosition, scannerEndPosition - 1);
|
||||
return;
|
||||
} else {
|
||||
hasWhitespaces= true;
|
||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||
addDeleteEdit(scanner.getCurrentTokenStartPosition(), scanner.getCurrentTokenEndPosition());
|
||||
}
|
||||
break;
|
||||
case Token.tLINECOMMENT:
|
||||
if (hasWhitespaces) {
|
||||
space();
|
||||
}
|
||||
printLineComment();
|
||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||
hasLineComment= true;
|
||||
break;
|
||||
case Token.tBLOCKCOMMENT:
|
||||
if (hasWhitespaces) {
|
||||
space();
|
||||
}
|
||||
printBlockComment(false);
|
||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||
hasComment= true;
|
||||
break;
|
||||
case Token.tPREPROCESSOR:
|
||||
case Token.tPREPROCESSOR_DEFINE:
|
||||
case Token.tPREPROCESSOR_INCLUDE:
|
||||
if (column != 1)
|
||||
printNewLine(scanner.getCurrentTokenStartPosition());
|
||||
hasWhitespaces= false;
|
||||
printPreprocessorDirective();
|
||||
startNewLine();
|
||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||
hasLineComment= false;
|
||||
hasComment= false;
|
||||
count= 0;
|
||||
break;
|
||||
default:
|
||||
// step back one token
|
||||
scanner.resetTo(currentTokenStartPosition, scannerEndPosition - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void redoAlignment(AlignmentException e) {
|
||||
if (e.relativeDepth > 0) { // if exception targets a distinct context
|
||||
e.relativeDepth--; // record fact that current context got traversed
|
||||
|
|
Loading…
Add table
Reference in a new issue