mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Add %define lr.keep_unreachable_states.
* NEWS (2.3a+): Mention it in the entry for unreachable state removal. * doc/bison.texinfo (Decl Summary): Mention it in the %define entry. * src/main.c (main): Implement it. * tests/conflicts.at (Unreachable States After Conflict Resolution): Extend to test it, and fix a typo.
This commit is contained in:
@@ -636,7 +636,7 @@ AT_DATA([[input.y]],
|
||||
|
||||
start: resolved_conflict 'a' reported_conflicts 'a' ;
|
||||
|
||||
/* S/R conflict resolved as shift, so the state with item
|
||||
/* S/R conflict resolved as reduce, so the state with item
|
||||
* (resolved_conflict: 'a' . unreachable1) and all it transition successors are
|
||||
* unreachable, and the associated production is useless. */
|
||||
resolved_conflict:
|
||||
@@ -812,6 +812,19 @@ state 7
|
||||
$default reduce using rule 1 (start)
|
||||
]])
|
||||
|
||||
AT_DATA([[input-keep.y]],
|
||||
[[%define lr.keep_unreachable_states
|
||||
]])
|
||||
AT_CHECK([[cat input.y >> input-keep.y]])
|
||||
|
||||
AT_CHECK([[bison input-keep.y]], 0, [],
|
||||
[[input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
|
||||
input-keep.y:22.4: warning: rule never reduced because of conflicts: unreachable1: /* empty */
|
||||
input-keep.y:26.16: warning: rule never reduced because of conflicts: unreachable2: /* empty */
|
||||
input-keep.y:32.5-7: warning: rule never reduced because of conflicts: reported_conflicts: 'a'
|
||||
input-keep.y:33.4: warning: rule never reduced because of conflicts: reported_conflicts: /* empty */
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user