Upgrade RustPython (#5334)

This commit is contained in:
Micha Reiser 2023-06-23 22:39:47 +02:00 committed by GitHub
parent f45d1c2b84
commit 6ba9d5d5a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 265 additions and 271 deletions

View file

@ -17,83 +17,83 @@ pub trait AstNode: Ranged {
#[derive(Clone, Debug, is_macro::Is, PartialEq)]
pub enum AnyNode {
ModModule(ModModule<TextRange>),
ModInteractive(ModInteractive<TextRange>),
ModExpression(ModExpression<TextRange>),
ModFunctionType(ModFunctionType<TextRange>),
StmtFunctionDef(StmtFunctionDef<TextRange>),
StmtAsyncFunctionDef(StmtAsyncFunctionDef<TextRange>),
StmtClassDef(StmtClassDef<TextRange>),
StmtReturn(StmtReturn<TextRange>),
StmtDelete(StmtDelete<TextRange>),
StmtAssign(StmtAssign<TextRange>),
StmtAugAssign(StmtAugAssign<TextRange>),
StmtAnnAssign(StmtAnnAssign<TextRange>),
StmtFor(StmtFor<TextRange>),
StmtAsyncFor(StmtAsyncFor<TextRange>),
StmtWhile(StmtWhile<TextRange>),
StmtIf(StmtIf<TextRange>),
StmtWith(StmtWith<TextRange>),
StmtAsyncWith(StmtAsyncWith<TextRange>),
StmtMatch(StmtMatch<TextRange>),
StmtRaise(StmtRaise<TextRange>),
StmtTry(StmtTry<TextRange>),
StmtTryStar(StmtTryStar<TextRange>),
StmtAssert(StmtAssert<TextRange>),
StmtImport(StmtImport<TextRange>),
StmtImportFrom(StmtImportFrom<TextRange>),
StmtGlobal(StmtGlobal<TextRange>),
StmtNonlocal(StmtNonlocal<TextRange>),
StmtExpr(StmtExpr<TextRange>),
StmtPass(StmtPass<TextRange>),
StmtBreak(StmtBreak<TextRange>),
StmtContinue(StmtContinue<TextRange>),
ExprBoolOp(ExprBoolOp<TextRange>),
ExprNamedExpr(ExprNamedExpr<TextRange>),
ExprBinOp(ExprBinOp<TextRange>),
ExprUnaryOp(ExprUnaryOp<TextRange>),
ExprLambda(ExprLambda<TextRange>),
ExprIfExp(ExprIfExp<TextRange>),
ExprDict(ExprDict<TextRange>),
ExprSet(ExprSet<TextRange>),
ExprListComp(ExprListComp<TextRange>),
ExprSetComp(ExprSetComp<TextRange>),
ExprDictComp(ExprDictComp<TextRange>),
ExprGeneratorExp(ExprGeneratorExp<TextRange>),
ExprAwait(ExprAwait<TextRange>),
ExprYield(ExprYield<TextRange>),
ExprYieldFrom(ExprYieldFrom<TextRange>),
ExprCompare(ExprCompare<TextRange>),
ExprCall(ExprCall<TextRange>),
ExprFormattedValue(ExprFormattedValue<TextRange>),
ExprJoinedStr(ExprJoinedStr<TextRange>),
ExprConstant(ExprConstant<TextRange>),
ExprAttribute(ExprAttribute<TextRange>),
ExprSubscript(ExprSubscript<TextRange>),
ExprStarred(ExprStarred<TextRange>),
ExprName(ExprName<TextRange>),
ExprList(ExprList<TextRange>),
ExprTuple(ExprTuple<TextRange>),
ExprSlice(ExprSlice<TextRange>),
ExceptHandlerExceptHandler(ExceptHandlerExceptHandler<TextRange>),
PatternMatchValue(PatternMatchValue<TextRange>),
PatternMatchSingleton(PatternMatchSingleton<TextRange>),
PatternMatchSequence(PatternMatchSequence<TextRange>),
PatternMatchMapping(PatternMatchMapping<TextRange>),
PatternMatchClass(PatternMatchClass<TextRange>),
PatternMatchStar(PatternMatchStar<TextRange>),
PatternMatchAs(PatternMatchAs<TextRange>),
PatternMatchOr(PatternMatchOr<TextRange>),
TypeIgnoreTypeIgnore(TypeIgnoreTypeIgnore<TextRange>),
Comprehension(Comprehension<TextRange>),
Arguments(Arguments<TextRange>),
Arg(Arg<TextRange>),
ArgWithDefault(ArgWithDefault<TextRange>),
Keyword(Keyword<TextRange>),
Alias(Alias<TextRange>),
WithItem(WithItem<TextRange>),
MatchCase(MatchCase<TextRange>),
Decorator(Decorator<TextRange>),
ModModule(ModModule),
ModInteractive(ModInteractive),
ModExpression(ModExpression),
ModFunctionType(ModFunctionType),
StmtFunctionDef(StmtFunctionDef),
StmtAsyncFunctionDef(StmtAsyncFunctionDef),
StmtClassDef(StmtClassDef),
StmtReturn(StmtReturn),
StmtDelete(StmtDelete),
StmtAssign(StmtAssign),
StmtAugAssign(StmtAugAssign),
StmtAnnAssign(StmtAnnAssign),
StmtFor(StmtFor),
StmtAsyncFor(StmtAsyncFor),
StmtWhile(StmtWhile),
StmtIf(StmtIf),
StmtWith(StmtWith),
StmtAsyncWith(StmtAsyncWith),
StmtMatch(StmtMatch),
StmtRaise(StmtRaise),
StmtTry(StmtTry),
StmtTryStar(StmtTryStar),
StmtAssert(StmtAssert),
StmtImport(StmtImport),
StmtImportFrom(StmtImportFrom),
StmtGlobal(StmtGlobal),
StmtNonlocal(StmtNonlocal),
StmtExpr(StmtExpr),
StmtPass(StmtPass),
StmtBreak(StmtBreak),
StmtContinue(StmtContinue),
ExprBoolOp(ExprBoolOp),
ExprNamedExpr(ExprNamedExpr),
ExprBinOp(ExprBinOp),
ExprUnaryOp(ExprUnaryOp),
ExprLambda(ExprLambda),
ExprIfExp(ExprIfExp),
ExprDict(ExprDict),
ExprSet(ExprSet),
ExprListComp(ExprListComp),
ExprSetComp(ExprSetComp),
ExprDictComp(ExprDictComp),
ExprGeneratorExp(ExprGeneratorExp),
ExprAwait(ExprAwait),
ExprYield(ExprYield),
ExprYieldFrom(ExprYieldFrom),
ExprCompare(ExprCompare),
ExprCall(ExprCall),
ExprFormattedValue(ExprFormattedValue),
ExprJoinedStr(ExprJoinedStr),
ExprConstant(ExprConstant),
ExprAttribute(ExprAttribute),
ExprSubscript(ExprSubscript),
ExprStarred(ExprStarred),
ExprName(ExprName),
ExprList(ExprList),
ExprTuple(ExprTuple),
ExprSlice(ExprSlice),
ExceptHandlerExceptHandler(ExceptHandlerExceptHandler),
PatternMatchValue(PatternMatchValue),
PatternMatchSingleton(PatternMatchSingleton),
PatternMatchSequence(PatternMatchSequence),
PatternMatchMapping(PatternMatchMapping),
PatternMatchClass(PatternMatchClass),
PatternMatchStar(PatternMatchStar),
PatternMatchAs(PatternMatchAs),
PatternMatchOr(PatternMatchOr),
TypeIgnoreTypeIgnore(TypeIgnoreTypeIgnore),
Comprehension(Comprehension),
Arguments(Arguments),
Arg(Arg),
ArgWithDefault(ArgWithDefault),
Keyword(Keyword),
Alias(Alias),
WithItem(WithItem),
MatchCase(MatchCase),
Decorator(Decorator),
}
impl AnyNode {
@ -707,7 +707,7 @@ impl AnyNode {
}
}
impl AstNode for ModModule<TextRange> {
impl AstNode for ModModule {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -735,7 +735,7 @@ impl AstNode for ModModule<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ModInteractive<TextRange> {
impl AstNode for ModInteractive {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -763,7 +763,7 @@ impl AstNode for ModInteractive<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ModExpression<TextRange> {
impl AstNode for ModExpression {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -791,7 +791,7 @@ impl AstNode for ModExpression<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ModFunctionType<TextRange> {
impl AstNode for ModFunctionType {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -819,7 +819,7 @@ impl AstNode for ModFunctionType<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtFunctionDef<TextRange> {
impl AstNode for StmtFunctionDef {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -847,7 +847,7 @@ impl AstNode for StmtFunctionDef<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAsyncFunctionDef<TextRange> {
impl AstNode for StmtAsyncFunctionDef {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -875,7 +875,7 @@ impl AstNode for StmtAsyncFunctionDef<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtClassDef<TextRange> {
impl AstNode for StmtClassDef {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -903,7 +903,7 @@ impl AstNode for StmtClassDef<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtReturn<TextRange> {
impl AstNode for StmtReturn {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -931,7 +931,7 @@ impl AstNode for StmtReturn<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtDelete<TextRange> {
impl AstNode for StmtDelete {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -959,7 +959,7 @@ impl AstNode for StmtDelete<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAssign<TextRange> {
impl AstNode for StmtAssign {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -987,7 +987,7 @@ impl AstNode for StmtAssign<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAugAssign<TextRange> {
impl AstNode for StmtAugAssign {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1015,7 +1015,7 @@ impl AstNode for StmtAugAssign<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAnnAssign<TextRange> {
impl AstNode for StmtAnnAssign {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1043,7 +1043,7 @@ impl AstNode for StmtAnnAssign<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtFor<TextRange> {
impl AstNode for StmtFor {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1071,7 +1071,7 @@ impl AstNode for StmtFor<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAsyncFor<TextRange> {
impl AstNode for StmtAsyncFor {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1099,7 +1099,7 @@ impl AstNode for StmtAsyncFor<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtWhile<TextRange> {
impl AstNode for StmtWhile {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1127,7 +1127,7 @@ impl AstNode for StmtWhile<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtIf<TextRange> {
impl AstNode for StmtIf {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1155,7 +1155,7 @@ impl AstNode for StmtIf<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtWith<TextRange> {
impl AstNode for StmtWith {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1183,7 +1183,7 @@ impl AstNode for StmtWith<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAsyncWith<TextRange> {
impl AstNode for StmtAsyncWith {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1211,7 +1211,7 @@ impl AstNode for StmtAsyncWith<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtMatch<TextRange> {
impl AstNode for StmtMatch {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1239,7 +1239,7 @@ impl AstNode for StmtMatch<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtRaise<TextRange> {
impl AstNode for StmtRaise {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1267,7 +1267,7 @@ impl AstNode for StmtRaise<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtTry<TextRange> {
impl AstNode for StmtTry {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1295,7 +1295,7 @@ impl AstNode for StmtTry<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtTryStar<TextRange> {
impl AstNode for StmtTryStar {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1323,7 +1323,7 @@ impl AstNode for StmtTryStar<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtAssert<TextRange> {
impl AstNode for StmtAssert {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1351,7 +1351,7 @@ impl AstNode for StmtAssert<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtImport<TextRange> {
impl AstNode for StmtImport {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1379,7 +1379,7 @@ impl AstNode for StmtImport<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtImportFrom<TextRange> {
impl AstNode for StmtImportFrom {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1407,7 +1407,7 @@ impl AstNode for StmtImportFrom<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtGlobal<TextRange> {
impl AstNode for StmtGlobal {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1435,7 +1435,7 @@ impl AstNode for StmtGlobal<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtNonlocal<TextRange> {
impl AstNode for StmtNonlocal {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1463,7 +1463,7 @@ impl AstNode for StmtNonlocal<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtExpr<TextRange> {
impl AstNode for StmtExpr {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1491,7 +1491,7 @@ impl AstNode for StmtExpr<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtPass<TextRange> {
impl AstNode for StmtPass {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1519,7 +1519,7 @@ impl AstNode for StmtPass<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtBreak<TextRange> {
impl AstNode for StmtBreak {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1547,7 +1547,7 @@ impl AstNode for StmtBreak<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for StmtContinue<TextRange> {
impl AstNode for StmtContinue {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1575,7 +1575,7 @@ impl AstNode for StmtContinue<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprBoolOp<TextRange> {
impl AstNode for ExprBoolOp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1603,7 +1603,7 @@ impl AstNode for ExprBoolOp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprNamedExpr<TextRange> {
impl AstNode for ExprNamedExpr {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1631,7 +1631,7 @@ impl AstNode for ExprNamedExpr<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprBinOp<TextRange> {
impl AstNode for ExprBinOp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1659,7 +1659,7 @@ impl AstNode for ExprBinOp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprUnaryOp<TextRange> {
impl AstNode for ExprUnaryOp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1687,7 +1687,7 @@ impl AstNode for ExprUnaryOp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprLambda<TextRange> {
impl AstNode for ExprLambda {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1715,7 +1715,7 @@ impl AstNode for ExprLambda<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprIfExp<TextRange> {
impl AstNode for ExprIfExp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1743,7 +1743,7 @@ impl AstNode for ExprIfExp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprDict<TextRange> {
impl AstNode for ExprDict {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1771,7 +1771,7 @@ impl AstNode for ExprDict<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprSet<TextRange> {
impl AstNode for ExprSet {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1799,7 +1799,7 @@ impl AstNode for ExprSet<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprListComp<TextRange> {
impl AstNode for ExprListComp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1827,7 +1827,7 @@ impl AstNode for ExprListComp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprSetComp<TextRange> {
impl AstNode for ExprSetComp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1855,7 +1855,7 @@ impl AstNode for ExprSetComp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprDictComp<TextRange> {
impl AstNode for ExprDictComp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1883,7 +1883,7 @@ impl AstNode for ExprDictComp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprGeneratorExp<TextRange> {
impl AstNode for ExprGeneratorExp {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1911,7 +1911,7 @@ impl AstNode for ExprGeneratorExp<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprAwait<TextRange> {
impl AstNode for ExprAwait {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1939,7 +1939,7 @@ impl AstNode for ExprAwait<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprYield<TextRange> {
impl AstNode for ExprYield {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1967,7 +1967,7 @@ impl AstNode for ExprYield<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprYieldFrom<TextRange> {
impl AstNode for ExprYieldFrom {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -1995,7 +1995,7 @@ impl AstNode for ExprYieldFrom<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprCompare<TextRange> {
impl AstNode for ExprCompare {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2023,7 +2023,7 @@ impl AstNode for ExprCompare<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprCall<TextRange> {
impl AstNode for ExprCall {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2051,7 +2051,7 @@ impl AstNode for ExprCall<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprFormattedValue<TextRange> {
impl AstNode for ExprFormattedValue {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2079,7 +2079,7 @@ impl AstNode for ExprFormattedValue<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprJoinedStr<TextRange> {
impl AstNode for ExprJoinedStr {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2107,7 +2107,7 @@ impl AstNode for ExprJoinedStr<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprConstant<TextRange> {
impl AstNode for ExprConstant {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2135,7 +2135,7 @@ impl AstNode for ExprConstant<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprAttribute<TextRange> {
impl AstNode for ExprAttribute {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2163,7 +2163,7 @@ impl AstNode for ExprAttribute<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprSubscript<TextRange> {
impl AstNode for ExprSubscript {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2191,7 +2191,7 @@ impl AstNode for ExprSubscript<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprStarred<TextRange> {
impl AstNode for ExprStarred {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2219,7 +2219,7 @@ impl AstNode for ExprStarred<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprName<TextRange> {
impl AstNode for ExprName {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2247,7 +2247,7 @@ impl AstNode for ExprName<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprList<TextRange> {
impl AstNode for ExprList {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2275,7 +2275,7 @@ impl AstNode for ExprList<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprTuple<TextRange> {
impl AstNode for ExprTuple {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2303,7 +2303,7 @@ impl AstNode for ExprTuple<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExprSlice<TextRange> {
impl AstNode for ExprSlice {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2331,7 +2331,7 @@ impl AstNode for ExprSlice<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ExceptHandlerExceptHandler<TextRange> {
impl AstNode for ExceptHandlerExceptHandler {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2359,7 +2359,7 @@ impl AstNode for ExceptHandlerExceptHandler<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchValue<TextRange> {
impl AstNode for PatternMatchValue {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2387,7 +2387,7 @@ impl AstNode for PatternMatchValue<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchSingleton<TextRange> {
impl AstNode for PatternMatchSingleton {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2415,7 +2415,7 @@ impl AstNode for PatternMatchSingleton<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchSequence<TextRange> {
impl AstNode for PatternMatchSequence {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2443,7 +2443,7 @@ impl AstNode for PatternMatchSequence<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchMapping<TextRange> {
impl AstNode for PatternMatchMapping {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2471,7 +2471,7 @@ impl AstNode for PatternMatchMapping<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchClass<TextRange> {
impl AstNode for PatternMatchClass {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2499,7 +2499,7 @@ impl AstNode for PatternMatchClass<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchStar<TextRange> {
impl AstNode for PatternMatchStar {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2527,7 +2527,7 @@ impl AstNode for PatternMatchStar<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchAs<TextRange> {
impl AstNode for PatternMatchAs {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2555,7 +2555,7 @@ impl AstNode for PatternMatchAs<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for PatternMatchOr<TextRange> {
impl AstNode for PatternMatchOr {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2583,7 +2583,7 @@ impl AstNode for PatternMatchOr<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for TypeIgnoreTypeIgnore<TextRange> {
impl AstNode for TypeIgnoreTypeIgnore {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2612,7 +2612,7 @@ impl AstNode for TypeIgnoreTypeIgnore<TextRange> {
}
}
impl AstNode for Comprehension<TextRange> {
impl AstNode for Comprehension {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2640,7 +2640,7 @@ impl AstNode for Comprehension<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for Arguments<TextRange> {
impl AstNode for Arguments {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2668,7 +2668,7 @@ impl AstNode for Arguments<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for Arg<TextRange> {
impl AstNode for Arg {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2696,7 +2696,7 @@ impl AstNode for Arg<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for ArgWithDefault<TextRange> {
impl AstNode for ArgWithDefault {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2724,7 +2724,7 @@ impl AstNode for ArgWithDefault<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for Keyword<TextRange> {
impl AstNode for Keyword {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2752,7 +2752,7 @@ impl AstNode for Keyword<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for Alias<TextRange> {
impl AstNode for Alias {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2780,7 +2780,7 @@ impl AstNode for Alias<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for WithItem<TextRange> {
impl AstNode for WithItem {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2808,7 +2808,7 @@ impl AstNode for WithItem<TextRange> {
AnyNode::from(self)
}
}
impl AstNode for MatchCase<TextRange> {
impl AstNode for MatchCase {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -2837,7 +2837,7 @@ impl AstNode for MatchCase<TextRange> {
}
}
impl AstNode for Decorator<TextRange> {
impl AstNode for Decorator {
fn cast(kind: AnyNode) -> Option<Self>
where
Self: Sized,
@ -3516,83 +3516,83 @@ impl Ranged for AnyNode {
#[derive(Copy, Clone, Debug, is_macro::Is, PartialEq)]
pub enum AnyNodeRef<'a> {
ModModule(&'a ModModule<TextRange>),
ModInteractive(&'a ModInteractive<TextRange>),
ModExpression(&'a ModExpression<TextRange>),
ModFunctionType(&'a ModFunctionType<TextRange>),
StmtFunctionDef(&'a StmtFunctionDef<TextRange>),
StmtAsyncFunctionDef(&'a StmtAsyncFunctionDef<TextRange>),
StmtClassDef(&'a StmtClassDef<TextRange>),
StmtReturn(&'a StmtReturn<TextRange>),
StmtDelete(&'a StmtDelete<TextRange>),
StmtAssign(&'a StmtAssign<TextRange>),
StmtAugAssign(&'a StmtAugAssign<TextRange>),
StmtAnnAssign(&'a StmtAnnAssign<TextRange>),
StmtFor(&'a StmtFor<TextRange>),
StmtAsyncFor(&'a StmtAsyncFor<TextRange>),
StmtWhile(&'a StmtWhile<TextRange>),
StmtIf(&'a StmtIf<TextRange>),
StmtWith(&'a StmtWith<TextRange>),
StmtAsyncWith(&'a StmtAsyncWith<TextRange>),
StmtMatch(&'a StmtMatch<TextRange>),
StmtRaise(&'a StmtRaise<TextRange>),
StmtTry(&'a StmtTry<TextRange>),
StmtTryStar(&'a StmtTryStar<TextRange>),
StmtAssert(&'a StmtAssert<TextRange>),
StmtImport(&'a StmtImport<TextRange>),
StmtImportFrom(&'a StmtImportFrom<TextRange>),
StmtGlobal(&'a StmtGlobal<TextRange>),
StmtNonlocal(&'a StmtNonlocal<TextRange>),
StmtExpr(&'a StmtExpr<TextRange>),
StmtPass(&'a StmtPass<TextRange>),
StmtBreak(&'a StmtBreak<TextRange>),
StmtContinue(&'a StmtContinue<TextRange>),
ExprBoolOp(&'a ExprBoolOp<TextRange>),
ExprNamedExpr(&'a ExprNamedExpr<TextRange>),
ExprBinOp(&'a ExprBinOp<TextRange>),
ExprUnaryOp(&'a ExprUnaryOp<TextRange>),
ExprLambda(&'a ExprLambda<TextRange>),
ExprIfExp(&'a ExprIfExp<TextRange>),
ExprDict(&'a ExprDict<TextRange>),
ExprSet(&'a ExprSet<TextRange>),
ExprListComp(&'a ExprListComp<TextRange>),
ExprSetComp(&'a ExprSetComp<TextRange>),
ExprDictComp(&'a ExprDictComp<TextRange>),
ExprGeneratorExp(&'a ExprGeneratorExp<TextRange>),
ExprAwait(&'a ExprAwait<TextRange>),
ExprYield(&'a ExprYield<TextRange>),
ExprYieldFrom(&'a ExprYieldFrom<TextRange>),
ExprCompare(&'a ExprCompare<TextRange>),
ExprCall(&'a ExprCall<TextRange>),
ExprFormattedValue(&'a ExprFormattedValue<TextRange>),
ExprJoinedStr(&'a ExprJoinedStr<TextRange>),
ExprConstant(&'a ExprConstant<TextRange>),
ExprAttribute(&'a ExprAttribute<TextRange>),
ExprSubscript(&'a ExprSubscript<TextRange>),
ExprStarred(&'a ExprStarred<TextRange>),
ExprName(&'a ExprName<TextRange>),
ExprList(&'a ExprList<TextRange>),
ExprTuple(&'a ExprTuple<TextRange>),
ExprSlice(&'a ExprSlice<TextRange>),
ExceptHandlerExceptHandler(&'a ExceptHandlerExceptHandler<TextRange>),
PatternMatchValue(&'a PatternMatchValue<TextRange>),
PatternMatchSingleton(&'a PatternMatchSingleton<TextRange>),
PatternMatchSequence(&'a PatternMatchSequence<TextRange>),
PatternMatchMapping(&'a PatternMatchMapping<TextRange>),
PatternMatchClass(&'a PatternMatchClass<TextRange>),
PatternMatchStar(&'a PatternMatchStar<TextRange>),
PatternMatchAs(&'a PatternMatchAs<TextRange>),
PatternMatchOr(&'a PatternMatchOr<TextRange>),
TypeIgnoreTypeIgnore(&'a TypeIgnoreTypeIgnore<TextRange>),
Comprehension(&'a Comprehension<TextRange>),
Arguments(&'a Arguments<TextRange>),
Arg(&'a Arg<TextRange>),
ArgWithDefault(&'a ArgWithDefault<TextRange>),
Keyword(&'a Keyword<TextRange>),
Alias(&'a Alias<TextRange>),
WithItem(&'a WithItem<TextRange>),
MatchCase(&'a MatchCase<TextRange>),
Decorator(&'a Decorator<TextRange>),
ModModule(&'a ModModule),
ModInteractive(&'a ModInteractive),
ModExpression(&'a ModExpression),
ModFunctionType(&'a ModFunctionType),
StmtFunctionDef(&'a StmtFunctionDef),
StmtAsyncFunctionDef(&'a StmtAsyncFunctionDef),
StmtClassDef(&'a StmtClassDef),
StmtReturn(&'a StmtReturn),
StmtDelete(&'a StmtDelete),
StmtAssign(&'a StmtAssign),
StmtAugAssign(&'a StmtAugAssign),
StmtAnnAssign(&'a StmtAnnAssign),
StmtFor(&'a StmtFor),
StmtAsyncFor(&'a StmtAsyncFor),
StmtWhile(&'a StmtWhile),
StmtIf(&'a StmtIf),
StmtWith(&'a StmtWith),
StmtAsyncWith(&'a StmtAsyncWith),
StmtMatch(&'a StmtMatch),
StmtRaise(&'a StmtRaise),
StmtTry(&'a StmtTry),
StmtTryStar(&'a StmtTryStar),
StmtAssert(&'a StmtAssert),
StmtImport(&'a StmtImport),
StmtImportFrom(&'a StmtImportFrom),
StmtGlobal(&'a StmtGlobal),
StmtNonlocal(&'a StmtNonlocal),
StmtExpr(&'a StmtExpr),
StmtPass(&'a StmtPass),
StmtBreak(&'a StmtBreak),
StmtContinue(&'a StmtContinue),
ExprBoolOp(&'a ExprBoolOp),
ExprNamedExpr(&'a ExprNamedExpr),
ExprBinOp(&'a ExprBinOp),
ExprUnaryOp(&'a ExprUnaryOp),
ExprLambda(&'a ExprLambda),
ExprIfExp(&'a ExprIfExp),
ExprDict(&'a ExprDict),
ExprSet(&'a ExprSet),
ExprListComp(&'a ExprListComp),
ExprSetComp(&'a ExprSetComp),
ExprDictComp(&'a ExprDictComp),
ExprGeneratorExp(&'a ExprGeneratorExp),
ExprAwait(&'a ExprAwait),
ExprYield(&'a ExprYield),
ExprYieldFrom(&'a ExprYieldFrom),
ExprCompare(&'a ExprCompare),
ExprCall(&'a ExprCall),
ExprFormattedValue(&'a ExprFormattedValue),
ExprJoinedStr(&'a ExprJoinedStr),
ExprConstant(&'a ExprConstant),
ExprAttribute(&'a ExprAttribute),
ExprSubscript(&'a ExprSubscript),
ExprStarred(&'a ExprStarred),
ExprName(&'a ExprName),
ExprList(&'a ExprList),
ExprTuple(&'a ExprTuple),
ExprSlice(&'a ExprSlice),
ExceptHandlerExceptHandler(&'a ExceptHandlerExceptHandler),
PatternMatchValue(&'a PatternMatchValue),
PatternMatchSingleton(&'a PatternMatchSingleton),
PatternMatchSequence(&'a PatternMatchSequence),
PatternMatchMapping(&'a PatternMatchMapping),
PatternMatchClass(&'a PatternMatchClass),
PatternMatchStar(&'a PatternMatchStar),
PatternMatchAs(&'a PatternMatchAs),
PatternMatchOr(&'a PatternMatchOr),
TypeIgnoreTypeIgnore(&'a TypeIgnoreTypeIgnore),
Comprehension(&'a Comprehension),
Arguments(&'a Arguments),
Arg(&'a Arg),
ArgWithDefault(&'a ArgWithDefault),
Keyword(&'a Keyword),
Alias(&'a Alias),
WithItem(&'a WithItem),
MatchCase(&'a MatchCase),
Decorator(&'a Decorator),
}
impl AnyNodeRef<'_> {