gccrs: Improve lexer dump
authorRaiki Tamura <tamaron1203@gmail.com>
Wed, 16 Nov 2022 08:15:24 +0000 (17:15 +0900)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 21 Feb 2023 11:36:51 +0000 (12:36 +0100)
commit0ef795c3278e35cdd274f22bb0ab9783a983af57
tree6d66e92f7ecc2d42449c5489f9460ff358dfbf1e
parent78c70a50f7441d909f9cc3f23c6e970a1d7f1612
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>
gcc/rust/lex/rust-lex.cc
gcc/rust/lex/rust-lex.h
gcc/rust/parse/rust-parse-impl.h
gcc/rust/parse/rust-parse.h
gcc/rust/rust-session-manager.cc
gcc/rust/util/rust-optional.h