clearly deprecate %name-prefix

* src/scan-gram.l (%name-prefix): Issue a deprecation warning.

* tests/calc.at, tests/headers.at, tests/input.at, tests/java.at,
* tests/javapush.at, tests/local.at: Adjust expectations.
Or disable -Wdeprecated.

* doc/bison.texi: Document that %name-prefix is replaced by %define
api.prefix.
This commit is contained in:
Akim Demaille
2019-01-02 19:09:56 +01:00
parent 9ec93d4e34
commit b90675e67a
9 changed files with 63 additions and 49 deletions

View File

@@ -2310,7 +2310,7 @@ m4_pushdef([AT_TEST],
%%
exp: %empty;
]])
AT_BISON_CHECK([[$2 input.y]], [[1]], [[]],
AT_BISON_CHECK([[$2 -Wno-deprecated input.y]], [[1]], [[]],
[[$3: error: '%name-prefix' and '%define api.prefix' cannot be used together
]])
])
@@ -2501,7 +2501,9 @@ AT_DATA_GRAMMAR([[input.y]],
%token_table
%error-verbose
%glr-parser
%% exp : '0'
%name-prefix "bar"
%%
exp : '0'
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
@@ -2512,7 +2514,7 @@ input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-pre
input.y:14.1-15.2: warning: deprecated directive: '%file-prefix\n =', use '%file-prefix' [-Wdeprecated]
input.y:17.1-19: warning: deprecated directive: '%fixed-output_files', use '%fixed-output-files' [-Wdeprecated]
input.y:18.1-19: warning: deprecated directive: '%fixed_output-files', use '%fixed-output-files' [-Wdeprecated]
input.y:20.1-13: warning: deprecated directive: '%name-prefix=', use '%name-prefix' [-Wdeprecated]
input.y:20.1-13: warning: deprecated directive: '%name-prefix=', use '%define api.prefix' [-Wdeprecated]
input.y:21.1-16: warning: deprecated directive: '%no-default_prec', use '%no-default-prec' [-Wdeprecated]
input.y:22.1-16: warning: deprecated directive: '%no_default-prec', use '%no-default-prec' [-Wdeprecated]
input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wdeprecated]
@@ -2522,6 +2524,7 @@ input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-tabl
input.y:27.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:27-6: error: %define variable 'parse.error' redefined
input.y:11-6: previous definition
input.y:29.1-12: warning: deprecated directive: '%name-prefix', use '%define api.prefix' [-Wdeprecated]
]])
AT_CLEANUP
@@ -2581,7 +2584,6 @@ AT_DATA_GRAMMAR([[input.y]],
%file-prefix
"bar"
%fixed-output-files
%name-prefix "foo"
%no-default-prec
%no-lines
%output "foo"