diff options
author | Christian Stenger <christian.stenger@qt.io> | 2020-04-30 10:52:09 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2020-05-01 22:56:34 +0200 |
commit | 126ee5c901a9675a9ab61d4c6f2961c95b8bceac (patch) | |
tree | 228d41add83e0fd19f7650e452ba3efea28def65 /src/qml/parser/qqmljslexer.cpp | |
parent | dc56e57cc52de79668ab0612534de527f5fea75a (diff) |
Fix line number for follow-up lines in strings
If a string ends with a line terminator follow-up lines had a
wrong line number.
Change-Id: I98a8f69cbc876e07b3fe83490d517bf7771c59b5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljslexer.cpp')
-rw-r--r-- | src/qml/parser/qqmljslexer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp index 73e6893786..95ad9a0670 100644 --- a/src/qml/parser/qqmljslexer.cpp +++ b/src/qml/parser/qqmljslexer.cpp @@ -893,8 +893,10 @@ int Lexer::scanString(ScanStringMode mode) if (_engine) { while (_codePtr <= _endPtr) { if (isLineTerminator()) { - if ((quote == QLatin1Char('`') || qmlMode())) + if ((quote == QLatin1Char('`') || qmlMode())) { + --_currentLineNumber; // will be read again in scanChar() break; + } _errorCode = IllegalCharacter; _errorMessage = QCoreApplication::translate("QQmlParser", "Stray newline in string literal"); return T_ERROR; |