aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2010-06-29 15:23:07 +0200
committerChristian Kamm <[email protected]>2010-07-02 15:47:00 +0200
commit837e7b5abd3c18e1fb63d36c1630243172a28f90 (patch)
tree111444181db4749f5a95f6e05fa211aa0be16c73 /src/libs
parent4c655cdd90f4c9fb5f1c354a151ff3ede17ac86d (diff)
C++: Remember joined state in SimpleLexer.
Done-with: Erik Verbruggen
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/cplusplus/SimpleLexer.cpp12
-rw-r--r--src/libs/cplusplus/SimpleLexer.h3
2 files changed, 13 insertions, 2 deletions
diff --git a/src/libs/cplusplus/SimpleLexer.cpp b/src/libs/cplusplus/SimpleLexer.cpp
index 1efa043e7bd..e03208f2f72 100644
--- a/src/libs/cplusplus/SimpleLexer.cpp
+++ b/src/libs/cplusplus/SimpleLexer.cpp
@@ -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);
diff --git a/src/libs/cplusplus/SimpleLexer.h b/src/libs/cplusplus/SimpleLexer.h
index b745b1b8099..cdb61a5d0c9 100644
--- a/src/libs/cplusplus/SimpleLexer.h
+++ b/src/libs/cplusplus/SimpleLexer.h
@@ -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