Misc improvements

This commit is contained in:
Caio 2023-10-13 10:22:33 -03:00
parent b0889cb4ed
commit 6b59f6fbea
2 changed files with 35 additions and 6 deletions

View File

@ -229,35 +229,61 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool {
#[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)] #[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
pub enum TokenKind { pub enum TokenKind {
/* Expression-operator symbols. */ /* Expression-operator symbols. */
/// `=`
Eq, Eq,
/// `<`
Lt, Lt,
/// `<=`
Le, Le,
/// `==`
EqEq, EqEq,
/// `!=`
Ne, Ne,
/// `>`
Ge, Ge,
/// `>=`
Gt, Gt,
/// `&&`
AndAnd, AndAnd,
/// `||`
OrOr, OrOr,
/// `!`
Not, Not,
/// `~`
Tilde, Tilde,
BinOp(BinOpToken), BinOp(BinOpToken),
BinOpEq(BinOpToken), BinOpEq(BinOpToken),
/* Structural symbols */ /* Structural symbols */
/// `@`
At, At,
/// `.`
Dot, Dot,
/// `..`
DotDot, DotDot,
/// `...`
DotDotDot, DotDotDot,
/// `..=`
DotDotEq, DotDotEq,
/// `,`
Comma, Comma,
/// `;`
Semi, Semi,
/// `:`
Colon, Colon,
/// `::`
ModSep, ModSep,
/// `->`
RArrow, RArrow,
/// `<-`
LArrow, LArrow,
/// `=>`
FatArrow, FatArrow,
/// `#`
Pound, Pound,
/// `$`
Dollar, Dollar,
/// `?`
Question, Question,
/// Used by proc macros for representing lifetimes, not generated by lexer right now. /// Used by proc macros for representing lifetimes, not generated by lexer right now.
SingleQuote, SingleQuote,
@ -296,6 +322,7 @@ pub enum TokenKind {
/// similarly to symbols in string literal tokens. /// similarly to symbols in string literal tokens.
DocComment(CommentKind, ast::AttrStyle, Symbol), DocComment(CommentKind, ast::AttrStyle, Symbol),
/// End Of File
Eof, Eof,
} }

View File

@ -71,33 +71,35 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
} }
register_bang! { register_bang! {
// tidy-alphabetical-start
asm: asm::expand_asm, asm: asm::expand_asm,
assert: assert::expand_assert, assert: assert::expand_assert,
cfg: cfg::expand_cfg, cfg: cfg::expand_cfg,
column: source_util::expand_column, column: source_util::expand_column,
compile_error: compile_error::expand_compile_error, compile_error: compile_error::expand_compile_error,
concat: concat::expand_concat,
concat_bytes: concat_bytes::expand_concat_bytes, concat_bytes: concat_bytes::expand_concat_bytes,
concat_idents: concat_idents::expand_concat_idents, 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, env: env::expand_env,
file: source_util::expand_file, file: source_util::expand_file,
format_args_nl: format::expand_format_args_nl,
format_args: format::expand_format_args, 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, global_asm: asm::expand_global_asm,
include: source_util::expand_include,
include_bytes: source_util::expand_include_bytes, include_bytes: source_util::expand_include_bytes,
include_str: source_util::expand_include_str, include_str: source_util::expand_include_str,
include: source_util::expand_include,
line: source_util::expand_line, line: source_util::expand_line,
log_syntax: log_syntax::expand_log_syntax, log_syntax: log_syntax::expand_log_syntax,
module_path: source_util::expand_mod, module_path: source_util::expand_mod,
option_env: env::expand_option_env, option_env: env::expand_option_env,
core_panic: edition_panic::expand_panic,
std_panic: edition_panic::expand_panic, std_panic: edition_panic::expand_panic,
unreachable: edition_panic::expand_unreachable,
stringify: source_util::expand_stringify, stringify: source_util::expand_stringify,
trace_macros: trace_macros::expand_trace_macros, trace_macros: trace_macros::expand_trace_macros,
type_ascribe: type_ascribe::expand_type_ascribe, type_ascribe: type_ascribe::expand_type_ascribe,
unreachable: edition_panic::expand_unreachable,
// tidy-alphabetical-end
} }
register_attr! { register_attr! {