mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
api.prefix: incompatible with %name-prefix.
* data/bison.m4: Make it incompatible. * tests/input.at: Check that it is.
This commit is contained in:
@@ -69,7 +69,7 @@ AT_CLEANUP
|
||||
|
||||
|
||||
# _AT_UNUSED_VALUES_DECLARATIONS()
|
||||
# --------------------------------------------
|
||||
# --------------------------------
|
||||
# Generate the token, type, and destructor
|
||||
# declarations for the unused values tests.
|
||||
|
||||
@@ -1340,3 +1340,32 @@ input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
|
||||
AT_BISON_CHECK([[-Werror,no-all,yacc input.y]], [[1]], [[]], [[experr]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------------------------------ ##
|
||||
## %name-prefix and %define api.prefix are incompatible. ##
|
||||
## ------------------------------------------------------ ##
|
||||
|
||||
AT_SETUP([[%name-prefix and %define api.prefix are incompatible]])
|
||||
|
||||
# AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION)
|
||||
# --------------------------------------------
|
||||
m4_pushdef([AT_TEST],
|
||||
[AT_DATA([[input.y]],
|
||||
[[$1
|
||||
%%
|
||||
exp:;
|
||||
]])
|
||||
AT_BISON_CHECK([[$2 input.y]], [[1]], [[]],
|
||||
[[$3: '%name-prefix' and '%define api.prefix' cannot be used together
|
||||
]])
|
||||
])
|
||||
|
||||
AT_TEST([%define api.prefix foo %name-prefix "bar"], [], [input.y:1.9-18])
|
||||
AT_TEST([], [-Dapi.prefix=foo -p bar], [<command line>:2])
|
||||
AT_TEST([%name-prefix "bar"], [-Dapi.prefix=foo], [<command line>:2])
|
||||
AT_TEST([%define api.prefix foo], [-p bar], [input.y:1.9-18])
|
||||
|
||||
m4_popdef([AT_TEST])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user