use num_derive::FromPrimitive;
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Kotlin {
End = 0,
Identifier = 1,
AT = 2,
File = 3,
COLON = 4,
LBRACK = 5,
RBRACK = 6,
Package = 7,
SEMI = 8,
Import2 = 9,
DOT = 10,
STAR = 11,
As = 12,
Class = 13,
Fun = 14,
Interface = 15,
Object = 16,
Val = 17,
Var = 18,
EQ = 19,
Typealias = 20,
Companion = 21,
Init = 22,
Constructor = 23,
This = 24,
Super = 25,
LT = 26,
COMMA = 27,
GT = 28,
LPAREN = 29,
RPAREN = 30,
Where = 31,
By = 32,
Get = 33,
Set = 34,
LBRACE = 35,
RBRACE = 36,
For = 37,
In = 38,
While = 39,
Do = 40,
Enum = 41,
Sealed = 42,
Annotation2 = 43,
Data = 44,
Inner = 45,
Value = 46,
Tailrec = 47,
Operator = 48,
Infix = 49,
Inline = 50,
External = 51,
Suspend = 52,
Const = 53,
Public = 54,
Private = 55,
Protected = 56,
Internal = 57,
Abstract = 58,
Final = 59,
Open = 60,
Override = 61,
Lateinit = 62,
Vararg = 63,
Noinline = 64,
Crossinline = 65,
ReificationModifier = 66,
Expect = 67,
Actual = 68,
Field = 69,
Property = 70,
Receiver = 71,
Param = 72,
Setparam = 73,
Delegate = 74,
Dynamic = 75,
QMARK = 76,
AMP = 77,
DASHGT = 78,
PLUSEQ = 79,
DASHEQ = 80,
STAREQ = 81,
SLASHEQ = 82,
PERCENTEQ = 83,
PLUSPLUS = 84,
DASHDASH = 85,
PLUS = 86,
DASH = 87,
BANG = 88,
BANGBANG = 89,
SLASH = 90,
PERCENT = 91,
PIPEPIPE = 92,
AMPAMP = 93,
BANGEQ = 94,
BANGEQEQ = 95,
EQEQ = 96,
EQEQEQ = 97,
GTEQ = 98,
LTEQ = 99,
QMARKCOLON = 100,
BANGin = 101,
Is = 102,
AsQMARK = 103,
DOTDOT = 104,
DOTDOTLT = 105,
ThisAT = 106,
SuperAT = 107,
AT2 = 108,
If = 109,
Else = 110,
When = 111,
Try = 112,
Catch = 113,
Finally = 114,
Return = 115,
ReturnAT = 116,
Throw = 117,
COLONCOLON = 118,
DQUOTE = 119,
StringContent = 120,
StringContent2 = 121,
DOLLAR = 122,
DQUOTEDQUOTEDQUOTE = 123,
DQUOTEDQUOTEDQUOTEDQUOTE = 124,
DOLLARLBRACE = 125,
SQUOTE = 126,
CharacterLiteralToken1 = 127,
EscapeSequence = 128,
NumberLiteral = 129,
FloatLiteral = 130,
Out = 131,
Label = 132,
Shebang = 133,
LineComment = 134,
Semi = 135,
ClassMemberSemi = 136,
BlockComment = 137,
BANGis = 138,
In2 = 139,
QMARKDOT = 140,
StringContent3 = 141,
SourceFile = 142,
FileAnnotation = 143,
PackageHeader = 144,
Import = 145,
Declaration = 146,
ClassDeclaration = 147,
ObjectDeclaration = 148,
PropertyDeclaration = 149,
TypeAlias = 150,
CompanionObject = 151,
AnonymousInitializer = 152,
SecondaryConstructor = 153,
ConstructorDelegationCall = 154,
TypeParameters = 155,
TypeParameter = 156,
PrimaryConstructor = 157,
ClassParameters = 158,
ClassParameter = 159,
TypeConstraints = 160,
TypeConstraint = 161,
ConstructorInvocation = 162,
FunctionDeclaration = 163,
FunctionValueParameters = 164,
Parameter = 165,
DelegationSpecifiers = 166,
DelegationSpecifier = 167,
VariableDeclaration = 168,
MultiVariableDeclaration = 169,
PropertyDelegate = 170,
ExplicitDelegation = 171,
Getter = 172,
Setter = 173,
FunctionBody = 174,
Block = 175,
ForStatement = 176,
WhileStatement = 177,
DoWhileStatement = 178,
ClassBody = 179,
ClassMemberDeclaration = 180,
EnumClassBody = 181,
EnumEntry = 182,
ValueArguments = 183,
ValueArgument = 184,
Statement = 185,
Modifiers = 186,
ClassModifier = 187,
FunctionModifier = 188,
PropertyModifier = 189,
VisibilityModifier = 190,
InheritanceModifier = 191,
MemberModifier = 192,
ParameterModifiers = 193,
ParameterModifier = 194,
PlatformModifier = 195,
TypeModifiers = 196,
Annotation = 197,
UseSiteTarget = 198,
UnescapedAnnotation = 199,
Type = 200,
UserType = 201,
SimpleUserType = 202,
NullableType = 203,
NonNullableType = 204,
ReceiverType = 205,
TypeArguments = 206,
TypeProjection = 207,
FunctionType = 208,
FunctionTypeParameters = 209,
ParenthesizedType = 210,
Assignment = 211,
Expression = 212,
PrimaryExpression = 213,
UnaryExpression = 214,
AnnotatedExpression = 215,
LabeledExpression = 216,
BinaryExpression = 217,
InExpression = 218,
IsExpression = 219,
AsExpression = 220,
SpreadExpression = 221,
RangeExpression = 222,
InfixExpression = 223,
CallExpression = 224,
AnnotatedLambda = 225,
LambdaLiteral = 226,
LambdaParameters = 227,
LambdaParameter = 228,
AnonymousFunction = 229,
IndexExpression = 230,
ThisExpression = 231,
SuperExpression = 232,
IfExpression = 233,
ParenthesizedExpression = 234,
CollectionLiteral = 235,
WhenExpression = 236,
WhenSubject = 237,
WhenEntry = 238,
WhenCondition = 239,
RangeTest = 240,
TypeTest = 241,
TryExpression = 242,
CatchBlock = 243,
FinallyBlock = 244,
ReturnExpression = 245,
ThrowExpression = 246,
CallableReference = 247,
NavigationExpression = 248,
ObjectLiteral = 249,
StringLiteral = 250,
MultilineStringLiteral = 251,
Interpolation = 252,
CharacterLiteral = 253,
VarianceModifier = 254,
TypeParameterModifiers = 255,
QualifiedIdentifier = 256,
ReservedIdentifier = 257,
SourceFileRepeat1 = 258,
SourceFileRepeat2 = 259,
SourceFileRepeat3 = 260,
FileAnnotationRepeat1 = 261,
TypeParametersRepeat1 = 262,
ClassParametersRepeat1 = 263,
TypeConstraintsRepeat1 = 264,
FunctionValueParametersRepeat1 = 265,
DelegationSpecifiersRepeat1 = 266,
DelegationSpecifierRepeat1 = 267,
MultiVariableDeclarationRepeat1 = 268,
ClassBodyRepeat1 = 269,
EnumClassBodyRepeat1 = 270,
ValueArgumentsRepeat1 = 271,
StatementsRepeat1 = 272,
ModifiersRepeat1 = 273,
ParameterModifiersRepeat1 = 274,
TypeModifiersRepeat1 = 275,
UserTypeRepeat1 = 276,
TypeArgumentsRepeat1 = 277,
TypeProjectionRepeat1 = 278,
FunctionTypeParametersRepeat1 = 279,
LambdaParametersRepeat1 = 280,
IndexExpressionRepeat1 = 281,
WhenExpressionRepeat1 = 282,
WhenEntryRepeat1 = 283,
TryExpressionRepeat1 = 284,
StringLiteralRepeat1 = 285,
MultilineStringLiteralRepeat1 = 286,
TypeParameterModifiersRepeat1 = 287,
QualifiedIdentifierRepeat1 = 288,
Error = 289,
}
impl From<Kotlin> for &'static str {
#[inline(always)]
fn from(tok: Kotlin) -> Self {
match tok {
Kotlin::End => "end",
Kotlin::Identifier => "identifier",
Kotlin::AT => "@",
Kotlin::File => "file",
Kotlin::COLON => ":",
Kotlin::LBRACK => "[",
Kotlin::RBRACK => "]",
Kotlin::Package => "package",
Kotlin::SEMI => ";",
Kotlin::Import2 => "import",
Kotlin::DOT => ".",
Kotlin::STAR => "*",
Kotlin::As => "as",
Kotlin::Class => "class",
Kotlin::Fun => "fun",
Kotlin::Interface => "interface",
Kotlin::Object => "object",
Kotlin::Val => "val",
Kotlin::Var => "var",
Kotlin::EQ => "=",
Kotlin::Typealias => "typealias",
Kotlin::Companion => "companion",
Kotlin::Init => "init",
Kotlin::Constructor => "constructor",
Kotlin::This => "this",
Kotlin::Super => "super",
Kotlin::LT => "<",
Kotlin::COMMA => ",",
Kotlin::GT => ">",
Kotlin::LPAREN => "(",
Kotlin::RPAREN => ")",
Kotlin::Where => "where",
Kotlin::By => "by",
Kotlin::Get => "get",
Kotlin::Set => "set",
Kotlin::LBRACE => "{",
Kotlin::RBRACE => "}",
Kotlin::For => "for",
Kotlin::In => "in",
Kotlin::While => "while",
Kotlin::Do => "do",
Kotlin::Enum => "enum",
Kotlin::Sealed => "sealed",
Kotlin::Annotation2 => "annotation",
Kotlin::Data => "data",
Kotlin::Inner => "inner",
Kotlin::Value => "value",
Kotlin::Tailrec => "tailrec",
Kotlin::Operator => "operator",
Kotlin::Infix => "infix",
Kotlin::Inline => "inline",
Kotlin::External => "external",
Kotlin::Suspend => "suspend",
Kotlin::Const => "const",
Kotlin::Public => "public",
Kotlin::Private => "private",
Kotlin::Protected => "protected",
Kotlin::Internal => "internal",
Kotlin::Abstract => "abstract",
Kotlin::Final => "final",
Kotlin::Open => "open",
Kotlin::Override => "override",
Kotlin::Lateinit => "lateinit",
Kotlin::Vararg => "vararg",
Kotlin::Noinline => "noinline",
Kotlin::Crossinline => "crossinline",
Kotlin::ReificationModifier => "reification_modifier",
Kotlin::Expect => "expect",
Kotlin::Actual => "actual",
Kotlin::Field => "field",
Kotlin::Property => "property",
Kotlin::Receiver => "receiver",
Kotlin::Param => "param",
Kotlin::Setparam => "setparam",
Kotlin::Delegate => "delegate",
Kotlin::Dynamic => "dynamic",
Kotlin::QMARK => "?",
Kotlin::AMP => "&",
Kotlin::DASHGT => "->",
Kotlin::PLUSEQ => "+=",
Kotlin::DASHEQ => "-=",
Kotlin::STAREQ => "*=",
Kotlin::SLASHEQ => "/=",
Kotlin::PERCENTEQ => "%=",
Kotlin::PLUSPLUS => "++",
Kotlin::DASHDASH => "--",
Kotlin::PLUS => "+",
Kotlin::DASH => "-",
Kotlin::BANG => "!",
Kotlin::BANGBANG => "!!",
Kotlin::SLASH => "/",
Kotlin::PERCENT => "%",
Kotlin::PIPEPIPE => "||",
Kotlin::AMPAMP => "&&",
Kotlin::BANGEQ => "!=",
Kotlin::BANGEQEQ => "!==",
Kotlin::EQEQ => "==",
Kotlin::EQEQEQ => "===",
Kotlin::GTEQ => ">=",
Kotlin::LTEQ => "<=",
Kotlin::QMARKCOLON => "?:",
Kotlin::BANGin => "!in",
Kotlin::Is => "is",
Kotlin::AsQMARK => "as?",
Kotlin::DOTDOT => "..",
Kotlin::DOTDOTLT => "..<",
Kotlin::ThisAT => "this@",
Kotlin::SuperAT => "super@",
Kotlin::AT2 => "@",
Kotlin::If => "if",
Kotlin::Else => "else",
Kotlin::When => "when",
Kotlin::Try => "try",
Kotlin::Catch => "catch",
Kotlin::Finally => "finally",
Kotlin::Return => "return",
Kotlin::ReturnAT => "return@",
Kotlin::Throw => "throw",
Kotlin::COLONCOLON => "::",
Kotlin::DQUOTE => "\"",
Kotlin::StringContent => "string_content",
Kotlin::StringContent2 => "string_content",
Kotlin::DOLLAR => "$",
Kotlin::DQUOTEDQUOTEDQUOTE => "\"\"\"",
Kotlin::DQUOTEDQUOTEDQUOTEDQUOTE => "\"\"\"\"",
Kotlin::DOLLARLBRACE => "${",
Kotlin::SQUOTE => "'",
Kotlin::CharacterLiteralToken1 => "character_literal_token1",
Kotlin::EscapeSequence => "escape_sequence",
Kotlin::NumberLiteral => "number_literal",
Kotlin::FloatLiteral => "float_literal",
Kotlin::Out => "out",
Kotlin::Label => "label",
Kotlin::Shebang => "shebang",
Kotlin::LineComment => "line_comment",
Kotlin::Semi => "_semi",
Kotlin::ClassMemberSemi => "_class_member_semi",
Kotlin::BlockComment => "block_comment",
Kotlin::BANGis => "!is",
Kotlin::In2 => "in",
Kotlin::QMARKDOT => "?.",
Kotlin::StringContent3 => "string_content",
Kotlin::SourceFile => "source_file",
Kotlin::FileAnnotation => "file_annotation",
Kotlin::PackageHeader => "package_header",
Kotlin::Import => "import",
Kotlin::Declaration => "declaration",
Kotlin::ClassDeclaration => "class_declaration",
Kotlin::ObjectDeclaration => "object_declaration",
Kotlin::PropertyDeclaration => "property_declaration",
Kotlin::TypeAlias => "type_alias",
Kotlin::CompanionObject => "companion_object",
Kotlin::AnonymousInitializer => "anonymous_initializer",
Kotlin::SecondaryConstructor => "secondary_constructor",
Kotlin::ConstructorDelegationCall => "constructor_delegation_call",
Kotlin::TypeParameters => "type_parameters",
Kotlin::TypeParameter => "type_parameter",
Kotlin::PrimaryConstructor => "primary_constructor",
Kotlin::ClassParameters => "class_parameters",
Kotlin::ClassParameter => "class_parameter",
Kotlin::TypeConstraints => "type_constraints",
Kotlin::TypeConstraint => "type_constraint",
Kotlin::ConstructorInvocation => "constructor_invocation",
Kotlin::FunctionDeclaration => "function_declaration",
Kotlin::FunctionValueParameters => "function_value_parameters",
Kotlin::Parameter => "parameter",
Kotlin::DelegationSpecifiers => "delegation_specifiers",
Kotlin::DelegationSpecifier => "delegation_specifier",
Kotlin::VariableDeclaration => "variable_declaration",
Kotlin::MultiVariableDeclaration => "multi_variable_declaration",
Kotlin::PropertyDelegate => "property_delegate",
Kotlin::ExplicitDelegation => "explicit_delegation",
Kotlin::Getter => "getter",
Kotlin::Setter => "setter",
Kotlin::FunctionBody => "function_body",
Kotlin::Block => "block",
Kotlin::ForStatement => "for_statement",
Kotlin::WhileStatement => "while_statement",
Kotlin::DoWhileStatement => "do_while_statement",
Kotlin::ClassBody => "class_body",
Kotlin::ClassMemberDeclaration => "class_member_declaration",
Kotlin::EnumClassBody => "enum_class_body",
Kotlin::EnumEntry => "enum_entry",
Kotlin::ValueArguments => "value_arguments",
Kotlin::ValueArgument => "value_argument",
Kotlin::Statement => "statement",
Kotlin::Modifiers => "modifiers",
Kotlin::ClassModifier => "class_modifier",
Kotlin::FunctionModifier => "function_modifier",
Kotlin::PropertyModifier => "property_modifier",
Kotlin::VisibilityModifier => "visibility_modifier",
Kotlin::InheritanceModifier => "inheritance_modifier",
Kotlin::MemberModifier => "member_modifier",
Kotlin::ParameterModifiers => "parameter_modifiers",
Kotlin::ParameterModifier => "parameter_modifier",
Kotlin::PlatformModifier => "platform_modifier",
Kotlin::TypeModifiers => "type_modifiers",
Kotlin::Annotation => "annotation",
Kotlin::UseSiteTarget => "use_site_target",
Kotlin::UnescapedAnnotation => "_unescaped_annotation",
Kotlin::Type => "type",
Kotlin::UserType => "user_type",
Kotlin::SimpleUserType => "_simple_user_type",
Kotlin::NullableType => "nullable_type",
Kotlin::NonNullableType => "non_nullable_type",
Kotlin::ReceiverType => "_receiver_type",
Kotlin::TypeArguments => "type_arguments",
Kotlin::TypeProjection => "type_projection",
Kotlin::FunctionType => "function_type",
Kotlin::FunctionTypeParameters => "function_type_parameters",
Kotlin::ParenthesizedType => "parenthesized_type",
Kotlin::Assignment => "assignment",
Kotlin::Expression => "expression",
Kotlin::PrimaryExpression => "primary_expression",
Kotlin::UnaryExpression => "unary_expression",
Kotlin::AnnotatedExpression => "annotated_expression",
Kotlin::LabeledExpression => "labeled_expression",
Kotlin::BinaryExpression => "binary_expression",
Kotlin::InExpression => "in_expression",
Kotlin::IsExpression => "is_expression",
Kotlin::AsExpression => "as_expression",
Kotlin::SpreadExpression => "spread_expression",
Kotlin::RangeExpression => "range_expression",
Kotlin::InfixExpression => "infix_expression",
Kotlin::CallExpression => "call_expression",
Kotlin::AnnotatedLambda => "annotated_lambda",
Kotlin::LambdaLiteral => "lambda_literal",
Kotlin::LambdaParameters => "lambda_parameters",
Kotlin::LambdaParameter => "_lambda_parameter",
Kotlin::AnonymousFunction => "anonymous_function",
Kotlin::IndexExpression => "index_expression",
Kotlin::ThisExpression => "this_expression",
Kotlin::SuperExpression => "super_expression",
Kotlin::IfExpression => "if_expression",
Kotlin::ParenthesizedExpression => "parenthesized_expression",
Kotlin::CollectionLiteral => "collection_literal",
Kotlin::WhenExpression => "when_expression",
Kotlin::WhenSubject => "when_subject",
Kotlin::WhenEntry => "when_entry",
Kotlin::WhenCondition => "_when_condition",
Kotlin::RangeTest => "range_test",
Kotlin::TypeTest => "type_test",
Kotlin::TryExpression => "try_expression",
Kotlin::CatchBlock => "catch_block",
Kotlin::FinallyBlock => "finally_block",
Kotlin::ReturnExpression => "return_expression",
Kotlin::ThrowExpression => "throw_expression",
Kotlin::CallableReference => "callable_reference",
Kotlin::NavigationExpression => "navigation_expression",
Kotlin::ObjectLiteral => "object_literal",
Kotlin::StringLiteral => "string_literal",
Kotlin::MultilineStringLiteral => "multiline_string_literal",
Kotlin::Interpolation => "interpolation",
Kotlin::CharacterLiteral => "character_literal",
Kotlin::VarianceModifier => "variance_modifier",
Kotlin::TypeParameterModifiers => "type_parameter_modifiers",
Kotlin::QualifiedIdentifier => "qualified_identifier",
Kotlin::ReservedIdentifier => "_reserved_identifier",
Kotlin::SourceFileRepeat1 => "source_file_repeat1",
Kotlin::SourceFileRepeat2 => "source_file_repeat2",
Kotlin::SourceFileRepeat3 => "source_file_repeat3",
Kotlin::FileAnnotationRepeat1 => "file_annotation_repeat1",
Kotlin::TypeParametersRepeat1 => "type_parameters_repeat1",
Kotlin::ClassParametersRepeat1 => "class_parameters_repeat1",
Kotlin::TypeConstraintsRepeat1 => "type_constraints_repeat1",
Kotlin::FunctionValueParametersRepeat1 => "function_value_parameters_repeat1",
Kotlin::DelegationSpecifiersRepeat1 => "delegation_specifiers_repeat1",
Kotlin::DelegationSpecifierRepeat1 => "delegation_specifier_repeat1",
Kotlin::MultiVariableDeclarationRepeat1 => "multi_variable_declaration_repeat1",
Kotlin::ClassBodyRepeat1 => "class_body_repeat1",
Kotlin::EnumClassBodyRepeat1 => "enum_class_body_repeat1",
Kotlin::ValueArgumentsRepeat1 => "value_arguments_repeat1",
Kotlin::StatementsRepeat1 => "_statements_repeat1",
Kotlin::ModifiersRepeat1 => "modifiers_repeat1",
Kotlin::ParameterModifiersRepeat1 => "parameter_modifiers_repeat1",
Kotlin::TypeModifiersRepeat1 => "type_modifiers_repeat1",
Kotlin::UserTypeRepeat1 => "user_type_repeat1",
Kotlin::TypeArgumentsRepeat1 => "type_arguments_repeat1",
Kotlin::TypeProjectionRepeat1 => "type_projection_repeat1",
Kotlin::FunctionTypeParametersRepeat1 => "function_type_parameters_repeat1",
Kotlin::LambdaParametersRepeat1 => "lambda_parameters_repeat1",
Kotlin::IndexExpressionRepeat1 => "index_expression_repeat1",
Kotlin::WhenExpressionRepeat1 => "when_expression_repeat1",
Kotlin::WhenEntryRepeat1 => "when_entry_repeat1",
Kotlin::TryExpressionRepeat1 => "try_expression_repeat1",
Kotlin::StringLiteralRepeat1 => "string_literal_repeat1",
Kotlin::MultilineStringLiteralRepeat1 => "multiline_string_literal_repeat1",
Kotlin::TypeParameterModifiersRepeat1 => "type_parameter_modifiers_repeat1",
Kotlin::QualifiedIdentifierRepeat1 => "qualified_identifier_repeat1",
Kotlin::Error => "ERROR",
}
}
}
impl From<u16> for Kotlin {
#[inline(always)]
fn from(x: u16) -> Self {
num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
}
}
impl PartialEq<u16> for Kotlin {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Into::<Self>::into(*x)
}
}
impl PartialEq<Kotlin> for u16 {
#[inline(always)]
fn eq(&self, x: &Kotlin) -> bool {
*x == *self
}
}