diff options
| author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-07-19 13:09:17 +0200 |
|---|---|---|
| committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-07-19 13:09:17 +0200 |
| commit | 66af31d5bc5a1ea76be381dc9246fbe4fe034fbb (patch) | |
| tree | 9541637ba71200d98109f7bc3f698842deb4848e /gcc/rust/rust-session-manager.h | |
| parent | fb1b2a6bf5eed9dd9405dca9b9c895f48509875e (diff) | |
| download | gcc-66af31d5bc5a1ea76be381dc9246fbe4fe034fbb.zip gcc-66af31d5bc5a1ea76be381dc9246fbe4fe034fbb.tar.gz gcc-66af31d5bc5a1ea76be381dc9246fbe4fe034fbb.tar.bz2 | |
lexer: Allow specifiying tokens as reserved in certain editions
Some tokens such as `try` only became reserved keywords in certain
editions. This behavior might happen again in the future and we should
be able to handle it.
Diffstat (limited to 'gcc/rust/rust-session-manager.h')
| -rw-r--r-- | gcc/rust/rust-session-manager.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/rust-session-manager.h b/gcc/rust/rust-session-manager.h index c68e796..24a15f5 100644 --- a/gcc/rust/rust-session-manager.h +++ b/gcc/rust/rust-session-manager.h @@ -191,13 +191,13 @@ struct CompileOptions bool proc_macro = false; std::string metadata_output_path; - enum Edition + enum class Edition { E2015 = 0, E2018, E2021, } edition - = E2015; + = Edition::E2015; bool dump_option_enabled (DumpOption option) const { @@ -239,6 +239,8 @@ struct CompileOptions edition = static_cast<Edition> (raw_edition); } + const Edition &get_edition () { return edition; } + void set_metadata_output (const std::string &path) { metadata_output_path = path; |
