@@ -46,7 +46,7 @@ impl<U> From<ModFunctionType<U>> for Mod<U> {
4646 }
4747}
4848
49- #[ derive( Clone , Debug , PartialEq ) ]
49+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
5050pub enum Mod < U = ( ) > {
5151 Module ( ModModule < U > ) ,
5252 Interactive ( ModInteractive < U > ) ,
@@ -366,34 +366,61 @@ impl<U> From<StmtExpr<U>> for StmtKind<U> {
366366 }
367367}
368368
369- #[ derive( Clone , Debug , PartialEq ) ]
369+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
370370pub enum StmtKind < U = ( ) > {
371+ #[ is( name = "function_def_stmt" ) ]
371372 FunctionDef ( StmtFunctionDef < U > ) ,
373+ #[ is( name = "async_function_def_stmt" ) ]
372374 AsyncFunctionDef ( StmtAsyncFunctionDef < U > ) ,
375+ #[ is( name = "class_def_stmt" ) ]
373376 ClassDef ( StmtClassDef < U > ) ,
377+ #[ is( name = "return_stmt" ) ]
374378 Return ( StmtReturn < U > ) ,
379+ #[ is( name = "delete_stmt" ) ]
375380 Delete ( StmtDelete < U > ) ,
381+ #[ is( name = "assign_stmt" ) ]
376382 Assign ( StmtAssign < U > ) ,
383+ #[ is( name = "aug_assign_stmt" ) ]
377384 AugAssign ( StmtAugAssign < U > ) ,
385+ #[ is( name = "ann_assign_stmt" ) ]
378386 AnnAssign ( StmtAnnAssign < U > ) ,
387+ #[ is( name = "for_stmt" ) ]
379388 For ( StmtFor < U > ) ,
389+ #[ is( name = "async_for_stmt" ) ]
380390 AsyncFor ( StmtAsyncFor < U > ) ,
391+ #[ is( name = "while_stmt" ) ]
381392 While ( StmtWhile < U > ) ,
393+ #[ is( name = "if_stmt" ) ]
382394 If ( StmtIf < U > ) ,
395+ #[ is( name = "with_stmt" ) ]
383396 With ( StmtWith < U > ) ,
397+ #[ is( name = "async_with_stmt" ) ]
384398 AsyncWith ( StmtAsyncWith < U > ) ,
399+ #[ is( name = "match_stmt" ) ]
385400 Match ( StmtMatch < U > ) ,
401+ #[ is( name = "raise_stmt" ) ]
386402 Raise ( StmtRaise < U > ) ,
403+ #[ is( name = "try_stmt" ) ]
387404 Try ( StmtTry < U > ) ,
405+ #[ is( name = "try_star_stmt" ) ]
388406 TryStar ( StmtTryStar < U > ) ,
407+ #[ is( name = "assert_stmt" ) ]
389408 Assert ( StmtAssert < U > ) ,
409+ #[ is( name = "import_stmt" ) ]
390410 Import ( StmtImport < U > ) ,
411+ #[ is( name = "import_from_stmt" ) ]
391412 ImportFrom ( StmtImportFrom < U > ) ,
413+ #[ is( name = "global_stmt" ) ]
392414 Global ( StmtGlobal ) ,
415+ #[ is( name = "nonlocal_stmt" ) ]
393416 Nonlocal ( StmtNonlocal ) ,
417+ #[ is( name = "expr_stmt" ) ]
394418 Expr ( StmtExpr < U > ) ,
419+ #[ is( name = "pass_stmt" ) ]
395420 Pass ,
421+ #[ is( name = "break_stmt" ) ]
396422 Break ,
423+ #[ is( name = "continue_stmt" ) ]
397424 Continue ,
398425}
399426pub type Stmt < U = ( ) > = Attributed < StmtKind < U > , U > ;
@@ -726,52 +753,79 @@ impl<U> From<ExprSlice<U>> for ExprKind<U> {
726753 }
727754}
728755
729- #[ derive( Clone , Debug , PartialEq ) ]
756+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
730757pub enum ExprKind < U = ( ) > {
758+ #[ is( name = "bool_op_expr" ) ]
731759 BoolOp ( ExprBoolOp < U > ) ,
760+ #[ is( name = "named_expr_expr" ) ]
732761 NamedExpr ( ExprNamedExpr < U > ) ,
762+ #[ is( name = "bin_op_expr" ) ]
733763 BinOp ( ExprBinOp < U > ) ,
764+ #[ is( name = "unary_op_expr" ) ]
734765 UnaryOp ( ExprUnaryOp < U > ) ,
766+ #[ is( name = "lambda_expr" ) ]
735767 Lambda ( ExprLambda < U > ) ,
768+ #[ is( name = "if_exp_expr" ) ]
736769 IfExp ( ExprIfExp < U > ) ,
770+ #[ is( name = "dict_expr" ) ]
737771 Dict ( ExprDict < U > ) ,
772+ #[ is( name = "set_expr" ) ]
738773 Set ( ExprSet < U > ) ,
774+ #[ is( name = "list_comp_expr" ) ]
739775 ListComp ( ExprListComp < U > ) ,
776+ #[ is( name = "set_comp_expr" ) ]
740777 SetComp ( ExprSetComp < U > ) ,
778+ #[ is( name = "dict_comp_expr" ) ]
741779 DictComp ( ExprDictComp < U > ) ,
780+ #[ is( name = "generator_exp_expr" ) ]
742781 GeneratorExp ( ExprGeneratorExp < U > ) ,
782+ #[ is( name = "await_expr" ) ]
743783 Await ( ExprAwait < U > ) ,
784+ #[ is( name = "yield_expr" ) ]
744785 Yield ( ExprYield < U > ) ,
786+ #[ is( name = "yield_from_expr" ) ]
745787 YieldFrom ( ExprYieldFrom < U > ) ,
788+ #[ is( name = "compare_expr" ) ]
746789 Compare ( ExprCompare < U > ) ,
790+ #[ is( name = "call_expr" ) ]
747791 Call ( ExprCall < U > ) ,
792+ #[ is( name = "formatted_value_expr" ) ]
748793 FormattedValue ( ExprFormattedValue < U > ) ,
794+ #[ is( name = "joined_str_expr" ) ]
749795 JoinedStr ( ExprJoinedStr < U > ) ,
796+ #[ is( name = "constant_expr" ) ]
750797 Constant ( ExprConstant ) ,
798+ #[ is( name = "attribute_expr" ) ]
751799 Attribute ( ExprAttribute < U > ) ,
800+ #[ is( name = "subscript_expr" ) ]
752801 Subscript ( ExprSubscript < U > ) ,
802+ #[ is( name = "starred_expr" ) ]
753803 Starred ( ExprStarred < U > ) ,
804+ #[ is( name = "name_expr" ) ]
754805 Name ( ExprName ) ,
806+ #[ is( name = "list_expr" ) ]
755807 List ( ExprList < U > ) ,
808+ #[ is( name = "tuple_expr" ) ]
756809 Tuple ( ExprTuple < U > ) ,
810+ #[ is( name = "slice_expr" ) ]
757811 Slice ( ExprSlice < U > ) ,
758812}
759813pub type Expr < U = ( ) > = Attributed < ExprKind < U > , U > ;
760814
761- #[ derive( Clone , Debug , PartialEq ) ]
815+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
762816pub enum ExprContext {
763817 Load ,
764818 Store ,
765819 Del ,
766820}
767821
768- #[ derive( Clone , Debug , PartialEq ) ]
822+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
769823pub enum Boolop {
770824 And ,
771825 Or ,
772826}
773827
774- #[ derive( Clone , Debug , PartialEq ) ]
828+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
775829pub enum Operator {
776830 Add ,
777831 Sub ,
@@ -788,15 +842,15 @@ pub enum Operator {
788842 FloorDiv ,
789843}
790844
791- #[ derive( Clone , Debug , PartialEq ) ]
845+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
792846pub enum Unaryop {
793847 Invert ,
794848 Not ,
795849 UAdd ,
796850 USub ,
797851}
798852
799- #[ derive( Clone , Debug , PartialEq ) ]
853+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
800854pub enum Cmpop {
801855 Eq ,
802856 NotEq ,
@@ -831,7 +885,7 @@ impl<U> From<ExcepthandlerExceptHandler<U>> for ExcepthandlerKind<U> {
831885 }
832886}
833887
834- #[ derive( Clone , Debug , PartialEq ) ]
888+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
835889pub enum ExcepthandlerKind < U = ( ) > {
836890 ExceptHandler ( ExcepthandlerExceptHandler < U > ) ,
837891}
@@ -977,7 +1031,7 @@ impl<U> From<PatternMatchOr<U>> for PatternKind<U> {
9771031 }
9781032}
9791033
980- #[ derive( Clone , Debug , PartialEq ) ]
1034+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
9811035pub enum PatternKind < U = ( ) > {
9821036 MatchValue ( PatternMatchValue < U > ) ,
9831037 MatchSingleton ( PatternMatchSingleton ) ,
@@ -1002,7 +1056,7 @@ impl From<TypeIgnoreTypeIgnore> for TypeIgnore {
10021056 }
10031057}
10041058
1005- #[ derive( Clone , Debug , PartialEq ) ]
1059+ #[ derive( Clone , Debug , PartialEq , is_macro :: Is ) ]
10061060pub enum TypeIgnore {
10071061 TypeIgnore ( TypeIgnoreTypeIgnore ) ,
10081062}
0 commit comments