C++: Support multiline strings and comments

Task-number: QTCREATORBUG-662
Change-Id: I0997fe2afaba71998d5da549b7141df0c023ff12
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Orgad Shaneh
2014-01-19 22:24:14 +02:00
committed by Orgad Shaneh
parent c06e68c439
commit 0f4e3c356a
4 changed files with 213 additions and 26 deletions

View File

@@ -223,7 +223,7 @@ void CppHighlighter::highlightBlock(const QString &text)
if (text.length() > lastTokenEnd)
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace));
if (!initialState && state && !tokens.isEmpty()) {
if (!initialState && state && !tokens.isEmpty() && tokens.last().isComment()) {
parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'),
tokens.last().begin()));
++braceDepth;