Skip to content

Commit

Permalink
Use colon for keyword defs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Apr 9, 2019
1 parent 86a3b9d commit 30a86cf
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/librustc_macros/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![,]>()?;

Expand Down
122 changes: 61 additions & 61 deletions src/libsyntax_pos/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*
Expand Down

0 comments on commit 30a86cf

Please sign in to comment.