big-code-analysis 1.1.0

Tool to compute and export code metrics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
// See `src/languages/mod.rs` for the rationale behind the per-file
// pedantic carve-outs below.
#![allow(clippy::match_same_arms, clippy::too_many_lines)]

// Code generated; DO NOT EDIT.

use num_derive::FromPrimitive;

#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Groovy {
    End = 0,
    Identifier = 1,
    Shebang = 2,
    COMMA = 3,
    COLON = 4,
    LBRACE = 5,
    RBRACE = 6,
    If = 7,
    LPAREN = 8,
    RPAREN = 9,
    Else = 10,
    While = 11,
    For = 12,
    SEMI = 13,
    Do = 14,
    Return = 15,
    Break = 16,
    Continue = 17,
    Throw = 18,
    Yield = 19,
    Assert = 20,
    Try = 21,
    EQ = 22,
    Catch = 23,
    PIPE = 24,
    Finally = 25,
    Sealed = 26,
    NonDASHsealed = 27,
    Class = 28,
    Trait = 29,
    Interface = 30,
    LT = 31,
    GT = 32,
    Extends = 33,
    AMP = 34,
    Implements = 35,
    Public = 36,
    Private = 37,
    Protected = 38,
    Static = 39,
    Final = 40,
    Abstract = 41,
    Synchronized = 42,
    Native = 43,
    Transient = 44,
    Volatile = 45,
    Strictfp = 46,
    Permits = 47,
    AT = 48,
    Def = 49,
    LT2 = 50,
    Throws = 51,
    DOTDOTDOT = 52,
    Enum = 53,
    Record = 54,
    Package = 55,
    Import = 56,
    DOTSTAR = 57,
    As = 58,
    DOT = 59,
    Var = 60,
    Pipeline = 61,
    In = 62,
    Switch = 63,
    Case = 64,
    DASHGT = 65,
    Default = 66,
    MembershipExpressionToken1 = 67,
    Instanceof = 68,
    InstanceofExpressionToken1 = 69,
    New = 70,
    LBRACK = 71,
    RBRACK = 72,
    QMARK = 73,
    Super = 74,
    QMARKDOT = 75,
    QMARKQMARKDOT = 76,
    STARDOT = 77,
    DOTAMP = 78,
    DOTAT = 79,
    COLONCOLON = 80,
    PLUSPLUS = 81,
    DASHDASH = 82,
    STAR = 83,
    QMARKLBRACK = 84,
    STARSTAR = 85,
    EQEQGT = 86,
    PLUSEQ = 87,
    DASHEQ = 88,
    STAREQ = 89,
    SLASHEQ = 90,
    PERCENTEQ = 91,
    STARSTAREQ = 92,
    LTLTEQ = 93,
    GTGTEQ = 94,
    GTGTGTEQ = 95,
    AMPEQ = 96,
    CARETEQ = 97,
    PIPEEQ = 98,
    QMARKEQ = 99,
    QMARKCOLON = 100,
    DOTDOT = 101,
    DOTDOTLT = 102,
    LTDOTDOT = 103,
    LTDOTDOTLT = 104,
    EQEQEQ = 105,
    BANGEQEQ = 106,
    LTEQGT = 107,
    EQTILDE = 108,
    EQEQTILDE = 109,
    PLUS = 110,
    DASH = 111,
    SLASH = 112,
    PERCENT = 113,
    LTLT = 114,
    GTGT = 115,
    GTGTGT = 116,
    LTEQ = 117,
    GTEQ = 118,
    EQEQ = 119,
    BANGEQ = 120,
    CARET = 121,
    AMPAMP = 122,
    PIPEPIPE = 123,
    STARCOLON = 124,
    BANG = 125,
    TILDE = 126,
    True = 127,
    False = 128,
    NullLiteral = 129,
    SLASH2 = 130,
    StringFragment = 131,
    SingleQuotedString = 132,
    TripleSingleQuotedString = 133,
    DQUOTE = 134,
    DQUOTE2 = 135,
    StringFragment2 = 136,
    StringFragment3 = 137,
    DQUOTEDQUOTEDQUOTE = 138,
    DQUOTEDQUOTEDQUOTE2 = 139,
    StringFragment4 = 140,
    Identifier2 = 141,
    DOLLARLBRACE = 142,
    DOLLARSLASH = 143,
    SLASHDOLLAR = 144,
    StringFragment5 = 145,
    NumberLiteral = 146,
    SlashyStringStart = 147,
    LineComment = 148,
    BlockComment = 149,
    GroovydocComment = 150,
    SourceFile = 151,
    Statement = 152,
    CommandChain = 153,
    CommandArgument = 154,
    LabeledStatement = 155,
    Block = 156,
    IfStatement = 157,
    WhileStatement = 158,
    ForStatement = 159,
    DoWhileStatement = 160,
    ReturnStatement = 161,
    BreakStatement = 162,
    ContinueStatement = 163,
    ThrowStatement = 164,
    YieldStatement = 165,
    AssertStatement = 166,
    TryStatement = 167,
    ResourceSpecification = 168,
    Resource = 169,
    CatchClause = 170,
    CatchFormalParameter = 171,
    MultiType = 172,
    FinallyClause = 173,
    ClassDeclaration = 174,
    TraitDeclaration = 175,
    InterfaceDeclaration = 176,
    TypeParameters = 177,
    TypeParameter = 178,
    Superclass = 179,
    SuperInterfaces = 180,
    ExtendsInterfaces = 181,
    Modifier = 182,
    PermitsClause = 183,
    AnnotationTypeDeclaration = 184,
    ClassBody = 185,
    ClassMember = 186,
    ConstructorDeclaration = 187,
    StaticInitializer = 188,
    FieldDeclaration = 189,
    MethodDeclaration = 190,
    MethodTypeParameters = 191,
    ThrowsClause = 192,
    FormalParameters = 193,
    FormalParameter = 194,
    VarargsType = 195,
    EnumDeclaration = 196,
    EnumBody = 197,
    EnumConstant = 198,
    RecordDeclaration = 199,
    RecordComponents = 200,
    RecordComponent = 201,
    PackageDeclaration = 202,
    ImportDeclaration = 203,
    QualifiedName = 204,
    LocalVariableDeclaration = 205,
    InitializedDeclarator = 206,
    VariableDeclarator = 207,
    MultiAssignmentDeclaration = 208,
    PipelineStatement = 209,
    Annotation = 210,
    ForInStatement = 211,
    ExpressionStatement = 212,
    Expression = 213,
    SwitchExpression = 214,
    SwitchBlock = 215,
    SwitchCase = 216,
    SwitchArrowCase = 217,
    SwitchDefault = 218,
    CastExpression = 219,
    CastType = 220,
    QualifiedType = 221,
    DottedTypeTail = 222,
    MembershipExpression = 223,
    InstanceofExpression = 224,
    ObjectCreationExpression = 225,
    ParenthesizedTypeCast = 226,
    Type = 227,
    QualifiedType2 = 228,
    ArrayType = 229,
    GenericType = 230,
    TypeArguments = 231,
    TypeArgument = 232,
    Wildcard = 233,
    FieldAccess = 234,
    SafeNavigationExpression = 235,
    SafeChainDotExpression = 236,
    SpreadDotExpression = 237,
    MethodPointerExpression = 238,
    DirectFieldAccessExpression = 239,
    PropertyName = 240,
    MethodReferenceExpression = 241,
    UpdateExpression = 242,
    UnaryUpdateExpression = 243,
    MethodInvocation = 244,
    ArgumentList = 245,
    Argument = 246,
    SpreadArguments = 247,
    SubscriptExpression = 248,
    SafeSubscriptExpression = 249,
    PowerExpression = 250,
    LogicalImplicationExpression = 251,
    AssignmentExpression = 252,
    TernaryExpression = 253,
    ElvisExpression = 254,
    RangeExpression = 255,
    IdentityExpression = 256,
    SpaceshipExpression = 257,
    RegexFindExpression = 258,
    RegexMatchExpression = 259,
    BinaryExpression = 260,
    Closure = 261,
    ClosureParameters = 262,
    ClosureParameter = 263,
    ListLiteral = 264,
    MapLiteral = 265,
    MapEntry = 266,
    SpreadMapEntry = 267,
    ParenthesizedExpression = 268,
    UnaryExpression = 269,
    BooleanLiteral = 270,
    StringLiteral = 271,
    SlashyString = 272,
    DoubleQuotedString = 273,
    TripleDoubleQuotedString = 274,
    GstringDollarInterpolation = 275,
    GstringBraceInterpolation = 276,
    DollarSlashyString = 277,
    SourceFileRepeat1 = 278,
    CommandChainRepeat1 = 279,
    TryStatementRepeat1 = 280,
    ResourceSpecificationRepeat1 = 281,
    MultiTypeRepeat1 = 282,
    ClassDeclarationRepeat1 = 283,
    ClassDeclarationRepeat2 = 284,
    TypeParametersRepeat1 = 285,
    TypeParameterRepeat1 = 286,
    SuperInterfacesRepeat1 = 287,
    ClassBodyRepeat1 = 288,
    FieldDeclarationRepeat1 = 289,
    FormalParametersRepeat1 = 290,
    EnumBodyRepeat1 = 291,
    RecordComponentsRepeat1 = 292,
    QualifiedNameRepeat1 = 293,
    LocalVariableDeclarationRepeat1 = 294,
    SwitchBlockRepeat1 = 295,
    QualifiedTypeRepeat1 = 296,
    TypeArgumentsRepeat1 = 297,
    ArgumentListRepeat1 = 298,
    ClosureParametersRepeat1 = 299,
    ListLiteralRepeat1 = 300,
    MapLiteralRepeat1 = 301,
    SlashyStringRepeat1 = 302,
    DoubleQuotedStringRepeat1 = 303,
    TripleDoubleQuotedStringRepeat1 = 304,
    DollarSlashyStringRepeat1 = 305,
    NamedArgument = 306,
    QuotedIdentifier = 307,
    TypeIdentifier = 308,
    Error = 309,
}

