From: Akim Demaille Date: Sat, 29 Dec 2001 14:27:01 +0000 (+0000) Subject: * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the X-Git-Tag: before-m4-back-end~47 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/d99361e65736d5eb8458030495c5a5f89e117052 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the user prologue. These are defaults. * tests/actions.at (Mid-rule actions): Make sure the user can define YYDEBUG and YYERROR_VERBOSE. --- diff --git a/ChangeLog b/ChangeLog index 5a9f6f99..d8074bed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-12-29 Akim Demaille + + * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the + user prologue. These are defaults. + * tests/actions.at (Mid-rule actions): Make sure the user can + define YYDEBUG and YYERROR_VERBOSE. + + 2001-12-29 Akim Demaille * src/output.c (header_output): Don't forget to export YYLTYPE and diff --git a/src/bison.simple b/src/bison.simple index 033d7268..3c58fc92 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -40,19 +40,6 @@ /* Using locations. */ #define YYLSP_NEEDED %%locations-flag -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG %%debug -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE %%error-verbose -#endif - /* If name_prefix is specify substitute the variables and functions names. */ #define yyparse %%prefix##parse @@ -66,6 +53,19 @@ /* Copy the user declarations. */ %%prologue +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG %%debug +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE %%error-verbose +#endif + #ifndef YYSTYPE typedef %%stype yystype; # define YYSTYPE yystype diff --git a/tests/actions.at b/tests/actions.at index 79dee6fb..e3d4ba29 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -31,10 +31,12 @@ AT_SETUP([Mid-rule actions]) AT_DATA([[input.y]], [[%{ -#include -#include -static void yyerror (const char *msg); -static int yylex (void); +# include +# include + static void yyerror (const char *msg); + static int yylex (void); +# define YYDEBUG 1 +# define YYERROR_VERBOSE 1 %} %% exp: { putchar ('0'); }