Add Expr::Dummy

This commit is contained in:
Shunsuke Shibayama 2022-12-11 18:28:20 +09:00
parent 3841b9f676
commit e1c8bb415b
9 changed files with 34 additions and 9 deletions

View file

@ -3527,11 +3527,13 @@ pub enum Expr {
ClassDef(ClassDef),
PatchDef(PatchDef),
AttrDef(AttrDef),
/// for mapping to Python AST
Dummy(Block),
}
impl_nested_display_for_chunk_enum!(Expr; Lit, Accessor, Array, Tuple, Dict, Set, Record, BinOp, UnaryOp, Call, DataPack, Lambda, TypeAsc, Def, Methods, ClassDef, PatchDef, AttrDef);
impl_nested_display_for_chunk_enum!(Expr; Lit, Accessor, Array, Tuple, Dict, Set, Record, BinOp, UnaryOp, Call, DataPack, Lambda, TypeAsc, Def, Methods, ClassDef, PatchDef, AttrDef, Dummy);
impl_display_from_nested!(Expr);
impl_locational_for_enum!(Expr; Lit, Accessor, Array, Tuple, Dict, Set, Record, BinOp, UnaryOp, Call, DataPack, Lambda, TypeAsc, Def, Methods, ClassDef, PatchDef, AttrDef);
impl_locational_for_enum!(Expr; Lit, Accessor, Array, Tuple, Dict, Set, Record, BinOp, UnaryOp, Call, DataPack, Lambda, TypeAsc, Def, Methods, ClassDef, PatchDef, AttrDef, Dummy);
impl Expr {
pub fn is_match_call(&self) -> bool {