diff options
author | Akim Demaille <akim@lrde.epita.fr> | 2012-09-21 17:21:01 +0200 |
---|---|---|
committer | Akim Demaille <akim@lrde.epita.fr> | 2012-09-25 20:19:41 +0200 |
commit | d87ea54cf6cc98d52356c138bd142d1b450bbc9a (patch) | |
tree | 014472f9df4709a41782ab4c95376439478c5260 /tests/existing.at | |
parent | 6c094ad0e389136b7b5c7b6eba72fbd4ec2897b6 (diff) | |
download | bison-d87ea54cf6cc98d52356c138bd142d1b450bbc9a.tar.gz |
warnings: use the regular interface for s/r and r/r conflicts
The current routines used to display s/r and r/r conflicts are both
inconvenient from the programmer point of view (they do not use the
warning infrastructure) and for the user (the messages are rather
terse, not necessarily pleasant to read, and because they don't use
the same routines, they look different).
It was due to the belief (dating back to the initial checked-in
version of Bison) that, at some point, POSIX Yacc mandated the format
for these messages. Today, the Open Group's manual page for Yacc,
<http://pubs.opengroup.org/onlinepubs/009695399/utilities/yacc.html>,
explicitly states that the format of these messages is unspecified.
See commit be7280480c175bed203883f524c7dcd6cf37c13d and
<http://lists.gnu.org/archive/html/bison-patches/2002-12/msg00027.html>.
For a discussion on the chosen warning format, see
http://lists.gnu.org/archive/html/bison-patches/2012-09/msg00039.html
In an effort to factor the handling of errors and warnings, use the
Bison warning routines to report these messages.
* src/conflicts.c (conflicts_print): Rewrite with clearer sections
about S/R and then R/R conflicts.
(conflict_report): Remove, inlined in its sole
caller...
(conflicts_output): here.
* tests/conflicts.at, tests/existing.at, tests/glr-regression.at,
* tests/reduce.at, tests/regression.at: Adjust the expected results.
* NEWS: Update.
Diffstat (limited to 'tests/existing.at')
-rw-r--r-- | tests/existing.at | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/existing.at b/tests/existing.at index f62430c0..d5cb39d1 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -424,8 +424,8 @@ dnl don't like even `print $!4;'. dnl BISON-STDERR [AT_COND_CASE([[canonical LR]], -[[input.y: conflicts: 265 shift/reduce]], -[[input.y: conflicts: 65 shift/reduce]])[ +[[input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]]], +[[input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]]])[ ]], dnl LAST-STATE @@ -1365,8 +1365,10 @@ dnl INPUT dnl BISON-STDERR [AT_COND_CASE([[canonical LR]], -[[input.y: conflicts: 1876 shift/reduce, 144 reduce/reduce]], -[[input.y: conflicts: 78 shift/reduce, 10 reduce/reduce]])[ +[[input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]]], +[[input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] +input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]]])[ ]], dnl LAST-STATE |