Closed ratijas closed 2 years ago
Hi @ratijas
It seems to be easy fix. We will fix this in this week. Thank you for providing good documentation and providing references.
It's not the only unsupported grammar. Another case I found is just a +
operator in a math expression on the right hand side of an assignment in a signal handler. It said something about invalid/unexpected QML_* tokens.
You guys really should reuse JavaScript parser from IntelliJ platform whenever possible, instead of reinventing the wheel. QML just embeds js with custom globals and properties, but without any syntax/grammar modifications.
Not to mention template string literals and their recursive parsing contexts.
`string text ${expression} string text`
tag`string text ${expression} string text`
Hi @ratijas
Reusing JB JS parser is not so easy that it seems to be. JS parser is not included by default in every JB editor, eg. in CLion. It is delivered in WebStorm, but this is paid IDE. We are in contact with JetBrains to resolve that, but on this moment we need to support simple javascript syntax on our own.
Summary
Object literal syntax does not support Shorthand property names (ES2015).
Steps to reproduce
Expected result
Parse object literal as normal. Word
duration
refers both to the key of this new object and to the existing variable in scope.Actual result