Skip to content
Snippets Groups Projects
Commit 599d4aa3 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

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

parent 1a3aa6a9
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment