diff options
author | Tom Tromey <tom@tromey.com> | 2020-12-16 15:49:40 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-12-16 17:35:37 -0700 |
commit | c5c412054ebeb9e9c9dcbb36692b1d6235eb6106 (patch) | |
tree | 312afccbb667f8e41d5ceabd6c60ef3d6f29eb2b /gdb/parser-defs.h | |
parent | f81baa08635491ebf42c3c3609050399d8af21af (diff) | |
download | gdb-c5c412054ebeb9e9c9dcbb36692b1d6235eb6106.zip gdb-c5c412054ebeb9e9c9dcbb36692b1d6235eb6106.tar.gz gdb-c5c412054ebeb9e9c9dcbb36692b1d6235eb6106.tar.bz2 |
Change parameters to language_defn::post_parser
In the expression rewrite, Ada type resolution will be done at parse
time rather than in a post-parse pass. At this point,
language_defn::post_parser will be removed. However, for this to
work, the information available to post_parser must be made available
during the actual parse.
This patch refactors this code slightly to make this possible. In
particular, "void_context_p" is passed to the parser_state
constructor, and the parser state is then passed to the post_parser
method.
gdb/ChangeLog
2020-12-16 Tom Tromey <tom@tromey.com>
* rust-exp.y (rust_lex_tests): Update.
* parser-defs.h (parser_state): Add void_p parameter.
<void_context_p>: New member.
* parse.c (parse_exp_in_context): Update.
* language.h (language_defn::post_parser): Remove void_context_p,
completing, tracker parameters. Add parser state.
* ada-lang.c (ada_language::post_parser): Update.
Diffstat (limited to 'gdb/parser-defs.h')
-rw-r--r-- | gdb/parser-defs.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 1721605..56ac5ed 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -109,14 +109,16 @@ struct parser_state : public expr_builder int comma, const char *input, int completion, - innermost_block_tracker *tracker) + innermost_block_tracker *tracker, + bool void_p) : expr_builder (lang, gdbarch), expression_context_block (context_block), expression_context_pc (context_pc), comma_terminates (comma), lexptr (input), parse_completion (completion), - block_tracker (tracker) + block_tracker (tracker), + void_context_p (void_p) { } @@ -192,6 +194,9 @@ struct parser_state : public expr_builder /* The innermost block tracker. */ innermost_block_tracker *block_tracker; + /* True if no value is expected from the expression. */ + bool void_context_p; + private: /* Data structure for saving values of arglist_len for function calls whose |