mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
warnings: be less picky about occurrences of m4_/b4_ in the output
Reported by Marko Mäkelä. <https://lists.gnu.org/r/bug-bison/2021-10/msg00026.html> * src/scan-skel.l: It is ok to have foob4_ or foom4_. * tests/skeletons.at (Suspicious sequences): New.
This commit is contained in:
1
THANKS
1
THANKS
@@ -117,6 +117,7 @@ Marc Autret autret_m@epita.fr
|
|||||||
Marc Mendiola mmendiol@usc.edu
|
Marc Mendiola mmendiol@usc.edu
|
||||||
Marc Schönefeld marc.schoenefeld@gmx.org
|
Marc Schönefeld marc.schoenefeld@gmx.org
|
||||||
Mark Boyall wolfeinstein@gmail.com
|
Mark Boyall wolfeinstein@gmail.com
|
||||||
|
Marko Mäkelä marko.makela@iki.fi
|
||||||
Martin Blais blais@furius.ca
|
Martin Blais blais@furius.ca
|
||||||
Martin Jacobs martin.jacobs@arcor.de
|
Martin Jacobs martin.jacobs@arcor.de
|
||||||
Martin Mokrejs mmokrejs@natur.cuni.cz
|
Martin Mokrejs mmokrejs@natur.cuni.cz
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ static void output_mapped_file (char const *name);
|
|||||||
%}
|
%}
|
||||||
|
|
||||||
/* Identifiers of our M4 macros. */
|
/* Identifiers of our M4 macros. */
|
||||||
macro [bm]4_[a-zA-Z_0-9]*
|
macro [bm]4_[a-zA-Z_0-9]*
|
||||||
|
/* Safe sequence of word-constituent characters. */
|
||||||
|
identifier [A-Za-z_0-9]+
|
||||||
|
|
||||||
%x SC_AT_DIRECTIVE_ARGS
|
%x SC_AT_DIRECTIVE_ARGS
|
||||||
%x SC_AT_DIRECTIVE_SKIP_WS
|
%x SC_AT_DIRECTIVE_SKIP_WS
|
||||||
@@ -90,7 +92,7 @@ macro [bm]4_[a-zA-Z_0-9]*
|
|||||||
/* This pattern must not match more than the previous @ patterns. */
|
/* This pattern must not match more than the previous @ patterns. */
|
||||||
@[^@{}''(\n]* fail_for_invalid_at (yytext);
|
@[^@{}''(\n]* fail_for_invalid_at (yytext);
|
||||||
\n out_lineno++; ECHO;
|
\n out_lineno++; ECHO;
|
||||||
[^bm@\n]+ ECHO;
|
[^a-z@\n]+ ECHO;
|
||||||
|
|
||||||
/* If there are still identifiers that look like macros, such as
|
/* If there are still identifiers that look like macros, such as
|
||||||
b4_synbol, this probably an error, say a typo in M4, or
|
b4_synbol, this probably an error, say a typo in M4, or
|
||||||
@@ -104,6 +106,7 @@ macro [bm]4_[a-zA-Z_0-9]*
|
|||||||
"suspicious sequence in the output: %s", yytext);
|
"suspicious sequence in the output: %s", yytext);
|
||||||
ECHO;
|
ECHO;
|
||||||
}
|
}
|
||||||
|
{identifier} ECHO;
|
||||||
. ECHO;
|
. ECHO;
|
||||||
|
|
||||||
<INITIAL><<EOF>> {
|
<INITIAL><<EOF>> {
|
||||||
|
|||||||
@@ -324,3 +324,44 @@ AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
## ---------------------- ##
|
||||||
|
## Suspicious sequences. ##
|
||||||
|
## ---------------------- ##
|
||||||
|
|
||||||
|
AT_SETUP([[Suspicious sequences]])
|
||||||
|
|
||||||
|
AT_DATA([[skel.c]],
|
||||||
|
[[m4@&t@_include(b4_skeletonsdir/[c.m4])
|
||||||
|
m4@&t@_divert_push(0)d@&t@nl
|
||||||
|
@output(b4_parser_file_name@)d@&t@nl
|
||||||
|
]b4_user_pre_prologue[
|
||||||
|
]b4_user_post_prologue[
|
||||||
|
b4_unevaluated
|
||||||
|
m4@&t@_unevaluated
|
||||||
|
]b4_epilogue[
|
||||||
|
|
||||||
|
m4@&t@_divert_pop(0)
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_DATA([[input1.y]],
|
||||||
|
[[%skeleton "./skel.c"
|
||||||
|
%{
|
||||||
|
myb4_unevaluated
|
||||||
|
mym4_unevaluated
|
||||||
|
%}
|
||||||
|
%%
|
||||||
|
start: ;
|
||||||
|
%%
|
||||||
|
myb4_unevaluated
|
||||||
|
mym4_unevaluated
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_BISON_CHECK([[input1.y]], [], [],
|
||||||
|
[[input1.tab.c:10: warning: suspicious sequence in the output: b4_unevaluated [-Wother]
|
||||||
|
input1.tab.c:11: warning: suspicious sequence in the output: m4@&t@_unevaluated [-Wother]
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|||||||
Reference in New Issue
Block a user