aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-11-10 16:36:54 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-14 16:39:25 +0100
commitfff130ee6c4b4a06d0f90fa8ed8c3a6c4218035f (patch)
tree5a8f1f23253b110cdec03def8e50678d5eb5b31d /src
parent2ad0e1978347dd7c1782a9edb5047351c3fb6706 (diff)
Fix parsing of unary expressions.
Prohibit the lexer to synthesize a semicolon token after the colon-sign of a binding declaration. The parser internally was rewriting the following bindings Component.onCompleted: ++foo as Component.onCompleted: ; ++foo Task-number: QTBUG-21310 Change-Id: I0558d17fd81b5abac81fb990502d49767ea40730 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index ba4298d3d4..9b9af3868d 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -106,7 +106,7 @@ Lexer::Lexer(Engine *engine)
, _restrictedKeyword(false)
, _terminator(false)
, _followsClosingBrace(false)
- , _delimited(false)
+ , _delimited(true)
, _qmlMode(true)
{
if (engine)
@@ -156,7 +156,7 @@ void Lexer::setCode(const QString &code, int lineno, bool qmlMode)
_restrictedKeyword = false;
_terminator = false;
_followsClosingBrace = false;
- _delimited = false;
+ _delimited = true;
}
void Lexer::scanChar()
@@ -185,6 +185,7 @@ int Lexer::lex()
switch (_tokenKind) {
case T_LBRACE:
case T_SEMICOLON:
+ case T_COLON:
_delimited = true;
break;