From 6b59f6fbeaacf066ee0167f6cf48aa8eab467659 Mon Sep 17 00:00:00 2001 From: Caio Date: Fri, 13 Oct 2023 10:22:33 -0300 Subject: [PATCH] Misc improvements --- compiler/rustc_ast/src/token.rs | 27 ++++++++++++++++++++++++ compiler/rustc_builtin_macros/src/lib.rs | 14 ++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 300b1486f9b..04baed15a37 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -229,35 +229,61 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool { #[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] pub enum TokenKind { /* Expression-operator symbols. */ + /// `=` Eq, + /// `<` Lt, + /// `<=` Le, + /// `==` EqEq, + /// `!=` Ne, + /// `>` Ge, + /// `>=` Gt, + /// `&&` AndAnd, + /// `||` OrOr, + /// `!` Not, + /// `~` Tilde, BinOp(BinOpToken), BinOpEq(BinOpToken), /* Structural symbols */ + /// `@` At, + /// `.` Dot, + /// `..` DotDot, + /// `...` DotDotDot, + /// `..=` DotDotEq, + /// `,` Comma, + /// `;` Semi, + /// `:` Colon, + /// `::` ModSep, + /// `->` RArrow, + /// `<-` LArrow, + /// `=>` FatArrow, + /// `#` Pound, + /// `$` Dollar, + /// `?` Question, /// Used by proc macros for representing lifetimes, not generated by lexer right now. SingleQuote, @@ -296,6 +322,7 @@ pub enum TokenKind { /// similarly to symbols in string literal tokens. DocComment(CommentKind, ast::AttrStyle, Symbol), + /// End Of File Eof, } diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index ebf1448f55c..35b615697f7 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -71,33 +71,35 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) { } register_bang! { + // tidy-alphabetical-start asm: asm::expand_asm, assert: assert::expand_assert, cfg: cfg::expand_cfg, column: source_util::expand_column, compile_error: compile_error::expand_compile_error, + concat: concat::expand_concat, concat_bytes: concat_bytes::expand_concat_bytes, concat_idents: concat_idents::expand_concat_idents, - concat: concat::expand_concat, + const_format_args: format::expand_format_args, + core_panic: edition_panic::expand_panic, env: env::expand_env, file: source_util::expand_file, - format_args_nl: format::expand_format_args_nl, format_args: format::expand_format_args, - const_format_args: format::expand_format_args, + format_args_nl: format::expand_format_args_nl, global_asm: asm::expand_global_asm, + include: source_util::expand_include, include_bytes: source_util::expand_include_bytes, include_str: source_util::expand_include_str, - include: source_util::expand_include, line: source_util::expand_line, log_syntax: log_syntax::expand_log_syntax, module_path: source_util::expand_mod, option_env: env::expand_option_env, - core_panic: edition_panic::expand_panic, std_panic: edition_panic::expand_panic, - unreachable: edition_panic::expand_unreachable, stringify: source_util::expand_stringify, trace_macros: trace_macros::expand_trace_macros, type_ascribe: type_ascribe::expand_type_ascribe, + unreachable: edition_panic::expand_unreachable, + // tidy-alphabetical-end } register_attr! {