]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Add edition separation for keywords
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 16 Nov 2023 10:42:35 +0000 (11:42 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:44 +0000 (12:36 +0100)
commitc23db3e0c2e7717cedcdc1ff14f2aba563de2178
tree62ecc175f009f81f2544c61d8f0ce35cfcf9b780
parent7f6319671e348bfd64cd1f468d19db3be50b5a93
gccrs: Add edition separation for keywords

It might be required in the future to get only the keywords from a
specific edition. To do so we need a mean to differentiate keywords based
on their edition. This commit changes the existing keyword macro to
allow such behavior.

gcc/rust/ChangeLog:

* lex/rust-token.h (enum PrimitiveCoreType): Change enum macro calls.
(RS_TOKEN_KEYWORD): Remove generic token keyword macro.
(RS_TOKEN_KEYWORD_2015): Introduce keywords for edition 2015.
(RS_TOKEN_KEYWORD_2018): Likewise with edition 2018.
* lex/rust-token.cc (RS_TOKEN_KEYWORD): Remove old macro definition.
(RS_TOKEN_KEYWORD_2015): Replace with 2015 definition...
(RS_TOKEN_KEYWORD_2018): ... and 2018 definition.
* util/rust-keyword-values.cc (RS_TOKEN_KEYWORD):  Likewise.
(RS_TOKEN_KEYWORD_2015): Likewise.
(RS_TOKEN_KEYWORD_2018): Likewise.
* util/rust-keyword-values.h (RS_TOKEN_KEYWORD): Likewise.
(RS_TOKEN_KEYWORD_2015): Likewise.
(RS_TOKEN_KEYWORD_2018): Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/lex/rust-token.cc
gcc/rust/lex/rust-token.h
gcc/rust/util/rust-keyword-values.cc
gcc/rust/util/rust-keyword-values.h