+/** If the \a variable name is obsolete, return the name to use,
+ * otherwise \a variable. */
+static
+char const *
+muscle_percent_variable_update (char const *variable, location variable_loc)
+{
+ typedef struct
+ {
+ const char *obsolete;
+ const char *updated;
+ } conversion_type;
+ const conversion_type conversion[] =
+ {
+ { "api.push_pull", "api.push-pull", },
+ { "api.tokens.prefix", "api.token.prefix", },
+ { "lex_symbol", "api.token.constructor", },
+ { "location_type", "api.location.type", },
+ { "lr.default-reductions", "lr.default-reduction", },
+ { "lr.keep-unreachable-states", "lr.keep-unreachable-state", },
+ { "lr.keep_unreachable_states", "lr.keep-unreachable-state", },
+ { "namespace", "api.namespace", },
+ };
+ char const *res = variable;
+ int i;
+ for (i = 0; i < ARRAY_CARDINALITY (conversion); ++i)
+ if (STREQ (conversion[i].obsolete, variable))
+ {
+ res = conversion[i].updated;
+ complain (&variable_loc, Wdeprecated,
+ _("deprecated %%define variable name: %s, use %s"),
+ quote (variable), quote_n (1, res));
+ break;
+ }
+ return res;
+}
+