mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
tests: dispatch per lang on AT_DATA_GRAMMAR
* tests/java.at: Do that. * tests/conflicts.at: Simplify. * tests/actions.at, tests/c++.at, tests/input.at, tests/local.at, * tests/named-refs.at: Use AT_BISON_OPTION_PUSHDEFS/AT_BISON_OPTION_POPDEFS.
This commit is contained in:
@@ -119,6 +119,7 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([Implicitly empty rule])
|
AT_SETUP([Implicitly empty rule])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[1.y]],
|
AT_DATA_GRAMMAR([[1.y]],
|
||||||
[[%%
|
[[%%
|
||||||
exp: a b;
|
exp: a b;
|
||||||
@@ -152,6 +153,7 @@ AT_BISON_CHECK([-fcaret 2.y], [0], [],
|
|||||||
|
|
||||||
AT_BISON_CHECK([-fcaret -Wno-empty-rule 2.y], [0])
|
AT_BISON_CHECK([-fcaret -Wno-empty-rule 2.y], [0])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
## ------------------------ ##
|
## ------------------------ ##
|
||||||
@@ -160,6 +162,7 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([Invalid uses of %empty])
|
AT_SETUP([Invalid uses of %empty])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[one.y]],
|
AT_DATA_GRAMMAR([[one.y]],
|
||||||
[[%%
|
[[%%
|
||||||
exp:
|
exp:
|
||||||
@@ -224,6 +227,7 @@ two.y:13.3-8: error: %empty on non-empty rule
|
|||||||
^~~~~~
|
^~~~~~
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
## ---------------------- ##
|
## ---------------------- ##
|
||||||
|
|||||||
@@ -1347,6 +1347,7 @@ m4_popdef([AT_TEST])
|
|||||||
|
|
||||||
AT_SETUP([[C++ GLR parser identifier shadowing]])
|
AT_SETUP([[C++ GLR parser identifier shadowing]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([input.yy], [
|
AT_DATA_GRAMMAR([input.yy], [
|
||||||
%skeleton "glr.cc"
|
%skeleton "glr.cc"
|
||||||
|
|
||||||
@@ -1386,6 +1387,7 @@ int main ()
|
|||||||
AT_BISON_CHECK([[-o input.cc input.yy]])
|
AT_BISON_CHECK([[-o input.cc input.yy]])
|
||||||
AT_FOR_EACH_CXX([AT_COMPILE_CXX([[input]])])
|
AT_FOR_EACH_CXX([AT_COMPILE_CXX([[input]])])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([Token declaration order: literals vs. identifiers])
|
AT_SETUP([Token declaration order: literals vs. identifiers])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%token 'a' 'b' C D
|
[[%token 'a' 'b' C D
|
||||||
%token E F 'g' 'h'
|
%token E F 'g' 'h'
|
||||||
@@ -171,6 +172,7 @@ AT_CHECK([[cat input.output | sed -n '/^State 0$/,/^State 1$/p']], 0,
|
|||||||
State 1
|
State 1
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -404,7 +406,7 @@ AT_SETUP([[parse.error=verbose and consistent errors: ]$1])
|
|||||||
|
|
||||||
AT_BISON_OPTION_PUSHDEFS([$1 AT_CXX_IF([[%defines]], [[%define api.pure]])])
|
AT_BISON_OPTION_PUSHDEFS([$1 AT_CXX_IF([[%defines]], [[%define api.pure]])])
|
||||||
|
|
||||||
AT_JAVA_IF([AT_DATA], [AT_DATA_GRAMMAR])([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[AT_JAVA_IF([[
|
[AT_JAVA_IF([[
|
||||||
|
|
||||||
%code imports {
|
%code imports {
|
||||||
|
|||||||
@@ -1313,6 +1313,7 @@ AT_CLEANUP
|
|||||||
AT_SETUP([Typed symbol aliases])
|
AT_SETUP([Typed symbol aliases])
|
||||||
|
|
||||||
# Bison 2.0 broke typed symbol aliases - ensure they work.
|
# Bison 2.0 broke typed symbol aliases - ensure they work.
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
|
|
||||||
AT_DATA_GRAMMAR([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[[%union
|
[[%union
|
||||||
@@ -1328,6 +1329,7 @@ exp: "MY TOKEN";
|
|||||||
|
|
||||||
AT_BISON_CHECK([-o input.c input.y])
|
AT_BISON_CHECK([-o input.c input.y])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -1337,12 +1339,14 @@ AT_CLEANUP
|
|||||||
|
|
||||||
m4_define([AT_CHECK_REQUIRE],
|
m4_define([AT_CHECK_REQUIRE],
|
||||||
[AT_SETUP([Require $1])
|
[AT_SETUP([Require $1])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[[%require "$1";
|
[[%require "$1";
|
||||||
%%
|
%%
|
||||||
empty_file: %empty;
|
empty_file: %empty;
|
||||||
]])
|
]])
|
||||||
AT_BISON_CHECK([-o input.c input.y], $2, [], ignore)
|
AT_BISON_CHECK([-o input.c input.y], $2, [], ignore)
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -1361,6 +1365,7 @@ AT_SETUP([String aliases for character tokens])
|
|||||||
# Bison once thought a character token and its alias were different
|
# Bison once thought a character token and its alias were different
|
||||||
# symbols with the same user token number.
|
# symbols with the same user token number.
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([input.y],
|
AT_DATA_GRAMMAR([input.y],
|
||||||
[[%token 'a' "a"
|
[[%token 'a' "a"
|
||||||
%%
|
%%
|
||||||
@@ -1370,6 +1375,7 @@ start: 'a';
|
|||||||
|
|
||||||
AT_BISON_CHECK([-o input.c input.y])
|
AT_BISON_CHECK([-o input.c input.y])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -1399,7 +1405,6 @@ without_period: "WITHOUT.PERIOD";
|
|||||||
]AT_YYERROR_DEFINE[
|
]AT_YYERROR_DEFINE[
|
||||||
]AT_YYLEX_DEFINE[
|
]AT_YYLEX_DEFINE[
|
||||||
]])
|
]])
|
||||||
AT_BISON_OPTION_POPDEFS
|
|
||||||
|
|
||||||
# POSIX Yacc accept periods, but not dashes.
|
# POSIX Yacc accept periods, but not dashes.
|
||||||
AT_BISON_CHECK([--yacc input.y], [], [],
|
AT_BISON_CHECK([--yacc input.y], [], [],
|
||||||
@@ -1436,6 +1441,7 @@ input.y:11.10-16: error: invalid identifier: '1NV4L1D'
|
|||||||
input.y:12.10: error: invalid character: '-'
|
input.y:12.10: error: invalid character: '-'
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -1445,6 +1451,7 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([Numbered tokens])
|
AT_SETUP([Numbered tokens])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([redecl.y],
|
AT_DATA_GRAMMAR([redecl.y],
|
||||||
[[%token DECIMAL_1 11259375
|
[[%token DECIMAL_1 11259375
|
||||||
HEXADECIMAL_1 0xabcdef
|
HEXADECIMAL_1 0xabcdef
|
||||||
@@ -1474,6 +1481,7 @@ AT_BISON_CHECK([too-large.y], [1], [],
|
|||||||
too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
|
too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -2379,6 +2387,7 @@ AT_CLEANUP
|
|||||||
## -------------- ##
|
## -------------- ##
|
||||||
|
|
||||||
AT_SETUP([[Stray $ or @]])
|
AT_SETUP([[Stray $ or @]])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
|
|
||||||
# Give %printer and %destructor "<*> exp TOK" instead of "<*>" to
|
# Give %printer and %destructor "<*> exp TOK" instead of "<*>" to
|
||||||
# check that the warnings are reported once, not three times.
|
# check that the warnings are reported once, not three times.
|
||||||
@@ -2407,6 +2416,7 @@ input.y:16.19: warning: stray '$' [-Wother]
|
|||||||
input.y:16.23: warning: stray '@' [-Wother]
|
input.y:16.23: warning: stray '@' [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -2484,6 +2494,7 @@ AT_SETUP([[Deprecated directives]])
|
|||||||
|
|
||||||
AT_KEYWORDS([[deprec]])
|
AT_KEYWORDS([[deprec]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[
|
[[
|
||||||
%default_prec
|
%default_prec
|
||||||
@@ -2603,6 +2614,7 @@ exp : '0'
|
|||||||
|
|
||||||
AT_BISON_CHECK([[input.y]])
|
AT_BISON_CHECK([[input.y]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -2619,6 +2631,7 @@ AT_SETUP([[Unput's effect on locations]])
|
|||||||
|
|
||||||
AT_KEYWORDS([[deprec]])
|
AT_KEYWORDS([[deprec]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[
|
[[
|
||||||
%glr-parser
|
%glr-parser
|
||||||
@@ -2642,6 +2655,7 @@ input.y: error: reduce/reduce conflicts: 0 found, 42 expected
|
|||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -2653,6 +2667,7 @@ AT_SETUP([[Non-deprecated directives]])
|
|||||||
|
|
||||||
AT_KEYWORDS([[deprec]])
|
AT_KEYWORDS([[deprec]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[
|
[[
|
||||||
%default-prec
|
%default-prec
|
||||||
@@ -2677,6 +2692,7 @@ input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
|
|||||||
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
@@ -2686,6 +2702,7 @@ AT_CLEANUP
|
|||||||
|
|
||||||
AT_SETUP([[Cannot type action]])
|
AT_SETUP([[Cannot type action]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([[input.y]],
|
AT_DATA_GRAMMAR([[input.y]],
|
||||||
[[%%
|
[[%%
|
||||||
exp: <int> {}
|
exp: <int> {}
|
||||||
@@ -2697,4 +2714,5 @@ AT_BISON_CHECK([[-fcaret input.y]], [[0]], [[]],
|
|||||||
^~~~~~~~
|
^~~~~~~~
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ m4_define([_AT_DATA_JAVA_CALC_Y],
|
|||||||
[m4_if([$1$2$3], $[1]$[2]$[3], [],
|
[m4_if([$1$2$3], $[1]$[2]$[3], [],
|
||||||
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
[m4_fatal([$0: Invalid arguments: $@])])dnl
|
||||||
AT_BISON_OPTION_PUSHDEFS([%language "Java" $4])
|
AT_BISON_OPTION_PUSHDEFS([%language "Java" $4])
|
||||||
AT_DATA([Calc.y],
|
AT_DATA_GRAMMAR([Calc.y],
|
||||||
[[/* Infix notation calculator--calc */
|
[[/* Infix notation calculator--calc */
|
||||||
%language "Java"
|
%language "Java"
|
||||||
%name-prefix "Calc"
|
%name-prefix "Calc"
|
||||||
|
|||||||
@@ -397,15 +397,13 @@ m4_define([AT_DATA_SOURCE],
|
|||||||
$2])
|
$2])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
# Generate the file NAME, which CONTENT is preceded by
|
# Generate the file NAME, which CONTENT is preceded by
|
||||||
# AT_DATA_GRAMMAR_PROLOGUE.
|
# AT_DATA_GRAMMAR_PROLOGUE.
|
||||||
m4_define([AT_DATA_GRAMMAR],
|
m4_define([AT_DATA_GRAMMAR], [AT_LANG_DISPATCH([$0], $@)])
|
||||||
[AT_DATA([$1],
|
|
||||||
[AT_DATA_GRAMMAR_PROLOGUE
|
|
||||||
$2])
|
|
||||||
])
|
|
||||||
|
|
||||||
# AT_YYLEX_PROTOTYPE
|
# AT_YYLEX_PROTOTYPE
|
||||||
# AT_YYLEX_DECLARE_EXTERN
|
# AT_YYLEX_DECLARE_EXTERN
|
||||||
@@ -455,6 +453,15 @@ m4_define([AT_MAIN_DEFINE], [AT_LANG_DISPATCH([$0], $@)])
|
|||||||
## C. ##
|
## C. ##
|
||||||
## --- ##
|
## --- ##
|
||||||
|
|
||||||
|
# AT_DATA_GRAMMAR(c)(NAME, CONTENT)
|
||||||
|
# ---------------------------------
|
||||||
|
# Generate the file NAME, with CONTENT.
|
||||||
|
m4_define([AT_DATA_GRAMMAR(c)],
|
||||||
|
[AT_DATA([$1],
|
||||||
|
[AT_DATA_GRAMMAR_PROLOGUE
|
||||||
|
$2])
|
||||||
|
])
|
||||||
|
|
||||||
m4_define([AT_YYERROR_FORMALS(c)],
|
m4_define([AT_YYERROR_FORMALS(c)],
|
||||||
[AT_YYERROR_ARG_LOC_IF([AT_YYLTYPE const * const llocp, ])AT_PARSE_PARAMS[const char *msg]])
|
[AT_YYERROR_ARG_LOC_IF([AT_YYLTYPE const * const llocp, ])AT_PARSE_PARAMS[const char *msg]])
|
||||||
|
|
||||||
@@ -566,6 +573,11 @@ m4_define([AT_LANG_FOR_EACH_STD(c)],
|
|||||||
## C++. ##
|
## C++. ##
|
||||||
## ----- ##
|
## ----- ##
|
||||||
|
|
||||||
|
|
||||||
|
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
||||||
|
# ------------------------------
|
||||||
|
m4_copy([AT_DATA_GRAMMAR(c)], [AT_DATA_GRAMMAR(c++)])
|
||||||
|
|
||||||
# No need to declare, it's part of the class interface.
|
# No need to declare, it's part of the class interface.
|
||||||
m4_define([AT_YYERROR_DECLARE(c++)], [])
|
m4_define([AT_YYERROR_DECLARE(c++)], [])
|
||||||
m4_define([AT_YYERROR_DECLARE_EXTERN(c++)], [])
|
m4_define([AT_YYERROR_DECLARE_EXTERN(c++)], [])
|
||||||
@@ -625,6 +637,12 @@ CXXFLAGS=$at_for_each_std_CXXFLAGS_save
|
|||||||
## Java. ##
|
## Java. ##
|
||||||
## ------ ##
|
## ------ ##
|
||||||
|
|
||||||
|
|
||||||
|
# AT_DATA_GRAMMAR(NAME, CONTENT)
|
||||||
|
# ------------------------------
|
||||||
|
m4_copy([AT_DATA], [AT_DATA_GRAMMAR(java)])
|
||||||
|
|
||||||
|
|
||||||
m4_define([AT_YYERROR_DEFINE(java)],
|
m4_define([AT_YYERROR_DEFINE(java)],
|
||||||
[AT_LOCATION_IF([[public void yyerror (Calc.Location l, String s)
|
[AT_LOCATION_IF([[public void yyerror (Calc.Location l, String s)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ AT_CLEANUP
|
|||||||
## ----------------------- ##
|
## ----------------------- ##
|
||||||
|
|
||||||
AT_SETUP([Misleading references])
|
AT_SETUP([Misleading references])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -307,11 +308,13 @@ AT_BISON_CHECK([-o test.c test.y], 0, [],
|
|||||||
test.y:11.8-10: refers to: $foo at $1
|
test.y:11.8-10: refers to: $foo at $1
|
||||||
test.y:11.12-18: possibly meant: $[foo.bar] at $2
|
test.y:11.12-18: possibly meant: $[foo.bar] at $2
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Many kinds of errors])
|
AT_SETUP([Many kinds of errors])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%token IDENT
|
%token IDENT
|
||||||
@@ -540,11 +543,13 @@ test.y:45.41-46: possibly meant: $[then-a].f at $4
|
|||||||
^~~~~~
|
^~~~~~
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Missing identifiers in brackets])
|
AT_SETUP([Missing identifiers in brackets])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -554,11 +559,13 @@ start: foo[] bar
|
|||||||
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
||||||
[[test.y:11.12: error: an identifier expected
|
[[test.y:11.12: error: an identifier expected
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Redundant words in brackets])
|
AT_SETUP([Redundant words in brackets])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -568,11 +575,13 @@ start: foo[ a d ] bar
|
|||||||
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
||||||
[[test.y:11.15: error: unexpected identifier in bracketed name: 'd'
|
[[test.y:11.15: error: unexpected identifier in bracketed name: 'd'
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Comments in brackets])
|
AT_SETUP([Comments in brackets])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -582,11 +591,13 @@ start: foo[/* comment */] bar
|
|||||||
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
||||||
[[test.y:11.25: error: an identifier expected
|
[[test.y:11.25: error: an identifier expected
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Stray symbols in brackets])
|
AT_SETUP([Stray symbols in brackets])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -599,11 +610,13 @@ AT_BISON_CHECK([-o test.c test.y], 1, [],
|
|||||||
test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
|
test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
|
||||||
test.y:11.29-30: error: invalid characters in bracketed name: '+\0\001\002\377'
|
test.y:11.29-30: error: invalid characters in bracketed name: '+\0\001\002\377'
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Redundant words in LHS brackets])
|
AT_SETUP([Redundant words in LHS brackets])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -612,6 +625,7 @@ start[a s]: foo;
|
|||||||
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
AT_BISON_CHECK([-o test.c test.y], 1, [],
|
||||||
[[test.y:11.9: error: unexpected identifier in bracketed name: 's'
|
[[test.y:11.9: error: unexpected identifier in bracketed name: 's'
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
@@ -619,17 +633,20 @@ AT_CLEANUP
|
|||||||
# Bison used to free twice the named ref for "a", since a single copy
|
# Bison used to free twice the named ref for "a", since a single copy
|
||||||
# was used in two rules.
|
# was used in two rules.
|
||||||
AT_SETUP([Factored LHS])
|
AT_SETUP([Factored LHS])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
start[a]: "foo" | "bar";
|
start[a]: "foo" | "bar";
|
||||||
]])
|
]])
|
||||||
AT_BISON_CHECK([-o test.c test.y])
|
AT_BISON_CHECK([-o test.c test.y])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
AT_SETUP([Unresolved references])
|
AT_SETUP([Unresolved references])
|
||||||
|
AT_BISON_OPTION_PUSHDEFS
|
||||||
AT_DATA_GRAMMAR([test.y],
|
AT_DATA_GRAMMAR([test.y],
|
||||||
[[
|
[[
|
||||||
%%
|
%%
|
||||||
@@ -690,6 +707,7 @@ test.y:28.3-65: symbol not found in production before $3: sym
|
|||||||
test.y:28.52-61: error: invalid reference: '$<aa>[sym]'
|
test.y:28.52-61: error: invalid reference: '$<aa>[sym]'
|
||||||
test.y:28.3-65: symbol not found in production: sym
|
test.y:28.3-65: symbol not found in production: sym
|
||||||
]])
|
]])
|
||||||
|
AT_BISON_OPTION_POPDEFS
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user