Convert rust-exp.y to use operations
This converts the Rust parser to generate operations rather than
exp_elements.
The Rust parser already made its own AST, that it then lowered to GDB
expressions. Ironically, this made conversion trickier, rather than
simpler, than the other parsers, primarily due to the way that binary
operations were lowered. Perhaps in the future, converting the Rust
parser to directly create operations while parsing would be
worthwhile.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* rust-exp.y: Create operations.
(rust_parser::convert_params_to_expression): Change return type.
(binop_maker_ftype): New typedef.
(maker_map): New global.
(rust_parser::convert_ast_to_expression): Change return type.
(rust_language::parser): Update.
(_initialize_rust_exp): Initialize maker_map.