Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-01-31 13:51:49 -0500
committerSergey Prigogin2011-01-31 13:51:49 -0500
commitbc8b98729f95447f30c6d79b061da0f21bfce39d (patch)
treeb096715119597ceba67042677219cf5af3249562
parent253c5f1f0379f71105ec11afe8ed8fd81dad925f (diff)
downloadorg.eclipse.cdt-bc8b98729f95447f30c6d79b061da0f21bfce39d.tar.gz
org.eclipse.cdt-bc8b98729f95447f30c6d79b061da0f21bfce39d.tar.xz
org.eclipse.cdt-bc8b98729f95447f30c6d79b061da0f21bfce39d.zip
Code streamlining.
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
index 58e3cd4e53..1ddfb8b100 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
@@ -3441,17 +3441,18 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
try {
statement.accept(this);
} catch (RuntimeException e) {
- if (i < statementsLength - 1) {
- reportFormattingProblem(e);
- exitAlignments();
- skipToNode(statements.get(i + 1));
- while (scribe.indentationLevel < indentLevel) {
- scribe.indent();
- }
- while (scribe.indentationLevel > indentLevel) {
- scribe.unIndent();
- }
- } else throw e;
+ if (i >= statementsLength - 1) {
+ throw e;
+ }
+ reportFormattingProblem(e);
+ exitAlignments();
+ skipToNode(statements.get(i + 1));
+ while (scribe.indentationLevel < indentLevel) {
+ scribe.indent();
+ }
+ while (scribe.indentationLevel > indentLevel) {
+ scribe.unIndent();
+ }
}
previousStatement= statement;
}
@@ -3474,9 +3475,9 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
localScanner.resetTo(start, end);
if (localScanner.getNextToken() == Token.tLBRACE) {
switch (localScanner.getNextToken()) {
- case Token.tBLOCKCOMMENT :
- case Token.tLINECOMMENT :
- return true;
+ case Token.tBLOCKCOMMENT:
+ case Token.tLINECOMMENT:
+ return true;
}
}
return false;
@@ -3504,8 +3505,8 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
int token = localScanner.getNextToken();
loop: while (true) {
switch (token) {
- case Token.tBLOCKCOMMENT :
- case Token.tLINECOMMENT :
+ case Token.tBLOCKCOMMENT:
+ case Token.tLINECOMMENT:
token = localScanner.getNextToken();
continue loop;
default:

Back to the top