Use colon for keyword defs

This commit is contained in:
John Kåre Alsaker 2019-04-09 09:39:48 +02:00
parent baebf79057
commit f598091c05
2 changed files with 62 additions and 62 deletions

View file

@ -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![,]>()?;

View file

@ -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::*