bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/3] {master} convert the conflict messages to a more bison-l


From: Paul Eggert
Subject: Re: [PATCH 0/3] {master} convert the conflict messages to a more bison-like form
Date: Sun, 23 Sep 2012 08:55:27 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

>> 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

[Prev in Thread] Current Thread [Next in Thread]