forked from qt-creator/qt-creator
CppTools: Added skipComments flag.
This commit is contained in:
@@ -33,14 +33,17 @@
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
BackwardsScanner::BackwardsScanner(const QTextCursor &cursor, int maxBlockCount, const QString &suffix)
|
||||
BackwardsScanner::BackwardsScanner(const QTextCursor &cursor,
|
||||
int maxBlockCount,
|
||||
const QString &suffix,
|
||||
bool skipComments)
|
||||
: _offset(0)
|
||||
, _blocksTokenized(0)
|
||||
, _block(cursor.block())
|
||||
, _maxBlockCount(maxBlockCount)
|
||||
{
|
||||
_tokenize.setQtMocRunEnabled(true);
|
||||
_tokenize.setSkipComments(true);
|
||||
_tokenize.setSkipComments(skipComments);
|
||||
_tokenize.setObjCEnabled(true);
|
||||
_text = _block.text().left(cursor.position() - cursor.block().position());
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ class CPLUSPLUS_EXPORT BackwardsScanner
|
||||
public:
|
||||
explicit BackwardsScanner(const QTextCursor &cursor,
|
||||
int maxBlockCount = MAX_BLOCK_COUNT,
|
||||
const QString &suffix = QString());
|
||||
const QString &suffix = QString(),
|
||||
bool skipComments = true);
|
||||
|
||||
int startToken() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user