forked from qt-creator/qt-creator
Fixed: Wrong usage highlighting if function's argument list contains comment.
Task-number: QTCREATORBUG-577
This commit is contained in:
@@ -662,6 +662,21 @@ bool Preprocessor::markGeneratedTokens(bool markGeneratedTokens,
|
||||
return previous;
|
||||
}
|
||||
|
||||
bool Preprocessor::maybeAfterComment() const
|
||||
{
|
||||
unsigned endOfPreviousToken = 0;
|
||||
|
||||
if (_dot != _tokens.constBegin())
|
||||
endOfPreviousToken = (_dot - 1)->end();
|
||||
|
||||
const char *start = _source.constBegin() + endOfPreviousToken;
|
||||
|
||||
if (*start == '/')
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Preprocessor::preprocess(const QString &fileName, const QByteArray &source,
|
||||
QByteArray *result)
|
||||
{
|
||||
@@ -710,7 +725,7 @@ void Preprocessor::preprocess(const QString &fileName, const QByteArray &source,
|
||||
|
||||
} else {
|
||||
|
||||
if (_dot->f.whitespace) {
|
||||
if (_dot->f.whitespace || maybeAfterComment()) {
|
||||
unsigned endOfPreviousToken = 0;
|
||||
|
||||
if (_dot != _tokens.constBegin())
|
||||
|
||||
@@ -172,6 +172,7 @@ private:
|
||||
void out(const char *s);
|
||||
|
||||
QString string(const char *first, int len) const;
|
||||
bool maybeAfterComment() const;
|
||||
|
||||
private:
|
||||
Client *client;
|
||||
|
||||
Reference in New Issue
Block a user