qmlweb / qmlweb-parser

A QML parser in JavaScript
Other
27 stars 11 forks source link

Drop qmlobjdef, support deep subproperties in qmlprop #17

Closed ChALkeR closed 8 years ago

ChALkeR commented 8 years ago

qmlobjdef supported only two components, a different format was needed to support assignments like Drag.hotSpot.x: width / 2.

Let's just use qmlprop with name = 'Drag.hotSpot.x' for that, instead of defining a separate token type for properties with two components.

Refs: https://github.com/qmlweb/qmlweb/pull/280

/cc @akreuzkamp

stephenmdangelo commented 8 years ago

+1 This (and the corresponding change in qmlweb) fixes parsing of a use-case I have that's setting a module-qualified attached property (e.g. ModuleQualifer.AttachedObject.property: "foo").

akreuzkamp commented 8 years ago

I'm not 100% convinced to be honest. Wouldn't it be better to create proper AST for the names? See #19 for an alternative approach, that creates proper AST.

ChALkeR commented 8 years ago

Closing in favor of #19.