impl From<Groovy> for &'static str {
    #[inline]
    fn from(tok: Groovy) -> Self {
        match tok {
            Groovy::End => "end",
            Groovy::Identifier => "identifier",
            Groovy::Shebang => "shebang",
            Groovy::COMMA => ",",
            Groovy::COLON => ":",
            Groovy::LBRACE => "{",
            Groovy::RBRACE => "}",
            Groovy::If => "if",
            Groovy::LPAREN => "(",
            Groovy::RPAREN => ")",
            Groovy::Else => "else",
            Groovy::While => "while",
            Groovy::For => "for",
            Groovy::SEMI => ";",
            Groovy::Do => "do",
            Groovy::Return => "return",
            Groovy::Break => "break",
            Groovy::Continue => "continue",
            Groovy::Throw => "throw",
            Groovy::Yield => "yield",
            Groovy::Assert => "assert",
            Groovy::Try => "try",
            Groovy::EQ => "=",
            Groovy::Catch => "catch",
            Groovy::PIPE => "|",
            Groovy::Finally => "finally",
            Groovy::Sealed => "sealed",
            Groovy::NonDASHsealed => "non-sealed",
            Groovy::Class => "class",
            Groovy::Trait => "trait",
            Groovy::Interface => "interface",
            Groovy::LT => "<",
            Groovy::GT => ">",
            Groovy::Extends => "extends",
            Groovy::AMP => "&",
            Groovy::Implements => "implements",
            Groovy::Public => "public",
            Groovy::Private => "private",
            Groovy::Protected => "protected",
            Groovy::Static => "static",
            Groovy::Final => "final",
            Groovy::Abstract => "abstract",
            Groovy::Synchronized => "synchronized",
            Groovy::Native => "native",
            Groovy::Transient => "transient",
            Groovy::Volatile => "volatile",
            Groovy::Strictfp => "strictfp",
            Groovy::Permits => "permits",
            Groovy::AT => "@",
            Groovy::Def => "def",
            Groovy::LT2 => "<",
            Groovy::Throws => "throws",
            Groovy::DOTDOTDOT => "...",
            Groovy::Enum => "enum",
            Groovy::Record => "record",
            Groovy::Package => "package",
            Groovy::Import => "import",
            Groovy::DOTSTAR => ".*",
            Groovy::As => "as",
            Groovy::DOT => ".",
            Groovy::Var => "var",
            Groovy::Pipeline => "pipeline",
            Groovy::In => "in",
            Groovy::Switch => "switch",
            Groovy::Case => "case",
            Groovy::DASHGT => "->",
            Groovy::Default => "default",
            Groovy::MembershipExpressionToken1 => "membership_expression_token1",
            Groovy::Instanceof => "instanceof",
            Groovy::InstanceofExpressionToken1 => "instanceof_expression_token1",
            Groovy::New => "new",
            Groovy::LBRACK => "[",
            Groovy::RBRACK => "]",
            Groovy::QMARK => "?",
            Groovy::Super => "super",
            Groovy::QMARKDOT => "?.",
            Groovy::QMARKQMARKDOT => "??.",
            Groovy::STARDOT => "*.",
            Groovy::DOTAMP => ".&",
            Groovy::DOTAT => ".@",
            Groovy::COLONCOLON => "::",
            Groovy::PLUSPLUS => "++",
            Groovy::DASHDASH => "--",
            Groovy::STAR => "*",
            Groovy::QMARKLBRACK => "?[",
            Groovy::STARSTAR => "**",
            Groovy::EQEQGT => "==>",
            Groovy::PLUSEQ => "+=",
            Groovy::DASHEQ => "-=",
            Groovy::STAREQ => "*=",
            Groovy::SLASHEQ => "/=",
            Groovy::PERCENTEQ => "%=",
            Groovy::STARSTAREQ => "**=",
            Groovy::LTLTEQ => "<<=",
            Groovy::GTGTEQ => ">>=",
            Groovy::GTGTGTEQ => ">>>=",
            Groovy::AMPEQ => "&=",
            Groovy::CARETEQ => "^=",
            Groovy::PIPEEQ => "|=",
            Groovy::QMARKEQ => "?=",
            Groovy::QMARKCOLON => "?:",
            Groovy::DOTDOT => "..",
            Groovy::DOTDOTLT => "..<",
            Groovy::LTDOTDOT => "<..",
            Groovy::LTDOTDOTLT => "<..<",
            Groovy::EQEQEQ => "===",
            Groovy::BANGEQEQ => "!==",
            Groovy::LTEQGT => "<=>",
            Groovy::EQTILDE => "=~",
            Groovy::EQEQTILDE => "==~",
            Groovy::PLUS => "+",
            Groovy::DASH => "-",
            Groovy::SLASH => "/",
            Groovy::PERCENT => "%",
            Groovy::LTLT => "<<",
            Groovy::GTGT => ">>",
            Groovy::GTGTGT => ">>>",
            Groovy::LTEQ => "<=",
            Groovy::GTEQ => ">=",
            Groovy::EQEQ => "==",
            Groovy::BANGEQ => "!=",
            Groovy::CARET => "^",
            Groovy::AMPAMP => "&&",
            Groovy::PIPEPIPE => "||",
            Groovy::STARCOLON => "*:",
            Groovy::BANG => "!",
            Groovy::TILDE => "~",
            Groovy::True => "true",
            Groovy::False => "false",
            Groovy::NullLiteral => "null_literal",
            Groovy::SLASH2 => "/",
            Groovy::StringFragment => "string_fragment",
            Groovy::SingleQuotedString => "_single_quoted_string",
            Groovy::TripleSingleQuotedString => "_triple_single_quoted_string",
            Groovy::DQUOTE => "\"",
            Groovy::DQUOTE2 => "\"",
            Groovy::StringFragment2 => "string_fragment",
            Groovy::StringFragment3 => "string_fragment",
            Groovy::DQUOTEDQUOTEDQUOTE => "\"\"\"",
            Groovy::DQUOTEDQUOTEDQUOTE2 => "\"\"\"",
            Groovy::StringFragment4 => "string_fragment",
            Groovy::Identifier2 => "identifier",
            Groovy::DOLLARLBRACE => "${",
            Groovy::DOLLARSLASH => "$/",
            Groovy::SLASHDOLLAR => "/$",
            Groovy::StringFragment5 => "string_fragment",
            Groovy::NumberLiteral => "number_literal",
            Groovy::SlashyStringStart => "_slashy_string_start",
            Groovy::LineComment => "line_comment",
            Groovy::BlockComment => "block_comment",
            Groovy::GroovydocComment => "groovydoc_comment",
            Groovy::SourceFile => "source_file",
            Groovy::Statement => "_statement",
            Groovy::CommandChain => "command_chain",
            Groovy::CommandArgument => "_command_argument",
            Groovy::LabeledStatement => "labeled_statement",
            Groovy::Block => "block",
            Groovy::IfStatement => "if_statement",
            Groovy::WhileStatement => "while_statement",
            Groovy::ForStatement => "for_statement",
            Groovy::DoWhileStatement => "do_while_statement",
            Groovy::ReturnStatement => "return_statement",
            Groovy::BreakStatement => "break_statement",
            Groovy::ContinueStatement => "continue_statement",
            Groovy::ThrowStatement => "throw_statement",
            Groovy::YieldStatement => "yield_statement",
            Groovy::AssertStatement => "assert_statement",
            Groovy::TryStatement => "try_statement",
            Groovy::ResourceSpecification => "resource_specification",
            Groovy::Resource => "resource",
            Groovy::CatchClause => "catch_clause",
            Groovy::CatchFormalParameter => "catch_formal_parameter",
            Groovy::MultiType => "multi_type",
            Groovy::FinallyClause => "finally_clause",
            Groovy::ClassDeclaration => "class_declaration",
            Groovy::TraitDeclaration => "trait_declaration",
            Groovy::InterfaceDeclaration => "interface_declaration",
            Groovy::TypeParameters => "type_parameters",
            Groovy::TypeParameter => "type_parameter",
            Groovy::Superclass => "superclass",
            Groovy::SuperInterfaces => "super_interfaces",
            Groovy::ExtendsInterfaces => "extends_interfaces",
            Groovy::Modifier => "_modifier",
            Groovy::PermitsClause => "permits_clause",
            Groovy::AnnotationTypeDeclaration => "annotation_type_declaration",
            Groovy::ClassBody => "class_body",
            Groovy::ClassMember => "_class_member",
            Groovy::ConstructorDeclaration => "constructor_declaration",
            Groovy::StaticInitializer => "static_initializer",
            Groovy::FieldDeclaration => "field_declaration",
            Groovy::MethodDeclaration => "method_declaration",
            Groovy::MethodTypeParameters => "method_type_parameters",
            Groovy::ThrowsClause => "throws_clause",
            Groovy::FormalParameters => "formal_parameters",
            Groovy::FormalParameter => "formal_parameter",
            Groovy::VarargsType => "varargs_type",
            Groovy::EnumDeclaration => "enum_declaration",
            Groovy::EnumBody => "enum_body",
            Groovy::EnumConstant => "enum_constant",
            Groovy::RecordDeclaration => "record_declaration",
            Groovy::RecordComponents => "record_components",
            Groovy::RecordComponent => "record_component",
            Groovy::PackageDeclaration => "package_declaration",
            Groovy::ImportDeclaration => "import_declaration",
            Groovy::QualifiedName => "qualified_name",
            Groovy::LocalVariableDeclaration => "local_variable_declaration",
            Groovy::InitializedDeclarator => "_initialized_declarator",
            Groovy::VariableDeclarator => "variable_declarator",
            Groovy::MultiAssignmentDeclaration => "multi_assignment_declaration",
            Groovy::PipelineStatement => "pipeline_statement",
            Groovy::Annotation => "annotation",
            Groovy::ForInStatement => "for_in_statement",
            Groovy::ExpressionStatement => "expression_statement",
            Groovy::Expression => "_expression",
            Groovy::SwitchExpression => "switch_expression",
            Groovy::SwitchBlock => "switch_block",
            Groovy::SwitchCase => "switch_case",
            Groovy::SwitchArrowCase => "switch_arrow_case",
            Groovy::SwitchDefault => "switch_default",
            Groovy::CastExpression => "cast_expression",
            Groovy::CastType => "_cast_type",
            Groovy::QualifiedType => "qualified_type",
            Groovy::DottedTypeTail => "_dotted_type_tail",
            Groovy::MembershipExpression => "membership_expression",
            Groovy::InstanceofExpression => "instanceof_expression",
            Groovy::ObjectCreationExpression => "object_creation_expression",
            Groovy::ParenthesizedTypeCast => "parenthesized_type_cast",
            Groovy::Type => "_type",
            Groovy::QualifiedType2 => "qualified_type",
            Groovy::ArrayType => "array_type",
            Groovy::GenericType => "generic_type",
            Groovy::TypeArguments => "type_arguments",
            Groovy::TypeArgument => "_type_argument",
            Groovy::Wildcard => "wildcard",
            Groovy::FieldAccess => "field_access",
            Groovy::SafeNavigationExpression => "safe_navigation_expression",
            Groovy::SafeChainDotExpression => "safe_chain_dot_expression",
            Groovy::SpreadDotExpression => "spread_dot_expression",
            Groovy::MethodPointerExpression => "method_pointer_expression",
            Groovy::DirectFieldAccessExpression => "direct_field_access_expression",
            Groovy::PropertyName => "_property_name",
            Groovy::MethodReferenceExpression => "method_reference_expression",
            Groovy::UpdateExpression => "update_expression",
            Groovy::UnaryUpdateExpression => "unary_update_expression",
            Groovy::MethodInvocation => "method_invocation",
            Groovy::ArgumentList => "argument_list",
            Groovy::Argument => "_argument",
            Groovy::SpreadArguments => "spread_arguments",
            Groovy::SubscriptExpression => "subscript_expression",
            Groovy::SafeSubscriptExpression => "safe_subscript_expression",
            Groovy::PowerExpression => "power_expression",
            Groovy::LogicalImplicationExpression => "logical_implication_expression",
            Groovy::AssignmentExpression => "assignment_expression",
            Groovy::TernaryExpression => "ternary_expression",
            Groovy::ElvisExpression => "elvis_expression",
            Groovy::RangeExpression => "range_expression",
            Groovy::IdentityExpression => "identity_expression",
            Groovy::SpaceshipExpression => "spaceship_expression",
            Groovy::RegexFindExpression => "regex_find_expression",
            Groovy::RegexMatchExpression => "regex_match_expression",
            Groovy::BinaryExpression => "binary_expression",
            Groovy::Closure => "closure",
            Groovy::ClosureParameters => "closure_parameters",
            Groovy::ClosureParameter => "closure_parameter",
            Groovy::ListLiteral => "list_literal",
            Groovy::MapLiteral => "map_literal",
            Groovy::MapEntry => "map_entry",
            Groovy::SpreadMapEntry => "spread_map_entry",
            Groovy::ParenthesizedExpression => "parenthesized_expression",
            Groovy::UnaryExpression => "unary_expression",
            Groovy::BooleanLiteral => "boolean_literal",
            Groovy::StringLiteral => "string_literal",
            Groovy::SlashyString => "_slashy_string",
            Groovy::DoubleQuotedString => "_double_quoted_string",
            Groovy::TripleDoubleQuotedString => "_triple_double_quoted_string",
            Groovy::GstringDollarInterpolation => "gstring_dollar_interpolation",
            Groovy::GstringBraceInterpolation => "gstring_brace_interpolation",
            Groovy::DollarSlashyString => "_dollar_slashy_string",
            Groovy::SourceFileRepeat1 => "source_file_repeat1",
            Groovy::CommandChainRepeat1 => "command_chain_repeat1",
            Groovy::TryStatementRepeat1 => "try_statement_repeat1",
            Groovy::ResourceSpecificationRepeat1 => "resource_specification_repeat1",
            Groovy::MultiTypeRepeat1 => "multi_type_repeat1",
            Groovy::ClassDeclarationRepeat1 => "class_declaration_repeat1",
            Groovy::ClassDeclarationRepeat2 => "class_declaration_repeat2",
            Groovy::TypeParametersRepeat1 => "type_parameters_repeat1",
            Groovy::TypeParameterRepeat1 => "type_parameter_repeat1",
            Groovy::SuperInterfacesRepeat1 => "super_interfaces_repeat1",
            Groovy::ClassBodyRepeat1 => "class_body_repeat1",
            Groovy::FieldDeclarationRepeat1 => "field_declaration_repeat1",
            Groovy::FormalParametersRepeat1 => "formal_parameters_repeat1",
            Groovy::EnumBodyRepeat1 => "enum_body_repeat1",
            Groovy::RecordComponentsRepeat1 => "record_components_repeat1",
            Groovy::QualifiedNameRepeat1 => "qualified_name_repeat1",
            Groovy::LocalVariableDeclarationRepeat1 => "local_variable_declaration_repeat1",
            Groovy::SwitchBlockRepeat1 => "switch_block_repeat1",
            Groovy::QualifiedTypeRepeat1 => "qualified_type_repeat1",
            Groovy::TypeArgumentsRepeat1 => "type_arguments_repeat1",
            Groovy::ArgumentListRepeat1 => "argument_list_repeat1",
            Groovy::ClosureParametersRepeat1 => "closure_parameters_repeat1",
            Groovy::ListLiteralRepeat1 => "list_literal_repeat1",
            Groovy::MapLiteralRepeat1 => "map_literal_repeat1",
            Groovy::SlashyStringRepeat1 => "_slashy_string_repeat1",
            Groovy::DoubleQuotedStringRepeat1 => "_double_quoted_string_repeat1",
            Groovy::TripleDoubleQuotedStringRepeat1 => "_triple_double_quoted_string_repeat1",
            Groovy::DollarSlashyStringRepeat1 => "_dollar_slashy_string_repeat1",
            Groovy::NamedArgument => "named_argument",
            Groovy::QuotedIdentifier => "quoted_identifier",
            Groovy::TypeIdentifier => "type_identifier",
            Groovy::Error => "ERROR",
        }
    }
}

impl From<u16> for Groovy {
    #[inline]
    fn from(x: u16) -> Self {
        num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
    }
}

// Groovy == u16
impl PartialEq<u16> for Groovy {
    #[inline]
    fn eq(&self, x: &u16) -> bool {
        *self == Into::<Self>::into(*x)
    }
}

// u16 == Groovy
impl PartialEq<Groovy> for u16 {
    #[inline]
    fn eq(&self, x: &Groovy) -> bool {
        *x == *self
    }
}