variables: simplify the upgrade of namespace into api.namespace.

This patch simplifies "variables: rename namespace as api.namespace",
commit 6750106107.
Suggested by Joel E. Denny in
http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html

	* src/muscle-tab.c (muscle_percent_variable_update): New.
	(muscle_percent_define_insert): Use it in replacement of the
	previous tr invocation.
	Remove variable_tr, no longer needed.
	* data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
	Remove.
	* data/c++.m4: No longer handle namespace -> api.namespace.
	* tests/input.at (%define backward compatibility): Check that
	namespace is treated as api.namespace.
This commit is contained in:
Akim Demaille
2009-08-19 14:24:15 +02:00
parent d59e456dbf
commit 171ad99d64
5 changed files with 57 additions and 46 deletions

View File

@@ -1055,6 +1055,17 @@ AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-34: invalid value for %define Boolean variable `lr.keep-unreachable-states'
]])
AT_DATA([[input.y]],
[[%define namespace "foo"
%define api.namespace "foo"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:2.9-21: %define variable `api.namespace' redefined
input.y:1.9-17: previous definition
]])
AT_DATA([[input.y]],
[[%define foo_bar "baz"
%%