Syntax highlighting for Objective-C identifiers (super, self, nil, Nil, _cmd, SEL, IMP, BOOL, YES, NO, id).

This commit is contained in:
Erik Verbruggen
2009-10-09 15:23:19 +02:00
parent 4b44fa5f4a
commit d61eb9c893
5 changed files with 113 additions and 15 deletions

View File

@@ -27,6 +27,7 @@
**
**************************************************************************/
#include "ObjectiveCTypeQualifiers.h"
#include "SimpleLexer.h"
#include <Lexer.h>
@@ -83,7 +84,6 @@ SimpleLexer::SimpleLexer()
_qtMocRunEnabled(true),
_objCEnabled(false)
{
setObjCEnabled(true);
}
SimpleLexer::~SimpleLexer()
@@ -156,6 +156,9 @@ QList<SimpleToken> SimpleLexer::operator()(const QString &text, int state)
simpleTk.text() == QLatin1String("include"))
lex.setScanAngleStringLiteralTokens(true);
if (_objCEnabled && tk.is(T_IDENTIFIER))
simpleTk.f._objcTypeQualifier = (classifyObjectiveCTypeQualifiers(firstChar + tk.offset, tk.f.length) != Token_identifier);
tokens.append(simpleTk);
}