diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-03-21 09:46:28 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-27 08:10:38 +0000 |
commit | 5165ae9070d20130c893a1eaf9fe914e689b1fe0 (patch) | |
tree | 13e213782c4c6781306242771de0b5e9a4a52e85 /src/qml | |
parent | 1cfd61f63609c4930db6130d2f63f678c420762d (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/parser/qqmljslexer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |