#[derive(Clone, Debug, PartialEq)]
pub enum Rust {
End = 0,
Identifier = 1,
SEMI = 2,
MacroRulesBANG = 3,
LPAREN = 4,
RPAREN = 5,
LBRACE = 6,
RBRACE = 7,
EQGT = 8,
LBRACK = 9,
RBRACK = 10,
COLON = 11,
DOLLAR = 12,
TokenRepetitionPatternToken1 = 13,
PLUS = 14,
STAR = 15,
QMARK = 16,
Block2 = 17,
Expr = 18,
Ident = 19,
Item = 20,
Lifetime2 = 21,
Literal2 = 22,
Meta = 23,
Pat = 24,
Path = 25,
Stmt = 26,
Tt = 27,
Ty = 28,
Vis = 29,
U8 = 30,
I8 = 31,
U16 = 32,
I16 = 33,
U32 = 34,
I32 = 35,
U64 = 36,
I64 = 37,
U128 = 38,
I128 = 39,
Isize = 40,
Usize = 41,
F32 = 42,
F64 = 43,
Bool = 44,
Str = 45,
Char = 46,
NonSpecialTokenToken1 = 47,
SQUOTE = 48,
As = 49,
Async = 50,
Await = 51,
Break = 52,
Const = 53,
Continue = 54,
Default = 55,
Enum = 56,
Fn = 57,
For = 58,
If = 59,
Impl = 60,
Let = 61,
Loop = 62,
Match = 63,
Mod = 64,
Pub = 65,
Return = 66,
Static = 67,
Struct = 68,
Trait = 69,
Type2 = 70,
Union = 71,
Unsafe = 72,
Use = 73,
Where = 74,
While = 75,
HASH = 76,
BANG = 77,
EQ = 78,
COMMA = 79,
Extern = 80,
Ref = 81,
DASHGT = 82,
LT = 83,
GT = 84,
COLONCOLON = 85,
UNDERSCORE = 86,
AMP = 87,
DOTDOTDOT = 88,
In = 89,
LT2 = 90,
Dyn = 91,
MutableSpecifier = 92,
DOTDOT = 93,
DOTDOTEQ = 94,
DASH = 95,
AMPAMP = 96,
PIPEPIPE = 97,
PIPE = 98,
CARET = 99,
EQEQ = 100,
BANGEQ = 101,
LTEQ = 102,
GTEQ = 103,
LTLT = 104,
GTGT = 105,
SLASH = 106,
PERCENT = 107,
PLUSEQ = 108,
DASHEQ = 109,
STAREQ = 110,
SLASHEQ = 111,
PERCENTEQ = 112,
AMPEQ = 113,
PIPEEQ = 114,
CARETEQ = 115,
LTLTEQ = 116,
GTGTEQ = 117,
Else = 118,
Move = 119,
DOT = 120,
AT = 121,
IntegerLiteral = 122,
DQUOTE = 123,
DQUOTE2 = 124,
CharLiteral = 125,
EscapeSequence = 126,
True = 127,
False = 128,
LineComment = 129,
Zelf = 130,
Super = 131,
Crate = 132,
Metavariable = 133,
StringContent = 134,
RawStringLiteral = 135,
FloatLiteral = 136,
BlockComment = 137,
SourceFile = 138,
Statement = 139,
EmptyStatement = 140,
ExpressionStatement = 141,
MacroDefinition = 142,
MacroRule = 143,
TokenPattern = 144,
TokenTreePattern = 145,
TokenBindingPattern = 146,
TokenRepetitionPattern = 147,
FragmentSpecifier = 148,
TokenTree = 149,
TokenRepetition = 150,
AttributeItem = 151,
InnerAttributeItem = 152,
MetaItem = 153,
MetaArguments = 154,
ModItem = 155,
ForeignModItem = 156,
DeclarationList = 157,
StructItem = 158,
UnionItem = 159,
EnumItem = 160,
EnumVariantList = 161,
EnumVariant = 162,
FieldDeclarationList = 163,
FieldDeclaration = 164,
OrderedFieldDeclarationList = 165,
ExternCrateDeclaration = 166,
ConstItem = 167,
StaticItem = 168,
TypeItem = 169,
FunctionItem = 170,
FunctionSignatureItem = 171,
FunctionModifiers = 172,
WhereClause = 173,
WherePredicate = 174,
ImplItem = 175,
TraitItem = 176,
AssociatedType = 177,
TraitBounds = 178,
HigherRankedTraitBound = 179,
RemovedTraitBound = 180,
TypeParameters = 181,
ConstParameter = 182,
ConstrainedTypeParameter = 183,
OptionalTypeParameter = 184,
LetDeclaration = 185,
UseDeclaration = 186,
UseClause = 187,
ScopedUseList = 188,
UseList = 189,
UseAsClause = 190,
UseWildcard = 191,
Parameters = 192,
SelfParameter = 193,
VariadicParameter = 194,
Parameter = 195,
ExternModifier = 196,
VisibilityModifier = 197,
Type = 198,
BracketedType = 199,
QualifiedType = 200,
Lifetime = 201,
ArrayType = 202,
ForLifetimes = 203,
FunctionType = 204,
TupleType = 205,
UnitType = 206,
GenericFunction = 207,
GenericType = 208,
GenericTypeWithTurbofish = 209,
BoundedType = 210,
TypeArguments = 211,
TypeBinding = 212,
ReferenceType = 213,
PointerType = 214,
EmptyType = 215,
AbstractType = 216,
DynamicType = 217,
Expression = 218,
MacroInvocation = 219,
ScopedIdentifier = 220,
ScopedTypeIdentifier = 221,
ScopedTypeIdentifier2 = 222,
RangeExpression = 223,
UnaryExpression = 224,
TryExpression = 225,
ReferenceExpression = 226,
BinaryExpression = 227,
AssignmentExpression = 228,
CompoundAssignmentExpr = 229,
TypeCastExpression = 230,
ReturnExpression = 231,
CallExpression = 232,
Arguments = 233,
ArrayExpression = 234,
ParenthesizedExpression = 235,
TupleExpression = 236,
UnitExpression = 237,
StructExpression = 238,
FieldInitializerList = 239,
ShorthandFieldInitializer = 240,
FieldInitializer = 241,
BaseFieldInitializer = 242,
IfExpression = 243,
IfLetExpression = 244,
ElseTail = 245,
MatchExpression = 246,
MatchBlock = 247,
MatchArm = 248,
MatchArm2 = 249,
MatchPattern = 250,
WhileExpression = 251,
WhileLetExpression = 252,
LoopExpression = 253,
ForExpression = 254,
ClosureExpression = 255,
ClosureParameters = 256,
LoopLabel = 257,
BreakExpression = 258,
ContinueExpression = 259,
IndexExpression = 260,
AwaitExpression = 261,
FieldExpression = 262,
UnsafeBlock = 263,
AsyncBlock = 264,
Block = 265,
Pattern = 266,
TuplePattern = 267,
SlicePattern = 268,
TupleStructPattern = 269,
StructPattern = 270,
FieldPattern = 271,
RemainingFieldPattern = 272,
MutPattern = 273,
RangePattern = 274,
RefPattern = 275,
CapturedPattern = 276,
ReferencePattern = 277,
OrPattern = 278,
Literal = 279,
LiteralPattern = 280,
NegativeLiteral = 281,
StringLiteral = 282,
BooleanLiteral = 283,
SourceFileRepeat1 = 284,
MacroDefinitionRepeat1 = 285,
TokenTreePatternRepeat1 = 286,
TokenTreeRepeat1 = 287,
MetaArgumentsRepeat1 = 288,
DeclarationListRepeat1 = 289,
EnumVariantListRepeat1 = 290,
EnumVariantListRepeat2 = 291,
FieldDeclarationListRepeat1 = 292,
OrderedFieldDeclarationListRepeat1 = 293,
FunctionModifiersRepeat1 = 294,
WhereClauseRepeat1 = 295,
TraitBoundsRepeat1 = 296,
TypeParametersRepeat1 = 297,
UseListRepeat1 = 298,
ParametersRepeat1 = 299,
ForLifetimesRepeat1 = 300,
TupleTypeRepeat1 = 301,
TypeArgumentsRepeat1 = 302,
ArgumentsRepeat1 = 303,
ArrayExpressionRepeat1 = 304,
TupleExpressionRepeat1 = 305,
FieldInitializerListRepeat1 = 306,
MatchBlockRepeat1 = 307,
ClosureParametersRepeat1 = 308,
TuplePatternRepeat1 = 309,
StructPatternRepeat1 = 310,
StringLiteralRepeat1 = 311,
FieldIdentifier = 312,
PrimitiveType = 313,
ShorthandFieldIdentifier = 314,
TypeIdentifier = 315,
Error = 316,
}
impl Into<&'static str> for Rust {
fn into(self) -> &'static str {
match self {
Rust::End => "end",
Rust::Identifier => "identifier",
Rust::SEMI => ";",
Rust::MacroRulesBANG => "macro_rules!",
Rust::LPAREN => "(",
Rust::RPAREN => ")",
Rust::LBRACE => "{",
Rust::RBRACE => "}",
Rust::EQGT => "=>",
Rust::LBRACK => "[",
Rust::RBRACK => "]",
Rust::COLON => ":",
Rust::DOLLAR => "$",
Rust::TokenRepetitionPatternToken1 => "token_repetition_pattern_token1",
Rust::PLUS => "+",
Rust::STAR => "*",
Rust::QMARK => "?",
Rust::Block2 => "block",
Rust::Expr => "expr",
Rust::Ident => "ident",
Rust::Item => "item",
Rust::Lifetime2 => "lifetime",
Rust::Literal2 => "literal",
Rust::Meta => "meta",
Rust::Pat => "pat",
Rust::Path => "path",
Rust::Stmt => "stmt",
Rust::Tt => "tt",
Rust::Ty => "ty",
Rust::Vis => "vis",
Rust::U8 => "u8",
Rust::I8 => "i8",
Rust::U16 => "u16",
Rust::I16 => "i16",
Rust::U32 => "u32",
Rust::I32 => "i32",
Rust::U64 => "u64",
Rust::I64 => "i64",
Rust::U128 => "u128",
Rust::I128 => "i128",
Rust::Isize => "isize",
Rust::Usize => "usize",
Rust::F32 => "f32",
Rust::F64 => "f64",
Rust::Bool => "bool",
Rust::Str => "str",
Rust::Char => "char",
Rust::NonSpecialTokenToken1 => "_non_special_token_token1",
Rust::SQUOTE => "'",
Rust::As => "as",
Rust::Async => "async",
Rust::Await => "await",
Rust::Break => "break",
Rust::Const => "const",
Rust::Continue => "continue",
Rust::Default => "default",
Rust::Enum => "enum",
Rust::Fn => "fn",
Rust::For => "for",
Rust::If => "if",
Rust::Impl => "impl",
Rust::Let => "let",
Rust::Loop => "loop",
Rust::Match => "match",
Rust::Mod => "mod",
Rust::Pub => "pub",
Rust::Return => "return",
Rust::Static => "static",
Rust::Struct => "struct",
Rust::Trait => "trait",
Rust::Type2 => "type",
Rust::Union => "union",
Rust::Unsafe => "unsafe",
Rust::Use => "use",
Rust::Where => "where",
Rust::While => "while",
Rust::HASH => "#",
Rust::BANG => "!",
Rust::EQ => "=",
Rust::COMMA => ",",
Rust::Extern => "extern",
Rust::Ref => "ref",
Rust::DASHGT => "->",
Rust::LT => "<",
Rust::GT => ">",
Rust::COLONCOLON => "::",
Rust::UNDERSCORE => "_",
Rust::AMP => "&",
Rust::DOTDOTDOT => "...",
Rust::In => "in",
Rust::LT2 => "<",
Rust::Dyn => "dyn",
Rust::MutableSpecifier => "mutable_specifier",
Rust::DOTDOT => "..",
Rust::DOTDOTEQ => "..=",
Rust::DASH => "-",
Rust::AMPAMP => "&&",
Rust::PIPEPIPE => "||",
Rust::PIPE => "|",
Rust::CARET => "^",
Rust::EQEQ => "==",
Rust::BANGEQ => "!=",
Rust::LTEQ => "<=",
Rust::GTEQ => ">=",
Rust::LTLT => "<<",
Rust::GTGT => ">>",
Rust::SLASH => "/",
Rust::PERCENT => "%",
Rust::PLUSEQ => "+=",
Rust::DASHEQ => "-=",
Rust::STAREQ => "*=",
Rust::SLASHEQ => "/=",
Rust::PERCENTEQ => "%=",
Rust::AMPEQ => "&=",
Rust::PIPEEQ => "|=",
Rust::CARETEQ => "^=",
Rust::LTLTEQ => "<<=",
Rust::GTGTEQ => ">>=",
Rust::Else => "else",
Rust::Move => "move",
Rust::DOT => ".",
Rust::AT => "@",
Rust::IntegerLiteral => "integer_literal",
Rust::DQUOTE => "\"",
Rust::DQUOTE2 => "\"",
Rust::CharLiteral => "char_literal",
Rust::EscapeSequence => "escape_sequence",
Rust::True => "true",
Rust::False => "false",
Rust::LineComment => "line_comment",
Rust::Zelf => "self",
Rust::Super => "super",
Rust::Crate => "crate",
Rust::Metavariable => "metavariable",
Rust::StringContent => "_string_content",
Rust::RawStringLiteral => "raw_string_literal",
Rust::FloatLiteral => "float_literal",
Rust::BlockComment => "block_comment",
Rust::SourceFile => "source_file",
Rust::Statement => "_statement",
Rust::EmptyStatement => "empty_statement",
Rust::ExpressionStatement => "_expression_statement",
Rust::MacroDefinition => "macro_definition",
Rust::MacroRule => "macro_rule",
Rust::TokenPattern => "_token_pattern",
Rust::TokenTreePattern => "token_tree_pattern",
Rust::TokenBindingPattern => "token_binding_pattern",
Rust::TokenRepetitionPattern => "token_repetition_pattern",
Rust::FragmentSpecifier => "fragment_specifier",
Rust::TokenTree => "token_tree",
Rust::TokenRepetition => "token_repetition",
Rust::AttributeItem => "attribute_item",
Rust::InnerAttributeItem => "inner_attribute_item",
Rust::MetaItem => "meta_item",
Rust::MetaArguments => "meta_arguments",
Rust::ModItem => "mod_item",
Rust::ForeignModItem => "foreign_mod_item",
Rust::DeclarationList => "declaration_list",
Rust::StructItem => "struct_item",
Rust::UnionItem => "union_item",
Rust::EnumItem => "enum_item",
Rust::EnumVariantList => "enum_variant_list",
Rust::EnumVariant => "enum_variant",
Rust::FieldDeclarationList => "field_declaration_list",
Rust::FieldDeclaration => "field_declaration",
Rust::OrderedFieldDeclarationList => "ordered_field_declaration_list",
Rust::ExternCrateDeclaration => "extern_crate_declaration",
Rust::ConstItem => "const_item",
Rust::StaticItem => "static_item",
Rust::TypeItem => "type_item",
Rust::FunctionItem => "function_item",
Rust::FunctionSignatureItem => "function_signature_item",
Rust::FunctionModifiers => "function_modifiers",
Rust::WhereClause => "where_clause",
Rust::WherePredicate => "where_predicate",
Rust::ImplItem => "impl_item",
Rust::TraitItem => "trait_item",
Rust::AssociatedType => "associated_type",
Rust::TraitBounds => "trait_bounds",
Rust::HigherRankedTraitBound => "higher_ranked_trait_bound",
Rust::RemovedTraitBound => "removed_trait_bound",
Rust::TypeParameters => "type_parameters",
Rust::ConstParameter => "const_parameter",
Rust::ConstrainedTypeParameter => "constrained_type_parameter",
Rust::OptionalTypeParameter => "optional_type_parameter",
Rust::LetDeclaration => "let_declaration",
Rust::UseDeclaration => "use_declaration",
Rust::UseClause => "_use_clause",
Rust::ScopedUseList => "scoped_use_list",
Rust::UseList => "use_list",
Rust::UseAsClause => "use_as_clause",
Rust::UseWildcard => "use_wildcard",
Rust::Parameters => "parameters",
Rust::SelfParameter => "self_parameter",
Rust::VariadicParameter => "variadic_parameter",
Rust::Parameter => "parameter",
Rust::ExternModifier => "extern_modifier",
Rust::VisibilityModifier => "visibility_modifier",
Rust::Type => "_type",
Rust::BracketedType => "bracketed_type",
Rust::QualifiedType => "qualified_type",
Rust::Lifetime => "lifetime",
Rust::ArrayType => "array_type",
Rust::ForLifetimes => "for_lifetimes",
Rust::FunctionType => "function_type",
Rust::TupleType => "tuple_type",
Rust::UnitType => "unit_type",
Rust::GenericFunction => "generic_function",
Rust::GenericType => "generic_type",
Rust::GenericTypeWithTurbofish => "generic_type_with_turbofish",
Rust::BoundedType => "bounded_type",
Rust::TypeArguments => "type_arguments",
Rust::TypeBinding => "type_binding",
Rust::ReferenceType => "reference_type",
Rust::PointerType => "pointer_type",
Rust::EmptyType => "empty_type",
Rust::AbstractType => "abstract_type",
Rust::DynamicType => "dynamic_type",
Rust::Expression => "_expression",
Rust::MacroInvocation => "macro_invocation",
Rust::ScopedIdentifier => "scoped_identifier",
Rust::ScopedTypeIdentifier => "scoped_type_identifier",
Rust::ScopedTypeIdentifier2 => "scoped_type_identifier",
Rust::RangeExpression => "range_expression",
Rust::UnaryExpression => "unary_expression",
Rust::TryExpression => "try_expression",
Rust::ReferenceExpression => "reference_expression",
Rust::BinaryExpression => "binary_expression",
Rust::AssignmentExpression => "assignment_expression",
Rust::CompoundAssignmentExpr => "compound_assignment_expr",
Rust::TypeCastExpression => "type_cast_expression",
Rust::ReturnExpression => "return_expression",
Rust::CallExpression => "call_expression",
Rust::Arguments => "arguments",
Rust::ArrayExpression => "array_expression",
Rust::ParenthesizedExpression => "parenthesized_expression",
Rust::TupleExpression => "tuple_expression",
Rust::UnitExpression => "unit_expression",
Rust::StructExpression => "struct_expression",
Rust::FieldInitializerList => "field_initializer_list",
Rust::ShorthandFieldInitializer => "shorthand_field_initializer",
Rust::FieldInitializer => "field_initializer",
Rust::BaseFieldInitializer => "base_field_initializer",
Rust::IfExpression => "if_expression",
Rust::IfLetExpression => "if_let_expression",
Rust::ElseTail => "_else_tail",
Rust::MatchExpression => "match_expression",
Rust::MatchBlock => "match_block",
Rust::MatchArm => "match_arm",
Rust::MatchArm2 => "match_arm",
Rust::MatchPattern => "match_pattern",
Rust::WhileExpression => "while_expression",
Rust::WhileLetExpression => "while_let_expression",
Rust::LoopExpression => "loop_expression",
Rust::ForExpression => "for_expression",
Rust::ClosureExpression => "closure_expression",
Rust::ClosureParameters => "closure_parameters",
Rust::LoopLabel => "loop_label",
Rust::BreakExpression => "break_expression",
Rust::ContinueExpression => "continue_expression",
Rust::IndexExpression => "index_expression",
Rust::AwaitExpression => "await_expression",
Rust::FieldExpression => "field_expression",
Rust::UnsafeBlock => "unsafe_block",
Rust::AsyncBlock => "async_block",
Rust::Block => "block",
Rust::Pattern => "_pattern",
Rust::TuplePattern => "tuple_pattern",
Rust::SlicePattern => "slice_pattern",
Rust::TupleStructPattern => "tuple_struct_pattern",
Rust::StructPattern => "struct_pattern",
Rust::FieldPattern => "field_pattern",
Rust::RemainingFieldPattern => "remaining_field_pattern",
Rust::MutPattern => "mut_pattern",
Rust::RangePattern => "range_pattern",
Rust::RefPattern => "ref_pattern",
Rust::CapturedPattern => "captured_pattern",
Rust::ReferencePattern => "reference_pattern",
Rust::OrPattern => "or_pattern",
Rust::Literal => "_literal",
Rust::LiteralPattern => "_literal_pattern",
Rust::NegativeLiteral => "negative_literal",
Rust::StringLiteral => "string_literal",
Rust::BooleanLiteral => "boolean_literal",
Rust::SourceFileRepeat1 => "source_file_repeat1",
Rust::MacroDefinitionRepeat1 => "macro_definition_repeat1",
Rust::TokenTreePatternRepeat1 => "token_tree_pattern_repeat1",
Rust::TokenTreeRepeat1 => "token_tree_repeat1",
Rust::MetaArgumentsRepeat1 => "meta_arguments_repeat1",
Rust::DeclarationListRepeat1 => "declaration_list_repeat1",
Rust::EnumVariantListRepeat1 => "enum_variant_list_repeat1",
Rust::EnumVariantListRepeat2 => "enum_variant_list_repeat2",
Rust::FieldDeclarationListRepeat1 => "field_declaration_list_repeat1",
Rust::OrderedFieldDeclarationListRepeat1 => "ordered_field_declaration_list_repeat1",
Rust::FunctionModifiersRepeat1 => "function_modifiers_repeat1",
Rust::WhereClauseRepeat1 => "where_clause_repeat1",
Rust::TraitBoundsRepeat1 => "trait_bounds_repeat1",
Rust::TypeParametersRepeat1 => "type_parameters_repeat1",
Rust::UseListRepeat1 => "use_list_repeat1",
Rust::ParametersRepeat1 => "parameters_repeat1",
Rust::ForLifetimesRepeat1 => "for_lifetimes_repeat1",
Rust::TupleTypeRepeat1 => "tuple_type_repeat1",
Rust::TypeArgumentsRepeat1 => "type_arguments_repeat1",
Rust::ArgumentsRepeat1 => "arguments_repeat1",
Rust::ArrayExpressionRepeat1 => "array_expression_repeat1",
Rust::TupleExpressionRepeat1 => "tuple_expression_repeat1",
Rust::FieldInitializerListRepeat1 => "field_initializer_list_repeat1",
Rust::MatchBlockRepeat1 => "match_block_repeat1",
Rust::ClosureParametersRepeat1 => "closure_parameters_repeat1",
Rust::TuplePatternRepeat1 => "tuple_pattern_repeat1",
Rust::StructPatternRepeat1 => "struct_pattern_repeat1",
Rust::StringLiteralRepeat1 => "string_literal_repeat1",
Rust::FieldIdentifier => "field_identifier",
Rust::PrimitiveType => "primitive_type",
Rust::ShorthandFieldIdentifier => "shorthand_field_identifier",
Rust::TypeIdentifier => "type_identifier",
Rust::Error => "ERROR",
}
}
}
#[allow(clippy::unreadable_literal)]
static KEYS: phf::Map<&'static str, Rust> = ::phf::Map {
key: 3213172566270843353,
disps: ::phf::Slice::Static(&[
(0, 223),
(0, 17),
(0, 0),
(3, 29),
(2, 145),
(0, 4),
(0, 85),
(0, 0),
(0, 139),
(0, 5),
(0, 221),
(2, 223),
(8, 137),
(4, 168),
(0, 44),
(2, 33),
(0, 46),
(0, 1),
(0, 0),
(0, 11),
(0, 17),
(0, 75),
(0, 86),
(0, 3),
(0, 23),
(1, 0),
(25, 19),
(0, 20),
(0, 55),
(0, 11),
(7, 144),
(17, 242),
(11, 85),
(0, 265),
(2, 282),
(0, 0),
(0, 284),
(19, 56),
(0, 25),
(0, 12),
(1, 11),
(0, 304),
(0, 83),
(36, 279),
(0, 119),
(0, 12),
(0, 166),
(3, 95),
(0, 5),
(0, 233),
(0, 2),
(0, 3),
(0, 152),
(95, 26),
(9, 184),
(0, 137),
(0, 2),
(2, 38),
(4, 267),
(2, 155),
(0, 0),
(0, 166),
]),
entries: ::phf::Slice::Static(&[
("array_expression_repeat1", Rust::ArrayExpressionRepeat1),
(
"ordered_field_declaration_list_repeat1",
Rust::OrderedFieldDeclarationListRepeat1,
),
("for_expression", Rust::ForExpression),
("optional_type_parameter", Rust::OptionalTypeParameter),
("match_pattern", Rust::MatchPattern),
("struct", Rust::Struct),
("field_initializer", Rust::FieldInitializer),
("<=", Rust::LTEQ),
("macro_definition_repeat1", Rust::MacroDefinitionRepeat1),
("enum", Rust::Enum),
("meta_arguments_repeat1", Rust::MetaArgumentsRepeat1),
("while_expression", Rust::WhileExpression),
("self_parameter", Rust::SelfParameter),
("ident", Rust::Ident),
("super", Rust::Super),
("u16", Rust::U16),
("line_comment", Rust::LineComment),
("|", Rust::PIPE),
("abstract_type", Rust::AbstractType),
("field_identifier", Rust::FieldIdentifier),
("trait", Rust::Trait),
("as", Rust::As),
("type_binding", Rust::TypeBinding),
(
"generic_type_with_turbofish",
Rust::GenericTypeWithTurbofish,
),
(
"shorthand_field_initializer",
Rust::ShorthandFieldInitializer,
),
("extern_crate_declaration", Rust::ExternCrateDeclaration),
(">>=", Rust::GTGTEQ),
("match_arm", Rust::MatchArm),
("type_arguments_repeat1", Rust::TypeArgumentsRepeat1),
("tuple_type_repeat1", Rust::TupleTypeRepeat1),
("@", Rust::AT),
("?", Rust::QMARK),
("return_expression", Rust::ReturnExpression),
("mut_pattern", Rust::MutPattern),
("continue", Rust::Continue),
("use_as_clause", Rust::UseAsClause),
("static_item", Rust::StaticItem),
("(", Rust::LPAREN),
("function_type", Rust::FunctionType),
("let_declaration", Rust::LetDeclaration),
("extern", Rust::Extern),
(";", Rust::SEMI),
("arguments", Rust::Arguments),
("let", Rust::Let),
("arguments_repeat1", Rust::ArgumentsRepeat1),
("match_block_repeat1", Rust::MatchBlockRepeat1),
("type_parameters", Rust::TypeParameters),
("escape_sequence", Rust::EscapeSequence),
("use", Rust::Use),
("source_file_repeat1", Rust::SourceFileRepeat1),
("metavariable", Rust::Metavariable),
("declaration_list_repeat1", Rust::DeclarationListRepeat1),
("boolean_literal", Rust::BooleanLiteral),
("type_identifier", Rust::TypeIdentifier),
("float_literal", Rust::FloatLiteral),
("while_let_expression", Rust::WhileLetExpression),
("match", Rust::Match),
("\'", Rust::SQUOTE),
("array_type", Rust::ArrayType),
("#", Rust::HASH),
(">", Rust::GT),
("async", Rust::Async),
("lifetime", Rust::Lifetime),
("::", Rust::COLONCOLON),
("macro_definition", Rust::MacroDefinition),
("enum_item", Rust::EnumItem),
("await_expression", Rust::AwaitExpression),
("parenthesized_expression", Rust::ParenthesizedExpression),
("trait_bounds_repeat1", Rust::TraitBoundsRepeat1),
("ref", Rust::Ref),
("true", Rust::True),
("removed_trait_bound", Rust::RemovedTraitBound),
("slice_pattern", Rust::SlicePattern),
("if", Rust::If),
("_expression", Rust::Expression),
("string_literal_repeat1", Rust::StringLiteralRepeat1),
("impl_item", Rust::ImplItem),
("type_cast_expression", Rust::TypeCastExpression),
("self", Rust::Zelf),
("empty_type", Rust::EmptyType),
("empty_statement", Rust::EmptyStatement),
("type_arguments", Rust::TypeArguments),
("array_expression", Rust::ArrayExpression),
("\\\"", Rust::DQUOTE),
("negative_literal", Rust::NegativeLiteral),
("macro_invocation", Rust::MacroInvocation),
("declaration_list", Rust::DeclarationList),
("where", Rust::Where),
("break_expression", Rust::BreakExpression),
("loop", Rust::Loop),
("closure_expression", Rust::ClosureExpression),
("visibility_modifier", Rust::VisibilityModifier),
("loop_label", Rust::LoopLabel),
("..=", Rust::DOTDOTEQ),
("field_expression", Rust::FieldExpression),
("usize", Rust::Usize),
("where_clause_repeat1", Rust::WhereClauseRepeat1),
("macro_rules!", Rust::MacroRulesBANG),
("expr", Rust::Expr),
(")", Rust::RPAREN),
("integer_literal", Rust::IntegerLiteral),
("{", Rust::LBRACE),
("str", Rust::Str),
("_statement", Rust::Statement),
("loop_expression", Rust::LoopExpression),
("/", Rust::SLASH),
("dyn", Rust::Dyn),
("shorthand_field_identifier", Rust::ShorthandFieldIdentifier),
("-", Rust::DASH),
("u8", Rust::U8),
("token_repetition", Rust::TokenRepetition),
("_non_special_token_token1", Rust::NonSpecialTokenToken1),
(
"field_initializer_list_repeat1",
Rust::FieldInitializerListRepeat1,
),
("char_literal", Rust::CharLiteral),
("function_item", Rust::FunctionItem),
("while", Rust::While),
("tuple_expression", Rust::TupleExpression),
("assignment_expression", Rust::AssignmentExpression),
("use_wildcard", Rust::UseWildcard),
("where_clause", Rust::WhereClause),
("item", Rust::Item),
("enum_variant_list_repeat2", Rust::EnumVariantListRepeat2),
("}", Rust::RBRACE),
("&", Rust::AMP),
("_literal_pattern", Rust::LiteralPattern),
("else", Rust::Else),
("function_modifiers", Rust::FunctionModifiers),
("!", Rust::BANG),
("or_pattern", Rust::OrPattern),
("]", Rust::RBRACK),
("closure_parameters_repeat1", Rust::ClosureParametersRepeat1),
("tuple_struct_pattern", Rust::TupleStructPattern),
("identifier", Rust::Identifier),
("mod", Rust::Mod),
("!=", Rust::BANGEQ),
("bracketed_type", Rust::BracketedType),
("unary_expression", Rust::UnaryExpression),
("struct_pattern", Rust::StructPattern),
("generic_type", Rust::GenericType),
("tuple_expression_repeat1", Rust::TupleExpressionRepeat1),
("false", Rust::False),
("unit_expression", Rust::UnitExpression),
("remaining_field_pattern", Rust::RemainingFieldPattern),
("if_let_expression", Rust::IfLetExpression),
("i32", Rust::I32),
("^=", Rust::CARETEQ),
("i16", Rust::I16),
("impl", Rust::Impl),
("end", Rust::End),
("struct_pattern_repeat1", Rust::StructPatternRepeat1),
("union", Rust::Union),
("parameters_repeat1", Rust::ParametersRepeat1),
("field_declaration", Rust::FieldDeclaration),
("scoped_type_identifier", Rust::ScopedTypeIdentifier),
("call_expression", Rust::CallExpression),
("bool", Rust::Bool),
("meta", Rust::Meta),
("unsafe", Rust::Unsafe),
("source_file", Rust::SourceFile),
(">>", Rust::GTGT),
("generic_function", Rust::GenericFunction),
("continue_expression", Rust::ContinueExpression),
("$", Rust::DOLLAR),
("&=", Rust::AMPEQ),
("block", Rust::Block),
("ERROR", Rust::Error),
("f64", Rust::F64),
("fragment_specifier", Rust::FragmentSpecifier),
("_literal", Rust::Literal),
("const_item", Rust::ConstItem),
("=>", Rust::EQGT),
("field_pattern", Rust::FieldPattern),
(":", Rust::COLON),
("mutable_specifier", Rust::MutableSpecifier),
("break", Rust::Break),
("/=", Rust::SLASHEQ),
(
"token_repetition_pattern_token1",
Rust::TokenRepetitionPatternToken1,
),
("+=", Rust::PLUSEQ),
("==", Rust::EQEQ),
("extern_modifier", Rust::ExternModifier),
("_type", Rust::Type),
("isize", Rust::Isize),
("_token_pattern", Rust::TokenPattern),
("||", Rust::PIPEPIPE),
("scoped_identifier", Rust::ScopedIdentifier),
("fn", Rust::Fn),
("foreign_mod_item", Rust::ForeignModItem),
("ref_pattern", Rust::RefPattern),
("=", Rust::EQ),
("unit_type", Rust::UnitType),
("+", Rust::PLUS),
("<<=", Rust::LTLTEQ),
("const", Rust::Const),
("block_comment", Rust::BlockComment),
("u128", Rust::U128),
("variadic_parameter", Rust::VariadicParameter),
("i128", Rust::I128),
("->", Rust::DASHGT),
("range_pattern", Rust::RangePattern),
("enum_variant", Rust::EnumVariant),
("...", Rust::DOTDOTDOT),
("i64", Rust::I64),
("enum_variant_list", Rust::EnumVariantList),
("default", Rust::Default),
(">=", Rust::GTEQ),
("qualified_type", Rust::QualifiedType),
("_pattern", Rust::Pattern),
("primitive_type", Rust::PrimitiveType),
("token_binding_pattern", Rust::TokenBindingPattern),
("|=", Rust::PIPEEQ),
("scoped_use_list", Rust::ScopedUseList),
("_", Rust::UNDERSCORE),
("*", Rust::STAR),
("reference_pattern", Rust::ReferencePattern),
("_string_content", Rust::StringContent),
("function_signature_item", Rust::FunctionSignatureItem),
("<<", Rust::LTLT),
("field_initializer_list", Rust::FieldInitializerList),
("trait_item", Rust::TraitItem),
("%", Rust::PERCENT),
("pub", Rust::Pub),
("for_lifetimes", Rust::ForLifetimes),
("struct_expression", Rust::StructExpression),
("associated_type", Rust::AssociatedType),
("captured_pattern", Rust::CapturedPattern),
("binary_expression", Rust::BinaryExpression),
("string_literal", Rust::StringLiteral),
("tuple_pattern", Rust::TuplePattern),
("-=", Rust::DASHEQ),
("closure_parameters", Rust::ClosureParameters),
("crate", Rust::Crate),
("field_declaration_list", Rust::FieldDeclarationList),
("*=", Rust::STAREQ),
("meta_arguments", Rust::MetaArguments),
("token_tree_repeat1", Rust::TokenTreeRepeat1),
("pointer_type", Rust::PointerType),
(
"field_declaration_list_repeat1",
Rust::FieldDeclarationListRepeat1,
),
("token_tree_pattern_repeat1", Rust::TokenTreePatternRepeat1),
("^", Rust::CARET),
("match_expression", Rust::MatchExpression),
("type_item", Rust::TypeItem),
("use_list_repeat1", Rust::UseListRepeat1),
("[", Rust::LBRACK),
("meta_item", Rust::MetaItem),
("type_parameters_repeat1", Rust::TypeParametersRepeat1),
("bounded_type", Rust::BoundedType),
("const_parameter", Rust::ConstParameter),
("tuple_pattern_repeat1", Rust::TuplePatternRepeat1),
("parameter", Rust::Parameter),
("return", Rust::Return),
("token_tree_pattern", Rust::TokenTreePattern),
("reference_type", Rust::ReferenceType),
("token_tree", Rust::TokenTree),
("where_predicate", Rust::WherePredicate),
("use_declaration", Rust::UseDeclaration),
("reference_expression", Rust::ReferenceExpression),
("inner_attribute_item", Rust::InnerAttributeItem),
("union_item", Rust::UnionItem),
("range_expression", Rust::RangeExpression),
("i8", Rust::I8),
("use_list", Rust::UseList),
("trait_bounds", Rust::TraitBounds),
("compound_assignment_expr", Rust::CompoundAssignmentExpr),
("raw_string_literal", Rust::RawStringLiteral),
("f32", Rust::F32),
("index_expression", Rust::IndexExpression),
("_else_tail", Rust::ElseTail),
("higher_ranked_trait_bound", Rust::HigherRankedTraitBound),
("path", Rust::Path),
("char", Rust::Char),
("dynamic_type", Rust::DynamicType),
("for", Rust::For),
("enum_variant_list_repeat1", Rust::EnumVariantListRepeat1),
("u64", Rust::U64),
("&&", Rust::AMPAMP),
("u32", Rust::U32),
("move", Rust::Move),
("tuple_type", Rust::TupleType),
("tt", Rust::Tt),
("ty", Rust::Ty),
(",", Rust::COMMA),
("_expression_statement", Rust::ExpressionStatement),
(
"ordered_field_declaration_list",
Rust::OrderedFieldDeclarationList,
),
("%=", Rust::PERCENTEQ),
(".", Rust::DOT),
("in", Rust::In),
("token_repetition_pattern", Rust::TokenRepetitionPattern),
("constrained_type_parameter", Rust::ConstrainedTypeParameter),
("attribute_item", Rust::AttributeItem),
("macro_rule", Rust::MacroRule),
("base_field_initializer", Rust::BaseFieldInitializer),
("struct_item", Rust::StructItem),
("async_block", Rust::AsyncBlock),
("function_modifiers_repeat1", Rust::FunctionModifiersRepeat1),
("..", Rust::DOTDOT),
("try_expression", Rust::TryExpression),
("await", Rust::Await),
("match_block", Rust::MatchBlock),
("if_expression", Rust::IfExpression),
("for_lifetimes_repeat1", Rust::ForLifetimesRepeat1),
("vis", Rust::Vis),
("stmt", Rust::Stmt),
("unsafe_block", Rust::UnsafeBlock),
("static", Rust::Static),
("<", Rust::LT),
("_use_clause", Rust::UseClause),
("pat", Rust::Pat),
("parameters", Rust::Parameters),
("mod_item", Rust::ModItem),
]),
};
impl From<&str> for Rust {
#[inline(always)]
fn from(key: &str) -> Self {
KEYS.get(key).unwrap().clone()
}
}
impl From<u16> for Rust {
#[inline(always)]
fn from(x: u16) -> Self {
unsafe { std::mem::transmute(x) }
}
}
impl PartialEq<u16> for Rust {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Rust::from(*x)
}
}
impl PartialEq<Rust> for u16 {
#[inline(always)]
fn eq(&self, x: &Rust) -> bool {
*x == *self
}
}