Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.15.0, 6.0
-
None
-
ac68310b7857693c9eb7ccb782133ac9ec8e2328 (qt/qtdeclarative/dev)
Description
See simplified version of code bellow.
qmlformat from "dev" and qmlformat from 5.15 prints:
Failed to parse formatted code. An error has occurred. Aborting.
If I add curly brackets around outer "if", qmlformat can handle this code,
but only once.
import QtQuick 2.0 Item { function f(x, y) { if (x && y) if (x < y) return 0; else return -1; else return y; } }
I mean if add:
import QtQuick 2.0 Item { function f(x, y) { if (x && y) { if (x < y) return 0; else return -1; } else { return y; } } }
qmlformat can parse this code,
but it removes "{" that fixed this code,
so if you run qmlformat -i test.qml , the second run failed.