X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/be7280480c175bed203883f524c7dcd6cf37c13d..6175ffe3211dad578ce6585584c4eb85cf891830:/src/conflicts.c diff --git a/src/conflicts.c b/src/conflicts.c index 721627f2..fe1f6f9f 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -1,6 +1,6 @@ /* Find and resolve or report look-ahead conflicts for bison, - Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002 + Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -237,9 +237,12 @@ resolve_sr_conflict (state *s, int ruleno, symbol **errors) } } - /* Some tokens have been explicitly made errors. Allocate a - permanent errs structure for this state, to record them. */ - state_errs_set (s, nerrs, errors); + if (nerrs) + { + /* Some tokens have been explicitly made errors. Allocate a + permanent errs structure for this state, to record them. */ + state_errs_set (s, nerrs, errors); + } if (obstack_object_size (&solved_conflicts_obstack)) { @@ -277,10 +280,7 @@ set_conflicts (state *s, symbol **errors) for (i = 0; i < reds->num; ++i) if (reds->rules[i]->prec && reds->rules[i]->prec->prec && !bitset_disjoint_p (reds->lookaheads[i], lookaheadset)) - { - resolve_sr_conflict (s, i, errors); - break; - } + resolve_sr_conflict (s, i, errors); /* Loop over all rules which require lookahead in this state. Check for conflicts not resolved above. */ @@ -495,12 +495,12 @@ conflicts_print (void) if (expected_conflicts != -1) { if (! src_ok) - complain (ngettext ("expected %d shift/reduce conflict", - "expected %d shift/reduce conflicts", - expected_conflicts), - expected_conflicts); + warn (ngettext ("expected %d shift/reduce conflict", + "expected %d shift/reduce conflicts", + expected_conflicts), + expected_conflicts); if (rrc_total) - complain (_("expected 0 reduce/reduce conflicts")); + warn (_("expected 0 reduce/reduce conflicts")); } }