Commit 837e7b5a authored by Christian Kamm's avatar Christian Kamm

C++: Remember joined state in SimpleLexer.

Done-with: Erik Verbruggen
parent 4c655cdd
......@@ -41,7 +41,8 @@ SimpleLexer::SimpleLexer()
: _lastState(0),
_skipComments(false),
_qtMocRunEnabled(true),
_objCEnabled(false)
_objCEnabled(false),
_endedJoined(false)
{
}
......@@ -78,6 +79,11 @@ void SimpleLexer::setSkipComments(bool skipComments)
_skipComments = skipComments;
}
bool SimpleLexer::endedJoined() const
{
return _endedJoined;
}
QList<Token> SimpleLexer::operator()(const QString &text, int state)
{
QList<Token> tokens;
......@@ -103,8 +109,10 @@ QList<Token> SimpleLexer::operator()(const QString &text, int state)
for (;;) {
Token tk;
lex(&tk);
if (tk.is(T_EOF_SYMBOL))
if (tk.is(T_EOF_SYMBOL)) {
_endedJoined = tk.joined();
break;
}
QStringRef spell = text.midRef(lex.tokenOffset(), lex.tokenLength());
lex.setScanAngleStringLiteralTokens(false);
......
......@@ -54,6 +54,8 @@ public:
bool objCEnabled() const;
void setObjCEnabled(bool onoff);
bool endedJoined() const;
QList<Token> operator()(const QString &text, int state = 0);
int state() const
......@@ -72,6 +74,7 @@ private:
bool _skipComments: 1;
bool _qtMocRunEnabled: 1;
bool _objCEnabled: 1;
bool _endedJoined: 1;
};
} // end of namespace CPlusPlus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment