aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-07-09 19:45:12 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-07-10 11:24:17 +0200
commit1c84e6debfc05e60f1f331ba5f1f265ec6590a8b (patch)
tree395ecf0e7d597c1c974b6bc5b6f37318bbcaac4f /src/qml/parser
parent5c3326702fcb200e9af594f66696cd8c21ac7e85 (diff)
Fix parsing of qml signals with multiple new-style type parameters
Amends 0844d1db03410ac88b4ce6b16f68a073b030b248. The modified examples show that the rule of multiple parameters was missing (with the colon) and the single entry colon rule must also come first in order to identify the use correctly. Change-Id: Ic625e2d4b7b0282e6f2289c8be347c36fe81e4c5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/parser')
-rw-r--r--src/qml/parser/qqmljs.g22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 76d2d75cfc..bdc4a0bb46 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -1106,6 +1106,17 @@ UiParameterListOpt: UiParameterList;
} break;
./
+UiParameterList: QmlIdentifier T_COLON UiPropertyType;
+/.
+ case $rule_number: {
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(3).UiQualifiedId->finish(), stringRef(1));
+ node->identifierToken = loc(1);
+ node->colonToken = loc(2);
+ node->propertyTypeToken = loc(3);
+ sym(1).Node = node;
+ } break;
+./
+
UiParameterList: UiPropertyType QmlIdentifier;
/.
case $rule_number: {
@@ -1116,13 +1127,14 @@ UiParameterList: UiPropertyType QmlIdentifier;
} break;
./
-UiParameterList: QmlIdentifier T_COLON UiPropertyType;
+UiParameterList: UiParameterList T_COMMA QmlIdentifier T_COLON UiPropertyType;
/.
case $rule_number: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(3).UiQualifiedId->finish(), stringRef(1));
- node->identifierToken = loc(1);
- node->colonToken = loc(2);
- node->propertyTypeToken = loc(3);
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, sym(5).UiQualifiedId->finish(), stringRef(3));
+ node->propertyTypeToken = loc(5);
+ node->commaToken = loc(2);
+ node->identifierToken = loc(3);
+ node->colonToken = loc(4);
sym(1).Node = node;
} break;
./