QmlJS: Fix uses of Scanner::state().

Change-Id: I5195fc43e8a6653bf52c0eaa6cddb8dfd25b6217
Reviewed-on: http://codereview.qt.nokia.com/319
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
Christian Kamm
2011-06-03 08:49:40 +02:00
committed by Joerg Bornemann
parent 362aef67e0
commit b729d4b973
5 changed files with 12 additions and 12 deletions

View File

@@ -166,22 +166,22 @@ static int findRegExpEnd(const QString &text, int start)
static inline int multiLineState(int state)
{
return state & 0x3;
return state & Scanner::MultiLineMask;
}
static inline void setMultiLineState(int *state, int s)
{
*state = s | (*state & ~0x3);
*state = s | (*state & ~Scanner::MultiLineMask);
}
static inline bool regexpMayFollow(int state)
{
return state & 0x4;
return state & Scanner::RegexpMayFollow;
}
static inline void setRegexpMayFollow(int *state, bool on)
{
*state = (on << 2) | (*state & 0x3);
*state = (on ? Scanner::RegexpMayFollow : 0) | (*state & ~Scanner::RegexpMayFollow);
}
QList<Token> Scanner::operator()(const QString &text, int startState)
@@ -189,8 +189,6 @@ QList<Token> Scanner::operator()(const QString &text, int startState)
_state = startState;
QList<Token> tokens;
// ### handle multi line comment state.
int index = 0;
if (multiLineState(_state) == MultiLineComment) {