[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] intl: fix conflicts instead of accepting them
From: |
Bruno Haible |
Subject: |
Re: [PATCH 3/4] intl: fix conflicts instead of accepting them |
Date: |
Fri, 01 May 2020 21:45:45 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; ) |
Hi Akim,
Akim Demaille wrote:
> The seven conflicts are related to "a ? b : c <op> d". In all the
> cases we left the S/R conflict be resolved as a shift, i.e., "a ? b
> : (c <op> d)". To make this explicit, give the rule of the ternary
> operator a very low precedence. In fact give it the same precedence
> as "?". Now, to resolve the conflict in "a ? b : c ? d : e" be parsed
> as "a ? b : (c ? d : e)", make them right-associative.
>
> * gettext-runtime/intl/plural.y: Require Bison 3.0, to use %precedence
> instead of useless associativities such as %right.
> Make '?' and ':' of the same precedence, right associative.
Thanks for this! The last time I analyzed this set of conflicts, about
20 years ago, I did not find a way to get rid of them, and it was common
practice at the time to let conflicts stay around if bison chose the
proper resolution to them.
I wasn't aware of all the new facilities in Bison, and am very grateful
that you brought this grammar into modern style!
Applied.
Bruno