Set the Lexer into qml mode when parsing binding expressions
authorLars Knoll <lars.knoll@digia.com>
Sun, 2 Jun 2013 20:56:59 +0000 (22:56 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Mon, 3 Jun 2013 05:04:57 +0000 (07:04 +0200)
Binding expressions allow multiline strings and digits starting
with 0. Simply setting the lexer into qmlmode when parsing them
will allow these expressions to pass.

Fixes 3 more test failures in qqmlecmascript

Change-Id: Ia14ec6d3facaf31883bb824c57096e59df3efea2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4/qv4script.cpp

index 0e11831..1a0e392 100644 (file)
@@ -119,7 +119,7 @@ void Script::parse()
 
     QQmlJS::Engine ee, *engine = &ee;
     Lexer lexer(engine);
-    lexer.setCode(sourceCode, line, false);
+    lexer.setCode(sourceCode, line, parseAsBinding);
     Parser parser(engine);
 
     const bool parsed = parser.parseProgram();