mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
tests: support api.prefix.
* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Define AT_API_PREFIX. (AT_YYERROR_DEFINE, AT_YYERROR_DECLARE_EXTERN, AT_YYLEX_DECLARE_EXTERN) (AT_YYLEX_DEFINE): Use it. * tests/input.at, tests/regression.at, tests/torture.at: Add AT_BISON_OPTION_PUSHDEFS/POPDEFS.
This commit is contained in:
@@ -391,7 +391,7 @@ AT_CLEANUP
|
||||
|
||||
AT_SETUP([Torturing the Scanner])
|
||||
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA([input.y], [])
|
||||
AT_BISON_CHECK([input.y], [1], [],
|
||||
[[input.y:1.1: syntax error, unexpected end of file
|
||||
@@ -501,7 +501,7 @@ value_as_yystype (value val)
|
||||
res.ival = val;
|
||||
return res;
|
||||
}
|
||||
|
||||
]AT_YYERROR_DEFINE[
|
||||
static int
|
||||
yylex (void)
|
||||
{
|
||||
@@ -514,15 +514,9 @@ yylex (void)
|
||||
yylval = value_as_yystype (input[toknum]);
|
||||
return input[toknum++];
|
||||
}
|
||||
|
||||
static void
|
||||
yyerror (const char *msg)
|
||||
{
|
||||
fprintf (stderr, "%s\n", msg);
|
||||
}
|
||||
]])
|
||||
|
||||
# Pacify Emacs'font-lock-mode: "
|
||||
# Pacify Emacs' font-lock-mode: "
|
||||
|
||||
AT_DATA([main.c],
|
||||
[[typedef int value;
|
||||
@@ -536,6 +530,7 @@ main (void)
|
||||
return yyparse ();
|
||||
}
|
||||
]])
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
|
||||
AT_BISON_CHECK([-d -v -o input.c input.y])
|
||||
AT_COMPILE([input.o], [-c input.c])
|
||||
|
||||
Reference in New Issue
Block a user