summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-04-16 09:15:55 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2010-04-16 09:53:40 (GMT)
commit561a7bf35b96ffe70ebafc3876e965ef41b4441d (patch)
tree100a9fcde25a603ddb1627da20b3a74fb912d726 /src/declarative/qml/parser
parent269623184ee55bd8126cf3ae5cfb619d3bdda91b (diff)
downloadQt-561a7bf35b96ffe70ebafc3876e965ef41b4441d.zip
Qt-561a7bf35b96ffe70ebafc3876e965ef41b4441d.tar.gz
Qt-561a7bf35b96ffe70ebafc3876e965ef41b4441d.tar.bz2
Fixed parsing of inner labelled statements.
The JS grammar is ambigious and the following statement can be parsed as an object-literal followed by an inserted semicolon or as two labelled statements. outer: { inner: {} } In the old days we used to resolve the conflict by reducing the statement to an expression statement but this was wrong so now we prefer the labelled statement. As nice side effect, we pass two more tests in tests/auto/declarative/parserstress. Task-number: QTBUG-8108
Diffstat (limited to 'src/declarative/qml/parser')
-rw-r--r--src/declarative/qml/parser/qdeclarativejs.g2
-rw-r--r--src/declarative/qml/parser/qdeclarativejsgrammar.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g
index ba9338e..1b66ba0 100644
--- a/src/declarative/qml/parser/qdeclarativejs.g
+++ b/src/declarative/qml/parser/qdeclarativejs.g
@@ -1376,7 +1376,7 @@ case $rule_number: {
} break;
./
-PropertyName: T_IDENTIFIER %prec REDUCE_HERE ;
+PropertyName: T_IDENTIFIER %prec SHIFT_THERE ;
/.
case $rule_number: {
AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
diff --git a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
index 52e979a..b87d8f4 100644
--- a/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
+++ b/src/declarative/qml/parser/qdeclarativejsgrammar.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
// This file was generated by qlalr - DO NOT EDIT!
-#include "private/qdeclarativejsgrammar_p.h"
+#include "qdeclarativejsgrammar_p.h"
QT_BEGIN_NAMESPACE
@@ -346,9 +346,9 @@ const short QDeclarativeJSGrammar::action_index [] = {
const short QDeclarativeJSGrammar::action_info [] = {
399, 352, 345, -101, 343, 457, 440, 403, 257, -112,
- -125, -131, -123, -98, -120, 348, -128, 389, 453, 391,
+ -125, -131, -123, 346, -120, 348, -128, 389, 453, 391,
416, 401, 408, 563, -101, -123, 416, -120, 539, -131,
- -98, -112, -125, 348, 257, 99, 71, 645, 621, 101,
+ 346, -112, -125, 348, 257, 99, 71, 645, 621, 101,
-128, 440, 141, 621, 164, 431, 539, 430, 453, 573,
457, 444, 440, 424, 71, 424, 101, 446, 559, 420,
424, 448, 539, 440, 570, 539, 466, 527, 312, 346,