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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
// 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 Perl {
    End = 0,
    Identifier = 1,
    LTLT = 2,
    PodStatementToken1 = 3,
    FILE = 4,
    LINE = 5,
    PACKAGE = 6,
    SUB = 7,
    END = 8,
    DATA = 9,
    Use = 10,
    Parent = 11,
    COMMA = 12,
    LPAREN = 13,
    RPAREN = 14,
    Constant = 15,
    Sub = 16,
    BEGIN = 17,
    UNITCHECK = 18,
    CHECK = 19,
    INIT = 20,
    END2 = 21,
    Package = 22,
    DOTDOTDOT = 23,
    No = 24,
    Feature = 25,
    If = 26,
    DASHGT = 27,
    Import = 28,
    Subs = 29,
    Require = 30,
    Unless = 31,
    While = 32,
    Until = 33,
    For = 34,
    Foreach = 35,
    When = 36,
    Elsif = 37,
    Else = 38,
    Continue2 = 39,
    BSLASH = 40,
    Our = 41,
    State = 42,
    My = 43,
    Local = 44,
    COLON = 45,
    Prototype2 = 46,
    LBRACE = 47,
    RBRACE = 48,
    Prototype = 49,
    Return = 50,
    COLONCOLON = 51,
    COLONCOLON2 = 52,
    Bless2 = 53,
    Goto = 54,
    QMARK = 55,
    PLUSPLUS = 56,
    DASHDASH = 57,
    STARSTAR = 58,
    BANG = 59,
    TILDE = 60,
    PLUS = 61,
    DASH = 62,
    EQTILDE = 63,
    BANGTILDE = 64,
    STAR = 65,
    Bodmas1Token1 = 66,
    Bodmas1Token2 = 67,
    Bodmas1Token3 = 68,
    Bodmas1Token4 = 69,
    DOT = 70,
    GTGT = 71,
    LT = 72,
    GT = 73,
    LTEQ = 74,
    GTEQ = 75,
    Lt = 76,
    Gt = 77,
    Le = 78,
    Ge = 79,
    EQEQ = 80,
    BANGEQ = 81,
    Eq = 82,
    Ne = 83,
    LTEQGT = 84,
    Cmp = 85,
    TILDETILDE = 86,
    Isa = 87,
    BitwiseAndExpToken1 = 88,
    PIPE = 89,
    CARET = 90,
    AMPAMP = 91,
    PIPEPIPE = 92,
    SLASHSLASH = 93,
    DOTDOT = 94,
    EQ = 95,
    STARSTAREQ = 96,
    PLUSEQ = 97,
    STAREQ = 98,
    AMPEQ = 99,
    AMPDOTEQ = 100,
    LTLTEQ = 101,
    AMPAMPEQ = 102,
    DASHEQ = 103,
    SLASHEQ = 104,
    PIPEEQ = 105,
    PIPEDOTEQ = 106,
    GTGTEQ = 107,
    PIPEPIPEEQ = 108,
    DOTEQ = 109,
    PERCENTEQ = 110,
    CARETEQ = 111,
    CARETDOTEQ = 112,
    SLASHSLASHEQ = 113,
    XEQ = 114,
    Not = 115,
    And = 116,
    Or = 117,
    Xor = 118,
    FileHandleOperatorToken1 = 119,
    StandardInputToken1 = 120,
    StandardInputToken2 = 121,
    StandardInputToken3 = 122,
    StandardInputToken4 = 123,
    FileHandle = 124,
    GT2 = 125,
    Method = 126,
    Func = 127,
    Integer = 128,
    FloatingPoint = 129,
    ScientificNotation = 130,
    Hexadecimal = 131,
    Octal = 132,
    VersionToken1 = 133,
    VersionToken2 = 134,
    VersionToken3 = 135,
    Next = 136,
    Last = 137,
    Redo = 138,
    SQUOTE = 139,
    ModuleNameToken1 = 140,
    DQUOTE = 141,
    SEMI = 142,
    Q = 143,
    Qq = 144,
    Qx = 145,
    BQUOTE = 146,
    BacktickQuotedToken1 = 147,
    Qw = 148,
    M = 149,
    SLASH = 150,
    Qr = 151,
    S = 152,
    Tr = 153,
    Y = 154,
    LBRACK = 155,
    RegexPatternContentToken1 = 156,
    RegexPatternContentToken2 = 157,
    RBRACK = 158,
    RegexPatternContentToken3 = 159,
    HASH = 160,
    RegexOption = 161,
    RegexOptionForSubstitution = 162,
    RegexOptionForTransliteration = 163,
    EscapeSequenceToken1 = 164,
    DASHGTLBRACK = 165,
    LBRACK2 = 166,
    True = 167,
    False = 168,
    DOLLAR = 169,
    SpecialScalarVariableToken1 = 170,
    ArrayVariableToken1 = 171,
    ArrayVariableToken2 = 172,
    ArrayVariableToken3 = 173,
    HashVariableToken1 = 174,
    HashVariableToken2 = 175,
    HashVariableToken3 = 176,
    DOLLARHASH = 177,
    AT = 178,
    PERCENT = 179,
    FatComma = 180,
    Super = 181,
    NoRequire = 182,
    CommentsToken1 = 183,
    ScalarVariableExternal = 184,
    StartDelimiter = 185,
    EndDelimiter = 186,
    StringContent = 187,
    StringSingleQuotedContent = 188,
    StringSingleQQuotedContent = 189,
    StringQqQuotedContent = 190,
    StringDoubleQuotedContent = 191,
    StartDelimiterQw = 192,
    ListItem = 193,
    EndDelimiterQw = 194,
    StartDelimiter2 = 195,
    StartDelimiterSlash = 196,
    RegexPattern = 197,
    EndDelimiter2 = 198,
    StartDelimiter3 = 199,
    SearchReplaceContent = 200,
    SeparatorDelimiter = 201,
    EndDelimiter3 = 202,
    StartDelimiter4 = 203,
    TransliterationContent = 204,
    SeparatorDelimiter2 = 205,
    EndDelimiter4 = 206,
    ImaginaryHeredocStart = 207,
    HeredocStartIdentifier = 208,
    HeredocContent = 209,
    HeredocEndIdentifier = 210,
    PodContent = 211,
    DataNotForCompiler = 212,
    AutomaticSemicolon = 213,
    SourceFile = 214,
    Statement = 215,
    HeredocInitializer = 216,
    HeredocOperator = 217,
    HeredocBodyStatement = 218,
    PodStatement = 219,
    SpecialLiteral = 220,
    UseParentStatement = 221,
    UseConstantStatement = 222,
    SpecialBlock = 223,
    PackageStatement = 224,
    EllipsisStatement = 225,
    UseNoVersion = 226,
    UseNoFeatureStatement = 227,
    ExpressionOrReturnExpression = 228,
    SingleLineStatement = 229,
    StatementModifiers = 230,
    CompoundStatement = 231,
    ExpressionStatement = 232,
    UseNoStatement = 233,
    UseNoIfStatement = 234,
    BarewordImport = 235,
    UseNoSubsStatement = 236,
    RequireStatement = 237,
    IfSimpleStatement = 238,
    IfSimple = 239,
    UnlessSimpleStatement = 240,
    WhileSimpleStatement = 241,
    UntilSimpleStatement = 242,
    ForSimpleStatement = 243,
    WhenSimpleStatement = 244,
    IfStatement = 245,
    UnlessStatement = 246,
    ElsifClause = 247,
    ElseClause = 248,
    WhileStatement = 249,
    Continue = 250,
    UntilStatement = 251,
    ForStatement1 = 252,
    ForStatement2 = 253,
    ForParenthesize = 254,
    Declaration = 255,
    VariableDeclaration = 256,
    VariableDec = 257,
    Scope = 258,
    FunctionOptions = 259,
    FunctionDefinition = 260,
    FunctionDefinitionWithoutSub = 261,
    AnonymousFunction = 262,
    Block = 263,
    FunctionSignature2 = 264,
    FunctionPrototype = 265,
    FunctionAttribute = 266,
    StandaloneBlock = 267,
    Label = 268,
    BlockStatements = 269,
    LoopControlStatement = 270,
    ReturnExpression = 271,
    ExpressionWithoutLValue = 272,
    ExpressionWithoutBareword = 273,
    Expression = 274,
    PackageVariable = 275,
    Bless = 276,
    GotoExpression = 277,
    BinaryExpression = 278,
    UnaryExpression = 279,
    TernaryExpression = 280,
    AutoIncrementDecrement = 281,
    Exponentiation = 282,
    SymbolicUnary = 283,
    BindingExpression = 284,
    Bodmas1 = 285,
    Bodmas2 = 286,
    ShiftExpression = 287,
    RelationalExpression = 288,
    EqualityExpression = 289,
    ClassInstanceExp = 290,
    BitwiseAndExp = 291,
    BitwiseOrXorExp = 292,
    LogicalAndExp = 293,
    LogicalOrsExp = 294,
    RangeExp = 295,
    AssignmentExp = 296,
    UnaryNot = 297,
    UnaryAnd = 298,
    LogicalVerbalOrXor = 299,
    FileHandleOperator = 300,
    IOOperator = 301,
    StandardInput = 302,
    StandardInputToIdentifier = 303,
    StandardInputToVariable = 304,
    CallExpressionWithSpacedArgs = 305,
    CallExpressionWithSub = 306,
    CallExpressionWithArgsWithBrackets = 307,
    CallExpressionWithVariable = 308,
    CallExpressionWithBareword = 309,
    AndBeforeSub = 310,
    MethodInvocation = 311,
    ArgumentChoice = 312,
    ParenthesizedArgument = 313,
    Arguments = 314,
    CallExpressionRecursive = 315,
    PrimitiveExpression = 316,
    Variables = 317,
    AccessVariables = 318,
    ScalarType = 319,
    String = 320,
    InterpolatableString = 321,
    ResolvesToDigit = 322,
    ArrayType = 323,
    NumericLiterals = 324,
    Version = 325,
    LoopControlKeyword = 326,
    PackageName = 327,
    ModuleName = 328,
    StringSingleQuoted = 329,
    StringQQuoted = 330,
    StringDoubleQuoted = 331,
    StringQqQuoted = 332,
    CommandQxQuoted = 333,
    BacktickQuoted = 334,
    WordListQw = 335,
    PatternMatcherM = 336,
    PatternMatcher = 337,
    RegexPatternQr = 338,
    SubstitutionPatternS = 339,
    TransliterationTrOrY = 340,
    RegexPatternContent = 341,
    EscapeSequence = 342,
    Interpolation = 343,
    HashAccessInInterpolation = 344,
    ArrayAccessInInterpolation = 345,
    Boolean = 346,
    SpecialScalarVariable = 347,
    ScalarVariable = 348,
    Typeglob = 349,
    ArrayAccessVariable = 350,
    HashAccessVariableSimple = 351,
    HashAccessVariable = 352,
    ArrayVariable = 353,
    HashVariable = 354,
    List = 355,
    Array = 356,
    ArrayRef = 357,
    HashRef = 358,
    Reference = 359,
    ToReference = 360,
    Dereference = 361,
    ScalarDereference = 362,
    LengthExpression = 363,
    ArrayDereference = 364,
    HashDereference = 365,
    KeywordsInHashKey = 366,
    ArrowOperator = 367,
    CommaOperator = 368,
    NormalComma = 369,
    Comments = 370,
    SourceFileRepeat1 = 371,
    HeredocBodyStatementRepeat1 = 372,
    UseParentStatementRepeat1 = 373,
    ExpressionStatementRepeat1 = 374,
    IfStatementRepeat1 = 375,
    BlockRepeat1 = 376,
    FunctionAttributeRepeat1 = 377,
    PackageVariableRepeat1 = 378,
    RelationalExpressionRepeat1 = 379,
    EqualityExpressionRepeat1 = 380,
    PackageNameRepeat1 = 381,
    StringSingleQuotedRepeat1 = 382,
    StringQQuotedRepeat1 = 383,
    StringDoubleQuotedRepeat1 = 384,
    StringQqQuotedRepeat1 = 385,
    BacktickQuotedRepeat1 = 386,
    WordListQwRepeat1 = 387,
    PatternMatcherMRepeat1 = 388,
    SubstitutionPatternSRepeat1 = 389,
    TransliterationTrOrYRepeat1 = 390,
    RegexPatternContentRepeat1 = 391,
    RegexPatternContentRepeat2 = 392,
    HashAccessInInterpolationRepeat1 = 393,
    ArrayAccessInInterpolationRepeat1 = 394,
    FunctionSignature = 395,
    Error = 396,
}

