Delete is_node_with_body method (#9643)

This commit is contained in:
Micha Reiser 2024-01-25 15:41:13 +01:00 committed by GitHub
parent ffd13e65ae
commit 5fe0fdd0a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5968,22 +5968,6 @@ impl<'a> AnyNodeRef<'a> {
}
}
pub const fn is_node_with_body(self) -> bool {
matches!(
self,
AnyNodeRef::StmtIf(_)
| AnyNodeRef::StmtFor(_)
| AnyNodeRef::StmtWhile(_)
| AnyNodeRef::StmtWith(_)
| AnyNodeRef::StmtMatch(_)
| AnyNodeRef::StmtFunctionDef(_)
| AnyNodeRef::StmtClassDef(_)
| AnyNodeRef::StmtTry(_)
| AnyNodeRef::ExceptHandlerExceptHandler(_)
| AnyNodeRef::ElifElseClause(_)
)
}
/// In our AST, only some alternative branches are represented as a node. This has historical
/// reasons, e.g. we added a node for elif/else in if statements which was not originally
/// present in the parser.