%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:
Akim Demaille
2018-11-08 21:46:16 +01:00
parent 260ae5481c
commit ad0b4661d1
4 changed files with 33 additions and 23 deletions

View File

@@ -44,4 +44,5 @@ void conflicts_free (void);
/* Were there conflicts? */
extern int expected_sr_conflicts;
extern int expected_rr_conflicts;
#endif /* !CONFLICTS_H_ */