Quick-Turn-Studio / CLionSupportForQt

19 stars 0 forks source link

Incorrect flagging of valid QML #40

Closed TomMettam closed 2 years ago

TomMettam commented 3 years ago
import QtQuick 2.0

SomeComponent {
    id: trackList

    readonly property bool isSomething: (browseView.something === this) || (browseView.something === that)
}

The plugin flags the || with the comment

QmlTokenType.CLOSE_BRACE, QmlTokenType.COMMAND_END or QmlTokenType.TERNARY_OPERATOR expected, got '||'
TomMettam commented 3 years ago

The same occurs with &&

grabusr commented 3 years ago

Hi Tom,

This is bug in the parsing non-simple expressions. We try to workaround not supporting left employed recursion in Grammar-Kit. I hope we will find the solution to the end of next week.

aeby commented 3 years ago

I guess this is also the root of this problem

someProp: cond1 ? thisValue : (cond2 ? thatValue : otherValue)
                                                 ^------- QmlTokenType.DOT or QmlTokenType.TERNARY_VALUE_SEPARATOR expected, got ':'
grabusr commented 3 years ago

Hi @TomMettam and @aeby

We created new parser mechanism to resolve issue with operations. Version 0.9.8 is able to download. Please let us know if it solves your issues.