Added BackwardsScanner::mid(tokenIndex). Mid() returns a substring starting from the position of the given token.

This commit is contained in:
Roberto Raggi
2009-09-21 17:38:25 +02:00
parent 41118d91fb
commit 42c676d19a
3 changed files with 9 additions and 2 deletions

View File

@@ -99,6 +99,12 @@ int BackwardsScanner::startPosition() const
QString BackwardsScanner::text() const
{ return _text; }
QString BackwardsScanner::mid(int index) const
{
const SimpleToken &firstToken = _tokens.at(index + _offset);
return _text.mid(firstToken.begin());
}
QString BackwardsScanner::text(int index) const
{
const SimpleToken &firstToken = _tokens.at(index + _offset);