C++ indenter: Fix error recovery in function definitions.

Task-number: QTCREATORBUG-1517
This commit is contained in:
Christian Kamm
2010-09-24 15:58:23 +02:00
parent 1b46f422ce
commit 17e0886c69
2 changed files with 16 additions and 2 deletions

View File

@@ -160,7 +160,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
if (tryExpression(true))
break;
switch (kind) {
case T_RBRACE:
case T_RBRACE: leave(true); continue;
case T_SEMICOLON: leave(true); break;
case T_EQUAL: enter(initializer); break;
case T_LBRACE: enter(defun_open); break;
@@ -251,7 +251,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
if (tryStatement())
break;
switch (kind) {
case T_RBRACE: leave(); continue; // always nested in declaration_start
case T_RBRACE: leave(); leave(); break; // always nested in declaration_start
} break;
case switch_statement: