diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-08-27 11:36:24 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-08-29 14:31:16 +0000 |
commit | 02f43807c6e2a35dc28b7ef477db55bb8312e60c (patch) | |
tree | cf1d659a4f264bd91629cb763a12053e08c264de /src/qml/parser | |
parent | 4ffbd99bfa78b12bcf7dbb85b127f77710daa2d5 (diff) |
qqmljs.g: reduce number of conflicts
Use right associativity to tell the parser to shift directly when
encountering an else statement. This is the wanted behavior, as the
"else" should be associated with the last "if" statement.
This removes one more shift/reduce conflict in the grammar.
See also https://stackoverflow.com/a/12734499 (qlalr behaves like
Bison/Yacc here).
Change-Id: Id29f00b5a2862fdb3399e4c8a183eda2ed328ba4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/parser')
-rw-r--r-- | src/qml/parser/qqmljs.g | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index 6c9760e472..098efa9344 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -122,6 +122,7 @@ --%left T_PLUS T_MINUS %nonassoc T_IDENTIFIER T_COLON T_SIGNAL T_PROPERTY T_READONLY T_ON T_SET T_GET T_OF T_STATIC T_FROM T_AS %nonassoc REDUCE_HERE +%right T_THEN T_ELSE %start TopLevel |