mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Misc improvements
This commit is contained in:
parent
b0889cb4ed
commit
6b59f6fbea
@ -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,
|
||||
}
|
||||
|
||||
|
@ -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! {
|
||||
|
Loading…
Reference in New Issue
Block a user