1#![allow(clippy::match_same_arms, clippy::too_many_lines)]
4#![allow(missing_docs)]
7
8use num_derive::FromPrimitive;
11
12#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
13pub enum Csharp {
14 End = 0,
15 IdentifierToken = 1,
16 Extern = 2,
17 Alias = 3,
18 SEMI = 4,
19 Global = 5,
20 Using = 6,
21 Unsafe = 7,
22 EQ = 8,
23 Static = 9,
24 LBRACK = 10,
25 Assembly = 11,
26 Module = 12,
27 COLON = 13,
28 COMMA = 14,
29 RBRACK = 15,
30 LPAREN = 16,
31 RPAREN = 17,
32 Field = 18,
33 Event = 19,
34 Method = 20,
35 Param = 21,
36 Property = 22,
37 Return = 23,
38 Type = 24,
39 Typevar = 25,
40 Namespace = 26,
41 Class = 27,
42 Ref = 28,
43 Struct = 29,
44 Enum = 30,
45 LBRACE = 31,
46 RBRACE = 32,
47 Interface = 33,
48 Delegate = 34,
49 Record = 35,
50 Abstract = 36,
51 Async = 37,
52 Const = 38,
53 File = 39,
54 Fixed = 40,
55 Internal = 41,
56 New = 42,
57 Override = 43,
58 Partial = 44,
59 Private = 45,
60 Protected = 46,
61 Public = 47,
62 Readonly = 48,
63 Required = 49,
64 Sealed = 50,
65 Virtual = 51,
66 Volatile = 52,
67 LT = 53,
68 GT = 54,
69 In = 55,
70 Out = 56,
71 Where = 57,
72 QMARK = 58,
73 Notnull = 59,
74 Unmanaged = 60,
75 Operator = 61,
76 Checked = 62,
77 BANG = 63,
78 TILDE = 64,
79 PLUSPLUS = 65,
80 DASHDASH = 66,
81 True = 67,
82 False = 68,
83 PLUS = 69,
84 DASH = 70,
85 STAR = 71,
86 SLASH = 72,
87 PERCENT = 73,
88 CARET = 74,
89 PIPE = 75,
90 AMP = 76,
91 LTLT = 77,
92 GTGT = 78,
93 GTGTGT = 79,
94 EQEQ = 80,
95 BANGEQ = 81,
96 GTEQ = 82,
97 LTEQ = 83,
98 Implicit = 84,
99 Explicit = 85,
100 Get = 86,
101 Set = 87,
102 Add = 88,
103 Remove = 89,
104 Init = 90,
105 This = 91,
106 DOT = 92,
107 Scoped = 93,
108 Params = 94,
109 Base = 95,
110 EQGT = 96,
111 COLONCOLON = 97,
112 Var = 98,
113 Managed = 99,
114 Cdecl = 100,
115 Stdcall = 101,
116 Thiscall = 102,
117 Fastcall = 103,
118 PredefinedType = 104,
119 Break = 105,
120 Unchecked = 106,
121 Continue = 107,
122 Do = 108,
123 While = 109,
124 For = 110,
125 Lock = 111,
126 Yield = 112,
127 Switch = 113,
128 Case = 114,
129 Default = 115,
130 Throw = 116,
131 Try = 117,
132 Catch = 118,
133 When = 119,
134 Finally = 120,
135 Await = 121,
136 Foreach = 122,
137 Goto = 123,
138 If = 124,
139 Else = 125,
140 Discard = 126,
141 DOTDOT = 127,
142 Not = 128,
143 And = 129,
144 Or = 130,
145 PLUSEQ = 131,
146 DASHEQ = 132,
147 STAREQ = 133,
148 SLASHEQ = 134,
149 PERCENTEQ = 135,
150 AMPEQ = 136,
151 CARETEQ = 137,
152 PIPEEQ = 138,
153 LTLTEQ = 139,
154 GTGTEQ = 140,
155 GTGTGTEQ = 141,
156 QMARKQMARKEQ = 142,
157 AMPAMP = 143,
158 PIPEPIPE = 144,
159 QMARKQMARK = 145,
160 From = 146,
161 Into = 147,
162 Join = 148,
163 On = 149,
164 Equals = 150,
165 Let = 151,
166 Orderby = 152,
167 Ascending = 153,
168 Descending = 154,
169 Group = 155,
170 By = 156,
171 Select = 157,
172 As = 158,
173 Is = 159,
174 InterpolationFormatClauseToken1 = 160,
175 DASHGT = 161,
176 Stackalloc = 162,
177 With = 163,
178 Sizeof = 164,
179 Typeof = 165,
180 Makeref = 166,
181 Reftype = 167,
182 Refvalue = 168,
183 NullLiteral = 169,
184 SQUOTE = 170,
185 CharacterLiteralContent = 171,
186 IntegerLiteral = 172,
187 RealLiteral = 173,
188 DQUOTE = 174,
189 StringLiteralContent = 175,
190 EscapeSequence = 176,
191 StringLiteralEncoding = 177,
192 VerbatimStringLiteral = 178,
193 RawStringLiteralToken1 = 179,
194 HASHif = 180,
195 PreprocIfToken2 = 181,
196 HASHendif = 182,
197 HASHelse = 183,
198 HASHelif = 184,
199 PreprocArg = 185,
200 HASHregion = 186,
201 HASHendregion = 187,
202 HASHline = 188,
203 Hidden = 189,
204 HASHpragma = 190,
205 Warning = 191,
206 Disable = 192,
207 Restore = 193,
208 Checksum = 194,
209 HASHnullable = 195,
210 Enable = 196,
211 Annotations = 197,
212 Warnings = 198,
213 HASHerror = 199,
214 HASHwarning = 200,
215 HASHdefine = 201,
216 HASHundef = 202,
217 ShebangDirective = 203,
218 Comment = 204,
219 OptionalSemi = 205,
220 InterpolationStart = 206,
221 InterpolationStart2 = 207,
222 InterpolationStart3 = 208,
223 DQUOTE2 = 209,
224 DQUOTE3 = 210,
225 InterpolationBrace = 211,
226 InterpolationBrace2 = 212,
227 StringContent = 213,
228 RawStringStart = 214,
229 RawStringEnd = 215,
230 RawStringContent = 216,
231 CompilationUnit = 217,
232 TopLevelItem = 218,
233 GlobalStatement = 219,
234 ExternAliasDirective = 220,
235 UsingDirective = 221,
236 GlobalAttribute = 222,
237 Attribute = 223,
238 AttributeArgumentList = 224,
239 AttributeArgument = 225,
240 AttributeList = 226,
241 AttributeList2 = 227,
242 AttributeTargetSpecifier = 228,
243 NamespaceDeclaration = 229,
244 FileScopedNamespaceDeclaration = 230,
245 TypeDeclaration = 231,
246 ClassDeclaration = 232,
247 ClassDeclarationInitializer = 233,
248 StructDeclaration = 234,
249 StructDeclarationInitializer = 235,
250 EnumDeclaration = 236,
251 EnumDeclarationInitializer = 237,
252 EnumMemberDeclarationList = 238,
253 EnumMemberDeclaration = 239,
254 InterfaceDeclaration = 240,
255 InterfaceDeclarationInitializer = 241,
256 DelegateDeclaration = 242,
257 DelegateDeclarationInitializer = 243,
258 RecordDeclaration = 244,
259 RecordDeclarationInitializer = 245,
260 BaseList = 246,
261 DeclarationListBody = 247,
262 PrimaryConstructorBaseType = 248,
263 Modifier = 249,
264 TypeParameterList = 250,
265 TypeParameter = 251,
266 BaseList2 = 252,
267 TypeParameterConstraintsClause = 253,
268 TypeParameterConstraint = 254,
269 ConstructorConstraint = 255,
270 OperatorDeclaration = 256,
271 ConversionOperatorDeclaration = 257,
272 DeclarationList = 258,
273 Declaration = 259,
274 FieldDeclaration = 260,
275 ConstructorDeclaration = 261,
276 ConstructorDeclarationInitializer = 262,
277 DestructorDeclaration = 263,
278 MethodDeclaration = 264,
279 EventDeclaration = 265,
280 EventFieldDeclaration = 266,
281 AccessorList = 267,
282 AccessorDeclaration = 268,
283 IndexerDeclaration = 269,
284 BracketedParameterList = 270,
285 PropertyDeclaration = 271,
286 ExplicitInterfaceSpecifier = 272,
287 ParameterList = 273,
288 Parameter = 274,
289 ParameterArray = 275,
290 ConstructorInitializer = 276,
291 ArgumentList = 277,
292 TuplePattern = 278,
293 Argument = 279,
294 Block = 280,
295 ArrowExpressionClause = 281,
296 FunctionBody = 282,
297 VariableDeclaration = 283,
298 VariableDeclaration2 = 284,
299 VariableDeclarator = 285,
300 VariableDeclarator2 = 286,
301 BracketedArgumentList = 287,
302 Name = 288,
303 AliasQualifiedName = 289,
304 SimpleName = 290,
305 QualifiedName = 291,
306 GenericName = 292,
307 TypeArgumentList = 293,
308 Type2 = 294,
309 ImplicitType = 295,
310 ArrayType = 296,
311 ArrayBaseType = 297,
312 ArrayRankSpecifier = 298,
313 NullableType = 299,
314 PointerType = 300,
315 PointerBaseType = 301,
316 FunctionPointerType = 302,
317 CallingConvention = 303,
318 FunctionPointerParameter = 304,
319 RefType = 305,
320 RefBaseType = 306,
321 ScopedType = 307,
322 ScopedBaseType = 308,
323 TupleType = 309,
324 TupleElement = 310,
325 Statement = 311,
326 BreakStatement = 312,
327 CheckedStatement = 313,
328 ContinueStatement = 314,
329 DoStatement = 315,
330 EmptyStatement = 316,
331 ExpressionStatement = 317,
332 FixedStatement = 318,
333 ForStatement = 319,
334 ForStatementConditions = 320,
335 ReturnStatement = 321,
336 LockStatement = 322,
337 YieldStatement = 323,
338 SwitchStatement = 324,
339 SwitchBody = 325,
340 SwitchSection = 326,
341 ThrowStatement = 327,
342 TryStatement = 328,
343 CatchClause = 329,
344 CatchDeclaration = 330,
345 CatchFilterClause = 331,
346 FinallyClause = 332,
347 UnsafeStatement = 333,
348 UsingStatement = 334,
349 ForeachStatement = 335,
350 ForeachStatementInitializer = 336,
351 GotoStatement = 337,
352 LabeledStatement = 338,
353 IfStatement = 339,
354 WhileStatement = 340,
355 LocalDeclarationStatement = 341,
356 LocalFunctionStatement = 342,
357 LocalFunctionDeclaration = 343,
358 Pattern = 344,
359 RecursivePattern = 345,
360 ConstantPattern = 346,
361 InvocationExpression = 347,
362 InvocationExpression2 = 348,
363 ParenthesizedPattern = 349,
364 VarPattern = 350,
365 TypePattern = 351,
366 ListPattern = 352,
367 RecursivePattern2 = 353,
368 PositionalPatternClause = 354,
369 PropertyPatternClause = 355,
370 Subpattern = 356,
371 RelationalPattern = 357,
372 NegatedPattern = 358,
373 AndPattern = 359,
374 OrPattern = 360,
375 DeclarationPattern = 361,
376 VariableDesignation = 362,
377 ParenthesizedVariableDesignation = 363,
378 Expression = 364,
379 NonLvalueExpression = 365,
380 LvalueExpression = 366,
381 ExpressionStatementExpression = 367,
382 AssignmentExpression = 368,
383 BinaryExpression = 369,
384 PostfixUnaryExpression = 370,
385 PrefixUnaryExpression = 371,
386 PrefixUnaryExpression2 = 372,
387 QueryExpression = 373,
388 FromClause = 374,
389 QueryBody = 375,
390 QueryClause = 376,
391 JoinClause = 377,
392 JoinHeader = 378,
393 JoinBody = 379,
394 JoinIntoClause = 380,
395 LetClause = 381,
396 OrderByClause = 382,
397 Ordering = 383,
398 WhereClause = 384,
399 SelectOrGroupClause = 385,
400 GroupClause = 386,
401 SelectClause = 387,
402 ConditionalExpression = 388,
403 ConditionalAccessExpression = 389,
404 AsExpression = 390,
405 IsExpression = 391,
406 IsPatternExpression = 392,
407 CastExpression = 393,
408 CheckedExpression = 394,
409 InvocationExpression3 = 395,
410 SwitchExpression = 396,
411 SwitchExpressionBody = 397,
412 SwitchExpressionArm = 398,
413 WhenClause = 399,
414 AwaitExpression = 400,
415 ThrowExpression = 401,
416 ElementAccessExpression = 402,
417 InterpolatedStringExpression = 403,
418 InterpolatedStringContent = 404,
419 InterpolatedVerbatimStringContent = 405,
420 InterpolatedRawStringContent = 406,
421 Interpolation = 407,
422 InterpolationAlignmentClause = 408,
423 InterpolationFormatClause = 409,
424 MemberAccessExpression = 410,
425 MemberBindingExpression = 411,
426 ObjectCreationExpression = 412,
427 ParenthesizedExpression = 413,
428 ParenthesizedExpression2 = 414,
429 LambdaExpression = 415,
430 LambdaExpressionInit = 416,
431 LambdaParameters = 417,
432 ArrayCreationExpression = 418,
433 AnonymousMethodExpression = 419,
434 AnonymousObjectCreationExpression = 420,
435 AnonymousObjectMemberDeclarator = 421,
436 ImplicitArrayCreationExpression = 422,
437 ImplicitObjectCreationExpression = 423,
438 ImplicitStackallocExpression = 424,
439 CollectionExpression = 425,
440 CollectionElement = 426,
441 ExpressionElement = 427,
442 SpreadElement = 428,
443 InitializerExpression = 429,
444 DeclarationExpression = 430,
445 DefaultExpression = 431,
446 WithExpression = 432,
447 WithBody = 433,
448 WithInitializer = 434,
449 SizeofExpression = 435,
450 TypeofExpression = 436,
451 MakerefExpression = 437,
452 RefExpression = 438,
453 ReftypeExpression = 439,
454 RefvalueExpression = 440,
455 StackallocExpression = 441,
456 RangeExpression = 442,
457 TupleExpression = 443,
458 Literal = 444,
459 CharacterLiteral = 445,
460 StringLiteral = 446,
461 RawStringLiteral = 447,
462 BooleanLiteral = 448,
463 Identifier = 449,
464 ReservedIdentifier = 450,
465 PreprocIf = 451,
466 PreprocElse = 452,
467 PreprocElif = 453,
468 PreprocIf2 = 454,
469 PreprocElse2 = 455,
470 PreprocElif2 = 456,
471 PreprocIf3 = 457,
472 PreprocElse3 = 458,
473 PreprocElif3 = 459,
474 PreprocIf4 = 460,
475 PreprocElse4 = 461,
476 PreprocElif4 = 462,
477 PreprocIfInAttributeList = 463,
478 PreprocElse5 = 464,
479 PreprocElif5 = 465,
480 PreprocExpression = 466,
481 ParenthesizedExpression3 = 467,
482 UnaryExpression = 468,
483 BinaryExpression2 = 469,
484 PreprocRegion = 470,
485 PreprocEndregion = 471,
486 PreprocLine = 472,
487 PreprocPragma = 473,
488 PreprocNullable = 474,
489 PreprocError = 475,
490 PreprocWarning = 476,
491 PreprocDefine = 477,
492 PreprocUndef = 478,
493 CompilationUnitRepeat1 = 479,
494 UsingDirectiveRepeat1 = 480,
495 GlobalAttributeRepeat1 = 481,
496 AttributeArgumentListRepeat1 = 482,
497 ClassDeclarationInitializerRepeat1 = 483,
498 ClassDeclarationInitializerRepeat2 = 484,
499 ClassDeclarationInitializerRepeat3 = 485,
500 ClassDeclarationInitializerRepeat4 = 486,
501 EnumMemberDeclarationListRepeat1 = 487,
502 RecordDeclarationInitializerRepeat1 = 488,
503 RecordBaseRepeat1 = 489,
504 TypeParameterListRepeat1 = 490,
505 BaseListRepeat1 = 491,
506 TypeParameterConstraintsClauseRepeat1 = 492,
507 ConversionOperatorDeclarationRepeat1 = 493,
508 DeclarationListRepeat1 = 494,
509 AccessorListRepeat1 = 495,
510 BracketedParameterListRepeat1 = 496,
511 ParameterTypeWithModifiersRepeat1 = 497,
512 ArgumentListRepeat1 = 498,
513 TuplePatternRepeat1 = 499,
514 BlockRepeat1 = 500,
515 VariableDeclarationRepeat1 = 501,
516 UsingVariableDeclarationRepeat1 = 502,
517 TypeArgumentListRepeat1 = 503,
518 TypeArgumentListRepeat2 = 504,
519 ArrayRankSpecifierRepeat1 = 505,
520 FunctionPointerTypeRepeat1 = 506,
521 CallingConventionRepeat1 = 507,
522 TupleTypeRepeat1 = 508,
523 ForStatementConditionsRepeat1 = 509,
524 SwitchBodyRepeat1 = 510,
525 TryStatementRepeat1 = 511,
526 CatchClauseRepeat1 = 512,
527 ListPatternRepeat1 = 513,
528 PositionalPatternClauseRepeat1 = 514,
529 ParenthesizedVariableDesignationRepeat1 = 515,
530 QueryBodyRepeat1 = 516,
531 QueryBodyRepeat2 = 517,
532 OrderByClauseRepeat1 = 518,
533 SwitchExpressionBodyRepeat1 = 519,
534 InterpolatedStringExpressionRepeat1 = 520,
535 InterpolatedStringExpressionRepeat2 = 521,
536 InterpolatedStringExpressionRepeat3 = 522,
537 LambdaExpressionInitRepeat1 = 523,
538 AnonymousObjectCreationExpressionRepeat1 = 524,
539 CollectionExpressionRepeat1 = 525,
540 WithBodyRepeat1 = 526,
541 StringLiteralRepeat1 = 527,
542 PreprocIfInTopLevelRepeat1 = 528,
543 PreprocPragmaRepeat1 = 529,
544 ElementBindingExpression = 530,
545 ImplicitParameter = 531,
546 InterpolationQuote = 532,
547 Error = 533,
548}
549
550impl From<Csharp> for &'static str {
551 #[inline]
552 fn from(tok: Csharp) -> Self {
553 match tok {
554 Csharp::End => "end",
555 Csharp::IdentifierToken => "_identifier_token",
556 Csharp::Extern => "extern",
557 Csharp::Alias => "alias",
558 Csharp::SEMI => ";",
559 Csharp::Global => "global",
560 Csharp::Using => "using",
561 Csharp::Unsafe => "unsafe",
562 Csharp::EQ => "=",
563 Csharp::Static => "static",
564 Csharp::LBRACK => "[",
565 Csharp::Assembly => "assembly",
566 Csharp::Module => "module",
567 Csharp::COLON => ":",
568 Csharp::COMMA => ",",
569 Csharp::RBRACK => "]",
570 Csharp::LPAREN => "(",
571 Csharp::RPAREN => ")",
572 Csharp::Field => "field",
573 Csharp::Event => "event",
574 Csharp::Method => "method",
575 Csharp::Param => "param",
576 Csharp::Property => "property",
577 Csharp::Return => "return",
578 Csharp::Type => "type",
579 Csharp::Typevar => "typevar",
580 Csharp::Namespace => "namespace",
581 Csharp::Class => "class",
582 Csharp::Ref => "ref",
583 Csharp::Struct => "struct",
584 Csharp::Enum => "enum",
585 Csharp::LBRACE => "{",
586 Csharp::RBRACE => "}",
587 Csharp::Interface => "interface",
588 Csharp::Delegate => "delegate",
589 Csharp::Record => "record",
590 Csharp::Abstract => "abstract",
591 Csharp::Async => "async",
592 Csharp::Const => "const",
593 Csharp::File => "file",
594 Csharp::Fixed => "fixed",
595 Csharp::Internal => "internal",
596 Csharp::New => "new",
597 Csharp::Override => "override",
598 Csharp::Partial => "partial",
599 Csharp::Private => "private",
600 Csharp::Protected => "protected",
601 Csharp::Public => "public",
602 Csharp::Readonly => "readonly",
603 Csharp::Required => "required",
604 Csharp::Sealed => "sealed",
605 Csharp::Virtual => "virtual",
606 Csharp::Volatile => "volatile",
607 Csharp::LT => "<",
608 Csharp::GT => ">",
609 Csharp::In => "in",
610 Csharp::Out => "out",
611 Csharp::Where => "where",
612 Csharp::QMARK => "?",
613 Csharp::Notnull => "notnull",
614 Csharp::Unmanaged => "unmanaged",
615 Csharp::Operator => "operator",
616 Csharp::Checked => "checked",
617 Csharp::BANG => "!",
618 Csharp::TILDE => "~",
619 Csharp::PLUSPLUS => "++",
620 Csharp::DASHDASH => "--",
621 Csharp::True => "true",
622 Csharp::False => "false",
623 Csharp::PLUS => "+",
624 Csharp::DASH => "-",
625 Csharp::STAR => "*",
626 Csharp::SLASH => "/",
627 Csharp::PERCENT => "%",
628 Csharp::CARET => "^",
629 Csharp::PIPE => "|",
630 Csharp::AMP => "&",
631 Csharp::LTLT => "<<",
632 Csharp::GTGT => ">>",
633 Csharp::GTGTGT => ">>>",
634 Csharp::EQEQ => "==",
635 Csharp::BANGEQ => "!=",
636 Csharp::GTEQ => ">=",
637 Csharp::LTEQ => "<=",
638 Csharp::Implicit => "implicit",
639 Csharp::Explicit => "explicit",
640 Csharp::Get => "get",
641 Csharp::Set => "set",
642 Csharp::Add => "add",
643 Csharp::Remove => "remove",
644 Csharp::Init => "init",
645 Csharp::This => "this",
646 Csharp::DOT => ".",
647 Csharp::Scoped => "scoped",
648 Csharp::Params => "params",
649 Csharp::Base => "base",
650 Csharp::EQGT => "=>",
651 Csharp::COLONCOLON => "::",
652 Csharp::Var => "var",
653 Csharp::Managed => "managed",
654 Csharp::Cdecl => "Cdecl",
655 Csharp::Stdcall => "Stdcall",
656 Csharp::Thiscall => "Thiscall",
657 Csharp::Fastcall => "Fastcall",
658 Csharp::PredefinedType => "predefined_type",
659 Csharp::Break => "break",
660 Csharp::Unchecked => "unchecked",
661 Csharp::Continue => "continue",
662 Csharp::Do => "do",
663 Csharp::While => "while",
664 Csharp::For => "for",
665 Csharp::Lock => "lock",
666 Csharp::Yield => "yield",
667 Csharp::Switch => "switch",
668 Csharp::Case => "case",
669 Csharp::Default => "default",
670 Csharp::Throw => "throw",
671 Csharp::Try => "try",
672 Csharp::Catch => "catch",
673 Csharp::When => "when",
674 Csharp::Finally => "finally",
675 Csharp::Await => "await",
676 Csharp::Foreach => "foreach",
677 Csharp::Goto => "goto",
678 Csharp::If => "if",
679 Csharp::Else => "else",
680 Csharp::Discard => "discard",
681 Csharp::DOTDOT => "..",
682 Csharp::Not => "not",
683 Csharp::And => "and",
684 Csharp::Or => "or",
685 Csharp::PLUSEQ => "+=",
686 Csharp::DASHEQ => "-=",
687 Csharp::STAREQ => "*=",
688 Csharp::SLASHEQ => "/=",
689 Csharp::PERCENTEQ => "%=",
690 Csharp::AMPEQ => "&=",
691 Csharp::CARETEQ => "^=",
692 Csharp::PIPEEQ => "|=",
693 Csharp::LTLTEQ => "<<=",
694 Csharp::GTGTEQ => ">>=",
695 Csharp::GTGTGTEQ => ">>>=",
696 Csharp::QMARKQMARKEQ => "??=",
697 Csharp::AMPAMP => "&&",
698 Csharp::PIPEPIPE => "||",
699 Csharp::QMARKQMARK => "??",
700 Csharp::From => "from",
701 Csharp::Into => "into",
702 Csharp::Join => "join",
703 Csharp::On => "on",
704 Csharp::Equals => "equals",
705 Csharp::Let => "let",
706 Csharp::Orderby => "orderby",
707 Csharp::Ascending => "ascending",
708 Csharp::Descending => "descending",
709 Csharp::Group => "group",
710 Csharp::By => "by",
711 Csharp::Select => "select",
712 Csharp::As => "as",
713 Csharp::Is => "is",
714 Csharp::InterpolationFormatClauseToken1 => "interpolation_format_clause_token1",
715 Csharp::DASHGT => "->",
716 Csharp::Stackalloc => "stackalloc",
717 Csharp::With => "with",
718 Csharp::Sizeof => "sizeof",
719 Csharp::Typeof => "typeof",
720 Csharp::Makeref => "__makeref",
721 Csharp::Reftype => "__reftype",
722 Csharp::Refvalue => "__refvalue",
723 Csharp::NullLiteral => "null_literal",
724 Csharp::SQUOTE => "'",
725 Csharp::CharacterLiteralContent => "character_literal_content",
726 Csharp::IntegerLiteral => "integer_literal",
727 Csharp::RealLiteral => "real_literal",
728 Csharp::DQUOTE => "\"",
729 Csharp::StringLiteralContent => "string_literal_content",
730 Csharp::EscapeSequence => "escape_sequence",
731 Csharp::StringLiteralEncoding => "string_literal_encoding",
732 Csharp::VerbatimStringLiteral => "verbatim_string_literal",
733 Csharp::RawStringLiteralToken1 => "raw_string_literal_token1",
734 Csharp::HASHif => "#if",
735 Csharp::PreprocIfToken2 => "preproc_if_token2",
736 Csharp::HASHendif => "#endif",
737 Csharp::HASHelse => "#else",
738 Csharp::HASHelif => "#elif",
739 Csharp::PreprocArg => "preproc_arg",
740 Csharp::HASHregion => "#region",
741 Csharp::HASHendregion => "#endregion",
742 Csharp::HASHline => "#line",
743 Csharp::Hidden => "hidden",
744 Csharp::HASHpragma => "#pragma",
745 Csharp::Warning => "warning",
746 Csharp::Disable => "disable",
747 Csharp::Restore => "restore",
748 Csharp::Checksum => "checksum",
749 Csharp::HASHnullable => "#nullable",
750 Csharp::Enable => "enable",
751 Csharp::Annotations => "annotations",
752 Csharp::Warnings => "warnings",
753 Csharp::HASHerror => "#error",
754 Csharp::HASHwarning => "#warning",
755 Csharp::HASHdefine => "#define",
756 Csharp::HASHundef => "#undef",
757 Csharp::ShebangDirective => "shebang_directive",
758 Csharp::Comment => "comment",
759 Csharp::OptionalSemi => "_optional_semi",
760 Csharp::InterpolationStart => "interpolation_start",
761 Csharp::InterpolationStart2 => "interpolation_start",
762 Csharp::InterpolationStart3 => "interpolation_start",
763 Csharp::DQUOTE2 => "\"",
764 Csharp::DQUOTE3 => "\"",
765 Csharp::InterpolationBrace => "interpolation_brace",
766 Csharp::InterpolationBrace2 => "interpolation_brace",
767 Csharp::StringContent => "string_content",
768 Csharp::RawStringStart => "raw_string_start",
769 Csharp::RawStringEnd => "raw_string_end",
770 Csharp::RawStringContent => "raw_string_content",
771 Csharp::CompilationUnit => "compilation_unit",
772 Csharp::TopLevelItem => "_top_level_item",
773 Csharp::GlobalStatement => "global_statement",
774 Csharp::ExternAliasDirective => "extern_alias_directive",
775 Csharp::UsingDirective => "using_directive",
776 Csharp::GlobalAttribute => "global_attribute",
777 Csharp::Attribute => "attribute",
778 Csharp::AttributeArgumentList => "attribute_argument_list",
779 Csharp::AttributeArgument => "attribute_argument",
780 Csharp::AttributeList => "attribute_list",
781 Csharp::AttributeList2 => "_attribute_list",
782 Csharp::AttributeTargetSpecifier => "attribute_target_specifier",
783 Csharp::NamespaceDeclaration => "namespace_declaration",
784 Csharp::FileScopedNamespaceDeclaration => "file_scoped_namespace_declaration",
785 Csharp::TypeDeclaration => "type_declaration",
786 Csharp::ClassDeclaration => "class_declaration",
787 Csharp::ClassDeclarationInitializer => "_class_declaration_initializer",
788 Csharp::StructDeclaration => "struct_declaration",
789 Csharp::StructDeclarationInitializer => "_struct_declaration_initializer",
790 Csharp::EnumDeclaration => "enum_declaration",
791 Csharp::EnumDeclarationInitializer => "_enum_declaration_initializer",
792 Csharp::EnumMemberDeclarationList => "enum_member_declaration_list",
793 Csharp::EnumMemberDeclaration => "enum_member_declaration",
794 Csharp::InterfaceDeclaration => "interface_declaration",
795 Csharp::InterfaceDeclarationInitializer => "_interface_declaration_initializer",
796 Csharp::DelegateDeclaration => "delegate_declaration",
797 Csharp::DelegateDeclarationInitializer => "_delegate_declaration_initializer",
798 Csharp::RecordDeclaration => "record_declaration",
799 Csharp::RecordDeclarationInitializer => "_record_declaration_initializer",
800 Csharp::BaseList => "base_list",
801 Csharp::DeclarationListBody => "_declaration_list_body",
802 Csharp::PrimaryConstructorBaseType => "primary_constructor_base_type",
803 Csharp::Modifier => "modifier",
804 Csharp::TypeParameterList => "type_parameter_list",
805 Csharp::TypeParameter => "type_parameter",
806 Csharp::BaseList2 => "base_list",
807 Csharp::TypeParameterConstraintsClause => "type_parameter_constraints_clause",
808 Csharp::TypeParameterConstraint => "type_parameter_constraint",
809 Csharp::ConstructorConstraint => "constructor_constraint",
810 Csharp::OperatorDeclaration => "operator_declaration",
811 Csharp::ConversionOperatorDeclaration => "conversion_operator_declaration",
812 Csharp::DeclarationList => "declaration_list",
813 Csharp::Declaration => "declaration",
814 Csharp::FieldDeclaration => "field_declaration",
815 Csharp::ConstructorDeclaration => "constructor_declaration",
816 Csharp::ConstructorDeclarationInitializer => "_constructor_declaration_initializer",
817 Csharp::DestructorDeclaration => "destructor_declaration",
818 Csharp::MethodDeclaration => "method_declaration",
819 Csharp::EventDeclaration => "event_declaration",
820 Csharp::EventFieldDeclaration => "event_field_declaration",
821 Csharp::AccessorList => "accessor_list",
822 Csharp::AccessorDeclaration => "accessor_declaration",
823 Csharp::IndexerDeclaration => "indexer_declaration",
824 Csharp::BracketedParameterList => "bracketed_parameter_list",
825 Csharp::PropertyDeclaration => "property_declaration",
826 Csharp::ExplicitInterfaceSpecifier => "explicit_interface_specifier",
827 Csharp::ParameterList => "parameter_list",
828 Csharp::Parameter => "parameter",
829 Csharp::ParameterArray => "_parameter_array",
830 Csharp::ConstructorInitializer => "constructor_initializer",
831 Csharp::ArgumentList => "argument_list",
832 Csharp::TuplePattern => "tuple_pattern",
833 Csharp::Argument => "argument",
834 Csharp::Block => "block",
835 Csharp::ArrowExpressionClause => "arrow_expression_clause",
836 Csharp::FunctionBody => "_function_body",
837 Csharp::VariableDeclaration => "variable_declaration",
838 Csharp::VariableDeclaration2 => "variable_declaration",
839 Csharp::VariableDeclarator => "variable_declarator",
840 Csharp::VariableDeclarator2 => "variable_declarator",
841 Csharp::BracketedArgumentList => "bracketed_argument_list",
842 Csharp::Name => "_name",
843 Csharp::AliasQualifiedName => "alias_qualified_name",
844 Csharp::SimpleName => "_simple_name",
845 Csharp::QualifiedName => "qualified_name",
846 Csharp::GenericName => "generic_name",
847 Csharp::TypeArgumentList => "type_argument_list",
848 Csharp::Type2 => "type",
849 Csharp::ImplicitType => "implicit_type",
850 Csharp::ArrayType => "array_type",
851 Csharp::ArrayBaseType => "_array_base_type",
852 Csharp::ArrayRankSpecifier => "array_rank_specifier",
853 Csharp::NullableType => "nullable_type",
854 Csharp::PointerType => "pointer_type",
855 Csharp::PointerBaseType => "_pointer_base_type",
856 Csharp::FunctionPointerType => "function_pointer_type",
857 Csharp::CallingConvention => "calling_convention",
858 Csharp::FunctionPointerParameter => "function_pointer_parameter",
859 Csharp::RefType => "ref_type",
860 Csharp::RefBaseType => "_ref_base_type",
861 Csharp::ScopedType => "scoped_type",
862 Csharp::ScopedBaseType => "_scoped_base_type",
863 Csharp::TupleType => "tuple_type",
864 Csharp::TupleElement => "tuple_element",
865 Csharp::Statement => "statement",
866 Csharp::BreakStatement => "break_statement",
867 Csharp::CheckedStatement => "checked_statement",
868 Csharp::ContinueStatement => "continue_statement",
869 Csharp::DoStatement => "do_statement",
870 Csharp::EmptyStatement => "empty_statement",
871 Csharp::ExpressionStatement => "expression_statement",
872 Csharp::FixedStatement => "fixed_statement",
873 Csharp::ForStatement => "for_statement",
874 Csharp::ForStatementConditions => "_for_statement_conditions",
875 Csharp::ReturnStatement => "return_statement",
876 Csharp::LockStatement => "lock_statement",
877 Csharp::YieldStatement => "yield_statement",
878 Csharp::SwitchStatement => "switch_statement",
879 Csharp::SwitchBody => "switch_body",
880 Csharp::SwitchSection => "switch_section",
881 Csharp::ThrowStatement => "throw_statement",
882 Csharp::TryStatement => "try_statement",
883 Csharp::CatchClause => "catch_clause",
884 Csharp::CatchDeclaration => "catch_declaration",
885 Csharp::CatchFilterClause => "catch_filter_clause",
886 Csharp::FinallyClause => "finally_clause",
887 Csharp::UnsafeStatement => "unsafe_statement",
888 Csharp::UsingStatement => "using_statement",
889 Csharp::ForeachStatement => "foreach_statement",
890 Csharp::ForeachStatementInitializer => "_foreach_statement_initializer",
891 Csharp::GotoStatement => "goto_statement",
892 Csharp::LabeledStatement => "labeled_statement",
893 Csharp::IfStatement => "if_statement",
894 Csharp::WhileStatement => "while_statement",
895 Csharp::LocalDeclarationStatement => "local_declaration_statement",
896 Csharp::LocalFunctionStatement => "local_function_statement",
897 Csharp::LocalFunctionDeclaration => "_local_function_declaration",
898 Csharp::Pattern => "pattern",
899 Csharp::RecursivePattern => "recursive_pattern",
900 Csharp::ConstantPattern => "constant_pattern",
901 Csharp::InvocationExpression => "invocation_expression",
902 Csharp::InvocationExpression2 => "invocation_expression",
903 Csharp::ParenthesizedPattern => "parenthesized_pattern",
904 Csharp::VarPattern => "var_pattern",
905 Csharp::TypePattern => "type_pattern",
906 Csharp::ListPattern => "list_pattern",
907 Csharp::RecursivePattern2 => "recursive_pattern",
908 Csharp::PositionalPatternClause => "positional_pattern_clause",
909 Csharp::PropertyPatternClause => "property_pattern_clause",
910 Csharp::Subpattern => "subpattern",
911 Csharp::RelationalPattern => "relational_pattern",
912 Csharp::NegatedPattern => "negated_pattern",
913 Csharp::AndPattern => "and_pattern",
914 Csharp::OrPattern => "or_pattern",
915 Csharp::DeclarationPattern => "declaration_pattern",
916 Csharp::VariableDesignation => "_variable_designation",
917 Csharp::ParenthesizedVariableDesignation => "parenthesized_variable_designation",
918 Csharp::Expression => "expression",
919 Csharp::NonLvalueExpression => "non_lvalue_expression",
920 Csharp::LvalueExpression => "lvalue_expression",
921 Csharp::ExpressionStatementExpression => "_expression_statement_expression",
922 Csharp::AssignmentExpression => "assignment_expression",
923 Csharp::BinaryExpression => "binary_expression",
924 Csharp::PostfixUnaryExpression => "postfix_unary_expression",
925 Csharp::PrefixUnaryExpression => "prefix_unary_expression",
926 Csharp::PrefixUnaryExpression2 => "prefix_unary_expression",
927 Csharp::QueryExpression => "query_expression",
928 Csharp::FromClause => "from_clause",
929 Csharp::QueryBody => "_query_body",
930 Csharp::QueryClause => "_query_clause",
931 Csharp::JoinClause => "join_clause",
932 Csharp::JoinHeader => "_join_header",
933 Csharp::JoinBody => "_join_body",
934 Csharp::JoinIntoClause => "join_into_clause",
935 Csharp::LetClause => "let_clause",
936 Csharp::OrderByClause => "order_by_clause",
937 Csharp::Ordering => "_ordering",
938 Csharp::WhereClause => "where_clause",
939 Csharp::SelectOrGroupClause => "_select_or_group_clause",
940 Csharp::GroupClause => "group_clause",
941 Csharp::SelectClause => "select_clause",
942 Csharp::ConditionalExpression => "conditional_expression",
943 Csharp::ConditionalAccessExpression => "conditional_access_expression",
944 Csharp::AsExpression => "as_expression",
945 Csharp::IsExpression => "is_expression",
946 Csharp::IsPatternExpression => "is_pattern_expression",
947 Csharp::CastExpression => "cast_expression",
948 Csharp::CheckedExpression => "checked_expression",
949 Csharp::InvocationExpression3 => "invocation_expression",
950 Csharp::SwitchExpression => "switch_expression",
951 Csharp::SwitchExpressionBody => "_switch_expression_body",
952 Csharp::SwitchExpressionArm => "switch_expression_arm",
953 Csharp::WhenClause => "when_clause",
954 Csharp::AwaitExpression => "await_expression",
955 Csharp::ThrowExpression => "throw_expression",
956 Csharp::ElementAccessExpression => "element_access_expression",
957 Csharp::InterpolatedStringExpression => "interpolated_string_expression",
958 Csharp::InterpolatedStringContent => "_interpolated_string_content",
959 Csharp::InterpolatedVerbatimStringContent => "_interpolated_verbatim_string_content",
960 Csharp::InterpolatedRawStringContent => "_interpolated_raw_string_content",
961 Csharp::Interpolation => "interpolation",
962 Csharp::InterpolationAlignmentClause => "interpolation_alignment_clause",
963 Csharp::InterpolationFormatClause => "interpolation_format_clause",
964 Csharp::MemberAccessExpression => "member_access_expression",
965 Csharp::MemberBindingExpression => "member_binding_expression",
966 Csharp::ObjectCreationExpression => "object_creation_expression",
967 Csharp::ParenthesizedExpression => "parenthesized_expression",
968 Csharp::ParenthesizedExpression2 => "parenthesized_expression",
969 Csharp::LambdaExpression => "lambda_expression",
970 Csharp::LambdaExpressionInit => "_lambda_expression_init",
971 Csharp::LambdaParameters => "_lambda_parameters",
972 Csharp::ArrayCreationExpression => "array_creation_expression",
973 Csharp::AnonymousMethodExpression => "anonymous_method_expression",
974 Csharp::AnonymousObjectCreationExpression => "anonymous_object_creation_expression",
975 Csharp::AnonymousObjectMemberDeclarator => "_anonymous_object_member_declarator",
976 Csharp::ImplicitArrayCreationExpression => "implicit_array_creation_expression",
977 Csharp::ImplicitObjectCreationExpression => "implicit_object_creation_expression",
978 Csharp::ImplicitStackallocExpression => "implicit_stackalloc_expression",
979 Csharp::CollectionExpression => "collection_expression",
980 Csharp::CollectionElement => "collection_element",
981 Csharp::ExpressionElement => "expression_element",
982 Csharp::SpreadElement => "spread_element",
983 Csharp::InitializerExpression => "initializer_expression",
984 Csharp::DeclarationExpression => "declaration_expression",
985 Csharp::DefaultExpression => "default_expression",
986 Csharp::WithExpression => "with_expression",
987 Csharp::WithBody => "_with_body",
988 Csharp::WithInitializer => "with_initializer",
989 Csharp::SizeofExpression => "sizeof_expression",
990 Csharp::TypeofExpression => "typeof_expression",
991 Csharp::MakerefExpression => "makeref_expression",
992 Csharp::RefExpression => "ref_expression",
993 Csharp::ReftypeExpression => "reftype_expression",
994 Csharp::RefvalueExpression => "refvalue_expression",
995 Csharp::StackallocExpression => "stackalloc_expression",
996 Csharp::RangeExpression => "range_expression",
997 Csharp::TupleExpression => "tuple_expression",
998 Csharp::Literal => "literal",
999 Csharp::CharacterLiteral => "character_literal",
1000 Csharp::StringLiteral => "string_literal",
1001 Csharp::RawStringLiteral => "raw_string_literal",
1002 Csharp::BooleanLiteral => "boolean_literal",
1003 Csharp::Identifier => "identifier",
1004 Csharp::ReservedIdentifier => "_reserved_identifier",
1005 Csharp::PreprocIf => "preproc_if",
1006 Csharp::PreprocElse => "preproc_else",
1007 Csharp::PreprocElif => "preproc_elif",
1008 Csharp::PreprocIf2 => "preproc_if",
1009 Csharp::PreprocElse2 => "preproc_else",
1010 Csharp::PreprocElif2 => "preproc_elif",
1011 Csharp::PreprocIf3 => "preproc_if",
1012 Csharp::PreprocElse3 => "preproc_else",
1013 Csharp::PreprocElif3 => "preproc_elif",
1014 Csharp::PreprocIf4 => "preproc_if",
1015 Csharp::PreprocElse4 => "preproc_else",
1016 Csharp::PreprocElif4 => "preproc_elif",
1017 Csharp::PreprocIfInAttributeList => "preproc_if_in_attribute_list",
1018 Csharp::PreprocElse5 => "preproc_else",
1019 Csharp::PreprocElif5 => "preproc_elif",
1020 Csharp::PreprocExpression => "_preproc_expression",
1021 Csharp::ParenthesizedExpression3 => "parenthesized_expression",
1022 Csharp::UnaryExpression => "unary_expression",
1023 Csharp::BinaryExpression2 => "binary_expression",
1024 Csharp::PreprocRegion => "preproc_region",
1025 Csharp::PreprocEndregion => "preproc_endregion",
1026 Csharp::PreprocLine => "preproc_line",
1027 Csharp::PreprocPragma => "preproc_pragma",
1028 Csharp::PreprocNullable => "preproc_nullable",
1029 Csharp::PreprocError => "preproc_error",
1030 Csharp::PreprocWarning => "preproc_warning",
1031 Csharp::PreprocDefine => "preproc_define",
1032 Csharp::PreprocUndef => "preproc_undef",
1033 Csharp::CompilationUnitRepeat1 => "compilation_unit_repeat1",
1034 Csharp::UsingDirectiveRepeat1 => "using_directive_repeat1",
1035 Csharp::GlobalAttributeRepeat1 => "global_attribute_repeat1",
1036 Csharp::AttributeArgumentListRepeat1 => "attribute_argument_list_repeat1",
1037 Csharp::ClassDeclarationInitializerRepeat1 => "_class_declaration_initializer_repeat1",
1038 Csharp::ClassDeclarationInitializerRepeat2 => "_class_declaration_initializer_repeat2",
1039 Csharp::ClassDeclarationInitializerRepeat3 => "_class_declaration_initializer_repeat3",
1040 Csharp::ClassDeclarationInitializerRepeat4 => "_class_declaration_initializer_repeat4",
1041 Csharp::EnumMemberDeclarationListRepeat1 => "enum_member_declaration_list_repeat1",
1042 Csharp::RecordDeclarationInitializerRepeat1 => {
1043 "_record_declaration_initializer_repeat1"
1044 }
1045 Csharp::RecordBaseRepeat1 => "record_base_repeat1",
1046 Csharp::TypeParameterListRepeat1 => "type_parameter_list_repeat1",
1047 Csharp::BaseListRepeat1 => "base_list_repeat1",
1048 Csharp::TypeParameterConstraintsClauseRepeat1 => {
1049 "type_parameter_constraints_clause_repeat1"
1050 }
1051 Csharp::ConversionOperatorDeclarationRepeat1 => {
1052 "conversion_operator_declaration_repeat1"
1053 }
1054 Csharp::DeclarationListRepeat1 => "declaration_list_repeat1",
1055 Csharp::AccessorListRepeat1 => "accessor_list_repeat1",
1056 Csharp::BracketedParameterListRepeat1 => "bracketed_parameter_list_repeat1",
1057 Csharp::ParameterTypeWithModifiersRepeat1 => "_parameter_type_with_modifiers_repeat1",
1058 Csharp::ArgumentListRepeat1 => "argument_list_repeat1",
1059 Csharp::TuplePatternRepeat1 => "tuple_pattern_repeat1",
1060 Csharp::BlockRepeat1 => "block_repeat1",
1061 Csharp::VariableDeclarationRepeat1 => "variable_declaration_repeat1",
1062 Csharp::UsingVariableDeclarationRepeat1 => "using_variable_declaration_repeat1",
1063 Csharp::TypeArgumentListRepeat1 => "type_argument_list_repeat1",
1064 Csharp::TypeArgumentListRepeat2 => "type_argument_list_repeat2",
1065 Csharp::ArrayRankSpecifierRepeat1 => "array_rank_specifier_repeat1",
1066 Csharp::FunctionPointerTypeRepeat1 => "function_pointer_type_repeat1",
1067 Csharp::CallingConventionRepeat1 => "calling_convention_repeat1",
1068 Csharp::TupleTypeRepeat1 => "tuple_type_repeat1",
1069 Csharp::ForStatementConditionsRepeat1 => "_for_statement_conditions_repeat1",
1070 Csharp::SwitchBodyRepeat1 => "switch_body_repeat1",
1071 Csharp::TryStatementRepeat1 => "try_statement_repeat1",
1072 Csharp::CatchClauseRepeat1 => "catch_clause_repeat1",
1073 Csharp::ListPatternRepeat1 => "list_pattern_repeat1",
1074 Csharp::PositionalPatternClauseRepeat1 => "positional_pattern_clause_repeat1",
1075 Csharp::ParenthesizedVariableDesignationRepeat1 => {
1076 "parenthesized_variable_designation_repeat1"
1077 }
1078 Csharp::QueryBodyRepeat1 => "_query_body_repeat1",
1079 Csharp::QueryBodyRepeat2 => "_query_body_repeat2",
1080 Csharp::OrderByClauseRepeat1 => "order_by_clause_repeat1",
1081 Csharp::SwitchExpressionBodyRepeat1 => "_switch_expression_body_repeat1",
1082 Csharp::InterpolatedStringExpressionRepeat1 => "interpolated_string_expression_repeat1",
1083 Csharp::InterpolatedStringExpressionRepeat2 => "interpolated_string_expression_repeat2",
1084 Csharp::InterpolatedStringExpressionRepeat3 => "interpolated_string_expression_repeat3",
1085 Csharp::LambdaExpressionInitRepeat1 => "_lambda_expression_init_repeat1",
1086 Csharp::AnonymousObjectCreationExpressionRepeat1 => {
1087 "anonymous_object_creation_expression_repeat1"
1088 }
1089 Csharp::CollectionExpressionRepeat1 => "collection_expression_repeat1",
1090 Csharp::WithBodyRepeat1 => "_with_body_repeat1",
1091 Csharp::StringLiteralRepeat1 => "string_literal_repeat1",
1092 Csharp::PreprocIfInTopLevelRepeat1 => "preproc_if_in_top_level_repeat1",
1093 Csharp::PreprocPragmaRepeat1 => "preproc_pragma_repeat1",
1094 Csharp::ElementBindingExpression => "element_binding_expression",
1095 Csharp::ImplicitParameter => "implicit_parameter",
1096 Csharp::InterpolationQuote => "interpolation_quote",
1097 Csharp::Error => "ERROR",
1098 }
1099 }
1100}
1101
1102impl From<u16> for Csharp {
1103 #[inline]
1104 fn from(x: u16) -> Self {
1105 num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
1106 }
1107}
1108
1109impl PartialEq<u16> for Csharp {
1111 #[inline]
1112 fn eq(&self, x: &u16) -> bool {
1113 *self == Into::<Self>::into(*x)
1114 }
1115}
1116
1117impl PartialEq<Csharp> for u16 {
1119 #[inline]
1120 fn eq(&self, x: &Csharp) -> bool {
1121 *x == *self
1122 }
1123}