forked from qt-creator/qt-creator
Fixed a few typos and bugs in the ObjC++ support.
This commit is contained in:
@@ -55,6 +55,11 @@ bool SimpleToken::isComment() const
|
||||
return _kind == T_COMMENT || _kind == T_DOXY_COMMENT;
|
||||
}
|
||||
|
||||
bool SimpleToken::isObjCAtKeyword() const
|
||||
{
|
||||
return _kind >= T_FIRST_LITERAL && _kind <= T_LAST_OBJC_AT_KEYWORD;
|
||||
}
|
||||
|
||||
SimpleLexer::SimpleLexer()
|
||||
: _lastState(0),
|
||||
_skipComments(false),
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
bool isOperator() const;
|
||||
bool isKeyword() const;
|
||||
bool isComment() const;
|
||||
bool isObjCAtKeyword() const;
|
||||
|
||||
public:
|
||||
int _kind;
|
||||
|
||||
@@ -157,7 +157,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
||||
initialState = 0;
|
||||
}
|
||||
|
||||
} else if (tk.isKeyword() || isQtKeyword(tk.text()))
|
||||
} else if (tk.isKeyword() || isQtKeyword(tk.text()) || tk.isObjCAtKeyword())
|
||||
setFormat(tk.position(), tk.length(), m_formats[CppKeywordFormat]);
|
||||
|
||||
else if (tk.isOperator())
|
||||
|
||||
@@ -598,7 +598,7 @@ void Lexer::scan_helper(Token *tok)
|
||||
|
||||
do {
|
||||
yyinp();
|
||||
if (! isalnum(_yychar))
|
||||
if (! (isalnum(_yychar) || _yychar == '_'))
|
||||
break;
|
||||
} while (_yychar);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ static const char *token_names[] = {
|
||||
|
||||
("<comment>"), ("<doxy comment>"),
|
||||
|
||||
("<identifier>"), ("<int literal>"), ("<float literal>"), ("<char literal>"),
|
||||
("<identifier>"), ("<numeric literal>"), ("<char literal>"),
|
||||
("<wide char literal>"), ("<string literal>"), ("<wide char literal>"),
|
||||
("<@string literal>"), ("<angle string literal>"),
|
||||
|
||||
|
||||
@@ -224,9 +224,9 @@ enum Kind {
|
||||
T_AT_THROW,
|
||||
T_AT_TRY,
|
||||
|
||||
T_LAST_OBJC_AT_KEYWORD,
|
||||
T_LAST_OBJC_AT_KEYWORD = T_AT_TRY,
|
||||
|
||||
T_FIRST_QT_KEYWORD = T_LAST_OBJC_AT_KEYWORD,
|
||||
T_FIRST_QT_KEYWORD,
|
||||
|
||||
// Qt keywords
|
||||
T_SIGNAL = T_FIRST_QT_KEYWORD,
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
{ return kind == T_COMMENT || kind == T_DOXY_COMMENT; }
|
||||
|
||||
inline bool isObjCAtKeyword() const
|
||||
{ return kind >= T_FIRST_OBJC_AT_KEYWORD && kind < T_LAST_OBJC_AT_KEYWORD; }
|
||||
{ return kind >= T_FIRST_OBJC_AT_KEYWORD && kind <= T_LAST_OBJC_AT_KEYWORD; }
|
||||
|
||||
static const char *name(int kind);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user