Move comma_terminates global to parser_state

This moves the comma_terminates global to parser_state.

gdb/ChangeLog
2019-04-04  Tom Tromey  <tom@tromey.com>

	* rust-exp.y (rustyylex, rust_lex_tests): Update.
	* parser-defs.h (struct parser_state) <parser_state>: Add new
	parameter.
	<comma_terminates>: New member.
	(comma_terminates): Don't declare global.
	* parse.c (comma_terminates): Remove global.
	(parse_exp_in_context): Update.
	* p-exp.y (yylex): Update.
	* m2-exp.y (yylex): Update.
	* go-exp.y (lex_one_token): Update.
	* f-exp.y (yylex): Update.
	* d-exp.y (lex_one_token): Update.
	* c-exp.y (lex_one_token): Update.
	* ada-lex.l: Update.
This commit is contained in:
Tom Tromey
2019-03-24 18:07:00 -06:00
parent 28aaf3fdf9
commit 8621b685bf
11 changed files with 36 additions and 19 deletions

View File

@@ -71,7 +71,6 @@ int arglist_len;
static struct type_stack type_stack;
const char *lexptr;
const char *prev_lexptr;
int comma_terminates;
/* True if parsing an expression to attempt completion. */
int parse_completion;
@@ -1122,8 +1121,6 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
expout_completion_name.reset ();
innermost_block.reset (tracker_types);
comma_terminates = comma;
if (lexptr == 0 || *lexptr == 0)
error_no_arg (_("expression to compute"));
@@ -1187,7 +1184,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
to the value matching SELECTED_FRAME as set by get_current_arch. */
parser_state ps (lang, get_current_arch (), expression_context_block,
expression_context_pc);
expression_context_pc, comma);
scoped_restore_current_language lang_saver;
set_language (lang->la_language);