Introduce and use parser flags

This patch adds a new parser_flags type and changes the parser APIs to
use it rather than a collection of 'int' and 'bool'.  More flags will
be added in subsquent patches.
This commit is contained in:
Tom Tromey
2023-04-28 08:08:49 -06:00
parent 562db56844
commit b8c03634d6
7 changed files with 48 additions and 26 deletions

View File

@@ -1315,7 +1315,10 @@ process_print_command_args (const char *args, value_print_options *print_opts,
/* VOIDPRINT is true to indicate that we do want to print a void
value, so invert it for parse_expression. */
expression_up expr = parse_expression (exp, nullptr, !voidprint);
parser_flags flags = 0;
if (!voidprint)
flags = PARSER_VOID_CONTEXT;
expression_up expr = parse_expression (exp, nullptr, flags);
return expr->evaluate ();
}