Skip to main content

big_code_analysis_ast/languages/
language_kotlin.rs

1// See `src/languages/mod.rs` for the rationale behind the per-file
2// pedantic carve-outs below.
3#![allow(clippy::match_same_arms, clippy::too_many_lines)]
4// One variant per grammar kind id, named after the rule; the name is
5// the documentation and there is nothing per-variant to add.
6#![allow(missing_docs)]
7
8// Code generated; DO NOT EDIT.
9
10use num_derive::FromPrimitive;
11
12#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
13pub enum Kotlin {
14    End = 0,
15    Identifier = 1,
16    AT = 2,
17    File = 3,
18    COLON = 4,
19    LBRACK = 5,
20    RBRACK = 6,
21    Package = 7,
22    SEMI = 8,
23    Import2 = 9,
24    DOT = 10,
25    STAR = 11,
26    As = 12,
27    Class = 13,
28    Fun = 14,
29    Interface = 15,
30    Object = 16,
31    Val = 17,
32    Var = 18,
33    EQ = 19,
34    Typealias = 20,
35    Companion = 21,
36    Init = 22,
37    Constructor = 23,
38    This = 24,
39    Super = 25,
40    LT = 26,
41    COMMA = 27,
42    GT = 28,
43    LPAREN = 29,
44    RPAREN = 30,
45    Where = 31,
46    By = 32,
47    Get = 33,
48    Set = 34,
49    LBRACE = 35,
50    RBRACE = 36,
51    For = 37,
52    In = 38,
53    While = 39,
54    Do = 40,
55    Enum = 41,
56    Sealed = 42,
57    Annotation2 = 43,
58    Data = 44,
59    Inner = 45,
60    Value = 46,
61    Tailrec = 47,
62    Operator = 48,
63    Infix = 49,
64    Inline = 50,
65    External = 51,
66    Suspend = 52,
67    Const = 53,
68    Public = 54,
69    Private = 55,
70    Protected = 56,
71    Internal = 57,
72    Abstract = 58,
73    Final = 59,
74    Open = 60,
75    Override = 61,
76    Lateinit = 62,
77    Vararg = 63,
78    Noinline = 64,
79    Crossinline = 65,
80    ReificationModifier = 66,
81    Expect = 67,
82    Actual = 68,
83    Field = 69,
84    Property = 70,
85    Receiver = 71,
86    Param = 72,
87    Setparam = 73,
88    Delegate = 74,
89    Dynamic = 75,
90    QMARK = 76,
91    AMP = 77,
92    DASHGT = 78,
93    PLUSEQ = 79,
94    DASHEQ = 80,
95    STAREQ = 81,
96    SLASHEQ = 82,
97    PERCENTEQ = 83,
98    PLUSPLUS = 84,
99    DASHDASH = 85,
100    PLUS = 86,
101    DASH = 87,
102    BANG = 88,
103    BANGBANG = 89,
104    SLASH = 90,
105    PERCENT = 91,
106    PIPEPIPE = 92,
107    AMPAMP = 93,
108    BANGEQ = 94,
109    BANGEQEQ = 95,
110    EQEQ = 96,
111    EQEQEQ = 97,
112    GTEQ = 98,
113    LTEQ = 99,
114    QMARKCOLON = 100,
115    BANGin = 101,
116    Is = 102,
117    AsQMARK = 103,
118    DOTDOT = 104,
119    DOTDOTLT = 105,
120    ThisAT = 106,
121    SuperAT = 107,
122    AT2 = 108,
123    If = 109,
124    Else = 110,
125    When = 111,
126    Try = 112,
127    Catch = 113,
128    Finally = 114,
129    Return = 115,
130    ReturnAT = 116,
131    Throw = 117,
132    COLONCOLON = 118,
133    DQUOTE = 119,
134    StringContent = 120,
135    StringContent2 = 121,
136    DOLLAR = 122,
137    DQUOTEDQUOTEDQUOTE = 123,
138    DQUOTEDQUOTEDQUOTEDQUOTE = 124,
139    DOLLARLBRACE = 125,
140    SQUOTE = 126,
141    CharacterLiteralToken1 = 127,
142    EscapeSequence = 128,
143    NumberLiteral = 129,
144    FloatLiteral = 130,
145    Out = 131,
146    Label = 132,
147    Shebang = 133,
148    LineComment = 134,
149    Semi = 135,
150    ClassMemberSemi = 136,
151    BlockComment = 137,
152    BANGis = 138,
153    In2 = 139,
154    QMARKDOT = 140,
155    StringContent3 = 141,
156    SourceFile = 142,
157    FileAnnotation = 143,
158    PackageHeader = 144,
159    Import = 145,
160    Declaration = 146,
161    ClassDeclaration = 147,
162    ObjectDeclaration = 148,
163    PropertyDeclaration = 149,
164    TypeAlias = 150,
165    CompanionObject = 151,
166    AnonymousInitializer = 152,
167    SecondaryConstructor = 153,
168    ConstructorDelegationCall = 154,
169    TypeParameters = 155,
170    TypeParameter = 156,
171    PrimaryConstructor = 157,
172    ClassParameters = 158,
173    ClassParameter = 159,
174    TypeConstraints = 160,
175    TypeConstraint = 161,
176    ConstructorInvocation = 162,
177    FunctionDeclaration = 163,
178    FunctionValueParameters = 164,
179    Parameter = 165,
180    DelegationSpecifiers = 166,
181    DelegationSpecifier = 167,
182    VariableDeclaration = 168,
183    MultiVariableDeclaration = 169,
184    PropertyDelegate = 170,
185    ExplicitDelegation = 171,
186    Getter = 172,
187    Setter = 173,
188    FunctionBody = 174,
189    Block = 175,
190    ForStatement = 176,
191    WhileStatement = 177,
192    DoWhileStatement = 178,
193    ClassBody = 179,
194    ClassMemberDeclaration = 180,
195    EnumClassBody = 181,
196    EnumEntry = 182,
197    ValueArguments = 183,
198    ValueArgument = 184,
199    Statement = 185,
200    Modifiers = 186,
201    ClassModifier = 187,
202    FunctionModifier = 188,
203    PropertyModifier = 189,
204    VisibilityModifier = 190,
205    InheritanceModifier = 191,
206    MemberModifier = 192,
207    ParameterModifiers = 193,
208    ParameterModifier = 194,
209    PlatformModifier = 195,
210    TypeModifiers = 196,
211    Annotation = 197,
212    UseSiteTarget = 198,
213    UnescapedAnnotation = 199,
214    Type = 200,
215    UserType = 201,
216    SimpleUserType = 202,
217    NullableType = 203,
218    NonNullableType = 204,
219    ReceiverType = 205,
220    TypeArguments = 206,
221    TypeProjection = 207,
222    FunctionType = 208,
223    FunctionTypeParameters = 209,
224    ParenthesizedType = 210,
225    Assignment = 211,
226    Expression = 212,
227    PrimaryExpression = 213,
228    UnaryExpression = 214,
229    AnnotatedExpression = 215,
230    LabeledExpression = 216,
231    BinaryExpression = 217,
232    InExpression = 218,
233    IsExpression = 219,
234    AsExpression = 220,
235    SpreadExpression = 221,
236    RangeExpression = 222,
237    InfixExpression = 223,
238    CallExpression = 224,
239    AnnotatedLambda = 225,
240    LambdaLiteral = 226,
241    LambdaParameters = 227,
242    LambdaParameter = 228,
243    AnonymousFunction = 229,
244    IndexExpression = 230,
245    ThisExpression = 231,
246    SuperExpression = 232,
247    IfExpression = 233,
248    ParenthesizedExpression = 234,
249    CollectionLiteral = 235,
250    WhenExpression = 236,
251    WhenSubject = 237,
252    WhenEntry = 238,
253    WhenCondition = 239,
254    RangeTest = 240,
255    TypeTest = 241,
256    TryExpression = 242,
257    CatchBlock = 243,
258    FinallyBlock = 244,
259    ReturnExpression = 245,
260    ThrowExpression = 246,
261    CallableReference = 247,
262    NavigationExpression = 248,
263    ObjectLiteral = 249,
264    StringLiteral = 250,
265    MultilineStringLiteral = 251,
266    Interpolation = 252,
267    CharacterLiteral = 253,
268    VarianceModifier = 254,
269    TypeParameterModifiers = 255,
270    QualifiedIdentifier = 256,
271    ReservedIdentifier = 257,
272    SourceFileRepeat1 = 258,
273    SourceFileRepeat2 = 259,
274    SourceFileRepeat3 = 260,
275    FileAnnotationRepeat1 = 261,
276    TypeParametersRepeat1 = 262,
277    ClassParametersRepeat1 = 263,
278    TypeConstraintsRepeat1 = 264,
279    FunctionValueParametersRepeat1 = 265,
280    DelegationSpecifiersRepeat1 = 266,
281    DelegationSpecifierRepeat1 = 267,
282    MultiVariableDeclarationRepeat1 = 268,
283    ClassBodyRepeat1 = 269,
284    EnumClassBodyRepeat1 = 270,
285    ValueArgumentsRepeat1 = 271,
286    StatementsRepeat1 = 272,
287    ModifiersRepeat1 = 273,
288    ParameterModifiersRepeat1 = 274,
289    TypeModifiersRepeat1 = 275,
290    UserTypeRepeat1 = 276,
291    TypeArgumentsRepeat1 = 277,
292    TypeProjectionRepeat1 = 278,
293    FunctionTypeParametersRepeat1 = 279,
294    LambdaParametersRepeat1 = 280,
295    IndexExpressionRepeat1 = 281,
296    WhenExpressionRepeat1 = 282,
297    WhenEntryRepeat1 = 283,
298    TryExpressionRepeat1 = 284,
299    StringLiteralRepeat1 = 285,
300    MultilineStringLiteralRepeat1 = 286,
301    TypeParameterModifiersRepeat1 = 287,
302    QualifiedIdentifierRepeat1 = 288,
303    Error = 289,
304}
305
306impl From<Kotlin> for &'static str {
307    #[inline]
308    fn from(tok: Kotlin) -> Self {
309        match tok {
310            Kotlin::End => "end",
311            Kotlin::Identifier => "identifier",
312            Kotlin::AT => "@",
313            Kotlin::File => "file",
314            Kotlin::COLON => ":",
315            Kotlin::LBRACK => "[",
316            Kotlin::RBRACK => "]",
317            Kotlin::Package => "package",
318            Kotlin::SEMI => ";",
319            Kotlin::Import2 => "import",
320            Kotlin::DOT => ".",
321            Kotlin::STAR => "*",
322            Kotlin::As => "as",
323            Kotlin::Class => "class",
324            Kotlin::Fun => "fun",
325            Kotlin::Interface => "interface",
326            Kotlin::Object => "object",
327            Kotlin::Val => "val",
328            Kotlin::Var => "var",
329            Kotlin::EQ => "=",
330            Kotlin::Typealias => "typealias",
331            Kotlin::Companion => "companion",
332            Kotlin::Init => "init",
333            Kotlin::Constructor => "constructor",
334            Kotlin::This => "this",
335            Kotlin::Super => "super",
336            Kotlin::LT => "<",
337            Kotlin::COMMA => ",",
338            Kotlin::GT => ">",
339            Kotlin::LPAREN => "(",
340            Kotlin::RPAREN => ")",
341            Kotlin::Where => "where",
342            Kotlin::By => "by",
343            Kotlin::Get => "get",
344            Kotlin::Set => "set",
345            Kotlin::LBRACE => "{",
346            Kotlin::RBRACE => "}",
347            Kotlin::For => "for",
348            Kotlin::In => "in",
349            Kotlin::While => "while",
350            Kotlin::Do => "do",
351            Kotlin::Enum => "enum",
352            Kotlin::Sealed => "sealed",
353            Kotlin::Annotation2 => "annotation",
354            Kotlin::Data => "data",
355            Kotlin::Inner => "inner",
356            Kotlin::Value => "value",
357            Kotlin::Tailrec => "tailrec",
358            Kotlin::Operator => "operator",
359            Kotlin::Infix => "infix",
360            Kotlin::Inline => "inline",
361            Kotlin::External => "external",
362            Kotlin::Suspend => "suspend",
363            Kotlin::Const => "const",
364            Kotlin::Public => "public",
365            Kotlin::Private => "private",
366            Kotlin::Protected => "protected",
367            Kotlin::Internal => "internal",
368            Kotlin::Abstract => "abstract",
369            Kotlin::Final => "final",
370            Kotlin::Open => "open",
371            Kotlin::Override => "override",
372            Kotlin::Lateinit => "lateinit",
373            Kotlin::Vararg => "vararg",
374            Kotlin::Noinline => "noinline",
375            Kotlin::Crossinline => "crossinline",
376            Kotlin::ReificationModifier => "reification_modifier",
377            Kotlin::Expect => "expect",
378            Kotlin::Actual => "actual",
379            Kotlin::Field => "field",
380            Kotlin::Property => "property",
381            Kotlin::Receiver => "receiver",
382            Kotlin::Param => "param",
383            Kotlin::Setparam => "setparam",
384            Kotlin::Delegate => "delegate",
385            Kotlin::Dynamic => "dynamic",
386            Kotlin::QMARK => "?",
387            Kotlin::AMP => "&",
388            Kotlin::DASHGT => "->",
389            Kotlin::PLUSEQ => "+=",
390            Kotlin::DASHEQ => "-=",
391            Kotlin::STAREQ => "*=",
392            Kotlin::SLASHEQ => "/=",
393            Kotlin::PERCENTEQ => "%=",
394            Kotlin::PLUSPLUS => "++",
395            Kotlin::DASHDASH => "--",
396            Kotlin::PLUS => "+",
397            Kotlin::DASH => "-",
398            Kotlin::BANG => "!",
399            Kotlin::BANGBANG => "!!",
400            Kotlin::SLASH => "/",
401            Kotlin::PERCENT => "%",
402            Kotlin::PIPEPIPE => "||",
403            Kotlin::AMPAMP => "&&",
404            Kotlin::BANGEQ => "!=",
405            Kotlin::BANGEQEQ => "!==",
406            Kotlin::EQEQ => "==",
407            Kotlin::EQEQEQ => "===",
408            Kotlin::GTEQ => ">=",
409            Kotlin::LTEQ => "<=",
410            Kotlin::QMARKCOLON => "?:",
411            Kotlin::BANGin => "!in",
412            Kotlin::Is => "is",
413            Kotlin::AsQMARK => "as?",
414            Kotlin::DOTDOT => "..",
415            Kotlin::DOTDOTLT => "..<",
416            Kotlin::ThisAT => "this@",
417            Kotlin::SuperAT => "super@",
418            Kotlin::AT2 => "@",
419            Kotlin::If => "if",
420            Kotlin::Else => "else",
421            Kotlin::When => "when",
422            Kotlin::Try => "try",
423            Kotlin::Catch => "catch",
424            Kotlin::Finally => "finally",
425            Kotlin::Return => "return",
426            Kotlin::ReturnAT => "return@",
427            Kotlin::Throw => "throw",
428            Kotlin::COLONCOLON => "::",
429            Kotlin::DQUOTE => "\"",
430            Kotlin::StringContent => "string_content",
431            Kotlin::StringContent2 => "string_content",
432            Kotlin::DOLLAR => "$",
433            Kotlin::DQUOTEDQUOTEDQUOTE => "\"\"\"",
434            Kotlin::DQUOTEDQUOTEDQUOTEDQUOTE => "\"\"\"\"",
435            Kotlin::DOLLARLBRACE => "${",
436            Kotlin::SQUOTE => "'",
437            Kotlin::CharacterLiteralToken1 => "character_literal_token1",
438            Kotlin::EscapeSequence => "escape_sequence",
439            Kotlin::NumberLiteral => "number_literal",
440            Kotlin::FloatLiteral => "float_literal",
441            Kotlin::Out => "out",
442            Kotlin::Label => "label",
443            Kotlin::Shebang => "shebang",
444            Kotlin::LineComment => "line_comment",
445            Kotlin::Semi => "_semi",
446            Kotlin::ClassMemberSemi => "_class_member_semi",
447            Kotlin::BlockComment => "block_comment",
448            Kotlin::BANGis => "!is",
449            Kotlin::In2 => "in",
450            Kotlin::QMARKDOT => "?.",
451            Kotlin::StringContent3 => "string_content",
452            Kotlin::SourceFile => "source_file",
453            Kotlin::FileAnnotation => "file_annotation",
454            Kotlin::PackageHeader => "package_header",
455            Kotlin::Import => "import",
456            Kotlin::Declaration => "declaration",
457            Kotlin::ClassDeclaration => "class_declaration",
458            Kotlin::ObjectDeclaration => "object_declaration",
459            Kotlin::PropertyDeclaration => "property_declaration",
460            Kotlin::TypeAlias => "type_alias",
461            Kotlin::CompanionObject => "companion_object",
462            Kotlin::AnonymousInitializer => "anonymous_initializer",
463            Kotlin::SecondaryConstructor => "secondary_constructor",
464            Kotlin::ConstructorDelegationCall => "constructor_delegation_call",
465            Kotlin::TypeParameters => "type_parameters",
466            Kotlin::TypeParameter => "type_parameter",
467            Kotlin::PrimaryConstructor => "primary_constructor",
468            Kotlin::ClassParameters => "class_parameters",
469            Kotlin::ClassParameter => "class_parameter",
470            Kotlin::TypeConstraints => "type_constraints",
471            Kotlin::TypeConstraint => "type_constraint",
472            Kotlin::ConstructorInvocation => "constructor_invocation",
473            Kotlin::FunctionDeclaration => "function_declaration",
474            Kotlin::FunctionValueParameters => "function_value_parameters",
475            Kotlin::Parameter => "parameter",
476            Kotlin::DelegationSpecifiers => "delegation_specifiers",
477            Kotlin::DelegationSpecifier => "delegation_specifier",
478            Kotlin::VariableDeclaration => "variable_declaration",
479            Kotlin::MultiVariableDeclaration => "multi_variable_declaration",
480            Kotlin::PropertyDelegate => "property_delegate",
481            Kotlin::ExplicitDelegation => "explicit_delegation",
482            Kotlin::Getter => "getter",
483            Kotlin::Setter => "setter",
484            Kotlin::FunctionBody => "function_body",
485            Kotlin::Block => "block",
486            Kotlin::ForStatement => "for_statement",
487            Kotlin::WhileStatement => "while_statement",
488            Kotlin::DoWhileStatement => "do_while_statement",
489            Kotlin::ClassBody => "class_body",
490            Kotlin::ClassMemberDeclaration => "class_member_declaration",
491            Kotlin::EnumClassBody => "enum_class_body",
492            Kotlin::EnumEntry => "enum_entry",
493            Kotlin::ValueArguments => "value_arguments",
494            Kotlin::ValueArgument => "value_argument",
495            Kotlin::Statement => "statement",
496            Kotlin::Modifiers => "modifiers",
497            Kotlin::ClassModifier => "class_modifier",
498            Kotlin::FunctionModifier => "function_modifier",
499            Kotlin::PropertyModifier => "property_modifier",
500            Kotlin::VisibilityModifier => "visibility_modifier",
501            Kotlin::InheritanceModifier => "inheritance_modifier",
502            Kotlin::MemberModifier => "member_modifier",
503            Kotlin::ParameterModifiers => "parameter_modifiers",
504            Kotlin::ParameterModifier => "parameter_modifier",
505            Kotlin::PlatformModifier => "platform_modifier",
506            Kotlin::TypeModifiers => "type_modifiers",
507            Kotlin::Annotation => "annotation",
508            Kotlin::UseSiteTarget => "use_site_target",
509            Kotlin::UnescapedAnnotation => "_unescaped_annotation",
510            Kotlin::Type => "type",
511            Kotlin::UserType => "user_type",
512            Kotlin::SimpleUserType => "_simple_user_type",
513            Kotlin::NullableType => "nullable_type",
514            Kotlin::NonNullableType => "non_nullable_type",
515            Kotlin::ReceiverType => "_receiver_type",
516            Kotlin::TypeArguments => "type_arguments",
517            Kotlin::TypeProjection => "type_projection",
518            Kotlin::FunctionType => "function_type",
519            Kotlin::FunctionTypeParameters => "function_type_parameters",
520            Kotlin::ParenthesizedType => "parenthesized_type",
521            Kotlin::Assignment => "assignment",
522            Kotlin::Expression => "expression",
523            Kotlin::PrimaryExpression => "primary_expression",
524            Kotlin::UnaryExpression => "unary_expression",
525            Kotlin::AnnotatedExpression => "annotated_expression",
526            Kotlin::LabeledExpression => "labeled_expression",
527            Kotlin::BinaryExpression => "binary_expression",
528            Kotlin::InExpression => "in_expression",
529            Kotlin::IsExpression => "is_expression",
530            Kotlin::AsExpression => "as_expression",
531            Kotlin::SpreadExpression => "spread_expression",
532            Kotlin::RangeExpression => "range_expression",
533            Kotlin::InfixExpression => "infix_expression",
534            Kotlin::CallExpression => "call_expression",
535            Kotlin::AnnotatedLambda => "annotated_lambda",
536            Kotlin::LambdaLiteral => "lambda_literal",
537            Kotlin::LambdaParameters => "lambda_parameters",
538            Kotlin::LambdaParameter => "_lambda_parameter",
539            Kotlin::AnonymousFunction => "anonymous_function",
540            Kotlin::IndexExpression => "index_expression",
541            Kotlin::ThisExpression => "this_expression",
542            Kotlin::SuperExpression => "super_expression",
543            Kotlin::IfExpression => "if_expression",
544            Kotlin::ParenthesizedExpression => "parenthesized_expression",
545            Kotlin::CollectionLiteral => "collection_literal",
546            Kotlin::WhenExpression => "when_expression",
547            Kotlin::WhenSubject => "when_subject",
548            Kotlin::WhenEntry => "when_entry",
549            Kotlin::WhenCondition => "_when_condition",
550            Kotlin::RangeTest => "range_test",
551            Kotlin::TypeTest => "type_test",
552            Kotlin::TryExpression => "try_expression",
553            Kotlin::CatchBlock => "catch_block",
554            Kotlin::FinallyBlock => "finally_block",
555            Kotlin::ReturnExpression => "return_expression",
556            Kotlin::ThrowExpression => "throw_expression",
557            Kotlin::CallableReference => "callable_reference",
558            Kotlin::NavigationExpression => "navigation_expression",
559            Kotlin::ObjectLiteral => "object_literal",
560            Kotlin::StringLiteral => "string_literal",
561            Kotlin::MultilineStringLiteral => "multiline_string_literal",
562            Kotlin::Interpolation => "interpolation",
563            Kotlin::CharacterLiteral => "character_literal",
564            Kotlin::VarianceModifier => "variance_modifier",
565            Kotlin::TypeParameterModifiers => "type_parameter_modifiers",
566            Kotlin::QualifiedIdentifier => "qualified_identifier",
567            Kotlin::ReservedIdentifier => "_reserved_identifier",
568            Kotlin::SourceFileRepeat1 => "source_file_repeat1",
569            Kotlin::SourceFileRepeat2 => "source_file_repeat2",
570            Kotlin::SourceFileRepeat3 => "source_file_repeat3",
571            Kotlin::FileAnnotationRepeat1 => "file_annotation_repeat1",
572            Kotlin::TypeParametersRepeat1 => "type_parameters_repeat1",
573            Kotlin::ClassParametersRepeat1 => "class_parameters_repeat1",
574            Kotlin::TypeConstraintsRepeat1 => "type_constraints_repeat1",
575            Kotlin::FunctionValueParametersRepeat1 => "function_value_parameters_repeat1",
576            Kotlin::DelegationSpecifiersRepeat1 => "delegation_specifiers_repeat1",
577            Kotlin::DelegationSpecifierRepeat1 => "delegation_specifier_repeat1",
578            Kotlin::MultiVariableDeclarationRepeat1 => "multi_variable_declaration_repeat1",
579            Kotlin::ClassBodyRepeat1 => "class_body_repeat1",
580            Kotlin::EnumClassBodyRepeat1 => "enum_class_body_repeat1",
581            Kotlin::ValueArgumentsRepeat1 => "value_arguments_repeat1",
582            Kotlin::StatementsRepeat1 => "_statements_repeat1",
583            Kotlin::ModifiersRepeat1 => "modifiers_repeat1",
584            Kotlin::ParameterModifiersRepeat1 => "parameter_modifiers_repeat1",
585            Kotlin::TypeModifiersRepeat1 => "type_modifiers_repeat1",
586            Kotlin::UserTypeRepeat1 => "user_type_repeat1",
587            Kotlin::TypeArgumentsRepeat1 => "type_arguments_repeat1",
588            Kotlin::TypeProjectionRepeat1 => "type_projection_repeat1",
589            Kotlin::FunctionTypeParametersRepeat1 => "function_type_parameters_repeat1",
590            Kotlin::LambdaParametersRepeat1 => "lambda_parameters_repeat1",
591            Kotlin::IndexExpressionRepeat1 => "index_expression_repeat1",
592            Kotlin::WhenExpressionRepeat1 => "when_expression_repeat1",
593            Kotlin::WhenEntryRepeat1 => "when_entry_repeat1",
594            Kotlin::TryExpressionRepeat1 => "try_expression_repeat1",
595            Kotlin::StringLiteralRepeat1 => "string_literal_repeat1",
596            Kotlin::MultilineStringLiteralRepeat1 => "multiline_string_literal_repeat1",
597            Kotlin::TypeParameterModifiersRepeat1 => "type_parameter_modifiers_repeat1",
598            Kotlin::QualifiedIdentifierRepeat1 => "qualified_identifier_repeat1",
599            Kotlin::Error => "ERROR",
600        }
601    }
602}
603
604impl From<u16> for Kotlin {
605    #[inline]
606    fn from(x: u16) -> Self {
607        num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
608    }
609}
610
611// Kotlin == u16
612impl PartialEq<u16> for Kotlin {
613    #[inline]
614    fn eq(&self, x: &u16) -> bool {
615        *self == Into::<Self>::into(*x)
616    }
617}
618
619// u16 == Kotlin
620impl PartialEq<Kotlin> for u16 {
621    #[inline]
622    fn eq(&self, x: &Kotlin) -> bool {
623        *x == *self
624    }
625}