diagnostics: improve the accuracy for %error-verbose

Avoid duplicate warnings about %error-verbose, once for deprecation,
another for duplicate.  Keep only the duplicate warning for the second
occurrence of %error-verbose.

This will help removal fixits.

* src/scan-gram.l (%error-verbose): Return as a PERCENT_ERROR_VERBOSE
token.
* src/parse-gram.y (do_error_verbose): New.
Use it.
* src/muscle-tab.c (muscle_percent_variable_update): Handle pseudo
variables such as %error-verbose.
This commit is contained in:
Akim Demaille
2019-01-13 13:13:21 +01:00
parent 8580b268c3
commit ba469451d8
4 changed files with 33 additions and 18 deletions

View File

@@ -446,6 +446,8 @@ muscle_percent_variable_update (char const *variable,
} conversion_type;
const conversion_type conversion[] =
{
{ "%error-verbose", "parse.error=verbose", muscle_keyword },
{ "%error_verbose", "parse.error=verbose", muscle_keyword },
{ "abstract", "api.parser.abstract", muscle_keyword },
{ "annotations", "api.parser.annotations", muscle_code },
{ "api.push_pull", "api.push-pull", muscle_keyword },
@@ -477,7 +479,9 @@ muscle_percent_variable_update (char const *variable,
: STREQ (c->obsolete, variable))
{
/* Generate the deprecation warning. */
*old = define_directive (c->obsolete, kind, *value);
*old = c->obsolete[0] == '%'
? xstrdup (c->obsolete)
: define_directive (c->obsolete, kind, *value);
*upd = define_directive (c->updated, c->kind, *value);
/* Update the variable and its value. */
{