From c95d0dd5f54b98825e4cfe00a807db78a073e376 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 6 Nov 2021 19:24:04 +0100 Subject: warnings: be less picky about occurrences of m4_/b4_ in the output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Marko Mäkelä. * src/scan-skel.l: It is ok to have foob4_ or foom4_. * tests/skeletons.at (Suspicious sequences): New. --- src/scan-skel.l | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/scan-skel.l') diff --git a/src/scan-skel.l b/src/scan-skel.l index 60232a2e..5a93ce03 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -54,7 +54,9 @@ static void output_mapped_file (char const *name); %} /* 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_SKIP_WS @@ -90,7 +92,7 @@ macro [bm]4_[a-zA-Z_0-9]* /* This pattern must not match more than the previous @ patterns. */ @[^@{}''(\n]* fail_for_invalid_at (yytext); \n out_lineno++; ECHO; -[^bm@\n]+ ECHO; +[^a-z@\n]+ ECHO; /* If there are still identifiers that look like macros, such as 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); ECHO; } +{identifier} ECHO; . ECHO; <> { -- cgit v1.2.1