From 4fbfd5215d5119e1b9c66b8d4a7110bfe90fecc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 27 Dec 2016 01:44:40 +0300 Subject: [PATCH] qmlpropdef: support list property types Fixes: https://github.com/qmlweb/qmlweb-parser/issues/33 --- src/api.js | 9 +++++++++ tests/qml/Properties.qml | 1 + tests/qml/Properties.qml.json | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/api.js b/src/api.js index 803ab36..ca16f3e 100644 --- a/src/api.js +++ b/src/api.js @@ -221,6 +221,15 @@ function qmlweb_parse($TEXT, document_type, exigent_mode) { function qmlpropdef() { var type = S.token.value; next(); + + var subtype; + if (is("operator", "<")) { + next(); + subtype = S.token.value; + next(); + expect_token("operator", ">"); + } + var name = S.token.value; next(); if (type == "alias") { diff --git a/tests/qml/Properties.qml b/tests/qml/Properties.qml index 5436ddd..3c8976a 100644 --- a/tests/qml/Properties.qml +++ b/tests/qml/Properties.qml @@ -14,4 +14,5 @@ Rectangle { property var foo: {} property var bar: [] property Item item: Item {} + property list items } diff --git a/tests/qml/Properties.qml.json b/tests/qml/Properties.qml.json index 06c0b7a..64e254f 100644 --- a/tests/qml/Properties.qml.json +++ b/tests/qml/Properties.qml.json @@ -151,7 +151,12 @@ [] ] ], - "Item {}\n" + "Item {}\n " + ], + [ + "qmlpropdef", + "items", + "list" ] ] ]