mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
Implement no-XXX arguments for --warnings, --report, --trace.
* src/getargs.c (flags_argmatch): Handles no-XXX. Fix typo in doxygen comment.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2008-11-21 Di-an Jan <dianj@freeshell.org>
|
||||||
|
|
||||||
|
Implement no-XXX arguments for --warnings, --report, --trace.
|
||||||
|
* src/getargs.c (flags_argmatch): Handles no-XXX.
|
||||||
|
Fix typo in doxygen comment.
|
||||||
|
|
||||||
2008-11-21 Akim Demaille <demaille@gostai.com>
|
2008-11-21 Akim Demaille <demaille@gostai.com>
|
||||||
|
|
||||||
Display the changes in cross-options.texi.
|
Display the changes in cross-options.texi.
|
||||||
|
|||||||
@@ -87,10 +87,12 @@ char *program_name;
|
|||||||
* \param keys array of valid subarguments.
|
* \param keys array of valid subarguments.
|
||||||
* \param values array of corresponding (int) values.
|
* \param values array of corresponding (int) values.
|
||||||
* \param flags the flags to update
|
* \param flags the flags to update
|
||||||
* \param args colon separated list of effective subarguments to decode.
|
* \param args comma separated list of effective subarguments to decode.
|
||||||
* If 0, then activate all the flags.
|
* If 0, then activate all the flags.
|
||||||
*
|
*
|
||||||
* The special value 0 resets the flags to 0.
|
* If VALUE != 0 then KEY sets flags and no-KEY clears them.
|
||||||
|
* If VALUE == 0 then KEY clears all flags and no-KEY sets all flags.
|
||||||
|
* Thus no-none = all and no-all = none.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
flags_argmatch (const char *option,
|
flags_argmatch (const char *option,
|
||||||
@@ -102,11 +104,18 @@ flags_argmatch (const char *option,
|
|||||||
args = strtok (args, ",");
|
args = strtok (args, ",");
|
||||||
while (args)
|
while (args)
|
||||||
{
|
{
|
||||||
int value = XARGMATCH (option, args, keys, values);
|
int no = strncmp (args, "no-", 3) == 0 ? 3 : 0;
|
||||||
|
int value = XARGMATCH (option, args + no, keys, values);
|
||||||
if (value == 0)
|
if (value == 0)
|
||||||
*flags = 0;
|
if (no)
|
||||||
|
*flags = ~0;
|
||||||
|
else
|
||||||
|
*flags = 0;
|
||||||
else
|
else
|
||||||
*flags |= value;
|
if (no)
|
||||||
|
*flags &= ~value;
|
||||||
|
else
|
||||||
|
*flags |= value;
|
||||||
args = strtok (NULL, ",");
|
args = strtok (NULL, ",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user