mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
%expect-rr: fix the computation of the overall number of conflicts
On a grammar such as
exp: "num" | "num" | "num"
we currently report only one RR conflict, instead of two.
This bug is present since the origins of Bison
commit 08089d5d35
Author: David MacKenzie <djm@djmnet.org>
Date: Tue Apr 20 05:42:52 1993 +0000
Initial revision
and was preserved in
commit 676385e29c
Author: Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
Date: Fri Jun 28 02:26:44 2002 +0000
Initial check-in introducing experimental GLR parsing. See entry in
ChangeLog dated 2002-06-27 from Paul Hilfinger for details.
See
https://lists.gnu.org/archive/html/bison-patches/2018-11/msg00011.html
* src/conflicts.h, src/conflicts.c (count_state_rr_conflicts)
(count_rr_conflicts): Use only the correct count of conflicts.
* tests/glr-regression.at: Fix expectations.
This commit is contained in:
@@ -342,7 +342,7 @@ AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_BISON_CHECK([[-o glr-regr3.c -rall glr-regr3.y]], 0, [],
|
||||
[[glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
|
||||
glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
glr-regr3.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
|
||||
]])
|
||||
AT_COMPILE([glr-regr3])
|
||||
|
||||
@@ -437,7 +437,7 @@ merge (YYSTYPE s1, YYSTYPE s2)
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_BISON_CHECK([[-o glr-regr4.c -rall glr-regr4.y]], 0, [],
|
||||
[[glr-regr4.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
[[glr-regr4.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
|
||||
]])
|
||||
AT_COMPILE([glr-regr4])
|
||||
|
||||
@@ -799,7 +799,7 @@ main (void)
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_BISON_CHECK([[-o glr-regr9.c -rall glr-regr9.y]], 0, [],
|
||||
[[glr-regr9.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
|
||||
[[glr-regr9.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
|
||||
]])
|
||||
AT_COMPILE([glr-regr9])
|
||||
|
||||
@@ -1363,7 +1363,7 @@ main (void)
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_BISON_CHECK([[-o glr-regr14.c -rall glr-regr14.y]], 0, [],
|
||||
[[glr-regr14.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
|
||||
[[glr-regr14.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
|
||||
]])
|
||||
AT_COMPILE([glr-regr14])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user