gccrs: Improve lexer dump
gcc/rust/ChangeLog:
* lex/rust-lex.cc (Lexer::Lexer): Add `dump_lex` boolean flag.
(Lexer::skip_token): Dump tokens if flag is enabled.
(Lexer::dump_and_skip): New function.
* lex/rust-lex.h: Include optional.h and declare functions.
* parse/rust-parse-impl.h (Parser::debug_dump_lex_output): Remove old
unused function.
* parse/rust-parse.h: Likewise.
* rust-session-manager.cc (Session::compile_crate): Pass lexer dump
option to lexer.
(Session::dump_lex): New function.
* util/rust-optional.h: Add missing constructor.
Signed-off-by:
Raiki Tamura <tamaron1203@gmail.com>
Showing
- gcc/rust/lex/rust-lex.cc 44 additions, 3 deletionsgcc/rust/lex/rust-lex.cc
- gcc/rust/lex/rust-lex.h 10 additions, 2 deletionsgcc/rust/lex/rust-lex.h
- gcc/rust/parse/rust-parse-impl.h 0 additions, 41 deletionsgcc/rust/parse/rust-parse-impl.h
- gcc/rust/parse/rust-parse.h 0 additions, 2 deletionsgcc/rust/parse/rust-parse.h
- gcc/rust/rust-session-manager.cc 17 additions, 24 deletionsgcc/rust/rust-session-manager.cc
- gcc/rust/util/rust-optional.h 1 addition, 0 deletionsgcc/rust/util/rust-optional.h
Loading
Please register or sign in to comment