C++: Accept language features in BackwardsScanner et al

Change-Id: Id97ca27fa909979573efca12dc0cd14b28eacd17
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-02-26 09:14:38 +02:00
committed by Orgad Shaneh
parent 1a37605f91
commit d63624afe0
15 changed files with 48 additions and 47 deletions

View File

@@ -40,8 +40,9 @@
using namespace CPlusPlus;
ExpressionUnderCursor::ExpressionUnderCursor()
ExpressionUnderCursor::ExpressionUnderCursor(const LanguageFeatures &languageFeatures)
: _jumpedComma(false)
, _languageFeatures(languageFeatures)
{ }
int ExpressionUnderCursor::startOfExpression(BackwardsScanner &tk, int index)
@@ -243,7 +244,7 @@ bool ExpressionUnderCursor::isAccessToken(const Token &tk)
QString ExpressionUnderCursor::operator()(const QTextCursor &cursor)
{
BackwardsScanner scanner(cursor);
BackwardsScanner scanner(cursor, _languageFeatures);
_jumpedComma = false;
@@ -257,7 +258,7 @@ QString ExpressionUnderCursor::operator()(const QTextCursor &cursor)
int ExpressionUnderCursor::startOfFunctionCall(const QTextCursor &cursor) const
{
BackwardsScanner scanner(cursor);
BackwardsScanner scanner(cursor, _languageFeatures);
int index = scanner.startToken();