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

@@ -61,6 +61,7 @@ void CppHighlighter::highlightBlock(const QString &text)
SimpleLexer tokenize;
tokenize.setQtMocRunEnabled(false);
tokenize.setObjCEnabled(true);
int initialState = state;
const QList<SimpleToken> tokens = tokenize(text, initialState);
@@ -157,7 +158,7 @@ void CppHighlighter::highlightBlock(const QString &text)
initialState = 0;
}
} else if (tk.isKeyword() || isQtKeyword(tk.text()) || tk.isObjCAtKeyword())
} else if (tk.isKeyword() || isQtKeyword(tk.text()) || tk.isObjCAtKeyword() || tk.isObjCTypeQualifier())
setFormat(tk.position(), tk.length(), m_formats[CppKeywordFormat]);
else if (tk.isOperator())