impl From<Perl> for &'static str {
    #[inline]
    fn from(tok: Perl) -> Self {
        match tok {
            Perl::End => "end",
            Perl::Identifier => "identifier",
            Perl::LTLT => "<<",
            Perl::PodStatementToken1 => "pod_statement_token1",
            Perl::FILE => "__FILE__",
            Perl::LINE => "__LINE__",
            Perl::PACKAGE => "__PACKAGE__",
            Perl::SUB => "__SUB__",
            Perl::END => "__END__",
            Perl::DATA => "__DATA__",
            Perl::Use => "use",
            Perl::Parent => "parent",
            Perl::COMMA => ",",
            Perl::LPAREN => "(",
            Perl::RPAREN => ")",
            Perl::Constant => "constant",
            Perl::Sub => "sub",
            Perl::BEGIN => "BEGIN",
            Perl::UNITCHECK => "UNITCHECK",
            Perl::CHECK => "CHECK",
            Perl::INIT => "INIT",
            Perl::END2 => "END",
            Perl::Package => "package",
            Perl::DOTDOTDOT => "...",
            Perl::No => "no",
            Perl::Feature => "feature",
            Perl::If => "if",
            Perl::DASHGT => "->",
            Perl::Import => "import",
            Perl::Subs => "subs",
            Perl::Require => "require",
            Perl::Unless => "unless",
            Perl::While => "while",
            Perl::Until => "until",
            Perl::For => "for",
            Perl::Foreach => "foreach",
            Perl::When => "when",
            Perl::Elsif => "elsif",
            Perl::Else => "else",
            Perl::Continue2 => "continue",
            Perl::BSLASH => "\\",
            Perl::Our => "our",
            Perl::State => "state",
            Perl::My => "my",
            Perl::Local => "local",
            Perl::COLON => ":",
            Perl::Prototype2 => "prototype",
            Perl::LBRACE => "{",
            Perl::RBRACE => "}",
            Perl::Prototype => "prototype",
            Perl::Return => "return",
            Perl::COLONCOLON => "::",
            Perl::COLONCOLON2 => "::",
            Perl::Bless2 => "bless",
            Perl::Goto => "goto",
            Perl::QMARK => "?",
            Perl::PLUSPLUS => "++",
            Perl::DASHDASH => "--",
            Perl::STARSTAR => "**",
            Perl::BANG => "!",
            Perl::TILDE => "~",
            Perl::PLUS => "+",
            Perl::DASH => "-",
            Perl::EQTILDE => "=~",
            Perl::BANGTILDE => "!~",
            Perl::STAR => "*",
            Perl::Bodmas1Token1 => "_bodmas_1_token1",
            Perl::Bodmas1Token2 => "_bodmas_1_token2",
            Perl::Bodmas1Token3 => "_bodmas_1_token3",
            Perl::Bodmas1Token4 => "_bodmas_1_token4",
            Perl::DOT => ".",
            Perl::GTGT => ">>",
            Perl::LT => "<",
            Perl::GT => ">",
            Perl::LTEQ => "<=",
            Perl::GTEQ => ">=",
            Perl::Lt => "lt",
            Perl::Gt => "gt",
            Perl::Le => "le",
            Perl::Ge => "ge",
            Perl::EQEQ => "==",
            Perl::BANGEQ => "!=",
            Perl::Eq => "eq",
            Perl::Ne => "ne",
            Perl::LTEQGT => "<=>",
            Perl::Cmp => "cmp",
            Perl::TILDETILDE => "~~",
            Perl::Isa => "isa",
            Perl::BitwiseAndExpToken1 => "_bitwise_and_exp_token1",
            Perl::PIPE => "|",
            Perl::CARET => "^",
            Perl::AMPAMP => "&&",
            Perl::PIPEPIPE => "||",
            Perl::SLASHSLASH => "//",
            Perl::DOTDOT => "..",
            Perl::EQ => "=",
            Perl::STARSTAREQ => "**=",
            Perl::PLUSEQ => "+=",
            Perl::STAREQ => "*=",
            Perl::AMPEQ => "&=",
            Perl::AMPDOTEQ => "&.=",
            Perl::LTLTEQ => "<<=",
            Perl::AMPAMPEQ => "&&=",
            Perl::DASHEQ => "-=",
            Perl::SLASHEQ => "/=",
            Perl::PIPEEQ => "|=",
            Perl::PIPEDOTEQ => "|.=",
            Perl::GTGTEQ => ">>=",
            Perl::PIPEPIPEEQ => "||=",
            Perl::DOTEQ => ".=",
            Perl::PERCENTEQ => "%=",
            Perl::CARETEQ => "^=",
            Perl::CARETDOTEQ => "^.=",
            Perl::SLASHSLASHEQ => "//=",
            Perl::XEQ => "X=",
            Perl::Not => "not",
            Perl::And => "and",
            Perl::Or => "or",
            Perl::Xor => "xor",
            Perl::FileHandleOperatorToken1 => "file_handle_operator_token1",
            Perl::StandardInputToken1 => "standard_input_token1",
            Perl::StandardInputToken2 => "standard_input_token2",
            Perl::StandardInputToken3 => "standard_input_token3",
            Perl::StandardInputToken4 => "standard_input_token4",
            Perl::FileHandle => "file_handle",
            Perl::GT2 => ">",
            Perl::Method => "method",
            Perl::Func => "func",
            Perl::Integer => "integer",
            Perl::FloatingPoint => "floating_point",
            Perl::ScientificNotation => "scientific_notation",
            Perl::Hexadecimal => "hexadecimal",
            Perl::Octal => "octal",
            Perl::VersionToken1 => "version_token1",
            Perl::VersionToken2 => "version_token2",
            Perl::VersionToken3 => "version_token3",
            Perl::Next => "next",
            Perl::Last => "last",
            Perl::Redo => "redo",
            Perl::SQUOTE => "'",
            Perl::ModuleNameToken1 => "module_name_token1",
            Perl::DQUOTE => "\"",
            Perl::SEMI => ";",
            Perl::Q => "q",
            Perl::Qq => "qq",
            Perl::Qx => "qx",
            Perl::BQUOTE => "`",
            Perl::BacktickQuotedToken1 => "backtick_quoted_token1",
            Perl::Qw => "qw",
            Perl::M => "m",
            Perl::SLASH => "/",
            Perl::Qr => "qr",
            Perl::S => "s",
            Perl::Tr => "tr",
            Perl::Y => "y",
            Perl::LBRACK => "[",
            Perl::RegexPatternContentToken1 => "regex_pattern_content_token1",
            Perl::RegexPatternContentToken2 => "regex_pattern_content_token2",
            Perl::RBRACK => "]",
            Perl::RegexPatternContentToken3 => "regex_pattern_content_token3",
            Perl::HASH => "#",
            Perl::RegexOption => "regex_option",
            Perl::RegexOptionForSubstitution => "regex_option_for_substitution",
            Perl::RegexOptionForTransliteration => "regex_option_for_transliteration",
            Perl::EscapeSequenceToken1 => "escape_sequence_token1",
            Perl::DASHGTLBRACK => "->[",
            Perl::LBRACK2 => "[",
            Perl::True => "true",
            Perl::False => "false",
            Perl::DOLLAR => "$",
            Perl::SpecialScalarVariableToken1 => "special_scalar_variable_token1",
            Perl::ArrayVariableToken1 => "array_variable_token1",
            Perl::ArrayVariableToken2 => "array_variable_token2",
            Perl::ArrayVariableToken3 => "array_variable_token3",
            Perl::HashVariableToken1 => "hash_variable_token1",
            Perl::HashVariableToken2 => "hash_variable_token2",
            Perl::HashVariableToken3 => "hash_variable_token3",
            Perl::DOLLARHASH => "$#",
            Perl::AT => "@",
            Perl::PERCENT => "%",
            Perl::FatComma => "fat_comma",
            Perl::Super => "super",
            Perl::NoRequire => "no_require",
            Perl::CommentsToken1 => "comments_token1",
            Perl::ScalarVariableExternal => "_scalar_variable_external",
            Perl::StartDelimiter => "start_delimiter",
            Perl::EndDelimiter => "end_delimiter",
            Perl::StringContent => "_string_content",
            Perl::StringSingleQuotedContent => "_string_single_quoted_content",
            Perl::StringSingleQQuotedContent => "_string_single_q_quoted_content",
            Perl::StringQqQuotedContent => "_string_qq_quoted_content",
            Perl::StringDoubleQuotedContent => "_string_double_quoted_content",
            Perl::StartDelimiterQw => "start_delimiter_qw",
            Perl::ListItem => "list_item",
            Perl::EndDelimiterQw => "end_delimiter_qw",
            Perl::StartDelimiter2 => "start_delimiter",
            Perl::StartDelimiterSlash => "_start_delimiter_slash",
            Perl::RegexPattern => "_regex_pattern",
            Perl::EndDelimiter2 => "end_delimiter",
            Perl::StartDelimiter3 => "start_delimiter",
            Perl::SearchReplaceContent => "_search_replace_content",
            Perl::SeparatorDelimiter => "separator_delimiter",
            Perl::EndDelimiter3 => "end_delimiter",
            Perl::StartDelimiter4 => "start_delimiter",
            Perl::TransliterationContent => "_transliteration_content",
            Perl::SeparatorDelimiter2 => "separator_delimiter",
            Perl::EndDelimiter4 => "end_delimiter",
            Perl::ImaginaryHeredocStart => "_imaginary_heredoc_start",
            Perl::HeredocStartIdentifier => "heredoc_start_identifier",
            Perl::HeredocContent => "_heredoc_content",
            Perl::HeredocEndIdentifier => "heredoc_end_identifier",
            Perl::PodContent => "_pod_content",
            Perl::DataNotForCompiler => "data_not_for_compiler",
            Perl::AutomaticSemicolon => "_automatic_semicolon",
            Perl::SourceFile => "source_file",
            Perl::Statement => "_statement",
            Perl::HeredocInitializer => "heredoc_initializer",
            Perl::HeredocOperator => "_heredoc_operator",
            Perl::HeredocBodyStatement => "heredoc_body_statement",
            Perl::PodStatement => "pod_statement",
            Perl::SpecialLiteral => "special_literal",
            Perl::UseParentStatement => "use_parent_statement",
            Perl::UseConstantStatement => "use_constant_statement",
            Perl::SpecialBlock => "special_block",
            Perl::PackageStatement => "package_statement",
            Perl::EllipsisStatement => "ellipsis_statement",
            Perl::UseNoVersion => "use_no_version",
            Perl::UseNoFeatureStatement => "use_no_feature_statement",
            Perl::ExpressionOrReturnExpression => "_expression_or_return_expression",
            Perl::SingleLineStatement => "single_line_statement",
            Perl::StatementModifiers => "_statement_modifiers",
            Perl::CompoundStatement => "_compound_statement",
            Perl::ExpressionStatement => "_expression_statement",
            Perl::UseNoStatement => "use_no_statement",
            Perl::UseNoIfStatement => "use_no_if_statement",
            Perl::BarewordImport => "bareword_import",
            Perl::UseNoSubsStatement => "use_no_subs_statement",
            Perl::RequireStatement => "require_statement",
            Perl::IfSimpleStatement => "if_simple_statement",
            Perl::IfSimple => "_if_simple",
            Perl::UnlessSimpleStatement => "unless_simple_statement",
            Perl::WhileSimpleStatement => "while_simple_statement",
            Perl::UntilSimpleStatement => "until_simple_statement",
            Perl::ForSimpleStatement => "for_simple_statement",
            Perl::WhenSimpleStatement => "when_simple_statement",
            Perl::IfStatement => "if_statement",
            Perl::UnlessStatement => "unless_statement",
            Perl::ElsifClause => "elsif_clause",
            Perl::ElseClause => "else_clause",
            Perl::WhileStatement => "while_statement",
            Perl::Continue => "continue",
            Perl::UntilStatement => "until_statement",
            Perl::ForStatement1 => "for_statement_1",
            Perl::ForStatement2 => "for_statement_2",
            Perl::ForParenthesize => "_for_parenthesize",
            Perl::Declaration => "_declaration",
            Perl::VariableDeclaration => "variable_declaration",
            Perl::VariableDec => "_variable_dec",
            Perl::Scope => "scope",
            Perl::FunctionOptions => "_function_options",
            Perl::FunctionDefinition => "function_definition",
            Perl::FunctionDefinitionWithoutSub => "function_definition_without_sub",
            Perl::AnonymousFunction => "anonymous_function",
            Perl::Block => "block",
            Perl::FunctionSignature2 => "_function_signature",
            Perl::FunctionPrototype => "function_prototype",
            Perl::FunctionAttribute => "function_attribute",
            Perl::StandaloneBlock => "standalone_block",
            Perl::Label => "label",
            Perl::BlockStatements => "_block_statements",
            Perl::LoopControlStatement => "loop_control_statement",
            Perl::ReturnExpression => "return_expression",
            Perl::ExpressionWithoutLValue => "_expression_without_l_value",
            Perl::ExpressionWithoutBareword => "_expression_without_bareword",
            Perl::Expression => "_expression",
            Perl::PackageVariable => "package_variable",
            Perl::Bless => "bless",
            Perl::GotoExpression => "goto_expression",
            Perl::BinaryExpression => "binary_expression",
            Perl::UnaryExpression => "unary_expression",
            Perl::TernaryExpression => "ternary_expression",
            Perl::AutoIncrementDecrement => "_auto_increment_decrement",
            Perl::Exponentiation => "_exponentiation",
            Perl::SymbolicUnary => "_symbolic_unary",
            Perl::BindingExpression => "_binding_expression",
            Perl::Bodmas1 => "_bodmas_1",
            Perl::Bodmas2 => "_bodmas_2",
            Perl::ShiftExpression => "_shift_expression",
            Perl::RelationalExpression => "_relational_expression",
            Perl::EqualityExpression => "_equality_expression",
            Perl::ClassInstanceExp => "_class_instance_exp",
            Perl::BitwiseAndExp => "_bitwise_and_exp",
            Perl::BitwiseOrXorExp => "_bitwise_or_xor_exp",
            Perl::LogicalAndExp => "_logical_and_exp",
            Perl::LogicalOrsExp => "_logical_ors_exp",
            Perl::RangeExp => "_range_exp",
            Perl::AssignmentExp => "_assignment_exp",
            Perl::UnaryNot => "_unary_not",
            Perl::UnaryAnd => "_unary_and",
            Perl::LogicalVerbalOrXor => "_logical_verbal_or_xor",
            Perl::FileHandleOperator => "file_handle_operator",
            Perl::IOOperator => "_i_o_operator",
            Perl::StandardInput => "standard_input",
            Perl::StandardInputToIdentifier => "standard_input_to_identifier",
            Perl::StandardInputToVariable => "standard_input_to_variable",
            Perl::CallExpressionWithSpacedArgs => "call_expression_with_spaced_args",
            Perl::CallExpressionWithSub => "call_expression_with_sub",
            Perl::CallExpressionWithArgsWithBrackets => "call_expression_with_args_with_brackets",
            Perl::CallExpressionWithVariable => "call_expression_with_variable",
            Perl::CallExpressionWithBareword => "call_expression_with_bareword",
            Perl::AndBeforeSub => "_and_before_sub",
            Perl::MethodInvocation => "method_invocation",
            Perl::ArgumentChoice => "_argument_choice",
            Perl::ParenthesizedArgument => "parenthesized_argument",
            Perl::Arguments => "arguments",
            Perl::CallExpressionRecursive => "call_expression_recursive",
            Perl::PrimitiveExpression => "_primitive_expression",
            Perl::Variables => "_variables",
            Perl::AccessVariables => "_access_variables",
            Perl::ScalarType => "_scalar_type",
            Perl::String => "_string",
            Perl::InterpolatableString => "_interpolatable_string",
            Perl::ResolvesToDigit => "_resolves_to_digit",
            Perl::ArrayType => "_array_type",
            Perl::NumericLiterals => "_numeric_literals",
            Perl::Version => "version",
            Perl::LoopControlKeyword => "loop_control_keyword",
            Perl::PackageName => "package_name",
            Perl::ModuleName => "module_name",
            Perl::StringSingleQuoted => "string_single_quoted",
            Perl::StringQQuoted => "string_q_quoted",
            Perl::StringDoubleQuoted => "string_double_quoted",
            Perl::StringQqQuoted => "string_qq_quoted",
            Perl::CommandQxQuoted => "command_qx_quoted",
            Perl::BacktickQuoted => "backtick_quoted",
            Perl::WordListQw => "word_list_qw",
            Perl::PatternMatcherM => "pattern_matcher_m",
            Perl::PatternMatcher => "pattern_matcher",
            Perl::RegexPatternQr => "regex_pattern_qr",
            Perl::SubstitutionPatternS => "substitution_pattern_s",
            Perl::TransliterationTrOrY => "transliteration_tr_or_y",
            Perl::RegexPatternContent => "regex_pattern_content",
            Perl::EscapeSequence => "escape_sequence",
            Perl::Interpolation => "interpolation",
            Perl::HashAccessInInterpolation => "hash_access_in_interpolation",
            Perl::ArrayAccessInInterpolation => "array_access_in_interpolation",
            Perl::Boolean => "_boolean",
            Perl::SpecialScalarVariable => "special_scalar_variable",
            Perl::ScalarVariable => "scalar_variable",
            Perl::Typeglob => "typeglob",
            Perl::ArrayAccessVariable => "array_access_variable",
            Perl::HashAccessVariableSimple => "hash_access_variable_simple",
            Perl::HashAccessVariable => "hash_access_variable",
            Perl::ArrayVariable => "array_variable",
            Perl::HashVariable => "hash_variable",
            Perl::List => "_list",
            Perl::Array => "array",
            Perl::ArrayRef => "array_ref",
            Perl::HashRef => "hash_ref",
            Perl::Reference => "_reference",
            Perl::ToReference => "to_reference",
            Perl::Dereference => "_dereference",
            Perl::ScalarDereference => "scalar_dereference",
            Perl::LengthExpression => "length_expression",
            Perl::ArrayDereference => "array_dereference",
            Perl::HashDereference => "hash_dereference",
            Perl::KeywordsInHashKey => "keywords_in_hash_key",
            Perl::ArrowOperator => "arrow_operator",
            Perl::CommaOperator => "_comma_operator",
            Perl::NormalComma => "normal_comma",
            Perl::Comments => "comments",
            Perl::SourceFileRepeat1 => "source_file_repeat1",
            Perl::HeredocBodyStatementRepeat1 => "heredoc_body_statement_repeat1",
            Perl::UseParentStatementRepeat1 => "use_parent_statement_repeat1",
            Perl::ExpressionStatementRepeat1 => "_expression_statement_repeat1",
            Perl::IfStatementRepeat1 => "if_statement_repeat1",
            Perl::BlockRepeat1 => "block_repeat1",
            Perl::FunctionAttributeRepeat1 => "function_attribute_repeat1",
            Perl::PackageVariableRepeat1 => "package_variable_repeat1",
            Perl::RelationalExpressionRepeat1 => "_relational_expression_repeat1",
            Perl::EqualityExpressionRepeat1 => "_equality_expression_repeat1",
            Perl::PackageNameRepeat1 => "package_name_repeat1",
            Perl::StringSingleQuotedRepeat1 => "string_single_quoted_repeat1",
            Perl::StringQQuotedRepeat1 => "string_q_quoted_repeat1",
            Perl::StringDoubleQuotedRepeat1 => "string_double_quoted_repeat1",
            Perl::StringQqQuotedRepeat1 => "string_qq_quoted_repeat1",
            Perl::BacktickQuotedRepeat1 => "backtick_quoted_repeat1",
            Perl::WordListQwRepeat1 => "word_list_qw_repeat1",
            Perl::PatternMatcherMRepeat1 => "pattern_matcher_m_repeat1",
            Perl::SubstitutionPatternSRepeat1 => "substitution_pattern_s_repeat1",
            Perl::TransliterationTrOrYRepeat1 => "transliteration_tr_or_y_repeat1",
            Perl::RegexPatternContentRepeat1 => "regex_pattern_content_repeat1",
            Perl::RegexPatternContentRepeat2 => "regex_pattern_content_repeat2",
            Perl::HashAccessInInterpolationRepeat1 => "hash_access_in_interpolation_repeat1",
            Perl::ArrayAccessInInterpolationRepeat1 => "array_access_in_interpolation_repeat1",
            Perl::FunctionSignature => "function_signature",
            Perl::Error => "ERROR",
        }
    }
}

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

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

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