This commit is contained in:
Shunsuke Shibayama 2022-11-28 00:21:44 +09:00
parent 217d55b476
commit df0fba34bd
2 changed files with 28 additions and 2 deletions

View file

@ -3450,6 +3450,10 @@ impl Expr {
matches!(self, Expr::Accessor(acc) if acc.is_const())
}
pub const fn is_definition(&self) -> bool {
matches!(self, Expr::Def(_) | Expr::ClassDef(_) | Expr::Methods(_))
}
pub fn need_to_be_closed(&self) -> bool {
matches!(
self,