>> While fixing this I ended up deciding that it's better to revert to
>> the Yacc style of conflict reports: this is easily translated, and it
>> has the virtue of familiarity, at any rate.  So I installed this:

Thanks, that reminded me of the problem.  Unfortunately the patch
you proposed has the problem.  There are a couple of instances of
code like this:

+          complain (complaint,
+                    ngettext ("%d reduce/reduce conflict, expected %d",
+                              "%d reduce/reduce conflicts, expected %d",
+                              total),
+                    total, expected);

But this isn't right, as there are two numbers 'total' and 'expected',
and either or both can be singular or plural so there are four possibilities
not two, and this can matter for the translation (even though it doesn't
happen to matter for the English version).

ngettext doesn't give us a way to solve this sort of problem, I'm
afraid.

Bison could output two messages rather than one, but that's getting
pretty verbose.

How about if we stick with the current style for numbers but use
the patch's style for everything else?  That is, instead of
the current style:

    foo.y: conflicts: 1 shift/reduce, 2 reduce/reduce

and the proposed style:

    foo.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
    foo.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]

we use this style:

    foo.y: warning: conflicts: 1 shift/reduce, 2 reduce/reduce [-Wconflicts-sr]

That'll be easier to generate, easier to translate,
and easier to parse automatically.

Reply via email to