Skip to content

Commit 16404ac

Browse files
committed
qmlpropdef: support list property types
Fixes: #33
1 parent b281c25 commit 16404ac

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/api.js

+10
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ function qmlweb_parse($TEXT, document_type, exigent_mode) {
238238
}
239239
return as("qmlaliasdef", name, objName, propName);
240240
}
241+
242+
var subtype;
243+
if (name === "<") {
244+
subtype = S.token.value;
245+
next();
246+
expect_token("operator", ">");
247+
name = S.token.value;
248+
next();
249+
}
250+
241251
if (is("punc", ":")) {
242252
next();
243253
statement.in_qmlprop = true;

tests/qml/Properties.qml

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ Rectangle {
1414
property var foo: {}
1515
property var bar: []
1616
property Item item: Item {}
17+
property list<Item> items
1718
}

tests/qml/Properties.qml.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@
151151
[]
152152
]
153153
],
154-
"Item {}\n"
154+
"Item {}\n "
155+
],
156+
[
157+
"qmlpropdef",
158+
"items",
159+
"list"
155160
]
156161
]
157162
]
158-
]
163+
]

0 commit comments

Comments
 (0)