aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/lex/rust-token.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-15 16:24:56 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-30 12:36:44 +0100
commit7f6319671e348bfd64cd1f468d19db3be50b5a93 (patch)
tree3268305ad76520c3e117194786a774b06c6d0192 /gcc/rust/lex/rust-token.h
parent72792563e60fb56b42c2e96b3ae27d28e09c2e7d (diff)
downloadgcc-7f6319671e348bfd64cd1f468d19db3be50b5a93.zip
gcc-7f6319671e348bfd64cd1f468d19db3be50b5a93.tar.gz
gcc-7f6319671e348bfd64cd1f468d19db3be50b5a93.tar.bz2
gccrs: Replace TOK suffix with KW
TOK suffix was chosen to disambiguate some identifiers with c++ reserved keyword. Even though this list lies within the rust-token header, this macro is used in many context sometimes unrelated with the lexer and tokens. This TOK suffix may appear surprising in such context. gcc/rust/ChangeLog: * lex/rust-token.h (enum PrimitiveCoreType): Change keyword suffix from tok to kw. * ast/rust-ast-collector.cc (TokenCollector::visit): Update suffix to match the new declaration. * lex/rust-lex.cc (Lexer::parse_raw_identifier): Likewise. * parse/rust-parse-impl.h (can_tok_start_type): Likewise. (Parser::parse_item): Likewise. (Parser::parse_vis_item): Likewise. (Parser::parse_extern_crate): Likewise. (Parser::parse_function): Likewise. (Parser::parse_function_qualifiers): Likewise. (Parser::parse_struct): Likewise. (Parser::parse_enum): Likewise. (Parser::parse_static_item): Likewise. (Parser::parse_trait_item): Likewise. (Parser::parse_inherent_impl_item): Likewise. (Parser::parse_trait_impl_item): Likewise. (Parser::parse_extern_block): Likewise. (Parser::parse_external_item): Likewise. (Parser::parse_stmt): Likewise. (Parser::parse_return_expr): Likewise. (Parser::parse_match_expr): Likewise. (Parser::parse_type): Likewise. (Parser::parse_for_prefixed_type): Likewise. (Parser::parse_type_no_bounds): Likewise. (Parser::parse_stmt_or_expr): Likewise. * parse/rust-parse.cc (peculiar_fragment_match_compatible): Likewie. * util/rust-token-converter.cc (convert): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/lex/rust-token.h')
-rw-r--r--gcc/rust/lex/rust-token.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h
index 5da8b6c..50513ac 100644
--- a/gcc/rust/lex/rust-token.h
+++ b/gcc/rust/lex/rust-token.h
@@ -162,11 +162,11 @@ enum PrimitiveCoreType
RS_TOKEN_KEYWORD (DO, "do") /* unused */ \
RS_TOKEN_KEYWORD (DYN, "dyn") \
RS_TOKEN_KEYWORD (ELSE, "else") \
- RS_TOKEN_KEYWORD (ENUM_TOK, "enum") \
- RS_TOKEN_KEYWORD (EXTERN_TOK, "extern") \
+ RS_TOKEN_KEYWORD (ENUM_KW, "enum") \
+ RS_TOKEN_KEYWORD (EXTERN_KW, "extern") \
RS_TOKEN_KEYWORD (FALSE_LITERAL, "false") \
- RS_TOKEN_KEYWORD (FINAL_TOK, "final") /* unused */ \
- RS_TOKEN_KEYWORD (FN_TOK, "fn") \
+ RS_TOKEN_KEYWORD (FINAL_KW, "final") /* unused */ \
+ RS_TOKEN_KEYWORD (FN_KW, "fn") \
RS_TOKEN_KEYWORD (FOR, "for") \
RS_TOKEN_KEYWORD (IF, "if") \
RS_TOKEN_KEYWORD (IMPL, "impl") \
@@ -174,20 +174,20 @@ enum PrimitiveCoreType
RS_TOKEN_KEYWORD (LET, "let") \
RS_TOKEN_KEYWORD (LOOP, "loop") \
RS_TOKEN_KEYWORD (MACRO, "macro") \
- RS_TOKEN_KEYWORD (MATCH_TOK, "match") \
+ RS_TOKEN_KEYWORD (MATCH_KW, "match") \
RS_TOKEN_KEYWORD (MOD, "mod") \
RS_TOKEN_KEYWORD (MOVE, "move") \
RS_TOKEN_KEYWORD (MUT, "mut") \
- RS_TOKEN_KEYWORD (OVERRIDE_TOK, "override") /* unused */ \
- RS_TOKEN_KEYWORD (PRIV, "priv") /* unused */ \
+ RS_TOKEN_KEYWORD (OVERRIDE_KW, "override") /* unused */ \
+ RS_TOKEN_KEYWORD (PRIV, "priv") /* unused */ \
RS_TOKEN_KEYWORD (PUB, "pub") \
RS_TOKEN_KEYWORD (REF, "ref") \
- RS_TOKEN_KEYWORD (RETURN_TOK, "return") \
+ RS_TOKEN_KEYWORD (RETURN_KW, "return") \
RS_TOKEN_KEYWORD (SELF_ALIAS, \
"Self") /* mrustc does not treat this as a reserved word*/ \
RS_TOKEN_KEYWORD (SELF, "self") \
- RS_TOKEN_KEYWORD (STATIC_TOK, "static") \
- RS_TOKEN_KEYWORD (STRUCT_TOK, "struct") \
+ RS_TOKEN_KEYWORD (STATIC_KW, "static") \
+ RS_TOKEN_KEYWORD (STRUCT_KW, "struct") \
RS_TOKEN_KEYWORD (SUPER, "super") \
RS_TOKEN_KEYWORD (TRAIT, "trait") \
RS_TOKEN_KEYWORD (TRUE_LITERAL, "true") \