* NEWS: Bison now warns if it finds a stray $' or @' in an action.

* src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
This commit is contained in:
Paul Eggert
2005-10-13 19:38:46 +00:00
parent 7625ec2c83
commit 302c0aeeba
3 changed files with 18 additions and 2 deletions

View File

@@ -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, "@@");
}
<<EOF>> unexpected_eof (code_start, "}"); BEGIN INITIAL;
}