forked from qt-creator/qt-creator
Split Objective-C keyword parsing to handle the '@' separately.
Because apparently, while designing the Objective-C language, somebody
thought it was a world-class idea to allow any white-space between the
'@' character and the subsequent keyword. With this fix, we now
correctly parse:
@ dynamic
and:
@
selector
and:
@"foo"
"bar"
@"mooze"
(This last one is 1 single string split over multiple lines.)
Wonderful, isn't it?
What we (and Clang) do not support, but what GCC supports is something
like:
@"foo"@@ "bar" @"mooze" @@
which is equivalent to @"foobarmooze".
This commit is contained in:
@@ -127,8 +127,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
||||
else if (tk.is(T_NUMERIC_LITERAL))
|
||||
setFormat(tk.position(), tk.length(), m_formats[CppNumberFormat]);
|
||||
|
||||
else if (tk.is(T_STRING_LITERAL) || tk.is(T_CHAR_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL) ||
|
||||
tk.is(T_AT_STRING_LITERAL))
|
||||
else if (tk.is(T_STRING_LITERAL) || tk.is(T_CHAR_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL))
|
||||
highightLine(text, tk.position(), tk.length(), m_formats[CppStringFormat]);
|
||||
|
||||
else if (tk.is(T_WIDE_STRING_LITERAL) || tk.is(T_WIDE_CHAR_LITERAL))
|
||||
|
||||
Reference in New Issue
Block a user