Skip to content
Permalink
Browse files

Use colon for keyword defs

  • Loading branch information...
Zoxc committed Apr 9, 2019
1 parent baebf79 commit f598091c055100daa1dc0d9c3f0f0a10209a0a84
Showing with 62 additions and 62 deletions.
  1. +1 −1 src/librustc_macros/src/symbols.rs
  2. +61 −61 src/libsyntax_pos/symbol.rs
@@ -22,7 +22,7 @@ struct Keyword {
impl Parse for Keyword {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let name = input.parse()?;
input.parse::<Token![,]>()?;
input.parse::<Token![:]>()?;
let value = input.parse()?;
input.parse::<Token![,]>()?;

@@ -23,79 +23,79 @@ symbols! {
Keywords {
// Special reserved identifiers used internally for elided lifetimes,
// unnamed method parameters, crate root module, error recovery etc.
Invalid, "",
PathRoot, "{{root}}",
DollarCrate, "$crate",
Underscore, "_",
Invalid: "",
PathRoot: "{{root}}",
DollarCrate: "$crate",
Underscore: "_",

// Keywords that are used in stable Rust.
As, "as",
Box, "box",
Break, "break",
Const, "const",
Continue, "continue",
Crate, "crate",
Else, "else",
Enum, "enum",
Extern, "extern",
False, "false",
Fn, "fn",
For, "for",
If, "if",
Impl, "impl",
In, "in",
Let, "let",
Loop, "loop",
Match, "match",
Mod, "mod",
Move, "move",
Mut, "mut",
Pub, "pub",
Ref, "ref",
Return, "return",
SelfLower, "self",
SelfUpper, "Self",
Static, "static",
Struct, "struct",
Super, "super",
Trait, "trait",
True, "true",
Type, "type",
Unsafe, "unsafe",
Use, "use",
Where, "where",
While, "while",
As: "as",
Box: "box",
Break: "break",
Const: "const",
Continue: "continue",
Crate: "crate",
Else: "else",
Enum: "enum",
Extern: "extern",
False: "false",
Fn: "fn",
For: "for",
If: "if",
Impl: "impl",
In: "in",
Let: "let",
Loop: "loop",
Match: "match",
Mod: "mod",
Move: "move",
Mut: "mut",
Pub: "pub",
Ref: "ref",
Return: "return",
SelfLower: "self",
SelfUpper: "Self",
Static: "static",
Struct: "struct",
Super: "super",
Trait: "trait",
True: "true",
Type: "type",
Unsafe: "unsafe",
Use: "use",
Where: "where",
While: "while",

// Keywords that are used in unstable Rust or reserved for future use.
Abstract, "abstract",
Become, "become",
Do, "do",
Final, "final",
Macro, "macro",
Override, "override",
Priv, "priv",
Typeof, "typeof",
Unsized, "unsized",
Virtual, "virtual",
Yield, "yield",
Abstract: "abstract",
Become: "become",
Do: "do",
Final: "final",
Macro: "macro",
Override: "override",
Priv: "priv",
Typeof: "typeof",
Unsized: "unsized",
Virtual: "virtual",
Yield: "yield",

// Edition-specific keywords that are used in stable Rust.
Dyn, "dyn", // >= 2018 Edition only
Dyn: "dyn", // >= 2018 Edition only

// Edition-specific keywords that are used in unstable Rust or reserved for future use.
Async, "async", // >= 2018 Edition only
Try, "try", // >= 2018 Edition only
Async: "async", // >= 2018 Edition only
Try: "try", // >= 2018 Edition only

// Special lifetime names
UnderscoreLifetime, "'_",
StaticLifetime, "'static",
UnderscoreLifetime: "'_",
StaticLifetime: "'static",

// Weak keywords, have special meaning only in specific contexts.
Auto, "auto",
Catch, "catch",
Default, "default",
Existential, "existential",
Union, "union",
Auto: "auto",
Catch: "catch",
Default: "default",
Existential: "existential",
Union: "union",
}

// Other symbols that can be referred to with syntax_pos::symbols::*

0 comments on commit f598091

Please sign in to comment.
You can’t perform that action at this time.