From 55d1006fcedde7a816290dfcd7cb84fa227ae560 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 25 Jun 2012 10:15:44 +0200 Subject: [PATCH 1/8] yacc: work around the ylwrap limitation. * data/yacc.c (b4_shared_declarations): Include the header guards. Do not include the header in the *.c file, duplicate it. * NEWS (Future Changes): Extend, and announce the forthcoming change about the use of the parser header. --- NEWS | 32 +++++++++++++++++++++++--------- data/yacc.c | 15 +++++++++------ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index 72e4b6b3..10829f54 100644 --- a/NEWS +++ b/NEWS @@ -2,19 +2,33 @@ GNU Bison NEWS * Noteworthy changes in release ?.? (????-??-??) [?] -** Future changes: +** Future changes - The next major release will drop support for generating parsers in K&R C, - and remove the definitions of yystype and yyltype (removal announced since - Bison 1.875). YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in - favor of %parse-param and %lex-param (introduced in Bison 1.875 too), will - no longer be supported. + The next major release of Bison will drop support for the following + deprecated features. Please report disagreements to bug-bison@gnu.org. -** The generated header is included (yacc.c) +*** K&C parsers + + Support for generating parsers in K&R C will be removed. Parsers + generated for C supprt ISO C90, and are tested with ISO C99 and ISO C11 + compilers. + +*** Deprecated features + + The definitions of yystype and yyltype will be removed, as announced since + Bison 1.875. Use YYSTYPE and YYLTYPE only. + + YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in favor of + %parse-param and %lex-param (introduced in Bison 1.875), will no longer be + supported. + +*** The generated header will be included (yacc.c) Instead of duplicating the content of the generated header (definition of - YYSTYPE, yyltype etc.), the generated parser now includes it, as was - already the case for GLR or C++ parsers. + YYSTYPE, yyparse declaration etc.), the generated parser will include it, + as is already the case for GLR or C++ parsers. This change is deferred + because existing versions of ylwrap (e.g., Automake 1.12.1) do not support + it. ** Headers (yacc.c, glr.c, glr.cc) diff --git a/data/yacc.c b/data/yacc.c index 400c68ce..57f3dace 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -227,6 +227,8 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[ # b4_declare_yyparse_push_ # ------------------------ +# Declaration of yyparse (and dependencies) when using the push parser +# (including in pull mode). m4_define([b4_declare_yyparse_push_], [[typedef struct ]b4_prefix[pstate ]b4_prefix[pstate; enum { YYPUSH_MORE = 4 }; @@ -272,12 +274,14 @@ m4_define([b4_declare_yyparse], # Declaration that might either go into the header (if --defines) # or open coded in the parser body. m4_define([b4_shared_declarations], -[b4_declare_yydebug[ +[b4_cpp_guard_open([b4_spec_defines_file])[ +]b4_declare_yydebug[ ]b4_percent_code_get([[requires]])[ ]b4_token_enums_defines(b4_tokens)[ ]b4_declare_yylstype[ ]b4_declare_yyparse[ -]b4_percent_code_get([[provides]])[]dnl +]b4_percent_code_get([[provides]])[ +]b4_cpp_guard_close([b4_spec_defines_file])[]dnl ]) ## -------------- ## @@ -337,8 +341,9 @@ m4_if(b4_prefix, [yy], [], # define YYTOKEN_TABLE ]b4_token_table[ #endif -]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]], - [b4_shared_declarations])[ +/* In a future release of Bison, this section will be replaced + by #include "@basename(]b4_spec_defines_file[@)". */ +]b4_shared_declarations[ /* Copy the second part of user declarations. */ ]b4_user_post_prologue @@ -2065,8 +2070,6 @@ b4_defines_if( b4_copyright([Bison interface for Yacc-like parsers in C], [1984, 1989-1990, 2000-2012])[ -]b4_cpp_guard_open([b4_spec_defines_file])[ ]b4_shared_declarations[ -]b4_cpp_guard_close([b4_spec_defines_file])[ ]])dnl b4_defines_if m4_divert_pop(0) From 5e01579ec04624d7d32b48cfc7d598d3d0e234df Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 09:37:27 +0200 Subject: [PATCH 2/8] maint: gitignores. --- build-aux/snippet/.gitignore | 4 ++++ lib/glthread/.gitignore | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 build-aux/snippet/.gitignore create mode 100644 lib/glthread/.gitignore diff --git a/build-aux/snippet/.gitignore b/build-aux/snippet/.gitignore new file mode 100644 index 00000000..2a3a2f91 --- /dev/null +++ b/build-aux/snippet/.gitignore @@ -0,0 +1,4 @@ +/_Noreturn.h +/arg-nonnull.h +/c++defs.h +/warn-on-use.h diff --git a/lib/glthread/.gitignore b/lib/glthread/.gitignore new file mode 100644 index 00000000..e0605e15 --- /dev/null +++ b/lib/glthread/.gitignore @@ -0,0 +1,3 @@ +/lock.c +/lock.h +/threadlib.c From 837b769659378e356f2f1ff4814e05c4e5300676 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 09:35:31 +0200 Subject: [PATCH 3/8] tests: fix confusion between api.prefix and name-prefix. * tests/local.at (AT_NAME_PREFIX): Take api.prefix into account. (AT_API_PREFIX): Rename as... (AT_API_prefix): this. Do not take %name-prefix into account. Fix misuses. --- tests/local.at | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/local.at b/tests/local.at index b0e4ee1a..85507a39 100644 --- a/tests/local.at +++ b/tests/local.at @@ -137,13 +137,13 @@ m4_pushdef([AT_PURE_AND_LOC_IF], m4_pushdef([AT_GLR_OR_PARAM_IF], [m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])]) m4_pushdef([AT_NAME_PREFIX], -[m4_bmatch([$3], [%name-prefix ".*"], - [m4_bregexp([$3], [%name-prefix "\([^""]*\)"], [\1])], - [yy])]) -m4_pushdef([AT_API_PREFIX], [m4_bmatch([$3], [\(%define api\.prefix\|%name-prefix\) ".*"], [m4_bregexp([$3], [\(%define api\.prefix\|%name-prefix\) "\([^""]*\)"], [\2])], [yy])]) +m4_pushdef([AT_API_prefix], +[m4_bmatch([$3], [%define api\.prefix ".*"], + [m4_bregexp([$3], [%define api\.prefix "\([^""]*\)"], [\1])], + [yy])]) # yyerror receives the location if %location & %pure & (%glr or %parse-param). m4_pushdef([AT_YYERROR_ARG_LOC_IF], [AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])], @@ -209,7 +209,7 @@ m4_popdef([AT_LOC]) m4_popdef([AT_PURE_LEX_IF]) m4_popdef([AT_YYERROR_SEES_LOC_IF]) m4_popdef([AT_YYERROR_ARG_LOC_IF]) -m4_popdef([AT_API_PREFIX]) +m4_popdef([AT_API_prefix]) m4_popdef([AT_NAME_PREFIX]) m4_popdef([AT_GLR_OR_PARAM_IF]) m4_popdef([AT_PURE_AND_LOC_IF]) @@ -282,7 +282,7 @@ $2]) # AT_YYLEX_DEFINE(INPUT-STRING, [ACTION]) # --------------------------------------- m4_define([AT_YYLEX_PROTOTYPE], -[int AT_API_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl +[int AT_NAME_PREFIX[]lex (]AT_YYLEX_FORMALS[)[]dnl ]) m4_define([AT_YYLEX_DECLARE_EXTERN], @@ -305,8 +305,8 @@ static abort (); res = input[toknum++]; ]$2;[]AT_LOCATION_IF([[ - ]AT_API_PREFIX[lloc.first_line = ]AT_API_PREFIX[lloc.last_line = 1; - ]AT_API_PREFIX[lloc.first_column = ]AT_API_PREFIX[lloc.last_column = toknum;]])[ + ]AT_NAME_PREFIX[lloc.first_line = ]AT_NAME_PREFIX[lloc.last_line = 1; + ]AT_NAME_PREFIX[lloc.first_column = ]AT_NAME_PREFIX[lloc.last_column = toknum;]])[ return res; }]dnl ]) @@ -324,7 +324,7 @@ m4_define([AT_YYERROR_FORMALS], m4_define([AT_YYERROR_PROTOTYPE], [m4_case(AT_LANG, -[c], [[void ]AT_API_PREFIX[error (]AT_YYERROR_FORMALS[)]])[]dnl +[c], [[void ]AT_NAME_PREFIX[error (]AT_YYERROR_FORMALS[)]])[]dnl ]) m4_define([AT_YYERROR_DECLARE_EXTERN], From 91ce0b3a66b75bb5b66f48a5a3cf59f3be08c0a8 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 25 Jun 2012 16:37:18 +0200 Subject: [PATCH 4/8] tests: generalize the compilation macros. * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): If OUTPUT ends with ".o", then append the "natural" extension for the input file (.c or .cc). If there is no source, pass -c. * tests/headers.at, tests/input.at, tests/regression.at: Adjust. --- tests/headers.at | 4 ++-- tests/input.at | 6 +++--- tests/local.at | 37 +++++++++++++++++++++++++++++-------- tests/regression.at | 10 +++++----- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/tests/headers.at b/tests/headers.at index a28f2e1b..549d62dc 100644 --- a/tests/headers.at +++ b/tests/headers.at @@ -111,8 +111,8 @@ main (void) # Link and execute, just to make sure everything is fine (and in # particular, that MY_LLOC is indeed defined somewhere). -AT_COMPILE([caller.o], [-c caller.c]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([caller.o]) +AT_COMPILE([input.o]) AT_COMPILE([caller], [caller.o input.o]) AT_PARSER_CHECK([./caller]) diff --git a/tests/input.at b/tests/input.at index 2f667d0a..6d8d552c 100644 --- a/tests/input.at +++ b/tests/input.at @@ -533,8 +533,8 @@ main (void) AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-d -v -o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) -AT_COMPILE([main.o], [-c main.c]) +AT_COMPILE([input.o]) +AT_COMPILE([main.o]) AT_COMPILE([input], [input.o main.o]) AT_PARSER_CHECK([./input], 0, [[[@<:@], @@ -654,7 +654,7 @@ input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash AT_BISON_CHECK([-o input.c input.y]) # Make sure we don't export silly token identifiers with periods or dashes. -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) # Periods are genuine letters, they can start identifiers. diff --git a/tests/local.at b/tests/local.at index 85507a39..1646a5e6 100644 --- a/tests/local.at +++ b/tests/local.at @@ -537,21 +537,37 @@ m4_define([AT_QUELL_VALGRIND], # AT_COMPILE(OUTPUT, [SOURCES = OUTPUT.c]) # ---------------------------------------- -# Compile SOURCES into OUTPUT. If OUTPUT does not contain '.', -# assume that we are linking too; this is a hack. +# Compile SOURCES into OUTPUT. +# +# If OUTPUT does not contain '.', assume that we are linking too, +# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT +# with trailing .o removed, and ".c" appended. m4_define([AT_COMPILE], -[AT_CHECK([$CC $CFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.c])[]m4_bmatch([$1], [[.]], [], [ $LIBS])], +[AT_CHECK(m4_join([ ], + [$CC $CFLAGS $CPPFLAGS], + [m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])], + [-o $1], + [m4_default([$2], [m4_bpatsubst([$1], [\.o$]).c])], + [m4_bmatch([$1], [[.]], [], [$LIBS])]), 0, [ignore], [ignore])]) # AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc]) -# -------------------------------------------- -# Compile SOURCES into OUTPUT. If OUTPUT does not contain '.', -# assume that we are linking too; this is a hack. -# If the C++ compiler does not work, ignore the test. +# --------------------------------------------- +# Compile SOURCES into OUTPUT. If the C++ compiler does not work, +# ignore the test. +# +# If OUTPUT does not contain '.', assume that we are linking too, +# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT +# with trailing .o removed, and ".cc" appended. m4_define([AT_COMPILE_CXX], [AT_KEYWORDS(c++) AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore) -AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.cc])[]m4_bmatch([$1], [[.]], [], [ $LIBS])], +AT_CHECK(m4_join([ ], + [$CXX $CXXFLAGS $CPPFLAGS], + [m4_bmatch([$1], [[.]], [-c], [$LDFLAGS])], + [-o $1], + [m4_default([$2], [m4_bpatsubst([$1], [\.o$]).cc])], + [m4_bmatch([$1], [[.]], [], [$LIBS])]), 0, [ignore], [ignore])]) # AT_JAVA_COMPILE(SOURCES) @@ -566,6 +582,11 @@ AT_CHECK([[$SHELL ../../../javacomp.sh ]$1], # AT_LANG_COMPILE(OUTPUT, [SOURCES = OUTPUT.c] # -------------------------------------------- +# Compile SOURCES into OUTPUT. Skip if compiler does not work. +# +# If OUTPUT does not contain '.', assume that we are linking too, +# otherwise pass "-c"; this is a hack. The default SOURCES is OUTPUT +# with trailing .o removed, and ".c"/".cc" appended. m4_define([AT_LANG_COMPILE], [m4_case(AT_LANG, [c], [AT_COMPILE([$1], [$2])], diff --git a/tests/regression.at b/tests/regression.at index 5c1ad32b..4208153a 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -41,7 +41,7 @@ program: 'x'; AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) AT_COMPILE([input.o], [-DYYDEBUG -c input.c]) AT_CLEANUP @@ -71,7 +71,7 @@ program: { $$ = ""; }; AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) AT_CLEANUP @@ -111,7 +111,7 @@ exp: MY_TOKEN; AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-y -o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) AT_CLEANUP @@ -156,7 +156,7 @@ exp: MY_TOKEN; AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) AT_CLEANUP @@ -527,7 +527,7 @@ exp: AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([-o input.c input.y]) -AT_COMPILE([input.o], [-c input.c]) +AT_COMPILE([input.o]) AT_CLEANUP From 0e16927b48c881317a38132923b6f3150802a7d3 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 10:09:10 +0200 Subject: [PATCH 5/8] tests: improve the generic yylex implementation. * tests/local.at (AT_YYSTYPE, AT_YYLTYPE): New. (AT_YYLEX_FORMALS): Use them. (AT_YYLEX_DEFINE): Be independent of the location implementation. --- tests/local.at | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/local.at b/tests/local.at index 1646a5e6..c1fcd60f 100644 --- a/tests/local.at +++ b/tests/local.at @@ -162,11 +162,19 @@ m4_pushdef([AT_PURE_LEX_IF], [AT_PURE_IF([$1], [AT_SKEL_CC_IF([$1], [$2])])]) +m4_pushdef([AT_YYSTYPE], +[AT_SKEL_CC_IF([AT_NAME_PREFIX[::parser::semantic_type]], + [[YYSTYPE]])]) +m4_pushdef([AT_YYLTYPE], +[AT_SKEL_CC_IF([AT_NAME_PREFIX[::parser::location_type]], + [[YYLTYPE]])]) + + AT_PURE_LEX_IF( [m4_pushdef([AT_LOC], [(*llocp)]) m4_pushdef([AT_VAL], [(*lvalp)]) m4_pushdef([AT_YYLEX_FORMALS], - [YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])]) + [AT_YYSTYPE *lvalp[]AT_LOCATION_IF([, AT_YYLTYPE *llocp])]) m4_pushdef([AT_YYLEX_ARGS], [lvalp[]AT_LOCATION_IF([, llocp])]) m4_pushdef([AT_USE_LEX_ARGS], @@ -204,6 +212,8 @@ m4_popdef([AT_YYLEX_PRE_FORMALS]) m4_popdef([AT_USE_LEX_ARGS]) m4_popdef([AT_YYLEX_ARGS]) m4_popdef([AT_YYLEX_FORMALS]) +m4_popdef([AT_YYLTYPE]) +m4_popdef([AT_YYSTYPE]) m4_popdef([AT_VAL]) m4_popdef([AT_LOC]) m4_popdef([AT_PURE_LEX_IF]) @@ -301,12 +311,13 @@ static static char const input[] = "$1"; static size_t toknum = 0; int res; + ]AT_USE_LEX_ARGS[; if (! (toknum < sizeof input)) abort (); res = input[toknum++]; - ]$2;[]AT_LOCATION_IF([[ - ]AT_NAME_PREFIX[lloc.first_line = ]AT_NAME_PREFIX[lloc.last_line = 1; - ]AT_NAME_PREFIX[lloc.first_column = ]AT_NAME_PREFIX[lloc.last_column = toknum;]])[ + ]$2[;]AT_LOCATION_IF([[ + ]AT_LOC_FIRST_LINE[ = ]AT_LOC_LAST_LINE[ = 1; + ]AT_LOC_FIRST_COLUMN[ = ]AT_LOC_LAST_COLUMN[ = toknum;]])[ return res; }]dnl ]) From 77519a7d18266500754693b5e9e4b89608d6ed2c Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 10:20:35 +0200 Subject: [PATCH 6/8] tests: use assert instead of plain abort. * tests/actions.at, tests/calc.at, tests/conflicts.at, * tests/cxx-type.at, tests/glr-regression.at, tests/input.at, * tests/named-refs.at, tests/regression.at, tests/torture.at, * tests/local.at: Prefer assert to abort. --- tests/actions.at | 3 +-- tests/calc.at | 8 +++----- tests/conflicts.at | 4 ++-- tests/cxx-type.at | 10 ++++------ tests/glr-regression.at | 35 +++++++++++++++++------------------ tests/input.at | 4 ++-- tests/local.at | 5 ++--- tests/named-refs.at | 6 ++---- tests/regression.at | 8 ++++---- tests/torture.at | 30 ++++++++++++++---------------- 10 files changed, 51 insertions(+), 62 deletions(-) diff --git a/tests/actions.at b/tests/actions.at index e5a885dd..0cf2e756 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -324,8 +324,7 @@ static AT_LOC.last_line = AT_LOC.last_column = AT_LOC.first_line + 9; ])[ - if (! (0 <= c && c <= strlen (source))) - abort (); + assert (0 <= c && c <= strlen (source)); if (source[c]) printf ("sending: '%c'", source[c]); else diff --git a/tests/calc.at b/tests/calc.at index 836c3a33..58e7e895 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -45,7 +45,7 @@ m4_define([_AT_DATA_CALC_Y], [m4_fatal([$0: Invalid arguments: $@])])dnl m4_pushdef([AT_CALC_MAIN], -[#include /* abort */ +[#include #if HAVE_UNISTD_H # include #else @@ -98,10 +98,8 @@ main (int argc, const char **argv) status = ]AT_NAME_PREFIX[parse (]AT_PARAM_IF([[&result, &count]])[); if (fclose (input)) perror ("fclose"); - if (global_result != result) - abort (); - if (global_count != count) - abort (); + assert (global_result == result); + assert (global_count == count); return status; } ]]) diff --git a/tests/conflicts.at b/tests/conflicts.at index 54df0511..cafa3338 100644 --- a/tests/conflicts.at +++ b/tests/conflicts.at @@ -57,6 +57,7 @@ AT_DATA_GRAMMAR([input.y], #include #include #include +#include #define YYERROR_VERBOSE 1 ]AT_YYERROR_DEFINE[ @@ -67,8 +68,7 @@ static int yylex (void) { static size_t toknum; - if (! (toknum <= strlen (input))) - abort (); + assert (toknum <= strlen (input)); return input[toknum++]; } diff --git a/tests/cxx-type.at b/tests/cxx-type.at index e172033a..f5e7c559 100644 --- a/tests/cxx-type.at +++ b/tests/cxx-type.at @@ -122,12 +122,12 @@ declarator : ID #include #include #include +#include int main (int argc, char **argv) { - if (argc != 2) - abort (); + assert (argc == 2); if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); @@ -152,8 +152,7 @@ main (int argc, char **argv) while (1) { - if (feof (stdin)) - abort (); + assert (!feof (stdin)); c = getchar (); switch (c) { @@ -182,8 +181,7 @@ main (int argc, char **argv) { buffer[i++] = c; colNum += 1; - if (i == sizeof buffer - 1) - abort (); + assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); diff --git a/tests/glr-regression.at b/tests/glr-regression.at index 479303df..288de258 100644 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@ -32,6 +32,7 @@ AT_DATA_GRAMMAR([glr-regr1.y], %{ #include #include +#include #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); @@ -80,8 +81,7 @@ yylex (void) for (;;) { int ch; - if (feof (stdin)) - abort (); + assert (!feof (stdin)); ch = getchar (); if (ch == EOF) return 0; @@ -128,6 +128,7 @@ AT_DATA_GRAMMAR([glr-regr2a.y], #include #include #include + #include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ %} @@ -177,8 +178,7 @@ yylex (void) { char buf[50]; char *s; - if (feof (stdin)) - abort (); + assert (!feof (stdin)); switch (fscanf (input, " %1[a-z,]", buf)) { case 1: @@ -190,8 +190,7 @@ yylex (void) } if (fscanf (input, "%49s", buf) != 1) return 0; - if (sizeof buf - 1 <= strlen (buf)) - abort (); + assert (strlen (buf) < sizeof buf - 1); s = (char *) malloc (strlen (buf) + 1); strcpy (s, buf); yylval = s; @@ -242,6 +241,7 @@ AT_DATA_GRAMMAR([glr-regr3.y], #include #include #include +#include static int MergeRule (int x0, int x1); ]AT_YYERROR_DECLARE[ @@ -302,8 +302,7 @@ int T[] = { T1, T2, T3, T4 }; int yylex (void) { char inp[3]; - if (feof (stdin)) - abort (); + assert (!feof (stdin)); if (fscanf (input, "%2s", inp) == EOF) return 0; switch (inp[0]) @@ -935,6 +934,7 @@ AT_DATA_GRAMMAR([glr-regr12.y], %{ # include +# include static int merge (YYSTYPE, YYSTYPE); ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ @@ -1003,8 +1003,7 @@ yylex (void) { static int const input[] = { PARENT_RHS_AFTER, 0 }; static size_t toknum; - if (! (toknum < sizeof input / sizeof *input)) - abort (); + assert (toknum < sizeof input / sizeof *input); if (input[toknum] == PARENT_RHS_AFTER) parent_rhs_after_value = 1; return input[toknum++]; @@ -1064,6 +1063,7 @@ AT_DATA_GRAMMAR([glr-regr13.y], %{ #include + #include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ static void print_lookahead (char const *); @@ -1122,8 +1122,7 @@ yylex (void) { static char const input[] = "ab"; static size_t toknum; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = toknum + 1; yylval.value = input[toknum] + 'A' - 'a'; @@ -1212,6 +1211,7 @@ AT_DATA_GRAMMAR([glr-regr14.y], %{ #include #include + #include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ static void print_lookahead (char const *); @@ -1328,8 +1328,7 @@ yylex (void) { static char const input[] = "abcdddd"; static size_t toknum; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = toknum + 1; yylval.value = input[toknum] + 'A' - 'a'; @@ -1492,6 +1491,7 @@ AT_DATA_GRAMMAR([glr-regr16.y], %{ # include +# include ]AT_YYERROR_DECLARE[ ]AT_YYLEX_DECLARE[ static int lookahead_value = 0; @@ -1512,8 +1512,7 @@ yylex (void) { static char const input[] = "ab"; static size_t toknum; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); if (input[toknum] == 'b') lookahead_value = 1; return input[toknum++]; @@ -1593,6 +1592,7 @@ empty1: ; empty2: ; %% +# include static void yyerror (YYLTYPE *locp, char const *msg) @@ -1606,8 +1606,7 @@ yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { static char const input[] = "ab"; static size_t toknum; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); lvalp->dummy = 0; llocp->first_line = llocp->last_line = 2; llocp->first_column = toknum + 1; diff --git a/tests/input.at b/tests/input.at index 6d8d552c..0ed8635f 100644 --- a/tests/input.at +++ b/tests/input.at @@ -442,6 +442,7 @@ char apostrophe = '\''; #include #include +#include %} /* %{ and %} can be here too. */ @@ -509,8 +510,7 @@ yylex (void) #output "; /* " */ static size_t toknum; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); yylval = value_as_yystype (input[toknum]); return input[toknum++]; } diff --git a/tests/local.at b/tests/local.at index c1fcd60f..4de2f7b3 100644 --- a/tests/local.at +++ b/tests/local.at @@ -304,7 +304,7 @@ m4_define([AT_YYLEX_DECLARE], ]) m4_define([AT_YYLEX_DEFINE], -[[#include /* abort */ +[[#include static ]AT_YYLEX_PROTOTYPE[ { @@ -312,8 +312,7 @@ static static size_t toknum = 0; int res; ]AT_USE_LEX_ARGS[; - if (! (toknum < sizeof input)) - abort (); + assert (toknum < sizeof input); res = input[toknum++]; ]$2[;]AT_LOCATION_IF([[ ]AT_LOC_FIRST_LINE[ = ]AT_LOC_LAST_LINE[ = 1; diff --git a/tests/named-refs.at b/tests/named-refs.at index c9b91a0e..3ccf1f66 100644 --- a/tests/named-refs.at +++ b/tests/named-refs.at @@ -162,10 +162,8 @@ int main (int argc, const char **argv) } status = yyparse (); fclose (input); - if (global_result != result) - abort (); - if (global_count != count) - abort (); + assert (global_result == result); + assert (global_count == count); return status; } ]]) diff --git a/tests/regression.at b/tests/regression.at index 4208153a..ac7d55ee 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -910,6 +910,7 @@ yyparse () } ]) +#include static int yylex (AT_LALR1_CC_IF([int *lval], [void])) [{ @@ -919,8 +920,7 @@ yylex (AT_LALR1_CC_IF([int *lval], [void])) }; static size_t toknum; ]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC. */])[ - if (! (toknum < sizeof tokens / sizeof *tokens)) - abort (); + assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; }] @@ -995,6 +995,7 @@ yyparse () } ])[ +#include static int yylex (]AT_LALR1_CC_IF([int *lval], [void])[) { @@ -1004,8 +1005,7 @@ yylex (]AT_LALR1_CC_IF([int *lval], [void])[) }; static size_t toknum; ]AT_LALR1_CC_IF([*lval = 0; /* Pacify GCC. */])[ - if (! (toknum < sizeof tokens / sizeof *tokens)) - abort (); + assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } diff --git a/tests/torture.at b/tests/torture.at index a8837b22..338c1648 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -56,6 +56,7 @@ print < #include +#include #define MAX $max ]AT_YYLEX_DECLARE[ ]AT_YYERROR_DECLARE[ @@ -77,8 +78,8 @@ for my $size (1 .. $max) print < ]AT_YYERROR_DEFINE[ static int yylex (void) @@ -199,8 +201,7 @@ yylex (void) static int counter = 1; if (counter <= MAX) return counter++; - if (counter++ != MAX + 1) - abort (); + assert (counter++ == MAX + 1); return 0; } @@ -328,8 +329,7 @@ yylex (void) static int counter = 1; if (counter > MAX) { - if (counter++ != MAX + 1) - abort (); + assert (counter++ == MAX + 1); return 0; } if (return_token) @@ -401,11 +401,11 @@ AT_DATA([input.y], exp: WAIT_FOR_EOF exp | ; %% ]AT_YYERROR_DEFINE[ +#include static int yylex (void) { - if (yylval < 0) - abort (); + assert (0 <= yylval); if (yylval--) return WAIT_FOR_EOF; else @@ -417,13 +417,12 @@ main (int argc, const char **argv) { char *endp; YYSTYPE yylval_init; - if (argc != 2) - abort (); + assert (argc == 2); yylval_init = strtol (argv[1], &endp, 10); - if (! (argv[1] != endp - && 0 <= yylval_init && yylval_init <= INT_MAX - && errno != ERANGE)) - abort (); + assert (argv[1] != endp); + assert (0 <= yylval_init); + assert (yylval_init <= INT_MAX); + assert (errno != ERANGE); yydebug = 1; { int count; @@ -438,8 +437,7 @@ main (int argc, const char **argv) [[ new_status = yypull_parse (ps); ]], [[ new_status = yyparse (); -]])[ if (count > 0 && new_status != status) - abort (); +]])[ assert (0 <= count || new_status == status); status = new_status; } ]m4_bmatch([$2], [%push-], From 8d6c1b5e85e830c31bb0421ea73de1080e5999d8 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 11:54:13 +0200 Subject: [PATCH 7/8] tests: use the generic yyerror function. * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Factor. Use AT_YYERROR_DEFINE. Therefore, instead of using stdout, use and check stderr. * tests/glr-regression.at (Uninitialized location when reporting ambiguity): Use AT_YYERROR_DEFINE. --- tests/actions.at | 136 +++++++++++++++++++--------------------- tests/glr-regression.at | 17 ++--- 2 files changed, 72 insertions(+), 81 deletions(-) diff --git a/tests/actions.at b/tests/actions.at index 0cf2e756..3f47928a 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -174,11 +174,12 @@ AT_CLEANUP ## Printers and Destructors. ## ## -------------------------- ## -# _AT_CHECK_PRINTER_AND_DESTRUCTOR($1, $2, $3, $4, BISON-DIRECTIVE, UNION-FLAG) -# ----------------------------------------------------------------------------- +# _AT_CHECK_PRINTER_AND_DESTRUCTOR($1, $2, $3, $4, +# BISON-DIRECTIVE, UNION-FLAG) +# ------------------------------------------------------------- m4_define([_AT_CHECK_PRINTER_AND_DESTRUCTOR], [# Make sure complex $n work. -m4_if([$1$2$3], $[1]$[2]$[3], [], +m4_if([$1$2$3$4], $[1]$[2]$[3]$[4], [], [m4_fatal([$0: Invalid arguments: $@])])dnl # Be sure to pass all the %directives to this macro to have correct @@ -193,13 +194,16 @@ AT_DATA_GRAMMAR([[input.y]], #define YYINITDEPTH 10 #define YYMAXDEPTH 10 -]AT_LALR1_CC_IF( - [#define RANGE(Location) (Location).begin.line, (Location).end.line], - [#define RANGE(Location) (Location).first_line, (Location).last_line]) -[} +#define RANGE(Location) ]AT_LALR1_CC_IF([(Location).begin.line, (Location).end.line], + [(Location).first_line, (Location).last_line])[ -$5] -m4_ifval([$6], [%union +/* Display the symbol type Symbol. */ +#define V(Symbol, Value, Location, Sep) \ + fprintf (stderr, #Symbol " (%d@%d-%d)" Sep, Value, RANGE(Location)) +} + +$5 +]m4_ifval([$6], [%union { int ival; }]) @@ -221,28 +225,28 @@ AT_LALR1_CC_IF([typedef yy::location YYLTYPE;])[ input line thing 'x' 'y' %destructor - { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); } input %destructor - { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); } line %destructor - { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); } thing %destructor - { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); } 'x' %destructor - { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); } 'y' %token END 0 %destructor - { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } + { fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); } END %% @@ -257,14 +261,15 @@ input: /* Nothing. */ { $$ = 0; - printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$)); + V(input, $$, @$, ": /* Nothing */\n"); } | line input /* Right recursive to load the stack so that popping at END can be exercised. */ { $$ = 2; - printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2)); + V(input, $$, @$, ": "); + V(line, $1, @1, " "); + V(input, $2, @2, "\n"); } ; @@ -272,28 +277,36 @@ line: thing thing thing ';' { $$ = $1; - printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), - $3, RANGE (@3), $4, RANGE (@4)); + V(line, $$, @$, ": "); + V(thing, $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; - printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), - $3, RANGE (@3), $4, RANGE (@4)); + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(thing, $3, @3, " "); + V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; - printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3)); + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + V(thing, $2, @2, " "); + V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; - printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3)); + V(line, $$, @$, ": "); + V('(', $1, @1, " "); + fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); + V(')', $3, @3, "\n"); } ; @@ -301,14 +314,16 @@ thing: 'x' { $$ = $1; - printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n", - $$, RANGE (@$), $1, RANGE (@1)); + V(thing, $$, @$, ": "); + V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULL; +]AT_YYERROR_DEFINE[ + static ]AT_YYLEX_PROTOTYPE[ { @@ -316,32 +331,18 @@ static int c = ]AT_VAL[]m4_ifval([$6], [.ival])[ = counter++; /* As in BASIC, line numbers go from 10 to 10. */ -]AT_LALR1_CC_IF( -[ AT_LOC.begin.line = AT_LOC.begin.column = 10 * c; - AT_LOC.end.line = AT_LOC.end.column = AT_LOC.begin.line + 9; -], -[ AT_LOC.first_line = AT_LOC.first_column = 10 * c; - AT_LOC.last_line = AT_LOC.last_column = AT_LOC.first_line + 9; -])[ - + ]AT_LOC_FIRST_LINE[ = ]AT_LOC_FIRST_COLUMN[ = 10 * c; + ]AT_LOC_LAST_LINE[ = ]AT_LOC_LAST_COLUMN[ = ]AT_LOC_FIRST_LINE[ + 9; assert (0 <= c && c <= strlen (source)); if (source[c]) - printf ("sending: '%c'", source[c]); + fprintf (stderr, "sending: '%c'", source[c]); else - printf ("sending: END"); - printf (" (%d@%d-%d)\n", c, RANGE (]AT_LOC[)); + fprintf (stderr, "sending: END"); + fprintf (stderr, " (%d@%d-%d)\n", c, RANGE (]AT_LOC[)); return source[c]; } - ]AT_LALR1_CC_IF( -[/* A C++ error reporting function. */ -void -yy::parser::error (const location& l, const std::string& m) -{ - printf ("%d-%d: %s\n", RANGE (l), m.c_str()); -} - -static bool yydebug; +[static bool yydebug; int yyparse () { @@ -349,12 +350,7 @@ yyparse () parser.set_debug_level (yydebug); return parser.parse (); } -], -[static void -yyerror (const char *msg) -{ - printf ("%d-%d: %s\n", RANGE (yylloc), msg); -}])[ +])[ int main (int argc, const char *argv[]) @@ -366,9 +362,9 @@ main (int argc, const char *argv[]) status = yyparse (); switch (status) { - case 0: printf ("Successful parse.\n"); break; - case 1: printf ("Parsing FAILED.\n"); break; - default: printf ("Parsing FAILED (status %d).\n", status); break; + case 0: fprintf (stderr, "Successful parse.\n"); break; + case 1: fprintf (stderr, "Parsing FAILED.\n"); break; + default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } @@ -382,7 +378,7 @@ AT_FULL_COMPILE([input]) # I.e., epsilon-reductions, as in "(x)" which ends by reducing # an empty "line" nterm. # FIXME: This location is not satisfying. Depend on the lookahead? -AT_PARSER_CHECK([./input '(x)'], 0, +AT_PARSER_CHECK([./input '(x)'], 0, [], [[sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) @@ -401,10 +397,10 @@ Successful parse. # --------------------------------- # '(y)' is an error, but can be recovered from. But what's the location # of the error itself ('y'), and of the resulting reduction ('(error)'). -AT_PARSER_CHECK([./input '(y)'], 0, +AT_PARSER_CHECK([./input '(y)'], 0, [], [[sending: '(' (0@0-9) sending: 'y' (1@10-19) -10-19: syntax error, unexpected 'y', expecting 'x' +10.10-19.18: syntax error, unexpected 'y', expecting 'x' Freeing token 'y' (1@10-19) sending: ')' (2@20-29) line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29) @@ -431,14 +427,14 @@ Successful parse. # '(', 'x', ')', # '(', 'x', ')', # 'y' -AT_PARSER_CHECK([./input '(xxxxx)(x)(x)y'], 1, +AT_PARSER_CHECK([./input '(xxxxx)(x)(x)y'], 1, [], [[sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) sending: 'x' (2@20-29) thing (2@20-29): 'x' (2@20-29) sending: 'x' (3@30-39) -30-39: syntax error, unexpected 'x', expecting ')' +30.30-39.38: syntax error, unexpected 'x', expecting ')' Freeing nterm thing (2@20-29) Freeing nterm thing (1@10-19) Freeing token 'x' (3@30-39) @@ -463,7 +459,7 @@ input (0@129-129): /* Nothing */ input (2@100-129): line (10@100-129) input (0@129-129) input (2@70-129): line (7@70-99) input (2@100-129) input (2@0-129): line (-1@0-69) input (2@70-129) -130-139: syntax error, unexpected 'y', expecting END +130.130-139.138: syntax error, unexpected 'y', expecting END Freeing nterm input (2@0-129) Freeing token 'y' (13@130-139) Parsing FAILED. @@ -479,7 +475,7 @@ Parsing FAILED. # '(', 'x', ')', # '(', 'x', ')', # 'x' -AT_PARSER_CHECK([./input '(x)(x)x'], 1, +AT_PARSER_CHECK([./input '(x)(x)x'], 1, [], [[sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) @@ -493,7 +489,7 @@ line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59) sending: 'x' (6@60-69) thing (6@60-69): 'x' (6@60-69) sending: END (7@70-79) -70-79: syntax error, unexpected END, expecting 'x' +70.70-79.78: syntax error, unexpected END, expecting 'x' Freeing nterm thing (6@60-69) Freeing nterm line (3@30-59) Freeing nterm line (0@0-29) @@ -507,7 +503,7 @@ Parsing FAILED. # Upon stack overflow, all symbols on the stack should be destroyed. # Only check for yacc.c. AT_YACC_IF([ -AT_PARSER_CHECK([./input '(x)(x)(x)(x)(x)(x)(x)'], 2, +AT_PARSER_CHECK([./input '(x)(x)(x)(x)(x)(x)(x)'], 2, [], [[sending: '(' (0@0-9) sending: 'x' (1@10-19) thing (1@10-19): 'x' (1@10-19) @@ -542,7 +538,7 @@ sending: '(' (18@180-189) sending: 'x' (19@190-199) thing (19@190-199): 'x' (19@190-199) sending: ')' (20@200-209) -200-209: memory exhausted +200.200-209.208: memory exhausted Freeing nterm thing (19@190-199) Freeing nterm line (15@150-179) Freeing nterm line (12@120-149) @@ -1201,7 +1197,7 @@ AT_DATA_GRAMMAR([[input.y]], %debug ]$1[ { - printf ("%d\n", @$.first_line); + fprintf (stderr, "%d\n", @$.first_line); } ]m4_if($1, [%initial-action], [], [[start]])[ %% diff --git a/tests/glr-regression.at b/tests/glr-regression.at index 288de258..91dedb89 100644 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@ -1550,7 +1550,8 @@ AT_CLEANUP AT_SETUP([Uninitialized location when reporting ambiguity]) -AT_BISON_OPTION_PUSHDEFS +AT_BISON_OPTION_PUSHDEFS([%glr-parser %locations %define api.pure]) + AT_DATA_GRAMMAR([glr-regr17.y], [[ %glr-parser @@ -1561,8 +1562,8 @@ AT_DATA_GRAMMAR([glr-regr17.y], %union { int dummy; } %{ - static void yyerror (YYLTYPE *, char const *); - static int yylex (YYSTYPE *, YYLTYPE *); + ]AT_YYERROR_DECLARE[ + ]AT_YYLEX_DECLARE[ %} %initial-action { @@ -1594,13 +1595,7 @@ empty2: ; %% # include -static void -yyerror (YYLTYPE *locp, char const *msg) -{ - fprintf (stderr, "%d.%d-%d.%d: %s.\n", locp->first_line, - locp->first_column, locp->last_line, locp->last_column, msg); -} - +]AT_YYERROR_DEFINE[ static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { @@ -1628,7 +1623,7 @@ AT_BISON_CHECK([[-o glr-regr17.c glr-regr17.y]], 0, [], AT_COMPILE([glr-regr17]) AT_PARSER_CHECK([[./glr-regr17]], 0, [], -[1.1-2.3: syntax is ambiguous. +[1.1-2.2: syntax is ambiguous ]) AT_CLEANUP From a32a2d57a5d931ad1e30d180f9d40b482b674593 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 26 Jun 2012 14:05:56 +0200 Subject: [PATCH 8/8] tests: do not output m4 set up. * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Use a diversion to avoid outputting comments etc. Removes 17k lines from testsuite (10% of the number of lines). --- tests/local.at | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/local.at b/tests/local.at index 4de2f7b3..5a5bbdd0 100644 --- a/tests/local.at +++ b/tests/local.at @@ -90,7 +90,8 @@ m4_popdef([AT_LOC_LAST_COLUMN])]) # AT_BISON_OPTION_PUSHDEFS([BISON-OPTIONS]) # ----------------------------------------- m4_define([AT_BISON_OPTION_PUSHDEFS], -[_AT_BISON_OPTION_PUSHDEFS($[1], $[2], [$1])]) +[m4_divert_text([KILL], + [_AT_BISON_OPTION_PUSHDEFS($[1], $[2], [$1])])]) # _AT_BISON_OPTION_PUSHDEFS($1, $2, [BISON-OPTIONS]) @@ -207,6 +208,7 @@ AT_SKEL_CC_IF( # AT_BISON_OPTION_POPDEFS # ----------------------- m4_define([AT_BISON_OPTION_POPDEFS], +[m4_divert_text([KILL], [m4_popdef([AT_YYLEX_PRE_ARGS]) m4_popdef([AT_YYLEX_PRE_FORMALS]) m4_popdef([AT_USE_LEX_ARGS]) @@ -235,7 +237,7 @@ m4_popdef([AT_SKEL_JAVA_IF]) m4_popdef([AT_GLR_CC_IF]) m4_popdef([AT_LALR1_CC_IF]) m4_popdef([AT_DEFINES_IF]) -AT_LOC_POPDEF +AT_LOC_POPDEF])dnl ])# AT_BISON_OPTION_POPDEFS