summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-01-18 19:51:57 +0200
committerOrgad Shaneh <orgads@gmail.com>2014-01-20 14:11:18 +0100
commita309b3cfe6173a923988f645aad0488d65589f0f (patch)
tree9b5e3f1999ee37cb356ee722ea9bba0c537dfb9d /src/plugins/cpptools/cppcodeformatter.cpp
parent25ab1199cde5c5590078ec882a76ae6260eca68b (diff)
downloadqt-creator-a309b3cfe6173a923988f645aad0488d65589f0f.tar.gz
C++: Store token kind as lexer state
... when needed Change-Id: I32a1649c87e1fa42da80eff5003b2f5714062064 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index c15e8c4aac..db557959be 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -504,7 +504,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
leave();
continue;
} else if (m_tokenIndex == m_tokens.size() - 1
- && lexerState == Lexer::State_Default) {
+ && lexerState == T_EOF_SYMBOL) {
leave();
} else if (m_tokenIndex == 0 && m_currentToken.isComment()) {
// to allow enter/leave to update the indentDepth
@@ -571,8 +571,8 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
if (topState != multiline_comment_start
&& topState != multiline_comment_cont
- && (lexerState == Lexer::State_MultiLineComment
- || lexerState == Lexer::State_MultiLineDoxyComment)) {
+ && (lexerState == T_COMMENT
+ || lexerState == T_DOXY_COMMENT)) {
enter(multiline_comment_start);
}
@@ -1612,7 +1612,7 @@ void QtStyleCodeFormatter::adjustIndent(const QList<CPlusPlus::Token> &tokens, i
if ((topState.type == multiline_comment_cont
|| topState.type == multiline_comment_start)
&& (kind == T_COMMENT || kind == T_DOXY_COMMENT)
- && (lexerState == Lexer::State_Default
+ && (lexerState == T_EOF_SYMBOL
|| tokens.size() != 1)) {
if (*indentDepth >= m_tabSettings.m_indentSize)
*indentDepth -= m_tabSettings.m_indentSize;