From: Paul Eggert Date: Thu, 13 Oct 2005 19:38:46 +0000 (+0000) Subject: * NEWS: Bison now warns if it finds a stray `$' or `@' in an action. X-Git-Tag: v2.3b~592 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/302c0aeeba0264be6031b48540ae4f2108a3d799 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action. * src/scan-gram.l ([$@]): Implement this. --- diff --git a/ChangeLog b/ChangeLog index ace626ad..80bd02c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ +2005-10-13 Paul Eggert + + * NEWS: Bison now warns if it finds a stray `$' or `@' in an action. + * src/scan-gram.l ([$@]): Implement this. + 2005-10-13 Akim Demaille * src/scan-skel.l: Output the base name parts of the parser and header file names. - * tests/output.at (AT_CHECK_OUTPUT): Support subdirectorioes, and + * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and additional checks. Use this to exercise C++ outputs in subdirs. Reported by Oleg Smolsky. diff --git a/NEWS b/NEWS index 90cc3471..2ab95345 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ Bison News Changes in version 2.1a: -* DJGPP support added. +* Bison now warns if it finds a stray `$' or `@' in an action. * %require "VERSION" To specify that the grammar file depends on features implemented in @@ -23,6 +23,8 @@ Changes in version 2.1a: If you wish to update, then make sure older version of Bison will fail using `%require "2.1a"'. +* DJGPP support added. + Changes in version 2.1, 2005-09-16: * Bison-generated parsers now support the translation of diagnostics like diff --git a/src/scan-gram.l b/src/scan-gram.l index 70d56ee9..3c7d37c4 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -618,6 +618,15 @@ splice (\\[ \f\t\v]*\n)* "$"("<"{tag}">")?(-?[0-9]+|"$") handle_dollar (token_type, yytext, *loc); "@"(-?[0-9]+|"$") handle_at (token_type, yytext, *loc); + "$" { + warn_at (*loc, _("stray `$'")); + obstack_sgrow (&obstack_for_string, "$]["); + } + "@" { + warn_at (*loc, _("stray `@'")); + obstack_sgrow (&obstack_for_string, "@@"); + } + <> unexpected_eof (code_start, "}"); BEGIN INITIAL; }