diff options
author | Tom Tromey <tom@tromey.com> | 2018-06-01 22:20:23 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-20 09:40:18 -0600 |
commit | 56ba65a04713fd8ff23908d4c57f75427317b8bb (patch) | |
tree | 729f93fba1764164bed0c8a82ea7590c93f3fe63 /gdb/buildsym.h | |
parent | 3ba174474d3cc063d6b7abf0bfdd6021bbaf8a90 (diff) | |
download | gdb-56ba65a04713fd8ff23908d4c57f75427317b8bb.zip gdb-56ba65a04713fd8ff23908d4c57f75427317b8bb.tar.gz gdb-56ba65a04713fd8ff23908d4c57f75427317b8bb.tar.bz2 |
Make the Rust parser pure
This makes the Rust parser a pure parser and removes all the
(non-constant) globals from rust-exp.y. This seemed like a nice
simplification to me and I think it should probably be applied to all
the parsers. Perhaps it would be good to go even one step farther and
have all parsers derive from parser_state.
Tested on x86-64 Fedora 26.
gdb/ChangeLog
2018-07-20 Tom Tromey <tom@tromey.com>
* rust-exp.y: Now a pure parser. Update all rules.
(%union): Move earlier.
(current_parser, work_obstack): Remove globals.
(rust_parser, ~rust_parser): Update.
(class rust_parser) <copy_name, concat3, crate_name, super_name,
lex_character, lex_number, lex_string, lex_identifier,
rust_lookup_type, convert_params_to_types, convert_ast_to_type,
convert_name, convert_params_to_expression,
convert_ast_to_expression, ast_basic_type, ast_operation,
ast_compound_assignment, rust_op, ast_literal, ast_dliteral,
ast_structop, ast_structop_anonymous, ast_unary, ast_cast,
ast_call_ish, ast_path, ast_string, ast_struct, ast_range,
ast_array_type, ast_slice_type, ast_reference_type,
ast_pointer_type, ast_function_type, ast_tuple_type>: New methods.
(rust_parse): Update.
(rustyyerror, rustyylex): Add parser parameter.
(rust_lex_test_one, rust_lex_int_test, rust_lex_exception_test)
(rust_lex_stringish_test, rust_lex_test_sequence)
(rust_lex_test_trailing_dot, rust_lex_test_completion)
(rust_lex_test_push_back, rust_lex_tests): Update.
Diffstat (limited to 'gdb/buildsym.h')
0 files changed, 0 insertions, 0 deletions