From 51576fb3c661cec97bb58e503351e7ad75053f6d Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 15 Dec 2001 11:09:05 +0000 Subject: [PATCH] * src/reader.c (copy_action): When --yacc, don't append a `;' to the user action: let it fail if lacking. Suggested by Aharon Robbins and Tom Tromey. --- ChangeLog | 6 ++++++ THANKS | 2 ++ src/reader.c | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8a080141..d1f758fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-12-15 Akim Demaille + + * src/reader.c (copy_action): When --yacc, don't append a `;' + to the user action: let it fail if lacking. + Suggested by Aharon Robbins and Tom Tromey. + 2001-12-14 Akim Demaille * src/lex.c (literalchar): Simply return the char you decoded, non diff --git a/THANKS b/THANKS index e0ae913f..195a0463 100644 --- a/THANKS +++ b/THANKS @@ -2,6 +2,7 @@ Bison was originally written by Robert Corbett. It would not be what it is today without the invaluable help of these people: Airy Andre Airy.Andre@edf.fr +Aharon Robbins arnold@gnu.org Akim Demaille akim@freefriends.org Albert Chin-A-Young china@thewrittenword.com Alexander Belopolsky alexb@rentec.com @@ -28,6 +29,7 @@ Richard Stallman rms@gnu.org Robert Anisko anisko_r@epita.fr Shura debil_urod@ngs.ru Tom Lane tgl@sss.pgh.pa.us +Tom Tromey tromey@cygnus.com Wolfram Wagner ww@mpi-sb.mpg.de Wwp subscript@free.fr diff --git a/src/reader.c b/src/reader.c index 53b8b3de..cfcab068 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1198,7 +1198,13 @@ copy_action (symbol_list *rule, int stack_offset) } } - obstack_sgrow (&action_obstack, ";\n break;}"); + /* As a Bison extension, add the ending semicolon. Since some Yacc + don't do that, help people using bison as a Yacc finding their + missing semicolons. */ + if (yacc_flag) + obstack_sgrow (&action_obstack, "}\n break;"); + else + obstack_sgrow (&action_obstack, ";\n break;}"); } /*-------------------------------------------------------------------. -- 2.45.2