Skip to content

Commit c48675f

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

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/api.js

+9
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,15 @@ function qmlweb_parse($TEXT, document_type, exigent_mode) {
221221
function qmlpropdef() {
222222
var type = S.token.value;
223223
next();
224+
225+
var subtype;
226+
if (is("operator", "<")) {
227+
next();
228+
subtype = S.token.value;
229+
next();
230+
expect_token("operator", ">");
231+
}
232+
224233
var name = S.token.value;
225234
next();
226235
if (type == "alias") {

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)