Skip to main content

big_code_analysis_ast/languages/
language_groovy.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 Groovy {
14    End = 0,
15    Identifier = 1,
16    SEMI = 2,
17    Shebang = 3,
18    COMMA = 4,
19    COLON = 5,
20    LBRACE = 6,
21    RBRACE = 7,
22    If = 8,
23    LPAREN = 9,
24    RPAREN = 10,
25    Else = 11,
26    While = 12,
27    For = 13,
28    Do = 14,
29    Return = 15,
30    Break = 16,
31    Continue = 17,
32    Throw = 18,
33    Yield = 19,
34    Assert = 20,
35    Try = 21,
36    EQ = 22,
37    Catch = 23,
38    PIPE = 24,
39    Finally = 25,
40    Sealed = 26,
41    NonDASHsealed = 27,
42    Class = 28,
43    Trait = 29,
44    Interface = 30,
45    LT = 31,
46    GT = 32,
47    Extends = 33,
48    AMP = 34,
49    Implements = 35,
50    Public = 36,
51    Private = 37,
52    Protected = 38,
53    Static = 39,
54    Final = 40,
55    Abstract = 41,
56    Synchronized = 42,
57    Native = 43,
58    Transient = 44,
59    Volatile = 45,
60    Strictfp = 46,
61    Permits = 47,
62    AT = 48,
63    Def = 49,
64    LT2 = 50,
65    Throws = 51,
66    DOTDOTDOT = 52,
67    Enum = 53,
68    Record = 54,
69    Package = 55,
70    Import = 56,
71    DOTSTAR = 57,
72    As = 58,
73    DOT = 59,
74    Var = 60,
75    Pipeline = 61,
76    In = 62,
77    Switch = 63,
78    Case = 64,
79    DASHGT = 65,
80    Default = 66,
81    MembershipExpressionToken1 = 67,
82    Instanceof = 68,
83    InstanceofExpressionToken1 = 69,
84    New = 70,
85    LBRACK = 71,
86    RBRACK = 72,
87    QMARK = 73,
88    Super = 74,
89    QMARKDOT = 75,
90    QMARKQMARKDOT = 76,
91    STARDOT = 77,
92    DOTAMP = 78,
93    DOTAT = 79,
94    COLONCOLON = 80,
95    PLUSPLUS = 81,
96    DASHDASH = 82,
97    STAR = 83,
98    QMARKLBRACK = 84,
99    STARSTAR = 85,
100    EQEQGT = 86,
101    PLUSEQ = 87,
102    DASHEQ = 88,
103    STAREQ = 89,
104    SLASHEQ = 90,
105    PERCENTEQ = 91,
106    STARSTAREQ = 92,
107    LTLTEQ = 93,
108    GTGTEQ = 94,
109    GTGTGTEQ = 95,
110    AMPEQ = 96,
111    CARETEQ = 97,
112    PIPEEQ = 98,
113    QMARKEQ = 99,
114    QMARKCOLON = 100,
115    DOTDOT = 101,
116    DOTDOTLT = 102,
117    LTDOTDOT = 103,
118    LTDOTDOTLT = 104,
119    EQEQEQ = 105,
120    BANGEQEQ = 106,
121    LTEQGT = 107,
122    EQTILDE = 108,
123    EQEQTILDE = 109,
124    PLUS = 110,
125    DASH = 111,
126    SLASH = 112,
127    PERCENT = 113,
128    LTLT = 114,
129    GTGT = 115,
130    GTGTGT = 116,
131    LTEQ = 117,
132    GTEQ = 118,
133    EQEQ = 119,
134    BANGEQ = 120,
135    CARET = 121,
136    AMPAMP = 122,
137    PIPEPIPE = 123,
138    STARCOLON = 124,
139    BANG = 125,
140    TILDE = 126,
141    True = 127,
142    False = 128,
143    NullLiteral = 129,
144    SLASH2 = 130,
145    StringFragment = 131,
146    SingleQuotedString = 132,
147    TripleSingleQuotedString = 133,
148    DQUOTE = 134,
149    DQUOTE2 = 135,
150    StringFragment2 = 136,
151    StringFragment3 = 137,
152    DQUOTEDQUOTEDQUOTE = 138,
153    DQUOTEDQUOTEDQUOTE2 = 139,
154    StringFragment4 = 140,
155    Identifier2 = 141,
156    DOLLARLBRACE = 142,
157    DOLLARSLASH = 143,
158    SLASHDOLLAR = 144,
159    StringFragment5 = 145,
160    NumberLiteral = 146,
161    SlashyStringStart = 147,
162    LineComment = 148,
163    BlockComment = 149,
164    GroovydocComment = 150,
165    SourceFile = 151,
166    Statement = 152,
167    CommandChain = 153,
168    CommandArgument = 154,
169    LabeledStatement = 155,
170    Block = 156,
171    IfStatement = 157,
172    WhileStatement = 158,
173    ForStatement = 159,
174    DoWhileStatement = 160,
175    ReturnStatement = 161,
176    BreakStatement = 162,
177    ContinueStatement = 163,
178    ThrowStatement = 164,
179    YieldStatement = 165,
180    AssertStatement = 166,
181    TryStatement = 167,
182    ResourceSpecification = 168,
183    Resource = 169,
184    CatchClause = 170,
185    CatchFormalParameter = 171,
186    MultiType = 172,
187    FinallyClause = 173,
188    ClassDeclaration = 174,
189    TraitDeclaration = 175,
190    InterfaceDeclaration = 176,
191    TypeParameters = 177,
192    TypeParameter = 178,
193    Superclass = 179,
194    SuperInterfaces = 180,
195    ExtendsInterfaces = 181,
196    Modifier = 182,
197    PermitsClause = 183,
198    AnnotationTypeDeclaration = 184,
199    ClassBody = 185,
200    ClassMember = 186,
201    ConstructorDeclaration = 187,
202    StaticInitializer = 188,
203    FieldDeclaration = 189,
204    MethodDeclaration = 190,
205    MethodTypeParameters = 191,
206    ThrowsClause = 192,
207    FormalParameters = 193,
208    FormalParameter = 194,
209    VarargsType = 195,
210    EnumDeclaration = 196,
211    EnumBody = 197,
212    EnumConstant = 198,
213    RecordDeclaration = 199,
214    RecordComponents = 200,
215    RecordComponent = 201,
216    PackageDeclaration = 202,
217    ImportDeclaration = 203,
218    QualifiedName = 204,
219    LocalVariableDeclaration = 205,
220    InitializedDeclarator = 206,
221    VariableDeclarator = 207,
222    MultiAssignmentDeclaration = 208,
223    PipelineStatement = 209,
224    Annotation = 210,
225    ForInStatement = 211,
226    ExpressionStatement = 212,
227    Expression = 213,
228    SwitchExpression = 214,
229    SwitchBlock = 215,
230    SwitchCase = 216,
231    SwitchArrowCase = 217,
232    SwitchDefault = 218,
233    CastExpression = 219,
234    CastType = 220,
235    QualifiedType = 221,
236    DottedTypeTail = 222,
237    MembershipExpression = 223,
238    InstanceofExpression = 224,
239    ObjectCreationExpression = 225,
240    ParenthesizedTypeCast = 226,
241    Type = 227,
242    QualifiedType2 = 228,
243    ArrayType = 229,
244    GenericType = 230,
245    TypeArguments = 231,
246    TypeArgument = 232,
247    Wildcard = 233,
248    FieldAccess = 234,
249    SafeNavigationExpression = 235,
250    SafeChainDotExpression = 236,
251    SpreadDotExpression = 237,
252    MethodPointerExpression = 238,
253    DirectFieldAccessExpression = 239,
254    PropertyName = 240,
255    MethodReferenceExpression = 241,
256    UpdateExpression = 242,
257    UnaryUpdateExpression = 243,
258    MethodInvocation = 244,
259    ArgumentList = 245,
260    Argument = 246,
261    SpreadArguments = 247,
262    SubscriptExpression = 248,
263    SafeSubscriptExpression = 249,
264    PowerExpression = 250,
265    LogicalImplicationExpression = 251,
266    AssignmentExpression = 252,
267    TernaryExpression = 253,
268    ElvisExpression = 254,
269    RangeExpression = 255,
270    IdentityExpression = 256,
271    SpaceshipExpression = 257,
272    RegexFindExpression = 258,
273    RegexMatchExpression = 259,
274    BinaryExpression = 260,
275    Closure = 261,
276    ClosureParameters = 262,
277    ClosureParameter = 263,
278    ListLiteral = 264,
279    MapLiteral = 265,
280    MapEntry = 266,
281    SpreadMapEntry = 267,
282    ParenthesizedExpression = 268,
283    UnaryExpression = 269,
284    BooleanLiteral = 270,
285    StringLiteral = 271,
286    SlashyString = 272,
287    DoubleQuotedString = 273,
288    TripleDoubleQuotedString = 274,
289    GstringDollarInterpolation = 275,
290    GstringBraceInterpolation = 276,
291    DollarSlashyString = 277,
292    SourceFileRepeat1 = 278,
293    CommandChainRepeat1 = 279,
294    TryStatementRepeat1 = 280,
295    ResourceSpecificationRepeat1 = 281,
296    MultiTypeRepeat1 = 282,
297    ClassDeclarationRepeat1 = 283,
298    ClassDeclarationRepeat2 = 284,
299    TypeParametersRepeat1 = 285,
300    TypeParameterRepeat1 = 286,
301    SuperInterfacesRepeat1 = 287,
302    ClassBodyRepeat1 = 288,
303    FieldDeclarationRepeat1 = 289,
304    FormalParametersRepeat1 = 290,
305    EnumBodyRepeat1 = 291,
306    RecordComponentsRepeat1 = 292,
307    QualifiedNameRepeat1 = 293,
308    LocalVariableDeclarationRepeat1 = 294,
309    SwitchBlockRepeat1 = 295,
310    QualifiedTypeRepeat1 = 296,
311    TypeArgumentsRepeat1 = 297,
312    ArgumentListRepeat1 = 298,
313    ClosureParametersRepeat1 = 299,
314    ListLiteralRepeat1 = 300,
315    MapLiteralRepeat1 = 301,
316    SlashyStringRepeat1 = 302,
317    DoubleQuotedStringRepeat1 = 303,
318    TripleDoubleQuotedStringRepeat1 = 304,
319    DollarSlashyStringRepeat1 = 305,
320    NamedArgument = 306,
321    QuotedIdentifier = 307,
322    TypeIdentifier = 308,
323    Error = 309,
324}
325
326impl From<Groovy> for &'static str {
327    #[inline]
328    fn from(tok: Groovy) -> Self {
329        match tok {
330            Groovy::End => "end",
331            Groovy::Identifier => "identifier",
332            Groovy::SEMI => ";",
333            Groovy::Shebang => "shebang",
334            Groovy::COMMA => ",",
335            Groovy::COLON => ":",
336            Groovy::LBRACE => "{",
337            Groovy::RBRACE => "}",
338            Groovy::If => "if",
339            Groovy::LPAREN => "(",
340            Groovy::RPAREN => ")",
341            Groovy::Else => "else",
342            Groovy::While => "while",
343            Groovy::For => "for",
344            Groovy::Do => "do",
345            Groovy::Return => "return",
346            Groovy::Break => "break",
347            Groovy::Continue => "continue",
348            Groovy::Throw => "throw",
349            Groovy::Yield => "yield",
350            Groovy::Assert => "assert",
351            Groovy::Try => "try",
352            Groovy::EQ => "=",
353            Groovy::Catch => "catch",
354            Groovy::PIPE => "|",
355            Groovy::Finally => "finally",
356            Groovy::Sealed => "sealed",
357            Groovy::NonDASHsealed => "non-sealed",
358            Groovy::Class => "class",
359            Groovy::Trait => "trait",
360            Groovy::Interface => "interface",
361            Groovy::LT => "<",
362            Groovy::GT => ">",
363            Groovy::Extends => "extends",
364            Groovy::AMP => "&",
365            Groovy::Implements => "implements",
366            Groovy::Public => "public",
367            Groovy::Private => "private",
368            Groovy::Protected => "protected",
369            Groovy::Static => "static",
370            Groovy::Final => "final",
371            Groovy::Abstract => "abstract",
372            Groovy::Synchronized => "synchronized",
373            Groovy::Native => "native",
374            Groovy::Transient => "transient",
375            Groovy::Volatile => "volatile",
376            Groovy::Strictfp => "strictfp",
377            Groovy::Permits => "permits",
378            Groovy::AT => "@",
379            Groovy::Def => "def",
380            Groovy::LT2 => "<",
381            Groovy::Throws => "throws",
382            Groovy::DOTDOTDOT => "...",
383            Groovy::Enum => "enum",
384            Groovy::Record => "record",
385            Groovy::Package => "package",
386            Groovy::Import => "import",
387            Groovy::DOTSTAR => ".*",
388            Groovy::As => "as",
389            Groovy::DOT => ".",
390            Groovy::Var => "var",
391            Groovy::Pipeline => "pipeline",
392            Groovy::In => "in",
393            Groovy::Switch => "switch",
394            Groovy::Case => "case",
395            Groovy::DASHGT => "->",
396            Groovy::Default => "default",
397            Groovy::MembershipExpressionToken1 => "membership_expression_token1",
398            Groovy::Instanceof => "instanceof",
399            Groovy::InstanceofExpressionToken1 => "instanceof_expression_token1",
400            Groovy::New => "new",
401            Groovy::LBRACK => "[",
402            Groovy::RBRACK => "]",
403            Groovy::QMARK => "?",
404            Groovy::Super => "super",
405            Groovy::QMARKDOT => "?.",
406            Groovy::QMARKQMARKDOT => "??.",
407            Groovy::STARDOT => "*.",
408            Groovy::DOTAMP => ".&",
409            Groovy::DOTAT => ".@",
410            Groovy::COLONCOLON => "::",
411            Groovy::PLUSPLUS => "++",
412            Groovy::DASHDASH => "--",
413            Groovy::STAR => "*",
414            Groovy::QMARKLBRACK => "?[",
415            Groovy::STARSTAR => "**",
416            Groovy::EQEQGT => "==>",
417            Groovy::PLUSEQ => "+=",
418            Groovy::DASHEQ => "-=",
419            Groovy::STAREQ => "*=",
420            Groovy::SLASHEQ => "/=",
421            Groovy::PERCENTEQ => "%=",
422            Groovy::STARSTAREQ => "**=",
423            Groovy::LTLTEQ => "<<=",
424            Groovy::GTGTEQ => ">>=",
425            Groovy::GTGTGTEQ => ">>>=",
426            Groovy::AMPEQ => "&=",
427            Groovy::CARETEQ => "^=",
428            Groovy::PIPEEQ => "|=",
429            Groovy::QMARKEQ => "?=",
430            Groovy::QMARKCOLON => "?:",
431            Groovy::DOTDOT => "..",
432            Groovy::DOTDOTLT => "..<",
433            Groovy::LTDOTDOT => "<..",
434            Groovy::LTDOTDOTLT => "<..<",
435            Groovy::EQEQEQ => "===",
436            Groovy::BANGEQEQ => "!==",
437            Groovy::LTEQGT => "<=>",
438            Groovy::EQTILDE => "=~",
439            Groovy::EQEQTILDE => "==~",
440            Groovy::PLUS => "+",
441            Groovy::DASH => "-",
442            Groovy::SLASH => "/",
443            Groovy::PERCENT => "%",
444            Groovy::LTLT => "<<",
445            Groovy::GTGT => ">>",
446            Groovy::GTGTGT => ">>>",
447            Groovy::LTEQ => "<=",
448            Groovy::GTEQ => ">=",
449            Groovy::EQEQ => "==",
450            Groovy::BANGEQ => "!=",
451            Groovy::CARET => "^",
452            Groovy::AMPAMP => "&&",
453            Groovy::PIPEPIPE => "||",
454            Groovy::STARCOLON => "*:",
455            Groovy::BANG => "!",
456            Groovy::TILDE => "~",
457            Groovy::True => "true",
458            Groovy::False => "false",
459            Groovy::NullLiteral => "null_literal",
460            Groovy::SLASH2 => "/",
461            Groovy::StringFragment => "string_fragment",
462            Groovy::SingleQuotedString => "_single_quoted_string",
463            Groovy::TripleSingleQuotedString => "_triple_single_quoted_string",
464            Groovy::DQUOTE => "\"",
465            Groovy::DQUOTE2 => "\"",
466            Groovy::StringFragment2 => "string_fragment",
467            Groovy::StringFragment3 => "string_fragment",
468            Groovy::DQUOTEDQUOTEDQUOTE => "\"\"\"",
469            Groovy::DQUOTEDQUOTEDQUOTE2 => "\"\"\"",
470            Groovy::StringFragment4 => "string_fragment",
471            Groovy::Identifier2 => "identifier",
472            Groovy::DOLLARLBRACE => "${",
473            Groovy::DOLLARSLASH => "$/",
474            Groovy::SLASHDOLLAR => "/$",
475            Groovy::StringFragment5 => "string_fragment",
476            Groovy::NumberLiteral => "number_literal",
477            Groovy::SlashyStringStart => "_slashy_string_start",
478            Groovy::LineComment => "line_comment",
479            Groovy::BlockComment => "block_comment",
480            Groovy::GroovydocComment => "groovydoc_comment",
481            Groovy::SourceFile => "source_file",
482            Groovy::Statement => "_statement",
483            Groovy::CommandChain => "command_chain",
484            Groovy::CommandArgument => "_command_argument",
485            Groovy::LabeledStatement => "labeled_statement",
486            Groovy::Block => "block",
487            Groovy::IfStatement => "if_statement",
488            Groovy::WhileStatement => "while_statement",
489            Groovy::ForStatement => "for_statement",
490            Groovy::DoWhileStatement => "do_while_statement",
491            Groovy::ReturnStatement => "return_statement",
492            Groovy::BreakStatement => "break_statement",
493            Groovy::ContinueStatement => "continue_statement",
494            Groovy::ThrowStatement => "throw_statement",
495            Groovy::YieldStatement => "yield_statement",
496            Groovy::AssertStatement => "assert_statement",
497            Groovy::TryStatement => "try_statement",
498            Groovy::ResourceSpecification => "resource_specification",
499            Groovy::Resource => "resource",
500            Groovy::CatchClause => "catch_clause",
501            Groovy::CatchFormalParameter => "catch_formal_parameter",
502            Groovy::MultiType => "multi_type",
503            Groovy::FinallyClause => "finally_clause",
504            Groovy::ClassDeclaration => "class_declaration",
505            Groovy::TraitDeclaration => "trait_declaration",
506            Groovy::InterfaceDeclaration => "interface_declaration",
507            Groovy::TypeParameters => "type_parameters",
508            Groovy::TypeParameter => "type_parameter",
509            Groovy::Superclass => "superclass",
510            Groovy::SuperInterfaces => "super_interfaces",
511            Groovy::ExtendsInterfaces => "extends_interfaces",
512            Groovy::Modifier => "_modifier",
513            Groovy::PermitsClause => "permits_clause",
514            Groovy::AnnotationTypeDeclaration => "annotation_type_declaration",
515            Groovy::ClassBody => "class_body",
516            Groovy::ClassMember => "_class_member",
517            Groovy::ConstructorDeclaration => "constructor_declaration",
518            Groovy::StaticInitializer => "static_initializer",
519            Groovy::FieldDeclaration => "field_declaration",
520            Groovy::MethodDeclaration => "method_declaration",
521            Groovy::MethodTypeParameters => "method_type_parameters",
522            Groovy::ThrowsClause => "throws_clause",
523            Groovy::FormalParameters => "formal_parameters",
524            Groovy::FormalParameter => "formal_parameter",
525            Groovy::VarargsType => "varargs_type",
526            Groovy::EnumDeclaration => "enum_declaration",
527            Groovy::EnumBody => "enum_body",
528            Groovy::EnumConstant => "enum_constant",
529            Groovy::RecordDeclaration => "record_declaration",
530            Groovy::RecordComponents => "record_components",
531            Groovy::RecordComponent => "record_component",
532            Groovy::PackageDeclaration => "package_declaration",
533            Groovy::ImportDeclaration => "import_declaration",
534            Groovy::QualifiedName => "qualified_name",
535            Groovy::LocalVariableDeclaration => "local_variable_declaration",
536            Groovy::InitializedDeclarator => "_initialized_declarator",
537            Groovy::VariableDeclarator => "variable_declarator",
538            Groovy::MultiAssignmentDeclaration => "multi_assignment_declaration",
539            Groovy::PipelineStatement => "pipeline_statement",
540            Groovy::Annotation => "annotation",
541            Groovy::ForInStatement => "for_in_statement",
542            Groovy::ExpressionStatement => "expression_statement",
543            Groovy::Expression => "_expression",
544            Groovy::SwitchExpression => "switch_expression",
545            Groovy::SwitchBlock => "switch_block",
546            Groovy::SwitchCase => "switch_case",
547            Groovy::SwitchArrowCase => "switch_arrow_case",
548            Groovy::SwitchDefault => "switch_default",
549            Groovy::CastExpression => "cast_expression",
550            Groovy::CastType => "_cast_type",
551            Groovy::QualifiedType => "qualified_type",
552            Groovy::DottedTypeTail => "_dotted_type_tail",
553            Groovy::MembershipExpression => "membership_expression",
554            Groovy::InstanceofExpression => "instanceof_expression",
555            Groovy::ObjectCreationExpression => "object_creation_expression",
556            Groovy::ParenthesizedTypeCast => "parenthesized_type_cast",
557            Groovy::Type => "_type",
558            Groovy::QualifiedType2 => "qualified_type",
559            Groovy::ArrayType => "array_type",
560            Groovy::GenericType => "generic_type",
561            Groovy::TypeArguments => "type_arguments",
562            Groovy::TypeArgument => "_type_argument",
563            Groovy::Wildcard => "wildcard",
564            Groovy::FieldAccess => "field_access",
565            Groovy::SafeNavigationExpression => "safe_navigation_expression",
566            Groovy::SafeChainDotExpression => "safe_chain_dot_expression",
567            Groovy::SpreadDotExpression => "spread_dot_expression",
568            Groovy::MethodPointerExpression => "method_pointer_expression",
569            Groovy::DirectFieldAccessExpression => "direct_field_access_expression",
570            Groovy::PropertyName => "_property_name",
571            Groovy::MethodReferenceExpression => "method_reference_expression",
572            Groovy::UpdateExpression => "update_expression",
573            Groovy::UnaryUpdateExpression => "unary_update_expression",
574            Groovy::MethodInvocation => "method_invocation",
575            Groovy::ArgumentList => "argument_list",
576            Groovy::Argument => "_argument",
577            Groovy::SpreadArguments => "spread_arguments",
578            Groovy::SubscriptExpression => "subscript_expression",
579            Groovy::SafeSubscriptExpression => "safe_subscript_expression",
580            Groovy::PowerExpression => "power_expression",
581            Groovy::LogicalImplicationExpression => "logical_implication_expression",
582            Groovy::AssignmentExpression => "assignment_expression",
583            Groovy::TernaryExpression => "ternary_expression",
584            Groovy::ElvisExpression => "elvis_expression",
585            Groovy::RangeExpression => "range_expression",
586            Groovy::IdentityExpression => "identity_expression",
587            Groovy::SpaceshipExpression => "spaceship_expression",
588            Groovy::RegexFindExpression => "regex_find_expression",
589            Groovy::RegexMatchExpression => "regex_match_expression",
590            Groovy::BinaryExpression => "binary_expression",
591            Groovy::Closure => "closure",
592            Groovy::ClosureParameters => "closure_parameters",
593            Groovy::ClosureParameter => "closure_parameter",
594            Groovy::ListLiteral => "list_literal",
595            Groovy::MapLiteral => "map_literal",
596            Groovy::MapEntry => "map_entry",
597            Groovy::SpreadMapEntry => "spread_map_entry",
598            Groovy::ParenthesizedExpression => "parenthesized_expression",
599            Groovy::UnaryExpression => "unary_expression",
600            Groovy::BooleanLiteral => "boolean_literal",
601            Groovy::StringLiteral => "string_literal",
602            Groovy::SlashyString => "_slashy_string",
603            Groovy::DoubleQuotedString => "_double_quoted_string",
604            Groovy::TripleDoubleQuotedString => "_triple_double_quoted_string",
605            Groovy::GstringDollarInterpolation => "gstring_dollar_interpolation",
606            Groovy::GstringBraceInterpolation => "gstring_brace_interpolation",
607            Groovy::DollarSlashyString => "_dollar_slashy_string",
608            Groovy::SourceFileRepeat1 => "source_file_repeat1",
609            Groovy::CommandChainRepeat1 => "command_chain_repeat1",
610            Groovy::TryStatementRepeat1 => "try_statement_repeat1",
611            Groovy::ResourceSpecificationRepeat1 => "resource_specification_repeat1",
612            Groovy::MultiTypeRepeat1 => "multi_type_repeat1",
613            Groovy::ClassDeclarationRepeat1 => "class_declaration_repeat1",
614            Groovy::ClassDeclarationRepeat2 => "class_declaration_repeat2",
615            Groovy::TypeParametersRepeat1 => "type_parameters_repeat1",
616            Groovy::TypeParameterRepeat1 => "type_parameter_repeat1",
617            Groovy::SuperInterfacesRepeat1 => "super_interfaces_repeat1",
618            Groovy::ClassBodyRepeat1 => "class_body_repeat1",
619            Groovy::FieldDeclarationRepeat1 => "field_declaration_repeat1",
620            Groovy::FormalParametersRepeat1 => "formal_parameters_repeat1",
621            Groovy::EnumBodyRepeat1 => "enum_body_repeat1",
622            Groovy::RecordComponentsRepeat1 => "record_components_repeat1",
623            Groovy::QualifiedNameRepeat1 => "qualified_name_repeat1",
624            Groovy::LocalVariableDeclarationRepeat1 => "local_variable_declaration_repeat1",
625            Groovy::SwitchBlockRepeat1 => "switch_block_repeat1",
626            Groovy::QualifiedTypeRepeat1 => "qualified_type_repeat1",
627            Groovy::TypeArgumentsRepeat1 => "type_arguments_repeat1",
628            Groovy::ArgumentListRepeat1 => "argument_list_repeat1",
629            Groovy::ClosureParametersRepeat1 => "closure_parameters_repeat1",
630            Groovy::ListLiteralRepeat1 => "list_literal_repeat1",
631            Groovy::MapLiteralRepeat1 => "map_literal_repeat1",
632            Groovy::SlashyStringRepeat1 => "_slashy_string_repeat1",
633            Groovy::DoubleQuotedStringRepeat1 => "_double_quoted_string_repeat1",
634            Groovy::TripleDoubleQuotedStringRepeat1 => "_triple_double_quoted_string_repeat1",
635            Groovy::DollarSlashyStringRepeat1 => "_dollar_slashy_string_repeat1",
636            Groovy::NamedArgument => "named_argument",
637            Groovy::QuotedIdentifier => "quoted_identifier",
638            Groovy::TypeIdentifier => "type_identifier",
639            Groovy::Error => "ERROR",
640        }
641    }
642}
643
644impl From<u16> for Groovy {
645    #[inline]
646    fn from(x: u16) -> Self {
647        num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
648    }
649}
650
651// Groovy == u16
652impl PartialEq<u16> for Groovy {
653    #[inline]
654    fn eq(&self, x: &u16) -> bool {
655        *self == Into::<Self>::into(*x)
656    }
657}
658
659// u16 == Groovy
660impl PartialEq<Groovy> for u16 {
661    #[inline]
662    fn eq(&self, x: &Groovy) -> bool {
663        *x == *self
664    }
665}