forked from qt-creator/qt-creator
C++: Remove Lexer::{tokenOffset(),tokenLength()}
The necessary data can be retrieved by the resulting Token. Change-Id: I79afb23183c156240c690beff30bb11dfe943e61 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
6
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
6
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -104,12 +104,6 @@ void Lexer::pushLineStartOffset()
|
|||||||
_translationUnit->pushLineOffset(_currentChar - _firstChar);
|
_translationUnit->pushLineOffset(_currentChar - _firstChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned Lexer::tokenOffset() const
|
|
||||||
{ return _tokenStart - _firstChar; }
|
|
||||||
|
|
||||||
unsigned Lexer::tokenLength() const
|
|
||||||
{ return _currentChar - _tokenStart; }
|
|
||||||
|
|
||||||
void Lexer::scan(Token *tok)
|
void Lexer::scan(Token *tok)
|
||||||
{
|
{
|
||||||
tok->reset();
|
tok->reset();
|
||||||
|
|||||||
3
src/libs/3rdparty/cplusplus/Lexer.h
vendored
3
src/libs/3rdparty/cplusplus/Lexer.h
vendored
@@ -44,9 +44,6 @@ public:
|
|||||||
inline void operator()(Token *tok)
|
inline void operator()(Token *tok)
|
||||||
{ scan(tok); }
|
{ scan(tok); }
|
||||||
|
|
||||||
unsigned tokenOffset() const;
|
|
||||||
unsigned tokenLength() const;
|
|
||||||
|
|
||||||
bool scanCommentTokens() const;
|
bool scanCommentTokens() const;
|
||||||
void setScanCommentTokens(bool onoff);
|
void setScanCommentTokens(bool onoff);
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ QList<Token> SimpleLexer::operator()(const QString &text, int state)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringRef spell = text.midRef(lex.tokenOffset(), lex.tokenLength());
|
QStringRef spell = text.midRef(tk.begin(), tk.length());
|
||||||
lex.setScanAngleStringLiteralTokens(false);
|
lex.setScanAngleStringLiteralTokens(false);
|
||||||
|
|
||||||
if (tk.f.newline && tk.is(T_POUND))
|
if (tk.f.newline && tk.is(T_POUND))
|
||||||
|
|||||||
Reference in New Issue
Block a user