Commit 293f6758 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixed: Wrong usage highlighting if function's argument list contains comment.

Task-number: QTCREATORBUG-577
parent a673fb71
......@@ -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;
......
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