Still allow newlines in QML mode to keep compatibility
for existing code.
Change-Id: I11dbd5a73ea8958f5ddc199b77a919969f8a5214
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
if (_engine) {
while (!_char.isNull()) {
- if (isLineTerminator() || _char == QLatin1Char('\\')) {
+ if (isLineTerminator()) {
+ if (qmlMode())
+ break;
+ _errorCode = IllegalCharacter;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "Stray newline in string literal");
+ return T_ERROR;
+ } else if (_char == QLatin1Char('\\')) {
break;
} else if (_char == quote) {
_tokenSpell = _engine->midRef(startCode - _code.unicode() - 1, _codePtr - startCode);