aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 11:33:10 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:10 -0600
commit28aaf3fdf9562c018dcf6ab4d0a4c644fff8d696 (patch)
treeb4ca770f82e55440997751bd9297de577396e1f8 /gdb/parse.c
parent1e58a4a4db997cf09315c22f3da725d1da7f9ee7 (diff)
downloadgdb-28aaf3fdf9562c018dcf6ab4d0a4c644fff8d696.zip
gdb-28aaf3fdf9562c018dcf6ab4d0a4c644fff8d696.tar.gz
gdb-28aaf3fdf9562c018dcf6ab4d0a4c644fff8d696.tar.bz2
Remove paren_depth global
This removes the "paren_depth" global. In most cases, it is made into a static global in a given parser. I consider this a slight improvement, because it makes it clear that the variable isn't used for communication between different modules of gdb. The one exception is the Rust parser, which already incorporates all local state into a transient object; in this case the parser depth is now a member. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * rust-exp.y (struct rust_parser) <paren_depth>: New member. (rustyylex, rust_lex_test_init, rust_lex_test_one) (rust_lex_test_sequence, rust_lex_test_push_back): Update. * parser-defs.h (paren_depth): Don't declare. * parse.c (paren_depth): Remove global. (parse_exp_in_context): Update. * p-exp.y (paren_depth): New global. (pascal_parse): Initialize it. * m2-exp.y (paren_depth): New global. (m2_parse): Initialize it. * go-exp.y (paren_depth): New global. (go_parse): Initialize it. * f-exp.y (paren_depth): New global. (f_parse): Initialize it. * d-exp.y (paren_depth): New global. (d_parse): Initialize it. * c-exp.y (paren_depth): New global. (c_parse): Initialize it. * ada-lex.l (paren_depth): New global. (lexer_init): Initialize it.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index d76aeb1..4ac79fa 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -71,7 +71,6 @@ int arglist_len;
static struct type_stack type_stack;
const char *lexptr;
const char *prev_lexptr;
-int paren_depth;
int comma_terminates;
/* True if parsing an expression to attempt completion. */
@@ -1117,7 +1116,6 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
lexptr = *stringptr;
prev_lexptr = NULL;
- paren_depth = 0;
type_stack.elements.clear ();
expout_last_struct = -1;
expout_tag_completion_type = TYPE_CODE_UNDEF;