Normalize conflict related messages.

* src/complain.h, src/complain.c (warn, complain): New.
* src/conflicts.c (conflicts_print): Use them.
(conflict_report_yacc): New, extracted from...
(conflicts_print): here.
* tests/conflicts.at, tests/existing.at: Adjust.
This commit is contained in:
Akim Demaille
2002-07-30 11:09:59 +00:00
parent e8832397ea
commit 52489d4445
6 changed files with 115 additions and 36 deletions

View File

@@ -142,7 +142,7 @@ exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c --report=all], 0, [],
[input.y contains 1 shift/reduce conflict.
[input.y: warning: 1 shift/reduce conflict
])
# Check the contents of the report.
@@ -371,7 +371,7 @@ id : '0';
]])
AT_CHECK([bison input.y -o input.c --report=all], 0, [],
[[input.y contains 1 reduce/reduce conflict.
[[input.y: warning: 1 reduce/reduce conflict
input.y:4.4-8: warning: rule never reduced because of conflicts: id: '0'
]])
@@ -483,8 +483,8 @@ exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c], 1, [],
[input.y contains 1 shift/reduce conflict.
expected 0 shift/reduce conflicts
[input.y: warning: 1 shift/reduce conflict
input.y: expected 0 shift/reduce conflicts
])
AT_CLEANUP
@@ -520,7 +520,7 @@ exp: exp OP exp | NUM;
]])
AT_CHECK([bison input.y -o input.c], 1, [],
[input.y contains 1 shift/reduce conflict.
expected 2 shift/reduce conflicts
[input.y: warning: 1 shift/reduce conflict
input.y: expected 2 shift/reduce conflicts
])
AT_CLEANUP

View File

@@ -1191,7 +1191,7 @@ ARGUMENT_LIST : EXPRESSION { mout(MENDSEP);
# don't actually check the output. But SEGV is watching us, and
# so might do dmalloc.
AT_CHECK([[bison --verbose --defines input.y]], 0, [],
[[input.y contains 78 shift/reduce conflicts and 10 reduce/reduce conflicts.
[[input.y: warning: 78 shift/reduce conflicts and 10 reduce/reduce conflicts
]])
AT_CHECK([[grep '^State.*contains' input.output]], 0,