forked from qt-creator/qt-creator
Added objcEnabled()/setObjcEnabled() to SimpleLexer.
This commit is contained in:
@@ -57,7 +57,8 @@ bool SimpleToken::isKeyword() const
|
||||
SimpleLexer::SimpleLexer()
|
||||
: _lastState(0),
|
||||
_skipComments(false),
|
||||
_qtMocRunEnabled(true)
|
||||
_qtMocRunEnabled(true),
|
||||
_objcEnabled(false)
|
||||
{ }
|
||||
|
||||
SimpleLexer::~SimpleLexer()
|
||||
@@ -73,6 +74,17 @@ void SimpleLexer::setQtMocRunEnabled(bool enabled)
|
||||
_qtMocRunEnabled = enabled;
|
||||
}
|
||||
|
||||
|
||||
bool SimpleLexer::objcEnabled() const
|
||||
{
|
||||
return _objcEnabled;
|
||||
}
|
||||
|
||||
void SimpleLexer::setObjcEnabled(bool onoff)
|
||||
{
|
||||
_objcEnabled = onoff;
|
||||
}
|
||||
|
||||
bool SimpleLexer::skipComments() const
|
||||
{
|
||||
return _skipComments;
|
||||
@@ -93,6 +105,7 @@ QList<SimpleToken> SimpleLexer::operator()(const QString &text, int state)
|
||||
|
||||
Lexer lex(firstChar, lastChar);
|
||||
lex.setQtMocRunEnabled(_qtMocRunEnabled);
|
||||
lex.setObjcEnabled(_objcEnabled);
|
||||
|
||||
if (! _skipComments)
|
||||
lex.setScanCommentTokens(true);
|
||||
|
||||
@@ -91,6 +91,9 @@ public:
|
||||
bool qtMocRunEnabled() const;
|
||||
void setQtMocRunEnabled(bool enabled);
|
||||
|
||||
bool objcEnabled() const;
|
||||
void setObjcEnabled(bool onoff);
|
||||
|
||||
QList<SimpleToken> operator()(const QString &text, int state = 0);
|
||||
|
||||
int state() const
|
||||
@@ -100,6 +103,7 @@ private:
|
||||
int _lastState;
|
||||
bool _skipComments: 1;
|
||||
bool _qtMocRunEnabled: 1;
|
||||
bool _objcEnabled: 1;
|
||||
};
|
||||
|
||||
} // end of namespace CPlusPlus
|
||||
|
||||
Reference in New Issue
Block a user