Skip to content
Snippets Groups Projects
Commit b2ff6314 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Added objcEnabled()/setObjcEnabled() to SimpleLexer.

parent c06c77da
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment