aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 18:07:00 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:11 -0600
commit8621b685bfdcb8773b8177fb2b89e45499902868 (patch)
tree843765b0588efca85780159f17fa8e71eb7311ff /gdb/rust-exp.y
parent28aaf3fdf9562c018dcf6ab4d0a4c644fff8d696 (diff)
downloadgdb-8621b685bfdcb8773b8177fb2b89e45499902868.zip
gdb-8621b685bfdcb8773b8177fb2b89e45499902868.tar.gz
gdb-8621b685bfdcb8773b8177fb2b89e45499902868.tar.bz2
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.
Diffstat (limited to 'gdb/rust-exp.y')
-rw-r--r--gdb/rust-exp.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
index 9d3083e..2f2cc8f 100644
--- a/gdb/rust-exp.y
+++ b/gdb/rust-exp.y
@@ -1674,7 +1674,8 @@ rustyylex (YYSTYPE *lvalp, rust_parser *parser)
/* Falls through to lex_operator. */
++parser->paren_depth;
}
- else if (lexptr[0] == ',' && comma_terminates && parser->paren_depth == 0)
+ else if (lexptr[0] == ',' && parser->pstate->comma_terminates
+ && parser->paren_depth == 0)
return 0;
return lex_operator (lvalp);
@@ -2713,7 +2714,7 @@ rust_lex_tests (void)
// Set up dummy "parser", so that rust_type works.
struct parser_state ps (&rust_language_defn, target_gdbarch (),
- nullptr, 0);
+ nullptr, 0, 0);
rust_parser parser (&ps);
rust_lex_test_one (&parser, "", 0);