(self, vm: &VirtualMachine, source_file: &SourceFile)
| 5 | // sum |
| 6 | impl Node for ast::Stmt { |
| 7 | fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef { |
| 8 | match self { |
| 9 | Self::FunctionDef(cons) => cons.ast_to_object(vm, source_file), |
| 10 | Self::ClassDef(cons) => cons.ast_to_object(vm, source_file), |
| 11 | Self::Return(cons) => cons.ast_to_object(vm, source_file), |
| 12 | Self::Delete(cons) => cons.ast_to_object(vm, source_file), |
| 13 | Self::Assign(cons) => cons.ast_to_object(vm, source_file), |
| 14 | Self::TypeAlias(cons) => cons.ast_to_object(vm, source_file), |
| 15 | Self::AugAssign(cons) => cons.ast_to_object(vm, source_file), |
| 16 | Self::AnnAssign(cons) => cons.ast_to_object(vm, source_file), |
| 17 | Self::For(cons) => cons.ast_to_object(vm, source_file), |
| 18 | Self::While(cons) => cons.ast_to_object(vm, source_file), |
| 19 | Self::If(cons) => cons.ast_to_object(vm, source_file), |
| 20 | Self::With(cons) => cons.ast_to_object(vm, source_file), |
| 21 | Self::Match(cons) => cons.ast_to_object(vm, source_file), |
| 22 | Self::Raise(cons) => cons.ast_to_object(vm, source_file), |
| 23 | Self::Try(cons) => cons.ast_to_object(vm, source_file), |
| 24 | Self::Assert(cons) => cons.ast_to_object(vm, source_file), |
| 25 | Self::Import(cons) => cons.ast_to_object(vm, source_file), |
| 26 | Self::ImportFrom(cons) => cons.ast_to_object(vm, source_file), |
| 27 | Self::Global(cons) => cons.ast_to_object(vm, source_file), |
| 28 | Self::Nonlocal(cons) => cons.ast_to_object(vm, source_file), |
| 29 | Self::Expr(cons) => cons.ast_to_object(vm, source_file), |
| 30 | Self::Pass(cons) => cons.ast_to_object(vm, source_file), |
| 31 | Self::Break(cons) => cons.ast_to_object(vm, source_file), |
| 32 | Self::Continue(cons) => cons.ast_to_object(vm, source_file), |
| 33 | Self::IpyEscapeCommand(_) => { |
| 34 | unimplemented!("IPython escape command is not allowed in Python AST") |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | #[allow(clippy::if_same_then_else)] |
| 40 | fn ast_from_object( |
nothing calls this directly
no test coverage detected