Commit deabf47f authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

CppTools: Added skipComments flag.

parent 9a00b8ba
...@@ -33,14 +33,17 @@ ...@@ -33,14 +33,17 @@
using namespace CPlusPlus; 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) : _offset(0)
, _blocksTokenized(0) , _blocksTokenized(0)
, _block(cursor.block()) , _block(cursor.block())
, _maxBlockCount(maxBlockCount) , _maxBlockCount(maxBlockCount)
{ {
_tokenize.setQtMocRunEnabled(true); _tokenize.setQtMocRunEnabled(true);
_tokenize.setSkipComments(true); _tokenize.setSkipComments(skipComments);
_tokenize.setObjCEnabled(true); _tokenize.setObjCEnabled(true);
_text = _block.text().left(cursor.position() - cursor.block().position()); _text = _block.text().left(cursor.position() - cursor.block().position());
......
...@@ -43,7 +43,8 @@ class CPLUSPLUS_EXPORT BackwardsScanner ...@@ -43,7 +43,8 @@ class CPLUSPLUS_EXPORT BackwardsScanner
public: public:
explicit BackwardsScanner(const QTextCursor &cursor, explicit BackwardsScanner(const QTextCursor &cursor,
int maxBlockCount = MAX_BLOCK_COUNT, int maxBlockCount = MAX_BLOCK_COUNT,
const QString &suffix = QString()); const QString &suffix = QString(),
bool skipComments = true);
int startToken() const; int startToken() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment