From 5165ae9070d20130c893a1eaf9fe914e689b1fe0 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 21 Mar 2018 09:46:28 +0100 Subject: Don't fail on pre increment operator after a newline In some valid cases, the lexer would add an automatic semicolon before the ++/-- operators even if it shouldn't. Change-Id: I2935259fd98a4c7f3f929cc1cecea85f7dde8016 Reviewed-by: Simon Hausmann --- src/qml/parser/qqmljslexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/parser/qqmljslexer.cpp') diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp index 1617f3dfa5..453c8ca474 100644 --- a/src/qml/parser/qqmljslexer.cpp +++ b/src/qml/parser/qqmljslexer.cpp @@ -628,7 +628,7 @@ again: } else if (_char == QLatin1Char('-')) { scanChar(); - if (_terminator && !_delimited && !_prohibitAutomaticSemicolon) { + if (_terminator && !_delimited && !_prohibitAutomaticSemicolon && _tokenKind != T_LPAREN) { _stackToken = T_MINUS_MINUS; return T_SEMICOLON; } @@ -646,7 +646,7 @@ again: } else if (_char == QLatin1Char('+')) { scanChar(); - if (_terminator && !_delimited && !_prohibitAutomaticSemicolon) { + if (_terminator && !_delimited && !_prohibitAutomaticSemicolon && _tokenKind != T_LPAREN) { _stackToken = T_PLUS_PLUS; return T_SEMICOLON; } -- cgit v1.2.3