mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-16 15:53:03 +00:00
Revert "made previous commit less hairy"
This reverts commit fd01e1d05e.
This commit is contained in:
@@ -85,42 +85,61 @@ flags_argmatch (const char *option,
|
|||||||
if (args)
|
if (args)
|
||||||
{
|
{
|
||||||
args = strtok (args, ",");
|
args = strtok (args, ",");
|
||||||
|
|
||||||
|
/* Not sure whether we should keep this : -Werror=no-bar */
|
||||||
|
int no = STRPREFIX_LIT ("no-", args) ? 3 : 0;
|
||||||
|
args += no;
|
||||||
|
int value = 0;
|
||||||
|
|
||||||
while (args)
|
while (args)
|
||||||
{
|
{
|
||||||
int value = all;
|
int err = STRPREFIX_LIT ("error", args);
|
||||||
int *save_flags = flags;
|
|
||||||
int no = STRPREFIX_LIT ("no-", args) ? 3 : 0;
|
|
||||||
int err = STRPREFIX_LIT ("error", args + no) ? 5 : 0;
|
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
flags = &errors_flag;
|
args += (args[5] == '=') ? 6 : 5;
|
||||||
if (!err || args[no + err++] != '\0')
|
|
||||||
value = XARGMATCH (option, args + no + err, keys, values);
|
|
||||||
|
|
||||||
if (!value)
|
if (!err || args[-1] == '=')
|
||||||
|
value = XARGMATCH (option, args, keys, values);
|
||||||
|
if (value == 0)
|
||||||
|
{
|
||||||
|
if (no)
|
||||||
{
|
{
|
||||||
if (no)
|
if (err)
|
||||||
*flags |= all;
|
/* Using &= ~all activates complaint, silent and fatal */
|
||||||
|
errors_flag = Wnone;
|
||||||
else
|
else
|
||||||
*flags &= ~all;
|
*flags |= all;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (no)
|
if (err)
|
||||||
*flags &= ~value;
|
errors_flag |= all;
|
||||||
else
|
else
|
||||||
{
|
*flags &= ~all;
|
||||||
if (err)
|
|
||||||
warnings_flag |= value;
|
|
||||||
*flags |= value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
flags = save_flags;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (no)
|
||||||
|
{
|
||||||
|
if (err)
|
||||||
|
errors_flag &= ~value;
|
||||||
|
else
|
||||||
|
*flags &= ~value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (err)
|
||||||
|
{
|
||||||
|
errors_flag |= value;
|
||||||
|
warnings_flag |= value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*flags |= value;
|
||||||
|
}
|
||||||
|
}
|
||||||
args = strtok (NULL, ",");
|
args = strtok (NULL, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
*flags |= all;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Decode a set of sub arguments.
|
/** Decode a set of sub arguments.
|
||||||
|
|||||||
Reference in New Issue
Block a user