X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/bbaf618c3e9a5645c5d71bf2ea0de2bdeb8a4976..746ac9aa81dd638d35ef43b75cefaff4af7afd48:/tests/local.at diff --git a/tests/local.at b/tests/local.at index d651eb95..ff39787c 100644 --- a/tests/local.at +++ b/tests/local.at @@ -71,7 +71,7 @@ m4_define([AT_BISON_OPTION_PUSHDEFS], # -------------------------------------------------- # This macro works around the impossibility to define macros # inside macros, because issuing `[$1]' is not possible in M4 :(. -# This sucks hard, GNU M4 should really provide M5 like $$1. +# This sucks hard, GNU M4 should really provide M5-like $$1. m4_define([_AT_BISON_OPTION_PUSHDEFS], [m4_if([$1$2], $[1]$[2], [], [m4_fatal([$0: Invalid arguments: $@])])dnl @@ -110,37 +110,40 @@ m4_pushdef([AT_NAME_PREFIX], [m4_bmatch([$3], [%name-prefix ".*"], [m4_bregexp([$3], [name-prefix "\([^"]*\)"], [\1])], [yy])]) +m4_pushdef([AT_TOKEN_PREFIX], +[m4_bmatch([$3], [%define api.tokens.prefix ".*"], + [m4_bregexp([$3], [%define api.tokens.prefix "\(.*\)"], [\1])])]) # 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])], - [$2])]) + [$2])]) # yyerror always sees the locations (when activated), except if # (yacc & pure & !param). FIXME: This is wrong. See the manual. m4_pushdef([AT_YYERROR_SEES_LOC_IF], [AT_LOCATION_IF([AT_YACC_IF([AT_PURE_IF([AT_PARAM_IF([$1], [$2])], - [$1])], - [$1])], - [$2])]) + [$1])], + [$1])], + [$2])]) # The interface is pure: either because %define api.pure, or because we # are using the C++ parsers. m4_pushdef([AT_PURE_LEX_IF], [AT_PURE_IF([$1], - [AT_SKEL_CC_IF([$1], [$2])])]) + [AT_SKEL_CC_IF([$1], [$2])])]) AT_PURE_LEX_IF( [m4_pushdef([AT_LOC], [(*llocp)]) m4_pushdef([AT_VAL], [(*lvalp)]) m4_pushdef([AT_LEX_FORMALS], - [YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])]) + [YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])]) m4_pushdef([AT_LEX_ARGS], - [lvalp[]AT_LOCATION_IF([, llocp])]) + [lvalp[]AT_LOCATION_IF([, llocp])]) m4_pushdef([AT_USE_LEX_ARGS], - [(void) lvalp;AT_LOCATION_IF([(void) llocp])]) + [(void) lvalp;AT_LOCATION_IF([(void) llocp])]) m4_pushdef([AT_LEX_PRE_FORMALS], - [AT_LEX_FORMALS, ]) + [AT_LEX_FORMALS, ]) m4_pushdef([AT_LEX_PRE_ARGS], - [AT_LEX_ARGS, ]) + [AT_LEX_ARGS, ]) ], [m4_pushdef([AT_LOC], [[(]AT_NAME_PREFIX[lloc)]]) m4_pushdef([AT_VAL], [[(]AT_NAME_PREFIX[lval)]]) @@ -159,6 +162,8 @@ AT_SKEL_CC_IF( [AT_LOC_PUSHDEF([begin.line], [begin.column], [end.line], [end.column])])], [AT_LOC_PUSHDEF([first_line], [first_column], [last_line], [last_column])]) + +AT_GLR_IF([AT_KEYWORDS([glr])]) ])# _AT_BISON_OPTION_PUSHDEFS @@ -409,7 +414,7 @@ m4_define([AT_QUELL_VALGRIND], # assume that we are linking too; this is a hack. m4_define([AT_COMPILE], [AT_CHECK([$CC $CFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.c])[]m4_bmatch([$1], [[.]], [], [ $LIBS])], - 0, [ignore], [ignore])]) + 0, [ignore], [ignore])]) # AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc]) # -------------------------------------------- @@ -420,7 +425,7 @@ 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])], - 0, [ignore], [ignore])]) + 0, [ignore], [ignore])]) # AT_JAVA_COMPILE(SOURCES) # ------------------------