mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
tests: factor the declaration/definition of yyerror and yylex.
* tests/local.at (AT_YYERROR_DECLARE, AT_YYERROR_DECLARE_EXTERN) (AT_YYERROR_DEFINE, AT_YYLEX_DECLARE, AT_YYLEX_DECLARE_EXTERN) (AT_YYLEX_DEFINE): New. Must be used inside AT_BISON_OPTION_PUSHDEFS/POPDEFS pair. * tests/actions.at, tests/conflicts.at, tests/glr-regression.at, * tests/headers.at, tests/input.at, tests/named-refs.at, * tests/regression.at, tests/skeletons.at, tests/synclines.at, * tests/torture.at: Use them.
This commit is contained in:
@@ -83,10 +83,11 @@ AT_CLEANUP
|
||||
|
||||
AT_SETUP([[Installed skeleton file names]])
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
m4_pushdef([AT_GRAM],
|
||||
[[%{
|
||||
#include <stdio.h>
|
||||
void yyerror (char const *msg);
|
||||
]AT_YYERROR_DECLARE[
|
||||
int yylex (void);
|
||||
%}
|
||||
|
||||
@@ -99,12 +100,7 @@ start: ;
|
||||
|
||||
%%
|
||||
|
||||
void
|
||||
yyerror (char const *msg)
|
||||
{
|
||||
fprintf (stderr, "%s\n", msg);
|
||||
}
|
||||
|
||||
]AT_YYERROR_DEFINE[
|
||||
int
|
||||
yylex (void)
|
||||
{
|
||||
@@ -139,6 +135,7 @@ AT_PARSER_CHECK([[./input-gram]], [[1]], [],
|
||||
|
||||
m4_popdef([AT_GRAM])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user