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

@@ -565,30 +565,6 @@ m4_define([b4_percent_define_use],
[m4_define([b4_percent_define_bison_variables(]$1[)])dnl
])
# b4_percent_define_copy_(SOURCE, DESTINATION, [|_loc|_syncline])
# ---------------------------------------------------------------
# Copy the value/loc/syncline from the variable SOURCE to the DESTINATION.
# Ignore undefined values. "Use" the SOURCE so that there are no
# complaints about unused variables.
m4_define([b4_percent_define_copy_],
[m4_ifdef([b4_percent_define$3(]$1[)],
[m4_define([b4_percent_define$3(]$2[)],
m4_defn([b4_percent_define$3(]$1[)]))])dnl
])
# b4_percent_define_copy(SOURCE, DESTINATION)
# -------------------------------------------
# Define the variable DESTINATION as a copy of SOURCE.
m4_define([b4_percent_define_copy],
[b4_percent_define_use([$1])dnl
b4_percent_define_copy_([$1], [$2], [])dnl
b4_percent_define_copy_([$1], [$2], [_loc])dnl
b4_percent_define_copy_([$1], [$2], [_syncline])dnl
])
# b4_percent_define_get(VARIABLE)
# -------------------------------
# Mimic muscle_percent_define_get in ../src/muscle_tab.h exactly. That is, if