diff options
author | Joel E. Denny <jdenny@ces.clemson.edu> | 2008-07-16 02:56:36 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny@ces.clemson.edu> | 2008-07-16 02:56:36 -0400 |
commit | bcf07cb7070fab57727b274486dc7a331ff8ac2d (patch) | |
tree | 694ffb6a394e77775c2e0d09b2c74391579929c8 /src/reduce.c | |
parent | 9aacab9ae9a16465284768f4014dc08b26819180 (diff) | |
download | bison-bcf07cb7070fab57727b274486dc7a331ff8ac2d.tar.gz |
Fix untranslatable composition of sentences.
Reported by Goran Uddeborg at
<http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
* THANKS (Goran Uddeborg): Add.
* src/reduce.c (reduce_print): Report the number of nonterminals and
rules useless in the grammar in separate sentences.
* tests/reduce.at (Useless Rules): Update output.
(Reduced Automaton): Likewise.
(Underivable Rules): Likewise.
(Empty Language): Likewise.
Diffstat (limited to 'src/reduce.c')
-rw-r--r-- | src/reduce.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/reduce.c b/src/reduce.c index 1306374a..1f8fc347 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -382,26 +382,24 @@ reduce_output (FILE *out) static void reduce_print (void) { - fprintf (stderr, "%s: %s: ", grammar_file, _("warning")); - if (nuseless_nonterminals > 0) - fprintf (stderr, ngettext ("%d nonterminal", - "%d nonterminals", - nuseless_nonterminals), - nuseless_nonterminals); - - if (nuseless_nonterminals > 0 && nuseless_productions > 0) - fprintf (stderr, _(" and ")); - + { + fprintf (stderr, "%s: %s: ", grammar_file, _("warning")); + fprintf (stderr, ngettext ("%d nonterminal useless in grammar", + "%d nonterminals useless in grammar", + nuseless_nonterminals), + nuseless_nonterminals); + fprintf (stderr, "\n"); + } if (nuseless_productions > 0) - fprintf (stderr, ngettext ("%d rule", - "%d rules", - nuseless_productions), - nuseless_productions); - - if (nuseless_nonterminals > 0 || nuseless_productions > 0) - fprintf (stderr, _(" useless in grammar")); - fprintf (stderr, "\n"); + { + fprintf (stderr, "%s: %s: ", grammar_file, _("warning")); + fprintf (stderr, ngettext ("%d rule useless in grammar", + "%d rules useless in grammar", + nuseless_productions), + nuseless_productions); + fprintf (stderr, "\n"); + } } void |