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 Php {
14 End = 0,
15 Name = 1,
16 PhpTag = 2,
17 PhpEndTag = 3,
18 TextToken1 = 4,
19 TextToken2 = 5,
20 SEMI = 6,
21 AMP = 7,
22 Static = 8,
23 COMMA = 9,
24 EQ = 10,
25 Global = 11,
26 Namespace = 12,
27 Use = 13,
28 As = 14,
29 Function = 15,
30 Const = 16,
31 BSLASH = 17,
32 LBRACE = 18,
33 RBRACE = 19,
34 Trait = 20,
35 Interface = 21,
36 Extends = 22,
37 Enum = 23,
38 COLON = 24,
39 String2 = 25,
40 Int = 26,
41 Case = 27,
42 Class = 28,
43 Final = 29,
44 Abstract = 30,
45 Readonly = 31,
46 Implements = 32,
47 EQGT = 33,
48 VarModifier = 34,
49 Insteadof = 35,
50 Public = 36,
51 Protected = 37,
52 Private = 38,
53 LPAREN = 39,
54 RPAREN = 40,
55 LPAREN2 = 41,
56 RPAREN2 = 42,
57 Fn = 43,
58 DOTDOTDOT = 44,
59 QMARK = 45,
60 BottomType = 46,
61 PIPE = 47,
62 Array = 48,
63 Bool = 49,
64 PrimitiveTypeToken1 = 50,
65 PrimitiveTypeToken2 = 51,
66 Float2 = 52,
67 PrimitiveTypeToken3 = 53,
68 PrimitiveTypeToken4 = 54,
69 Null2 = 55,
70 Object = 56,
71 PrimitiveTypeToken5 = 57,
72 PrimitiveTypeToken6 = 58,
73 CastTypeToken1 = 59,
74 CastTypeToken2 = 60,
75 CastTypeToken3 = 61,
76 CastTypeToken4 = 62,
77 CastTypeToken5 = 63,
78 CastTypeToken6 = 64,
79 CastTypeToken7 = 65,
80 CastTypeToken8 = 66,
81 CastTypeToken9 = 67,
82 CastTypeToken10 = 68,
83 CastTypeToken11 = 69,
84 CastTypeToken12 = 70,
85 Echo = 71,
86 Exit = 72,
87 Unset = 73,
88 Declare = 74,
89 Enddeclare = 75,
90 Ticks = 76,
91 Encoding = 77,
92 StrictTypes = 78,
93 Float = 79,
94 Try = 80,
95 Catch = 81,
96 Finally = 82,
97 Goto = 83,
98 Continue = 84,
99 Break = 85,
100 Integer = 86,
101 Return = 87,
102 Throw = 88,
103 While = 89,
104 Endwhile = 90,
105 Do = 91,
106 For = 92,
107 Endfor = 93,
108 Foreach = 94,
109 Endforeach = 95,
110 If = 96,
111 Endif = 97,
112 Elseif = 98,
113 Else = 99,
114 Match = 100,
115 Default = 101,
116 Switch = 102,
117 Endswitch = 103,
118 PLUS = 104,
119 DASH = 105,
120 TILDE = 106,
121 BANG = 107,
122 AT = 108,
123 Clone = 109,
124 COLONCOLON = 110,
125 Print = 111,
126 New = 112,
127 DASHDASH = 113,
128 PLUSPLUS = 114,
129 STARSTAREQ = 115,
130 STAREQ = 116,
131 SLASHEQ = 117,
132 PERCENTEQ = 118,
133 PLUSEQ = 119,
134 DASHEQ = 120,
135 DOTEQ = 121,
136 LTLTEQ = 122,
137 GTGTEQ = 123,
138 AMPEQ = 124,
139 CARETEQ = 125,
140 PIPEEQ = 126,
141 QMARKQMARKEQ = 127,
142 DASHGT = 128,
143 QMARKDASHGT = 129,
144 List = 130,
145 LBRACK = 131,
146 RBRACK = 132,
147 Zelf = 133,
148 Parent = 134,
149 ArgumentNameToken1 = 135,
150 ArgumentNameToken2 = 136,
151 HASHLBRACK = 137,
152 EscapeSequence = 138,
153 StringContent = 139,
154 EncapsedStringToken1 = 140,
155 DQUOTE = 141,
156 StringToken1 = 142,
157 SQUOTE = 143,
158 EscapeSequence2 = 144,
159 StringContentToken1 = 145,
160 LTLTLT = 146,
161 DQUOTE2 = 147,
162 NewLine = 148,
163 SQUOTE2 = 149,
164 BQUOTE = 150,
165 DOLLAR = 151,
166 Yield = 152,
167 Yieldfrom = 153,
168 Instanceof = 154,
169 QMARKQMARK = 155,
170 STARSTAR = 156,
171 And = 157,
172 Or = 158,
173 Xor = 159,
174 PIPEPIPE = 160,
175 AMPAMP = 161,
176 CARET = 162,
177 EQEQ = 163,
178 BANGEQ = 164,
179 LTGT = 165,
180 EQEQEQ = 166,
181 BANGEQEQ = 167,
182 LT = 168,
183 GT = 169,
184 LTEQ = 170,
185 GTEQ = 171,
186 LTEQGT = 172,
187 PIPEGT = 173,
188 DOT = 174,
189 LTLT = 175,
190 GTGT = 176,
191 STAR = 177,
192 SLASH = 178,
193 PERCENT = 179,
194 Include = 180,
195 IncludeOnce = 181,
196 Require = 182,
197 RequireOnce = 183,
198 Comment = 184,
199 AutomaticSemicolon = 185,
200 StringContent2 = 186,
201 StringContent3 = 187,
202 StringContent4 = 188,
203 StringContent5 = 189,
204 StringContent6 = 190,
205 StringContent7 = 191,
206 Eof = 192,
207 HeredocStart = 193,
208 HeredocEnd = 194,
209 NowdocString = 195,
210 SentinelError = 196,
211 Program = 197,
212 TextInterpolation = 198,
213 Text = 199,
214 Statement = 200,
215 EmptyStatement = 201,
216 ReferenceModifier = 202,
217 FunctionStaticDeclaration = 203,
218 StaticVariableDeclaration = 204,
219 GlobalDeclaration = 205,
220 NamespaceDefinition = 206,
221 NamespaceUseDeclaration = 207,
222 NamespaceUseClause = 208,
223 QualifiedName = 209,
224 RelativeName = 210,
225 Name2 = 211,
226 NamespaceName = 212,
227 NamespaceUseGroup2 = 213,
228 NamespaceUseGroup = 214,
229 TraitDeclaration = 215,
230 InterfaceDeclaration = 216,
231 BaseClause = 217,
232 EnumDeclaration = 218,
233 EnumDeclarationList = 219,
234 EnumMemberDeclaration = 220,
235 EnumCase = 221,
236 ClassDeclaration = 222,
237 DeclarationList = 223,
238 FinalModifier = 224,
239 AbstractModifier = 225,
240 ReadonlyModifier = 226,
241 ClassInterfaceClause = 227,
242 MemberDeclaration = 228,
243 ConstDeclaration = 229,
244 ConstDeclaration2 = 230,
245 PropertyDeclaration = 231,
246 Modifier = 232,
247 PropertyElement = 233,
248 PropertyHookList = 234,
249 PropertyHook = 235,
250 PropertyHookBody = 236,
251 MethodDeclaration = 237,
252 StaticModifier = 238,
253 UseDeclaration = 239,
254 UseList = 240,
255 UseInsteadOfClause = 241,
256 UseAsClause = 242,
257 VisibilityModifier = 243,
258 FunctionDefinition = 244,
259 AnonymousFunction = 245,
260 AnonymousFunctionUseClause = 246,
261 AnonymousFunctionHeader = 247,
262 ArrowFunctionHeader = 248,
263 ArrowFunction = 249,
264 FormalParameters = 250,
265 PropertyPromotionParameter = 251,
266 SimpleParameter = 252,
267 VariadicParameter = 253,
268 Type = 254,
269 Types = 255,
270 NamedType = 256,
271 OptionalType = 257,
272 UnionType = 258,
273 IntersectionType = 259,
274 DisjunctiveNormalFormType = 260,
275 PrimitiveType = 261,
276 CastType = 262,
277 ReturnType = 263,
278 ConstElement = 264,
279 ConstElement2 = 265,
280 EchoStatement = 266,
281 ExitStatement = 267,
282 UnsetStatement = 268,
283 DeclareStatement = 269,
284 DeclareDirective = 270,
285 Literal = 271,
286 TryStatement = 272,
287 CatchClause = 273,
288 TypeList = 274,
289 FinallyClause = 275,
290 GotoStatement = 276,
291 ContinueStatement = 277,
292 BreakStatement = 278,
293 ReturnStatement = 279,
294 ThrowExpression = 280,
295 WhileStatement = 281,
296 DoStatement = 282,
297 ForStatement = 283,
298 Expressions = 284,
299 SequenceExpression = 285,
300 ForeachStatement = 286,
301 Pair = 287,
302 ForeachValue = 288,
303 IfStatement = 289,
304 ColonBlock = 290,
305 ElseIfClause = 291,
306 ElseClause = 292,
307 ElseIfClause2 = 293,
308 ElseClause2 = 294,
309 MatchExpression = 295,
310 MatchBlock = 296,
311 MatchConditionList = 297,
312 MatchConditionalExpression = 298,
313 MatchDefaultExpression = 299,
314 SwitchStatement = 300,
315 SwitchBlock = 301,
316 CaseStatement = 302,
317 DefaultStatement = 303,
318 CompoundStatement = 304,
319 NamedLabelStatement = 305,
320 ExpressionStatement = 306,
321 Expression = 307,
322 UnaryExpression = 308,
323 UnaryOpExpression = 309,
324 ErrorSuppressionExpression = 310,
325 CloneExpression = 311,
326 PrimaryExpression = 312,
327 ParenthesizedExpression = 313,
328 ClassConstantAccessExpression = 314,
329 PrintIntrinsic = 315,
330 ObjectCreationExpression = 316,
331 NewNonDereferencableExpression = 317,
332 NewDereferencableExpression = 318,
333 ClassNameReference = 319,
334 AnonymousClass = 320,
335 UpdateExpression = 321,
336 CastExpression = 322,
337 CastExpression2 = 323,
338 AssignmentExpression = 324,
339 ReferenceAssignmentExpression = 325,
340 ConditionalExpression = 326,
341 AugmentedAssignmentExpression = 327,
342 MemberAccessExpression = 328,
343 MemberAccessExpression2 = 329,
344 NullsafeMemberAccessExpression = 330,
345 NullsafeMemberAccessExpression2 = 331,
346 ScopedPropertyAccessExpression = 332,
347 ScopedPropertyAccessExpression2 = 333,
348 ListLiteral = 334,
349 ListDestructing = 335,
350 ArrayDestructing = 336,
351 ArrayDestructingElement = 337,
352 FunctionCallExpression = 338,
353 CallableExpression = 339,
354 ScopedCallExpression = 340,
355 ScopeResolutionQualifier = 341,
356 RelativeScope = 342,
357 VariadicPlaceholder = 343,
358 Arguments = 344,
359 Argument = 345,
360 ArgumentName = 346,
361 MemberCallExpression = 347,
362 NullsafeMemberCallExpression = 348,
363 VariadicUnpacking = 349,
364 MemberName = 350,
365 SubscriptExpression = 351,
366 SubscriptExpression2 = 352,
367 DereferencableExpression = 353,
368 DereferencableScalar = 354,
369 ArrayCreationExpression = 355,
370 AttributeGroup = 356,
371 AttributeList = 357,
372 Attribute = 358,
373 ComplexStringPart = 359,
374 MemberAccessExpression3 = 360,
375 UnaryOpExpression2 = 361,
376 SimpleStringArrayAccessArgument = 362,
377 SubscriptExpression3 = 363,
378 SimpleStringPart = 364,
379 InterpolatedStringBody = 365,
380 InterpolatedStringBodyHeredoc = 366,
381 EncapsedString = 367,
382 String = 368,
383 StringContent8 = 369,
384 HeredocBody = 370,
385 Heredoc = 371,
386 NowdocBody = 372,
387 Nowdoc = 373,
388 InterpolatedExecutionOperatorBody = 374,
389 ShellCommandExpression = 375,
390 Boolean = 376,
391 Null = 377,
392 String3 = 378,
393 DynamicVariableName = 379,
394 SimpleVariable = 380,
395 NewVariable = 381,
396 CallableVariable = 382,
397 VariableName = 383,
398 ByRef = 384,
399 YieldExpression = 385,
400 ArrayElementInitializer = 386,
401 BinaryExpression = 387,
402 IncludeExpression = 388,
403 IncludeOnceExpression = 389,
404 RequireExpression = 390,
405 RequireOnceExpression = 391,
406 Semicolon = 392,
407 ProgramRepeat1 = 393,
408 TextRepeat1 = 394,
409 FunctionStaticDeclarationRepeat1 = 395,
410 GlobalDeclarationRepeat1 = 396,
411 NamespaceUseDeclarationRepeat1 = 397,
412 NamespaceNameRepeat1 = 398,
413 BaseClauseRepeat1 = 399,
414 EnumDeclarationListRepeat1 = 400,
415 ClassDeclarationRepeat1 = 401,
416 DeclarationListRepeat1 = 402,
417 ConstDeclarationRepeat1 = 403,
418 ClassConstDeclarationRepeat1 = 404,
419 PropertyDeclarationRepeat1 = 405,
420 PropertyHookListRepeat1 = 406,
421 UseListRepeat1 = 407,
422 AnonymousFunctionUseClauseRepeat1 = 408,
423 FormalParametersRepeat1 = 409,
424 UnionTypeRepeat1 = 410,
425 IntersectionTypeRepeat1 = 411,
426 DisjunctiveNormalFormTypeRepeat1 = 412,
427 UnsetStatementRepeat1 = 413,
428 TryStatementRepeat1 = 414,
429 TypeListRepeat1 = 415,
430 IfStatementRepeat1 = 416,
431 IfStatementRepeat2 = 417,
432 MatchBlockRepeat1 = 418,
433 MatchConditionListRepeat1 = 419,
434 SwitchBlockRepeat1 = 420,
435 ListDestructingRepeat1 = 421,
436 ArrayDestructingRepeat1 = 422,
437 ArgumentsRepeat1 = 423,
438 ArrayCreationExpressionRepeat1 = 424,
439 AttributeGroupRepeat1 = 425,
440 AttributeListRepeat1 = 426,
441 StringRepeat1 = 427,
442 StringContentRepeat1 = 428,
443 HeredocBodyRepeat1 = 429,
444 NowdocBodyRepeat1 = 430,
445 Operation = 431,
446 Error = 432,
447}
448
449impl From<Php> for &'static str {
450 #[inline]
451 fn from(tok: Php) -> Self {
452 match tok {
453 Php::End => "end",
454 Php::Name => "name",
455 Php::PhpTag => "php_tag",
456 Php::PhpEndTag => "php_end_tag",
457 Php::TextToken1 => "text_token1",
458 Php::TextToken2 => "text_token2",
459 Php::SEMI => ";",
460 Php::AMP => "&",
461 Php::Static => "static",
462 Php::COMMA => ",",
463 Php::EQ => "=",
464 Php::Global => "global",
465 Php::Namespace => "namespace",
466 Php::Use => "use",
467 Php::As => "as",
468 Php::Function => "function",
469 Php::Const => "const",
470 Php::BSLASH => "\\",
471 Php::LBRACE => "{",
472 Php::RBRACE => "}",
473 Php::Trait => "trait",
474 Php::Interface => "interface",
475 Php::Extends => "extends",
476 Php::Enum => "enum",
477 Php::COLON => ":",
478 Php::String2 => "string",
479 Php::Int => "int",
480 Php::Case => "case",
481 Php::Class => "class",
482 Php::Final => "final",
483 Php::Abstract => "abstract",
484 Php::Readonly => "readonly",
485 Php::Implements => "implements",
486 Php::EQGT => "=>",
487 Php::VarModifier => "var_modifier",
488 Php::Insteadof => "insteadof",
489 Php::Public => "public",
490 Php::Protected => "protected",
491 Php::Private => "private",
492 Php::LPAREN => "(",
493 Php::RPAREN => ")",
494 Php::LPAREN2 => "(",
495 Php::RPAREN2 => ")",
496 Php::Fn => "fn",
497 Php::DOTDOTDOT => "...",
498 Php::QMARK => "?",
499 Php::BottomType => "bottom_type",
500 Php::PIPE => "|",
501 Php::Array => "array",
502 Php::Bool => "bool",
503 Php::PrimitiveTypeToken1 => "primitive_type_token1",
504 Php::PrimitiveTypeToken2 => "primitive_type_token2",
505 Php::Float2 => "float",
506 Php::PrimitiveTypeToken3 => "primitive_type_token3",
507 Php::PrimitiveTypeToken4 => "primitive_type_token4",
508 Php::Null2 => "null",
509 Php::Object => "object",
510 Php::PrimitiveTypeToken5 => "primitive_type_token5",
511 Php::PrimitiveTypeToken6 => "primitive_type_token6",
512 Php::CastTypeToken1 => "cast_type_token1",
513 Php::CastTypeToken2 => "cast_type_token2",
514 Php::CastTypeToken3 => "cast_type_token3",
515 Php::CastTypeToken4 => "cast_type_token4",
516 Php::CastTypeToken5 => "cast_type_token5",
517 Php::CastTypeToken6 => "cast_type_token6",
518 Php::CastTypeToken7 => "cast_type_token7",
519 Php::CastTypeToken8 => "cast_type_token8",
520 Php::CastTypeToken9 => "cast_type_token9",
521 Php::CastTypeToken10 => "cast_type_token10",
522 Php::CastTypeToken11 => "cast_type_token11",
523 Php::CastTypeToken12 => "cast_type_token12",
524 Php::Echo => "echo",
525 Php::Exit => "exit",
526 Php::Unset => "unset",
527 Php::Declare => "declare",
528 Php::Enddeclare => "enddeclare",
529 Php::Ticks => "ticks",
530 Php::Encoding => "encoding",
531 Php::StrictTypes => "strict_types",
532 Php::Float => "float",
533 Php::Try => "try",
534 Php::Catch => "catch",
535 Php::Finally => "finally",
536 Php::Goto => "goto",
537 Php::Continue => "continue",
538 Php::Break => "break",
539 Php::Integer => "integer",
540 Php::Return => "return",
541 Php::Throw => "throw",
542 Php::While => "while",
543 Php::Endwhile => "endwhile",
544 Php::Do => "do",
545 Php::For => "for",
546 Php::Endfor => "endfor",
547 Php::Foreach => "foreach",
548 Php::Endforeach => "endforeach",
549 Php::If => "if",
550 Php::Endif => "endif",
551 Php::Elseif => "elseif",
552 Php::Else => "else",
553 Php::Match => "match",
554 Php::Default => "default",
555 Php::Switch => "switch",
556 Php::Endswitch => "endswitch",
557 Php::PLUS => "+",
558 Php::DASH => "-",
559 Php::TILDE => "~",
560 Php::BANG => "!",
561 Php::AT => "@",
562 Php::Clone => "clone",
563 Php::COLONCOLON => "::",
564 Php::Print => "print",
565 Php::New => "new",
566 Php::DASHDASH => "--",
567 Php::PLUSPLUS => "++",
568 Php::STARSTAREQ => "**=",
569 Php::STAREQ => "*=",
570 Php::SLASHEQ => "/=",
571 Php::PERCENTEQ => "%=",
572 Php::PLUSEQ => "+=",
573 Php::DASHEQ => "-=",
574 Php::DOTEQ => ".=",
575 Php::LTLTEQ => "<<=",
576 Php::GTGTEQ => ">>=",
577 Php::AMPEQ => "&=",
578 Php::CARETEQ => "^=",
579 Php::PIPEEQ => "|=",
580 Php::QMARKQMARKEQ => "??=",
581 Php::DASHGT => "->",
582 Php::QMARKDASHGT => "?->",
583 Php::List => "list",
584 Php::LBRACK => "[",
585 Php::RBRACK => "]",
586 Php::Zelf => "self",
587 Php::Parent => "parent",
588 Php::ArgumentNameToken1 => "_argument_name_token1",
589 Php::ArgumentNameToken2 => "_argument_name_token2",
590 Php::HASHLBRACK => "#[",
591 Php::EscapeSequence => "escape_sequence",
592 Php::StringContent => "string_content",
593 Php::EncapsedStringToken1 => "encapsed_string_token1",
594 Php::DQUOTE => "\"",
595 Php::StringToken1 => "string_token1",
596 Php::SQUOTE => "'",
597 Php::EscapeSequence2 => "escape_sequence",
598 Php::StringContentToken1 => "string_content_token1",
599 Php::LTLTLT => "<<<",
600 Php::DQUOTE2 => "\"",
601 Php::NewLine => "_new_line",
602 Php::SQUOTE2 => "'",
603 Php::BQUOTE => "`",
604 Php::DOLLAR => "$",
605 Php::Yield => "yield",
606 Php::Yieldfrom => "yield from",
607 Php::Instanceof => "instanceof",
608 Php::QMARKQMARK => "??",
609 Php::STARSTAR => "**",
610 Php::And => "and",
611 Php::Or => "or",
612 Php::Xor => "xor",
613 Php::PIPEPIPE => "||",
614 Php::AMPAMP => "&&",
615 Php::CARET => "^",
616 Php::EQEQ => "==",
617 Php::BANGEQ => "!=",
618 Php::LTGT => "<>",
619 Php::EQEQEQ => "===",
620 Php::BANGEQEQ => "!==",
621 Php::LT => "<",
622 Php::GT => ">",
623 Php::LTEQ => "<=",
624 Php::GTEQ => ">=",
625 Php::LTEQGT => "<=>",
626 Php::PIPEGT => "|>",
627 Php::DOT => ".",
628 Php::LTLT => "<<",
629 Php::GTGT => ">>",
630 Php::STAR => "*",
631 Php::SLASH => "/",
632 Php::PERCENT => "%",
633 Php::Include => "include",
634 Php::IncludeOnce => "include_once",
635 Php::Require => "require",
636 Php::RequireOnce => "require_once",
637 Php::Comment => "comment",
638 Php::AutomaticSemicolon => "_automatic_semicolon",
639 Php::StringContent2 => "string_content",
640 Php::StringContent3 => "string_content",
641 Php::StringContent4 => "string_content",
642 Php::StringContent5 => "string_content",
643 Php::StringContent6 => "string_content",
644 Php::StringContent7 => "string_content",
645 Php::Eof => "_eof",
646 Php::HeredocStart => "heredoc_start",
647 Php::HeredocEnd => "heredoc_end",
648 Php::NowdocString => "nowdoc_string",
649 Php::SentinelError => "sentinel_error",
650 Php::Program => "program",
651 Php::TextInterpolation => "text_interpolation",
652 Php::Text => "text",
653 Php::Statement => "statement",
654 Php::EmptyStatement => "empty_statement",
655 Php::ReferenceModifier => "reference_modifier",
656 Php::FunctionStaticDeclaration => "function_static_declaration",
657 Php::StaticVariableDeclaration => "static_variable_declaration",
658 Php::GlobalDeclaration => "global_declaration",
659 Php::NamespaceDefinition => "namespace_definition",
660 Php::NamespaceUseDeclaration => "namespace_use_declaration",
661 Php::NamespaceUseClause => "namespace_use_clause",
662 Php::QualifiedName => "qualified_name",
663 Php::RelativeName => "relative_name",
664 Php::Name2 => "_name",
665 Php::NamespaceName => "namespace_name",
666 Php::NamespaceUseGroup2 => "_namespace_use_group",
667 Php::NamespaceUseGroup => "namespace_use_group",
668 Php::TraitDeclaration => "trait_declaration",
669 Php::InterfaceDeclaration => "interface_declaration",
670 Php::BaseClause => "base_clause",
671 Php::EnumDeclaration => "enum_declaration",
672 Php::EnumDeclarationList => "enum_declaration_list",
673 Php::EnumMemberDeclaration => "_enum_member_declaration",
674 Php::EnumCase => "enum_case",
675 Php::ClassDeclaration => "class_declaration",
676 Php::DeclarationList => "declaration_list",
677 Php::FinalModifier => "final_modifier",
678 Php::AbstractModifier => "abstract_modifier",
679 Php::ReadonlyModifier => "readonly_modifier",
680 Php::ClassInterfaceClause => "class_interface_clause",
681 Php::MemberDeclaration => "_member_declaration",
682 Php::ConstDeclaration => "const_declaration",
683 Php::ConstDeclaration2 => "const_declaration",
684 Php::PropertyDeclaration => "property_declaration",
685 Php::Modifier => "_modifier",
686 Php::PropertyElement => "property_element",
687 Php::PropertyHookList => "property_hook_list",
688 Php::PropertyHook => "property_hook",
689 Php::PropertyHookBody => "_property_hook_body",
690 Php::MethodDeclaration => "method_declaration",
691 Php::StaticModifier => "static_modifier",
692 Php::UseDeclaration => "use_declaration",
693 Php::UseList => "use_list",
694 Php::UseInsteadOfClause => "use_instead_of_clause",
695 Php::UseAsClause => "use_as_clause",
696 Php::VisibilityModifier => "visibility_modifier",
697 Php::FunctionDefinition => "function_definition",
698 Php::AnonymousFunction => "anonymous_function",
699 Php::AnonymousFunctionUseClause => "anonymous_function_use_clause",
700 Php::AnonymousFunctionHeader => "_anonymous_function_header",
701 Php::ArrowFunctionHeader => "_arrow_function_header",
702 Php::ArrowFunction => "arrow_function",
703 Php::FormalParameters => "formal_parameters",
704 Php::PropertyPromotionParameter => "property_promotion_parameter",
705 Php::SimpleParameter => "simple_parameter",
706 Php::VariadicParameter => "variadic_parameter",
707 Php::Type => "type",
708 Php::Types => "_types",
709 Php::NamedType => "named_type",
710 Php::OptionalType => "optional_type",
711 Php::UnionType => "union_type",
712 Php::IntersectionType => "intersection_type",
713 Php::DisjunctiveNormalFormType => "disjunctive_normal_form_type",
714 Php::PrimitiveType => "primitive_type",
715 Php::CastType => "cast_type",
716 Php::ReturnType => "_return_type",
717 Php::ConstElement => "const_element",
718 Php::ConstElement2 => "const_element",
719 Php::EchoStatement => "echo_statement",
720 Php::ExitStatement => "exit_statement",
721 Php::UnsetStatement => "unset_statement",
722 Php::DeclareStatement => "declare_statement",
723 Php::DeclareDirective => "declare_directive",
724 Php::Literal => "literal",
725 Php::TryStatement => "try_statement",
726 Php::CatchClause => "catch_clause",
727 Php::TypeList => "type_list",
728 Php::FinallyClause => "finally_clause",
729 Php::GotoStatement => "goto_statement",
730 Php::ContinueStatement => "continue_statement",
731 Php::BreakStatement => "break_statement",
732 Php::ReturnStatement => "return_statement",
733 Php::ThrowExpression => "throw_expression",
734 Php::WhileStatement => "while_statement",
735 Php::DoStatement => "do_statement",
736 Php::ForStatement => "for_statement",
737 Php::Expressions => "_expressions",
738 Php::SequenceExpression => "sequence_expression",
739 Php::ForeachStatement => "foreach_statement",
740 Php::Pair => "pair",
741 Php::ForeachValue => "_foreach_value",
742 Php::IfStatement => "if_statement",
743 Php::ColonBlock => "colon_block",
744 Php::ElseIfClause => "else_if_clause",
745 Php::ElseClause => "else_clause",
746 Php::ElseIfClause2 => "else_if_clause",
747 Php::ElseClause2 => "else_clause",
748 Php::MatchExpression => "match_expression",
749 Php::MatchBlock => "match_block",
750 Php::MatchConditionList => "match_condition_list",
751 Php::MatchConditionalExpression => "match_conditional_expression",
752 Php::MatchDefaultExpression => "match_default_expression",
753 Php::SwitchStatement => "switch_statement",
754 Php::SwitchBlock => "switch_block",
755 Php::CaseStatement => "case_statement",
756 Php::DefaultStatement => "default_statement",
757 Php::CompoundStatement => "compound_statement",
758 Php::NamedLabelStatement => "named_label_statement",
759 Php::ExpressionStatement => "expression_statement",
760 Php::Expression => "expression",
761 Php::UnaryExpression => "_unary_expression",
762 Php::UnaryOpExpression => "unary_op_expression",
763 Php::ErrorSuppressionExpression => "error_suppression_expression",
764 Php::CloneExpression => "clone_expression",
765 Php::PrimaryExpression => "primary_expression",
766 Php::ParenthesizedExpression => "parenthesized_expression",
767 Php::ClassConstantAccessExpression => "class_constant_access_expression",
768 Php::PrintIntrinsic => "print_intrinsic",
769 Php::ObjectCreationExpression => "object_creation_expression",
770 Php::NewNonDereferencableExpression => "_new_non_dereferencable_expression",
771 Php::NewDereferencableExpression => "_new_dereferencable_expression",
772 Php::ClassNameReference => "_class_name_reference",
773 Php::AnonymousClass => "anonymous_class",
774 Php::UpdateExpression => "update_expression",
775 Php::CastExpression => "cast_expression",
776 Php::CastExpression2 => "cast_expression",
777 Php::AssignmentExpression => "assignment_expression",
778 Php::ReferenceAssignmentExpression => "reference_assignment_expression",
779 Php::ConditionalExpression => "conditional_expression",
780 Php::AugmentedAssignmentExpression => "augmented_assignment_expression",
781 Php::MemberAccessExpression => "member_access_expression",
782 Php::MemberAccessExpression2 => "member_access_expression",
783 Php::NullsafeMemberAccessExpression => "nullsafe_member_access_expression",
784 Php::NullsafeMemberAccessExpression2 => "nullsafe_member_access_expression",
785 Php::ScopedPropertyAccessExpression => "scoped_property_access_expression",
786 Php::ScopedPropertyAccessExpression2 => "scoped_property_access_expression",
787 Php::ListLiteral => "list_literal",
788 Php::ListDestructing => "_list_destructing",
789 Php::ArrayDestructing => "_array_destructing",
790 Php::ArrayDestructingElement => "_array_destructing_element",
791 Php::FunctionCallExpression => "function_call_expression",
792 Php::CallableExpression => "_callable_expression",
793 Php::ScopedCallExpression => "scoped_call_expression",
794 Php::ScopeResolutionQualifier => "_scope_resolution_qualifier",
795 Php::RelativeScope => "relative_scope",
796 Php::VariadicPlaceholder => "variadic_placeholder",
797 Php::Arguments => "arguments",
798 Php::Argument => "argument",
799 Php::ArgumentName => "_argument_name",
800 Php::MemberCallExpression => "member_call_expression",
801 Php::NullsafeMemberCallExpression => "nullsafe_member_call_expression",
802 Php::VariadicUnpacking => "variadic_unpacking",
803 Php::MemberName => "_member_name",
804 Php::SubscriptExpression => "subscript_expression",
805 Php::SubscriptExpression2 => "subscript_expression",
806 Php::DereferencableExpression => "_dereferencable_expression",
807 Php::DereferencableScalar => "_dereferencable_scalar",
808 Php::ArrayCreationExpression => "array_creation_expression",
809 Php::AttributeGroup => "attribute_group",
810 Php::AttributeList => "attribute_list",
811 Php::Attribute => "attribute",
812 Php::ComplexStringPart => "_complex_string_part",
813 Php::MemberAccessExpression3 => "member_access_expression",
814 Php::UnaryOpExpression2 => "unary_op_expression",
815 Php::SimpleStringArrayAccessArgument => "_simple_string_array_access_argument",
816 Php::SubscriptExpression3 => "subscript_expression",
817 Php::SimpleStringPart => "_simple_string_part",
818 Php::InterpolatedStringBody => "_interpolated_string_body",
819 Php::InterpolatedStringBodyHeredoc => "_interpolated_string_body_heredoc",
820 Php::EncapsedString => "encapsed_string",
821 Php::String => "string",
822 Php::StringContent8 => "string_content",
823 Php::HeredocBody => "heredoc_body",
824 Php::Heredoc => "heredoc",
825 Php::NowdocBody => "nowdoc_body",
826 Php::Nowdoc => "nowdoc",
827 Php::InterpolatedExecutionOperatorBody => "_interpolated_execution_operator_body",
828 Php::ShellCommandExpression => "shell_command_expression",
829 Php::Boolean => "boolean",
830 Php::Null => "null",
831 Php::String3 => "_string",
832 Php::DynamicVariableName => "dynamic_variable_name",
833 Php::SimpleVariable => "_simple_variable",
834 Php::NewVariable => "_new_variable",
835 Php::CallableVariable => "_callable_variable",
836 Php::VariableName => "variable_name",
837 Php::ByRef => "by_ref",
838 Php::YieldExpression => "yield_expression",
839 Php::ArrayElementInitializer => "array_element_initializer",
840 Php::BinaryExpression => "binary_expression",
841 Php::IncludeExpression => "include_expression",
842 Php::IncludeOnceExpression => "include_once_expression",
843 Php::RequireExpression => "require_expression",
844 Php::RequireOnceExpression => "require_once_expression",
845 Php::Semicolon => "_semicolon",
846 Php::ProgramRepeat1 => "program_repeat1",
847 Php::TextRepeat1 => "text_repeat1",
848 Php::FunctionStaticDeclarationRepeat1 => "function_static_declaration_repeat1",
849 Php::GlobalDeclarationRepeat1 => "global_declaration_repeat1",
850 Php::NamespaceUseDeclarationRepeat1 => "namespace_use_declaration_repeat1",
851 Php::NamespaceNameRepeat1 => "namespace_name_repeat1",
852 Php::BaseClauseRepeat1 => "base_clause_repeat1",
853 Php::EnumDeclarationListRepeat1 => "enum_declaration_list_repeat1",
854 Php::ClassDeclarationRepeat1 => "class_declaration_repeat1",
855 Php::DeclarationListRepeat1 => "declaration_list_repeat1",
856 Php::ConstDeclarationRepeat1 => "const_declaration_repeat1",
857 Php::ClassConstDeclarationRepeat1 => "_class_const_declaration_repeat1",
858 Php::PropertyDeclarationRepeat1 => "property_declaration_repeat1",
859 Php::PropertyHookListRepeat1 => "property_hook_list_repeat1",
860 Php::UseListRepeat1 => "use_list_repeat1",
861 Php::AnonymousFunctionUseClauseRepeat1 => "anonymous_function_use_clause_repeat1",
862 Php::FormalParametersRepeat1 => "formal_parameters_repeat1",
863 Php::UnionTypeRepeat1 => "union_type_repeat1",
864 Php::IntersectionTypeRepeat1 => "intersection_type_repeat1",
865 Php::DisjunctiveNormalFormTypeRepeat1 => "disjunctive_normal_form_type_repeat1",
866 Php::UnsetStatementRepeat1 => "unset_statement_repeat1",
867 Php::TryStatementRepeat1 => "try_statement_repeat1",
868 Php::TypeListRepeat1 => "type_list_repeat1",
869 Php::IfStatementRepeat1 => "if_statement_repeat1",
870 Php::IfStatementRepeat2 => "if_statement_repeat2",
871 Php::MatchBlockRepeat1 => "match_block_repeat1",
872 Php::MatchConditionListRepeat1 => "match_condition_list_repeat1",
873 Php::SwitchBlockRepeat1 => "switch_block_repeat1",
874 Php::ListDestructingRepeat1 => "_list_destructing_repeat1",
875 Php::ArrayDestructingRepeat1 => "_array_destructing_repeat1",
876 Php::ArgumentsRepeat1 => "arguments_repeat1",
877 Php::ArrayCreationExpressionRepeat1 => "array_creation_expression_repeat1",
878 Php::AttributeGroupRepeat1 => "attribute_group_repeat1",
879 Php::AttributeListRepeat1 => "attribute_list_repeat1",
880 Php::StringRepeat1 => "string_repeat1",
881 Php::StringContentRepeat1 => "string_content_repeat1",
882 Php::HeredocBodyRepeat1 => "heredoc_body_repeat1",
883 Php::NowdocBodyRepeat1 => "nowdoc_body_repeat1",
884 Php::Operation => "operation",
885 Php::Error => "ERROR",
886 }
887 }
888}
889
890impl From<u16> for Php {
891 #[inline]
892 fn from(x: u16) -> Self {
893 num_traits::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
894 }
895}
896
897impl PartialEq<u16> for Php {
899 #[inline]
900 fn eq(&self, x: &u16) -> bool {
901 *self == Into::<Self>::into(*x)
902 }
903}
904
905impl PartialEq<Php> for u16 {
907 #[inline]
908 fn eq(&self, x: &Php) -> bool {
909 *x == *self
910 }
911}