aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolai Kosjar <[email protected]>2014-02-25 11:38:32 -0300
committerNikolai Kosjar <[email protected]>2014-05-15 14:48:03 +0200
commita9c15c0bf5e04595bc5c1e8bd38506d325da0eb0 (patch)
treeaf5d3450ef6f754710ca70adb3911b956f35711d /src
parent6f63f6b647e033c548fe67fbd88c2ec2b1b079d6 (diff)
C++: Remove Lexer::{tokenOffset(),tokenLength()}
The necessary data can be retrieved by the resulting Token. Change-Id: I79afb23183c156240c690beff30bb11dfe943e61 Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/libs/3rdparty/cplusplus/Lexer.cpp6
-rw-r--r--src/libs/3rdparty/cplusplus/Lexer.h3
-rw-r--r--src/libs/cplusplus/SimpleLexer.cpp2
3 files changed, 1 insertions, 10 deletions
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp
index a5112ba8195..c1cec4a756f 100644
--- a/src/libs/3rdparty/cplusplus/Lexer.cpp
+++ b/src/libs/3rdparty/cplusplus/Lexer.cpp
@@ -104,12 +104,6 @@ void Lexer::pushLineStartOffset()
_translationUnit->pushLineOffset(_currentChar - _firstChar);
}
-unsigned Lexer::tokenOffset() const
-{ return _tokenStart - _firstChar; }
-
-unsigned Lexer::tokenLength() const
-{ return _currentChar - _tokenStart; }
-
void Lexer::scan(Token *tok)
{
tok->reset();
diff --git a/src/libs/3rdparty/cplusplus/Lexer.h b/src/libs/3rdparty/cplusplus/Lexer.h
index 85fe6d2d6bf..43a877e7a84 100644
--- a/src/libs/3rdparty/cplusplus/Lexer.h
+++ b/src/libs/3rdparty/cplusplus/Lexer.h
@@ -44,9 +44,6 @@ public:
inline void operator()(Token *tok)
{ scan(tok); }
- unsigned tokenOffset() const;
- unsigned tokenLength() const;
-
bool scanCommentTokens() const;
void setScanCommentTokens(bool onoff);
diff --git a/src/libs/cplusplus/SimpleLexer.cpp b/src/libs/cplusplus/SimpleLexer.cpp
index 44115775890..578c09ac9e3 100644
--- a/src/libs/cplusplus/SimpleLexer.cpp
+++ b/src/libs/cplusplus/SimpleLexer.cpp
@@ -89,7 +89,7 @@ QList<Token> SimpleLexer::operator()(const QString &text, int state)
break;
}
- QStringRef spell = text.midRef(lex.tokenOffset(), lex.tokenLength());
+ QStringRef spell = text.midRef(tk.begin(), tk.length());
lex.setScanAngleStringLiteralTokens(false);
if (tk.f.newline && tk.is(T_POUND))