Commit 599d4aa3 authored by Roberto Raggi's avatar Roberto Raggi

Fixed line/column position of the tokens after multiline string literals.

parent 1a3aa6a9
......@@ -664,6 +664,20 @@ Preprocessor::State Preprocessor::createStateFromSource(const QByteArray &source
void Preprocessor::processNewline(bool force)
{
if (_dot != _tokens.constBegin()) {
TokenIterator prevTok = _dot - 1;
if (prevTok->isLiteral()) {
const char *ptr = _source.constBegin() + prevTok->begin();
const char *end = ptr + prevTok->length();
for (; ptr != end; ++ptr) {
if (*ptr == '\n')
++env->currentLine;
}
}
}
if (! force && env->currentLine == _dot->lineno)
return;
......
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