use num_derive::FromPrimitive;
#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Cpp {
End = 0,
Identifier = 1,
HASHinclude = 2,
LF = 3,
HASHdefine = 4,
LPAREN = 5,
DOTDOTDOT = 6,
COMMA = 7,
RPAREN = 8,
HASHif = 9,
HASHendif = 10,
HASHifdef = 11,
HASHifndef = 12,
HASHelse = 13,
HASHelif = 14,
PreprocDirective = 15,
PreprocArg = 16,
LPAREN2 = 17,
Defined = 18,
BANG = 19,
TILDE = 20,
DASH = 21,
PLUS = 22,
STAR = 23,
SLASH = 24,
PERCENT = 25,
PIPEPIPE = 26,
AMPAMP = 27,
PIPE = 28,
CARET = 29,
AMP = 30,
EQEQ = 31,
BANGEQ = 32,
GT = 33,
GTEQ = 34,
LTEQ = 35,
LT = 36,
LTLT = 37,
GTGT = 38,
SEMI = 39,
Typedef = 40,
Extern = 41,
Attribute2 = 42,
COLONCOLON = 43,
LBRACKLBRACK = 44,
RBRACKRBRACK = 45,
Declspec = 46,
Based = 47,
Cdecl = 48,
Clrcall = 49,
Stdcall = 50,
Fastcall = 51,
Thiscall = 52,
Vectorcall = 53,
MsRestrictModifier = 54,
MsUnsignedPtrModifier = 55,
MsSignedPtrModifier = 56,
Unaligned = 57,
Unaligned2 = 58,
LBRACE = 59,
RBRACE = 60,
LBRACK = 61,
RBRACK = 62,
EQ = 63,
Static = 64,
Register = 65,
Inline = 66,
ThreadLocal = 67,
Const = 68,
Volatile = 69,
Restrict = 70,
Atomic = 71,
Mutable = 72,
Constexpr = 73,
Signed = 74,
Unsigned = 75,
Long = 76,
Short = 77,
PrimitiveType = 78,
Enum = 79,
Class = 80,
Struct = 81,
Union = 82,
COLON = 83,
If = 84,
Else = 85,
Switch = 86,
Case = 87,
Default = 88,
While = 89,
Do = 90,
For = 91,
Return = 92,
Break = 93,
Continue = 94,
Goto = 95,
QMARK = 96,
STAREQ = 97,
SLASHEQ = 98,
PERCENTEQ = 99,
PLUSEQ = 100,
DASHEQ = 101,
LTLTEQ = 102,
GTGTEQ = 103,
AMPEQ = 104,
CARETEQ = 105,
PIPEEQ = 106,
DASHDASH = 107,
PLUSPLUS = 108,
Sizeof = 109,
DOT = 110,
DASHGT = 111,
NumberLiteral = 112,
LSQUOTE = 113,
USQUOTE = 114,
USQUOTE2 = 115,
U8SQUOTE = 116,
SQUOTE = 117,
CharLiteralToken1 = 118,
LDQUOTE = 119,
UDQUOTE = 120,
UDQUOTE2 = 121,
U8DQUOTE = 122,
DQUOTE = 123,
StringLiteralToken1 = 124,
EscapeSequence = 125,
SystemLibString = 126,
True = 127,
False = 128,
Null = 129,
Comment = 130,
Decltype2 = 131,
Final = 132,
Override = 133,
Virtual = 134,
Explicit = 135,
Public = 136,
Private = 137,
Protected = 138,
Auto = 139,
Typename = 140,
Template = 141,
GT2 = 142,
Operator = 143,
Delete = 144,
Friend = 145,
Noexcept2 = 146,
Throw = 147,
Namespace = 148,
Using = 149,
StaticAssert = 150,
CoReturn = 151,
CoYield = 152,
Try = 153,
Catch = 154,
CoAwait = 155,
New = 156,
DASHGTSTAR = 157,
LPARENRPAREN = 158,
LBRACKRBRACK = 159,
DQUOTEDQUOTE = 160,
This = 161,
Nullptr = 162,
LiteralSuffix = 163,
AloneMacro = 164,
AloneMacroCallToken1 = 165,
CACHETRYINSPECT = 166,
CACHETRYUNWRAP = 167,
FORWARD = 168,
FORWARDSETATTRIBUTE = 169,
IDBTRYINSPECT = 170,
IDBTRYUNWRAP = 171,
LSTRYINSPECT = 172,
LSTRYUNWRAP = 173,
SDBTRYINSPECT = 174,
SDBTRYUNWRAP = 175,
PSGET = 176,
PSGETANDSET = 177,
PSGETLOCKLESS = 178,
QMTRYINSPECT = 179,
QMNOTEONLYTRYUNWRAP = 180,
QMTRYUNWRAP = 181,
QMWARNONLYTRYUNWRAP = 182,
MOZDECLUSEGUARDOBJECTNOTIFIER = 183,
MOZALLOCATOR = 184,
MOZALLOWTEMPORARY = 185,
MOZALWAYSINLINE = 186,
MOZALWAYSINLINEEVENDEBUG = 187,
MOZASANBLACKLIST = 188,
MOZCANRUNSCRIPT = 189,
MOZCANRUNSCRIPTBOUNDARY = 190,
MOZCANRUNSCRIPTFORDEFINITION = 191,
MOZCOLD = 192,
MOZFALLTHROUGH = 193,
MOZFORMATPRINTF = 194,
MOZHAVEANALYZERNORETURN = 195,
MOZHAVEASANBLACKLIST = 196,
MOZHAVENEVERINLINE = 197,
MOZHAVENORETURN = 198,
MOZHAVENORETURNPTR = 199,
MOZHAVENOSANITIZEATTR = 200,
MOZHAVESIGNEDOVERFLOWSANITIZEATTR = 201,
MOZHAVEUNSIGNEDOVERFLOWSANITIZEATTR = 202,
MOZHEAPALLOCATOR = 203,
MOZHEAPCLASS = 204,
MOZIMPLICIT = 205,
MOZINHERITTYPEANNOTATIONSFROMTEMPLATEARGS = 206,
MOZINITOUTSIDECTOR = 207,
MOZISCLASSINIT = 208,
MOZISREFPTR = 209,
MOZISSMARTPTRTOREFCOUNTED = 210,
MOZMAYBEUNUSED = 211,
MOZMAYCALLAFTERMUSTRETURN = 212,
MOZMUSTOVERRIDE = 213,
MOZMUSTRETURNFROMCALLERIFTHISISARG = 214,
MOZMUSTUSE = 215,
MOZMUSTUSETYPE = 216,
MOZNEEDSMEMMOVABLEMEMBERS = 217,
MOZNEEDSMEMMOVABLETYPE = 218,
MOZNEEDSNOVTABLETYPE = 219,
MOZNEVERINLINE = 220,
MOZNEVERINLINEDEBUG = 221,
MOZNONHEAPCLASS = 222,
MOZNONNULL = 223,
MOZNONNULLRETURN = 224,
MOZNONAUTOABLE = 225,
MOZNONMEMMOVABLE = 226,
MOZNONOWNINGREF = 227,
MOZNONPARAM = 228,
MOZNONTEMPORARYCLASS = 229,
MOZNORETURN = 230,
MOZNORETURNPTR = 231,
MOZNOADDREFRELEASEONRETURN = 232,
MOZNOARITHMETICEXPRINARGUMENT = 233,
MOZNODANGLINGONTEMPORARIES = 234,
MOZNOSANITIZESIGNEDOVERFLOW = 235,
MOZNOSANITIZEUNSIGNEDOVERFLOW = 236,
MOZONLYUSEDTOAVOIDSTATICCONSTRUCTORS = 237,
MOZOWNINGREF = 238,
MOZPOPDISABLENONTRIVIALUNIONWARNINGS = 239,
MOZPRETENDNORETURNFORSTATICANALYSIS = 240,
MOZPUSHDISABLENONTRIVIALUNIONWARNINGS = 241,
MOZRAII = 242,
MOZREQUIREDBASEMETHOD = 243,
MOZSTACKCLASS = 244,
MOZSTATICCLASS = 245,
MOZSTATICLOCALCLASS = 246,
MOZTEMPORARYCLASS = 247,
MOZTRIVIALCTORDTOR = 248,
MOZTSANBLACKLIST = 249,
MOZUNSAFEREF = 250,
MOZXPCOMABI = 251,
JSPUBLICAPI = 252,
RawStringLiteral = 253,
TranslationUnit = 254,
PreprocInclude = 255,
PreprocDef = 256,
PreprocFunctionDef = 257,
PreprocParams = 258,
PreprocCall = 259,
PreprocIf = 260,
PreprocIfdef = 261,
PreprocElse = 262,
PreprocElif = 263,
PreprocIf2 = 264,
PreprocIfdef2 = 265,
PreprocElse2 = 266,
PreprocElif2 = 267,
PreprocExpression = 268,
ParenthesizedExpression = 269,
PreprocDefined = 270,
UnaryExpression = 271,
CallExpression = 272,
ArgumentList = 273,
BinaryExpression = 274,
FunctionDefinition = 275,
Declaration = 276,
TypeDefinition = 277,
DeclarationModifiers = 278,
DeclarationSpecifiers = 279,
LinkageSpecification = 280,
AttributeSpecifier = 281,
Attribute = 282,
AttributeDeclaration = 283,
MsDeclspecModifier = 284,
MsBasedModifier = 285,
MsCallModifier = 286,
MsUnalignedPtrModifier = 287,
MsPointerModifier = 288,
DeclarationList = 289,
Declarator = 290,
FieldDeclarator = 291,
TypeDeclarator = 292,
AbstractDeclarator = 293,
ParenthesizedDeclarator = 294,
ParenthesizedDeclarator2 = 295,
ParenthesizedDeclarator3 = 296,
AbstractParenthesizedDeclarator = 297,
AttributedDeclarator = 298,
AttributedDeclarator2 = 299,
AttributedDeclarator3 = 300,
PointerDeclarator = 301,
PointerDeclarator2 = 302,
PointerDeclarator3 = 303,
AbstractPointerDeclarator = 304,
FunctionDeclarator = 305,
FunctionDeclarator2 = 306,
FunctionDeclarator3 = 307,
AbstractFunctionDeclarator = 308,
ArrayDeclarator = 309,
ArrayDeclarator2 = 310,
ArrayDeclarator3 = 311,
AbstractArrayDeclarator = 312,
InitDeclarator = 313,
CompoundStatement = 314,
StorageClassSpecifier = 315,
TypeQualifier = 316,
TypeSpecifier = 317,
SizedTypeSpecifier = 318,
EnumSpecifier = 319,
EnumeratorList = 320,
StructSpecifier = 321,
UnionSpecifier = 322,
FieldDeclarationList = 323,
FieldDeclarationListItem = 324,
FieldDeclaration = 325,
BitfieldClause = 326,
Enumerator = 327,
ParameterList = 328,
ParameterDeclaration = 329,
AttributedStatement = 330,
LabeledStatement = 331,
ExpressionStatement = 332,
IfStatement = 333,
SwitchStatement = 334,
CaseStatement = 335,
WhileStatement = 336,
DoStatement = 337,
ForStatement = 338,
ReturnStatement = 339,
BreakStatement = 340,
ContinueStatement = 341,
GotoStatement = 342,
Expression = 343,
CommaExpression = 344,
ConditionalExpression = 345,
AssignmentExpression = 346,
PointerExpression = 347,
UnaryExpression2 = 348,
BinaryExpression2 = 349,
UpdateExpression = 350,
CastExpression = 351,
TypeDescriptor = 352,
SizeofExpression = 353,
SubscriptExpression = 354,
CallExpression2 = 355,
ArgumentList2 = 356,
FieldExpression = 357,
CompoundLiteralExpression = 358,
ParenthesizedExpression2 = 359,
InitializerList = 360,
InitializerPair = 361,
SubscriptDesignator = 362,
FieldDesignator = 363,
CharLiteral = 364,
ConcatenatedString = 365,
StringLiteral = 366,
EmptyDeclaration = 367,
Decltype = 368,
ClassSpecifier = 369,
ClassName = 370,
VirtualSpecifier = 371,
VirtualFunctionSpecifier = 372,
ExplicitFunctionSpecifier = 373,
BaseClassClause = 374,
EnumBaseClause = 375,
DependentType = 376,
TemplateDeclaration = 377,
TemplateInstantiation = 378,
TemplateParameterList = 379,
TypeParameterDeclaration = 380,
VariadicTypeParameterDeclaration = 381,
OptionalTypeParameterDeclaration = 382,
TemplateTemplateParameterDeclaration = 383,
OptionalParameterDeclaration = 384,
VariadicParameterDeclaration = 385,
VariadicDeclarator = 386,
ReferenceDeclarator = 387,
OperatorCast = 388,
FieldInitializerList = 389,
FieldInitializer = 390,
FunctionDefinition2 = 391,
ConstructorSpecifiers = 392,
FunctionDefinition3 = 393,
Declaration2 = 394,
FunctionDefinition4 = 395,
Declaration3 = 396,
DefaultMethodClause = 397,
DeleteMethodClause = 398,
FriendDeclaration = 399,
AccessSpecifier = 400,
ReferenceDeclarator2 = 401,
ReferenceDeclarator3 = 402,
AbstractReferenceDeclarator = 403,
StructuredBindingDeclarator = 404,
RefQualifier = 405,
TrailingReturnType = 406,
Noexcept = 407,
ThrowSpecifier = 408,
TemplateType = 409,
TemplateMethod = 410,
TemplateFunction = 411,
TemplateArgumentList = 412,
NamespaceDefinition = 413,
NamespaceDefinitionName = 414,
UsingDeclaration = 415,
AliasDeclaration = 416,
StaticAssertDeclaration = 417,
ConditionClause = 418,
Declaration4 = 419,
ForRangeLoop = 420,
CoReturnStatement = 421,
CoYieldStatement = 422,
ThrowStatement = 423,
TryStatement = 424,
CatchClause = 425,
CoAwaitExpression = 426,
NewExpression = 427,
NewDeclarator = 428,
DeleteExpression = 429,
LambdaExpression = 430,
LambdaCaptureSpecifier = 431,
LambdaDefaultCapture = 432,
ParameterPackExpansion = 433,
ParameterPackExpansion2 = 434,
DestructorName = 435,
DependentName = 436,
DependentName2 = 437,
DependentName3 = 438,
ScopeResolution = 439,
QualifiedIdentifier = 440,
QualifiedIdentifier2 = 441,
QualifiedIdentifier3 = 442,
QualifiedIdentifier4 = 443,
OperatorName = 444,
UserDefinedLiteral = 445,
AloneMacroCall = 446,
CallMacroWithDeclFirstArg = 447,
MacroStatement = 448,
MacroAnnotation = 449,
TranslationUnitRepeat1 = 450,
PreprocParamsRepeat1 = 451,
PreprocIfInFieldDeclarationListRepeat1 = 452,
PreprocArgumentListRepeat1 = 453,
DeclarationRepeat1 = 454,
TypeDefinitionRepeat1 = 455,
TypeDefinitionRepeat2 = 456,
DeclarationSpecifiersRepeat1 = 457,
AttributeDeclarationRepeat1 = 458,
AttributedDeclaratorRepeat1 = 459,
PointerDeclaratorRepeat1 = 460,
FunctionDeclaratorRepeat1 = 461,
FunctionDeclaratorRepeat2 = 462,
AbstractFunctionDeclaratorRepeat1 = 463,
SizedTypeSpecifierRepeat1 = 464,
EnumeratorListRepeat1 = 465,
FieldDeclarationRepeat1 = 466,
ParameterListRepeat1 = 467,
CaseStatementRepeat1 = 468,
ArgumentListRepeat1 = 469,
InitializerListRepeat1 = 470,
InitializerPairRepeat1 = 471,
ConcatenatedStringRepeat1 = 472,
StringLiteralRepeat1 = 473,
ClassSpecifierRepeat1 = 474,
BaseClassClauseRepeat1 = 475,
TemplateParameterListRepeat1 = 476,
FieldInitializerListRepeat1 = 477,
OperatorCastDefinitionRepeat1 = 478,
StructuredBindingDeclaratorRepeat1 = 479,
ThrowSpecifierRepeat1 = 480,
TemplateArgumentListRepeat1 = 481,
TryStatementRepeat1 = 482,
LambdaCaptureSpecifierRepeat1 = 483,
AloneMacroCallRepeat1 = 484,
FieldIdentifier = 485,
NamespaceIdentifier = 486,
StatementIdentifier = 487,
TypeIdentifier = 488,
Error = 489,
}
impl From<Cpp> for &'static str {
#[inline(always)]
fn from(tok: Cpp) -> Self {
match tok {
Cpp::End => "end",
Cpp::Identifier => "identifier",
Cpp::HASHinclude => "#include",
Cpp::LF => "\n",
Cpp::HASHdefine => "#define",
Cpp::LPAREN => "(",
Cpp::DOTDOTDOT => "...",
Cpp::COMMA => ",",
Cpp::RPAREN => ")",
Cpp::HASHif => "#if",
Cpp::HASHendif => "#endif",
Cpp::HASHifdef => "#ifdef",
Cpp::HASHifndef => "#ifndef",
Cpp::HASHelse => "#else",
Cpp::HASHelif => "#elif",
Cpp::PreprocDirective => "preproc_directive",
Cpp::PreprocArg => "preproc_arg",
Cpp::LPAREN2 => "(",
Cpp::Defined => "defined",
Cpp::BANG => "!",
Cpp::TILDE => "~",
Cpp::DASH => "-",
Cpp::PLUS => "+",
Cpp::STAR => "*",
Cpp::SLASH => "/",
Cpp::PERCENT => "%",
Cpp::PIPEPIPE => "||",
Cpp::AMPAMP => "&&",
Cpp::PIPE => "|",
Cpp::CARET => "^",
Cpp::AMP => "&",
Cpp::EQEQ => "==",
Cpp::BANGEQ => "!=",
Cpp::GT => ">",
Cpp::GTEQ => ">=",
Cpp::LTEQ => "<=",
Cpp::LT => "<",
Cpp::LTLT => "<<",
Cpp::GTGT => ">>",
Cpp::SEMI => ";",
Cpp::Typedef => "typedef",
Cpp::Extern => "extern",
Cpp::Attribute2 => "__attribute__",
Cpp::COLONCOLON => "::",
Cpp::LBRACKLBRACK => "[[",
Cpp::RBRACKRBRACK => "]]",
Cpp::Declspec => "__declspec",
Cpp::Based => "__based",
Cpp::Cdecl => "__cdecl",
Cpp::Clrcall => "__clrcall",
Cpp::Stdcall => "__stdcall",
Cpp::Fastcall => "__fastcall",
Cpp::Thiscall => "__thiscall",
Cpp::Vectorcall => "__vectorcall",
Cpp::MsRestrictModifier => "ms_restrict_modifier",
Cpp::MsUnsignedPtrModifier => "ms_unsigned_ptr_modifier",
Cpp::MsSignedPtrModifier => "ms_signed_ptr_modifier",
Cpp::Unaligned => "_unaligned",
Cpp::Unaligned2 => "__unaligned",
Cpp::LBRACE => "{",
Cpp::RBRACE => "}",
Cpp::LBRACK => "[",
Cpp::RBRACK => "]",
Cpp::EQ => "=",
Cpp::Static => "static",
Cpp::Register => "register",
Cpp::Inline => "inline",
Cpp::ThreadLocal => "thread_local",
Cpp::Const => "const",
Cpp::Volatile => "volatile",
Cpp::Restrict => "restrict",
Cpp::Atomic => "_Atomic",
Cpp::Mutable => "mutable",
Cpp::Constexpr => "constexpr",
Cpp::Signed => "signed",
Cpp::Unsigned => "unsigned",
Cpp::Long => "long",
Cpp::Short => "short",
Cpp::PrimitiveType => "primitive_type",
Cpp::Enum => "enum",
Cpp::Class => "class",
Cpp::Struct => "struct",
Cpp::Union => "union",
Cpp::COLON => ":",
Cpp::If => "if",
Cpp::Else => "else",
Cpp::Switch => "switch",
Cpp::Case => "case",
Cpp::Default => "default",
Cpp::While => "while",
Cpp::Do => "do",
Cpp::For => "for",
Cpp::Return => "return",
Cpp::Break => "break",
Cpp::Continue => "continue",
Cpp::Goto => "goto",
Cpp::QMARK => "?",
Cpp::STAREQ => "*=",
Cpp::SLASHEQ => "/=",
Cpp::PERCENTEQ => "%=",
Cpp::PLUSEQ => "+=",
Cpp::DASHEQ => "-=",
Cpp::LTLTEQ => "<<=",
Cpp::GTGTEQ => ">>=",
Cpp::AMPEQ => "&=",
Cpp::CARETEQ => "^=",
Cpp::PIPEEQ => "|=",
Cpp::DASHDASH => "--",
Cpp::PLUSPLUS => "++",
Cpp::Sizeof => "sizeof",
Cpp::DOT => ".",
Cpp::DASHGT => "->",
Cpp::NumberLiteral => "number_literal",
Cpp::LSQUOTE => "L'",
Cpp::USQUOTE => "u'",
Cpp::USQUOTE2 => "U'",
Cpp::U8SQUOTE => "u8'",
Cpp::SQUOTE => "'",
Cpp::CharLiteralToken1 => "char_literal_token1",
Cpp::LDQUOTE => "L\"",
Cpp::UDQUOTE => "u\"",
Cpp::UDQUOTE2 => "U\"",
Cpp::U8DQUOTE => "u8\"",
Cpp::DQUOTE => "\"",
Cpp::StringLiteralToken1 => "string_literal_token1",
Cpp::EscapeSequence => "escape_sequence",
Cpp::SystemLibString => "system_lib_string",
Cpp::True => "true",
Cpp::False => "false",
Cpp::Null => "null",
Cpp::Comment => "comment",
Cpp::Decltype2 => "decltype",
Cpp::Final => "final",
Cpp::Override => "override",
Cpp::Virtual => "virtual",
Cpp::Explicit => "explicit",
Cpp::Public => "public",
Cpp::Private => "private",
Cpp::Protected => "protected",
Cpp::Auto => "auto",
Cpp::Typename => "typename",
Cpp::Template => "template",
Cpp::GT2 => ">",
Cpp::Operator => "operator",
Cpp::Delete => "delete",
Cpp::Friend => "friend",
Cpp::Noexcept2 => "noexcept",
Cpp::Throw => "throw",
Cpp::Namespace => "namespace",
Cpp::Using => "using",
Cpp::StaticAssert => "static_assert",
Cpp::CoReturn => "co_return",
Cpp::CoYield => "co_yield",
Cpp::Try => "try",
Cpp::Catch => "catch",
Cpp::CoAwait => "co_await",
Cpp::New => "new",
Cpp::DASHGTSTAR => "->*",
Cpp::LPARENRPAREN => "()",
Cpp::LBRACKRBRACK => "[]",
Cpp::DQUOTEDQUOTE => "\"\"",
Cpp::This => "this",
Cpp::Nullptr => "nullptr",
Cpp::LiteralSuffix => "literal_suffix",
Cpp::AloneMacro => "alone_macro",
Cpp::AloneMacroCallToken1 => "alone_macro_call_token1",
Cpp::CACHETRYINSPECT => "CACHE_TRY_INSPECT",
Cpp::CACHETRYUNWRAP => "CACHE_TRY_UNWRAP",
Cpp::FORWARD => "FORWARD",
Cpp::FORWARDSETATTRIBUTE => "FORWARD_SET_ATTRIBUTE",
Cpp::IDBTRYINSPECT => "IDB_TRY_INSPECT",
Cpp::IDBTRYUNWRAP => "IDB_TRY_UNWRAP",
Cpp::LSTRYINSPECT => "LS_TRY_INSPECT",
Cpp::LSTRYUNWRAP => "LS_TRY_UNWRAP",
Cpp::SDBTRYINSPECT => "SDB_TRY_INSPECT",
Cpp::SDBTRYUNWRAP => "SDB_TRY_UNWRAP",
Cpp::PSGET => "PS_GET",
Cpp::PSGETANDSET => "PS_GET_AND_SET",
Cpp::PSGETLOCKLESS => "PS_GET_LOCKLESS",
Cpp::QMTRYINSPECT => "QM_TRY_INSPECT",
Cpp::QMNOTEONLYTRYUNWRAP => "QM_NOTEONLY_TRY_UNWRAP",
Cpp::QMTRYUNWRAP => "QM_TRY_UNWRAP",
Cpp::QMWARNONLYTRYUNWRAP => "QM_WARNONLY_TRY_UNWRAP",
Cpp::MOZDECLUSEGUARDOBJECTNOTIFIER => "MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER",
Cpp::MOZALLOCATOR => "MOZ_ALLOCATOR",
Cpp::MOZALLOWTEMPORARY => "MOZ_ALLOW_TEMPORARY",
Cpp::MOZALWAYSINLINE => "MOZ_ALWAYS_INLINE",
Cpp::MOZALWAYSINLINEEVENDEBUG => "MOZ_ALWAYS_INLINE_EVEN_DEBUG",
Cpp::MOZASANBLACKLIST => "MOZ_ASAN_BLACKLIST",
Cpp::MOZCANRUNSCRIPT => "MOZ_CAN_RUN_SCRIPT",
Cpp::MOZCANRUNSCRIPTBOUNDARY => "MOZ_CAN_RUN_SCRIPT_BOUNDARY",
Cpp::MOZCANRUNSCRIPTFORDEFINITION => "MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION",
Cpp::MOZCOLD => "MOZ_COLD",
Cpp::MOZFALLTHROUGH => "MOZ_FALLTHROUGH",
Cpp::MOZFORMATPRINTF => "MOZ_FORMAT_PRINTF",
Cpp::MOZHAVEANALYZERNORETURN => "MOZ_HAVE_ANALYZER_NORETURN",
Cpp::MOZHAVEASANBLACKLIST => "MOZ_HAVE_ASAN_BLACKLIST",
Cpp::MOZHAVENEVERINLINE => "MOZ_HAVE_NEVER_INLINE",
Cpp::MOZHAVENORETURN => "MOZ_HAVE_NORETURN",
Cpp::MOZHAVENORETURNPTR => "MOZ_HAVE_NORETURN_PTR",
Cpp::MOZHAVENOSANITIZEATTR => "MOZ_HAVE_NO_SANITIZE_ATTR",
Cpp::MOZHAVESIGNEDOVERFLOWSANITIZEATTR => "MOZ_HAVE_SIGNED_OVERFLOW_SANITIZE_ATTR",
Cpp::MOZHAVEUNSIGNEDOVERFLOWSANITIZEATTR => "MOZ_HAVE_UNSIGNED_OVERFLOW_SANITIZE_ATTR",
Cpp::MOZHEAPALLOCATOR => "MOZ_HEAP_ALLOCATOR",
Cpp::MOZHEAPCLASS => "MOZ_HEAP_CLASS",
Cpp::MOZIMPLICIT => "MOZ_IMPLICIT",
Cpp::MOZINHERITTYPEANNOTATIONSFROMTEMPLATEARGS => {
"MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS"
}
Cpp::MOZINITOUTSIDECTOR => "MOZ_INIT_OUTSIDE_CTOR",
Cpp::MOZISCLASSINIT => "MOZ_IS_CLASS_INIT",
Cpp::MOZISREFPTR => "MOZ_IS_REFPTR",
Cpp::MOZISSMARTPTRTOREFCOUNTED => "MOZ_IS_SMARTPTR_TO_REFCOUNTED",
Cpp::MOZMAYBEUNUSED => "MOZ_MAYBE_UNUSED",
Cpp::MOZMAYCALLAFTERMUSTRETURN => "MOZ_MAY_CALL_AFTER_MUST_RETURN",
Cpp::MOZMUSTOVERRIDE => "MOZ_MUST_OVERRIDE",
Cpp::MOZMUSTRETURNFROMCALLERIFTHISISARG => "MOZ_MUST_RETURN_FROM_CALLER_IF_THIS_IS_ARG",
Cpp::MOZMUSTUSE => "MOZ_MUST_USE",
Cpp::MOZMUSTUSETYPE => "MOZ_MUST_USE_TYPE",
Cpp::MOZNEEDSMEMMOVABLEMEMBERS => "MOZ_NEEDS_MEMMOVABLE_MEMBERS",
Cpp::MOZNEEDSMEMMOVABLETYPE => "MOZ_NEEDS_MEMMOVABLE_TYPE",
Cpp::MOZNEEDSNOVTABLETYPE => "MOZ_NEEDS_NO_VTABLE_TYPE",
Cpp::MOZNEVERINLINE => "MOZ_NEVER_INLINE",
Cpp::MOZNEVERINLINEDEBUG => "MOZ_NEVER_INLINE_DEBUG",
Cpp::MOZNONHEAPCLASS => "MOZ_NONHEAP_CLASS",
Cpp::MOZNONNULL => "MOZ_NONNULL",
Cpp::MOZNONNULLRETURN => "MOZ_NONNULL_RETURN",
Cpp::MOZNONAUTOABLE => "MOZ_NON_AUTOABLE",
Cpp::MOZNONMEMMOVABLE => "MOZ_NON_MEMMOVABLE",
Cpp::MOZNONOWNINGREF => "MOZ_NON_OWNING_REF",
Cpp::MOZNONPARAM => "MOZ_NON_PARAM",
Cpp::MOZNONTEMPORARYCLASS => "MOZ_NON_TEMPORARY_CLASS",
Cpp::MOZNORETURN => "MOZ_NORETURN",
Cpp::MOZNORETURNPTR => "MOZ_NORETURN_PTR",
Cpp::MOZNOADDREFRELEASEONRETURN => "MOZ_NO_ADDREF_RELEASE_ON_RETURN",
Cpp::MOZNOARITHMETICEXPRINARGUMENT => "MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT",
Cpp::MOZNODANGLINGONTEMPORARIES => "MOZ_NO_DANGLING_ON_TEMPORARIES",
Cpp::MOZNOSANITIZESIGNEDOVERFLOW => "MOZ_NO_SANITIZE_SIGNED_OVERFLOW",
Cpp::MOZNOSANITIZEUNSIGNEDOVERFLOW => "MOZ_NO_SANITIZE_UNSIGNED_OVERFLOW",
Cpp::MOZONLYUSEDTOAVOIDSTATICCONSTRUCTORS => {
"MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS"
}
Cpp::MOZOWNINGREF => "MOZ_OWNING_REF",
Cpp::MOZPOPDISABLENONTRIVIALUNIONWARNINGS => {
"MOZ_POP_DISABLE_NONTRIVIAL_UNION_WARNINGS"
}
Cpp::MOZPRETENDNORETURNFORSTATICANALYSIS => "MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS",
Cpp::MOZPUSHDISABLENONTRIVIALUNIONWARNINGS => {
"MOZ_PUSH_DISABLE_NONTRIVIAL_UNION_WARNINGS"
}
Cpp::MOZRAII => "MOZ_RAII",
Cpp::MOZREQUIREDBASEMETHOD => "MOZ_REQUIRED_BASE_METHOD",
Cpp::MOZSTACKCLASS => "MOZ_STACK_CLASS",
Cpp::MOZSTATICCLASS => "MOZ_STATIC_CLASS",
Cpp::MOZSTATICLOCALCLASS => "MOZ_STATIC_LOCAL_CLASS",
Cpp::MOZTEMPORARYCLASS => "MOZ_TEMPORARY_CLASS",
Cpp::MOZTRIVIALCTORDTOR => "MOZ_TRIVIAL_CTOR_DTOR",
Cpp::MOZTSANBLACKLIST => "MOZ_TSAN_BLACKLIST",
Cpp::MOZUNSAFEREF => "MOZ_UNSAFE_REF",
Cpp::MOZXPCOMABI => "MOZ_XPCOM_ABI",
Cpp::JSPUBLICAPI => "JS_PUBLIC_API",
Cpp::RawStringLiteral => "raw_string_literal",
Cpp::TranslationUnit => "translation_unit",
Cpp::PreprocInclude => "preproc_include",
Cpp::PreprocDef => "preproc_def",
Cpp::PreprocFunctionDef => "preproc_function_def",
Cpp::PreprocParams => "preproc_params",
Cpp::PreprocCall => "preproc_call",
Cpp::PreprocIf => "preproc_if",
Cpp::PreprocIfdef => "preproc_ifdef",
Cpp::PreprocElse => "preproc_else",
Cpp::PreprocElif => "preproc_elif",
Cpp::PreprocIf2 => "preproc_if",
Cpp::PreprocIfdef2 => "preproc_ifdef",
Cpp::PreprocElse2 => "preproc_else",
Cpp::PreprocElif2 => "preproc_elif",
Cpp::PreprocExpression => "_preproc_expression",
Cpp::ParenthesizedExpression => "parenthesized_expression",
Cpp::PreprocDefined => "preproc_defined",
Cpp::UnaryExpression => "unary_expression",
Cpp::CallExpression => "call_expression",
Cpp::ArgumentList => "argument_list",
Cpp::BinaryExpression => "binary_expression",
Cpp::FunctionDefinition => "function_definition",
Cpp::Declaration => "declaration",
Cpp::TypeDefinition => "type_definition",
Cpp::DeclarationModifiers => "_declaration_modifiers",
Cpp::DeclarationSpecifiers => "_declaration_specifiers",
Cpp::LinkageSpecification => "linkage_specification",
Cpp::AttributeSpecifier => "attribute_specifier",
Cpp::Attribute => "attribute",
Cpp::AttributeDeclaration => "attribute_declaration",
Cpp::MsDeclspecModifier => "ms_declspec_modifier",
Cpp::MsBasedModifier => "ms_based_modifier",
Cpp::MsCallModifier => "ms_call_modifier",
Cpp::MsUnalignedPtrModifier => "ms_unaligned_ptr_modifier",
Cpp::MsPointerModifier => "ms_pointer_modifier",
Cpp::DeclarationList => "declaration_list",
Cpp::Declarator => "_declarator",
Cpp::FieldDeclarator => "_field_declarator",
Cpp::TypeDeclarator => "_type_declarator",
Cpp::AbstractDeclarator => "_abstract_declarator",
Cpp::ParenthesizedDeclarator => "parenthesized_declarator",
Cpp::ParenthesizedDeclarator2 => "parenthesized_declarator",
Cpp::ParenthesizedDeclarator3 => "parenthesized_declarator",
Cpp::AbstractParenthesizedDeclarator => "abstract_parenthesized_declarator",
Cpp::AttributedDeclarator => "attributed_declarator",
Cpp::AttributedDeclarator2 => "attributed_declarator",
Cpp::AttributedDeclarator3 => "attributed_declarator",
Cpp::PointerDeclarator => "pointer_declarator",
Cpp::PointerDeclarator2 => "pointer_declarator",
Cpp::PointerDeclarator3 => "pointer_declarator",
Cpp::AbstractPointerDeclarator => "abstract_pointer_declarator",
Cpp::FunctionDeclarator => "function_declarator",
Cpp::FunctionDeclarator2 => "function_declarator",
Cpp::FunctionDeclarator3 => "function_declarator",
Cpp::AbstractFunctionDeclarator => "abstract_function_declarator",
Cpp::ArrayDeclarator => "array_declarator",
Cpp::ArrayDeclarator2 => "array_declarator",
Cpp::ArrayDeclarator3 => "array_declarator",
Cpp::AbstractArrayDeclarator => "abstract_array_declarator",
Cpp::InitDeclarator => "init_declarator",
Cpp::CompoundStatement => "compound_statement",
Cpp::StorageClassSpecifier => "storage_class_specifier",
Cpp::TypeQualifier => "type_qualifier",
Cpp::TypeSpecifier => "_type_specifier",
Cpp::SizedTypeSpecifier => "sized_type_specifier",
Cpp::EnumSpecifier => "enum_specifier",
Cpp::EnumeratorList => "enumerator_list",
Cpp::StructSpecifier => "struct_specifier",
Cpp::UnionSpecifier => "union_specifier",
Cpp::FieldDeclarationList => "field_declaration_list",
Cpp::FieldDeclarationListItem => "_field_declaration_list_item",
Cpp::FieldDeclaration => "field_declaration",
Cpp::BitfieldClause => "bitfield_clause",
Cpp::Enumerator => "enumerator",
Cpp::ParameterList => "parameter_list",
Cpp::ParameterDeclaration => "parameter_declaration",
Cpp::AttributedStatement => "attributed_statement",
Cpp::LabeledStatement => "labeled_statement",
Cpp::ExpressionStatement => "expression_statement",
Cpp::IfStatement => "if_statement",
Cpp::SwitchStatement => "switch_statement",
Cpp::CaseStatement => "case_statement",
Cpp::WhileStatement => "while_statement",
Cpp::DoStatement => "do_statement",
Cpp::ForStatement => "for_statement",
Cpp::ReturnStatement => "return_statement",
Cpp::BreakStatement => "break_statement",
Cpp::ContinueStatement => "continue_statement",
Cpp::GotoStatement => "goto_statement",
Cpp::Expression => "_expression",
Cpp::CommaExpression => "comma_expression",
Cpp::ConditionalExpression => "conditional_expression",
Cpp::AssignmentExpression => "assignment_expression",
Cpp::PointerExpression => "pointer_expression",
Cpp::UnaryExpression2 => "unary_expression",
Cpp::BinaryExpression2 => "binary_expression",
Cpp::UpdateExpression => "update_expression",
Cpp::CastExpression => "cast_expression",
Cpp::TypeDescriptor => "type_descriptor",
Cpp::SizeofExpression => "sizeof_expression",
Cpp::SubscriptExpression => "subscript_expression",
Cpp::CallExpression2 => "call_expression",
Cpp::ArgumentList2 => "argument_list",
Cpp::FieldExpression => "field_expression",
Cpp::CompoundLiteralExpression => "compound_literal_expression",
Cpp::ParenthesizedExpression2 => "parenthesized_expression",
Cpp::InitializerList => "initializer_list",
Cpp::InitializerPair => "initializer_pair",
Cpp::SubscriptDesignator => "subscript_designator",
Cpp::FieldDesignator => "field_designator",
Cpp::CharLiteral => "char_literal",
Cpp::ConcatenatedString => "concatenated_string",
Cpp::StringLiteral => "string_literal",
Cpp::EmptyDeclaration => "_empty_declaration",
Cpp::Decltype => "decltype",
Cpp::ClassSpecifier => "class_specifier",
Cpp::ClassName => "_class_name",
Cpp::VirtualSpecifier => "virtual_specifier",
Cpp::VirtualFunctionSpecifier => "virtual_function_specifier",
Cpp::ExplicitFunctionSpecifier => "explicit_function_specifier",
Cpp::BaseClassClause => "base_class_clause",
Cpp::EnumBaseClause => "_enum_base_clause",
Cpp::DependentType => "dependent_type",
Cpp::TemplateDeclaration => "template_declaration",
Cpp::TemplateInstantiation => "template_instantiation",
Cpp::TemplateParameterList => "template_parameter_list",
Cpp::TypeParameterDeclaration => "type_parameter_declaration",
Cpp::VariadicTypeParameterDeclaration => "variadic_type_parameter_declaration",
Cpp::OptionalTypeParameterDeclaration => "optional_type_parameter_declaration",
Cpp::TemplateTemplateParameterDeclaration => "template_template_parameter_declaration",
Cpp::OptionalParameterDeclaration => "optional_parameter_declaration",
Cpp::VariadicParameterDeclaration => "variadic_parameter_declaration",
Cpp::VariadicDeclarator => "variadic_declarator",
Cpp::ReferenceDeclarator => "reference_declarator",
Cpp::OperatorCast => "operator_cast",
Cpp::FieldInitializerList => "field_initializer_list",
Cpp::FieldInitializer => "field_initializer",
Cpp::FunctionDefinition2 => "function_definition",
Cpp::ConstructorSpecifiers => "_constructor_specifiers",
Cpp::FunctionDefinition3 => "function_definition",
Cpp::Declaration2 => "declaration",
Cpp::FunctionDefinition4 => "function_definition",
Cpp::Declaration3 => "declaration",
Cpp::DefaultMethodClause => "default_method_clause",
Cpp::DeleteMethodClause => "delete_method_clause",
Cpp::FriendDeclaration => "friend_declaration",
Cpp::AccessSpecifier => "access_specifier",
Cpp::ReferenceDeclarator2 => "reference_declarator",
Cpp::ReferenceDeclarator3 => "reference_declarator",
Cpp::AbstractReferenceDeclarator => "abstract_reference_declarator",
Cpp::StructuredBindingDeclarator => "structured_binding_declarator",
Cpp::RefQualifier => "ref_qualifier",
Cpp::TrailingReturnType => "trailing_return_type",
Cpp::Noexcept => "noexcept",
Cpp::ThrowSpecifier => "throw_specifier",
Cpp::TemplateType => "template_type",
Cpp::TemplateMethod => "template_method",
Cpp::TemplateFunction => "template_function",
Cpp::TemplateArgumentList => "template_argument_list",
Cpp::NamespaceDefinition => "namespace_definition",
Cpp::NamespaceDefinitionName => "namespace_definition_name",
Cpp::UsingDeclaration => "using_declaration",
Cpp::AliasDeclaration => "alias_declaration",
Cpp::StaticAssertDeclaration => "static_assert_declaration",
Cpp::ConditionClause => "condition_clause",
Cpp::Declaration4 => "declaration",
Cpp::ForRangeLoop => "for_range_loop",
Cpp::CoReturnStatement => "co_return_statement",
Cpp::CoYieldStatement => "co_yield_statement",
Cpp::ThrowStatement => "throw_statement",
Cpp::TryStatement => "try_statement",
Cpp::CatchClause => "catch_clause",
Cpp::CoAwaitExpression => "co_await_expression",
Cpp::NewExpression => "new_expression",
Cpp::NewDeclarator => "new_declarator",
Cpp::DeleteExpression => "delete_expression",
Cpp::LambdaExpression => "lambda_expression",
Cpp::LambdaCaptureSpecifier => "lambda_capture_specifier",
Cpp::LambdaDefaultCapture => "lambda_default_capture",
Cpp::ParameterPackExpansion => "parameter_pack_expansion",
Cpp::ParameterPackExpansion2 => "parameter_pack_expansion",
Cpp::DestructorName => "destructor_name",
Cpp::DependentName => "dependent_name",
Cpp::DependentName2 => "dependent_name",
Cpp::DependentName3 => "dependent_name",
Cpp::ScopeResolution => "_scope_resolution",
Cpp::QualifiedIdentifier => "qualified_identifier",
Cpp::QualifiedIdentifier2 => "qualified_identifier",
Cpp::QualifiedIdentifier3 => "qualified_identifier",
Cpp::QualifiedIdentifier4 => "qualified_identifier",
Cpp::OperatorName => "operator_name",
Cpp::UserDefinedLiteral => "user_defined_literal",
Cpp::AloneMacroCall => "alone_macro_call",
Cpp::CallMacroWithDeclFirstArg => "_call_macro_with_decl_first_arg",
Cpp::MacroStatement => "macro_statement",
Cpp::MacroAnnotation => "macro_annotation",
Cpp::TranslationUnitRepeat1 => "translation_unit_repeat1",
Cpp::PreprocParamsRepeat1 => "preproc_params_repeat1",
Cpp::PreprocIfInFieldDeclarationListRepeat1 => {
"preproc_if_in_field_declaration_list_repeat1"
}
Cpp::PreprocArgumentListRepeat1 => "preproc_argument_list_repeat1",
Cpp::DeclarationRepeat1 => "declaration_repeat1",
Cpp::TypeDefinitionRepeat1 => "type_definition_repeat1",
Cpp::TypeDefinitionRepeat2 => "type_definition_repeat2",
Cpp::DeclarationSpecifiersRepeat1 => "_declaration_specifiers_repeat1",
Cpp::AttributeDeclarationRepeat1 => "attribute_declaration_repeat1",
Cpp::AttributedDeclaratorRepeat1 => "attributed_declarator_repeat1",
Cpp::PointerDeclaratorRepeat1 => "pointer_declarator_repeat1",
Cpp::FunctionDeclaratorRepeat1 => "function_declarator_repeat1",
Cpp::FunctionDeclaratorRepeat2 => "function_declarator_repeat2",
Cpp::AbstractFunctionDeclaratorRepeat1 => "abstract_function_declarator_repeat1",
Cpp::SizedTypeSpecifierRepeat1 => "sized_type_specifier_repeat1",
Cpp::EnumeratorListRepeat1 => "enumerator_list_repeat1",
Cpp::FieldDeclarationRepeat1 => "field_declaration_repeat1",
Cpp::ParameterListRepeat1 => "parameter_list_repeat1",
Cpp::CaseStatementRepeat1 => "case_statement_repeat1",
Cpp::ArgumentListRepeat1 => "argument_list_repeat1",
Cpp::InitializerListRepeat1 => "initializer_list_repeat1",
Cpp::InitializerPairRepeat1 => "initializer_pair_repeat1",
Cpp::ConcatenatedStringRepeat1 => "concatenated_string_repeat1",
Cpp::StringLiteralRepeat1 => "string_literal_repeat1",
Cpp::ClassSpecifierRepeat1 => "class_specifier_repeat1",
Cpp::BaseClassClauseRepeat1 => "base_class_clause_repeat1",
Cpp::TemplateParameterListRepeat1 => "template_parameter_list_repeat1",
Cpp::FieldInitializerListRepeat1 => "field_initializer_list_repeat1",
Cpp::OperatorCastDefinitionRepeat1 => "operator_cast_definition_repeat1",
Cpp::StructuredBindingDeclaratorRepeat1 => "structured_binding_declarator_repeat1",
Cpp::ThrowSpecifierRepeat1 => "throw_specifier_repeat1",
Cpp::TemplateArgumentListRepeat1 => "template_argument_list_repeat1",
Cpp::TryStatementRepeat1 => "try_statement_repeat1",
Cpp::LambdaCaptureSpecifierRepeat1 => "lambda_capture_specifier_repeat1",
Cpp::AloneMacroCallRepeat1 => "alone_macro_call_repeat1",
Cpp::FieldIdentifier => "field_identifier",
Cpp::NamespaceIdentifier => "namespace_identifier",
Cpp::StatementIdentifier => "statement_identifier",
Cpp::TypeIdentifier => "type_identifier",
Cpp::Error => "ERROR",
}
}
}
impl From<u16> for Cpp {
#[inline(always)]
fn from(x: u16) -> Self {
num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
}
}
impl PartialEq<u16> for Cpp {
#[inline(always)]
fn eq(&self, x: &u16) -> bool {
*self == Cpp::from(*x)
}
}
impl PartialEq<Cpp> for u16 {
#[inline(always)]
fn eq(&self, x: &Cpp) -> bool {
*x == *self
}
}