(self, vm: &VirtualMachine, source_file: &SourceFile)
| 4 | // product |
| 5 | impl Node for ast::MatchCase { |
| 6 | fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef { |
| 7 | let Self { |
| 8 | node_index: _, |
| 9 | pattern, |
| 10 | guard, |
| 11 | body, |
| 12 | range: _, |
| 13 | } = self; |
| 14 | let node = NodeAst |
| 15 | .into_ref_with_type(vm, pyast::NodeMatchCase::static_type().to_owned()) |
| 16 | .unwrap(); |
| 17 | let dict = node.as_object().dict().unwrap(); |
| 18 | dict.set_item("pattern", pattern.ast_to_object(vm, source_file), vm) |
| 19 | .unwrap(); |
| 20 | dict.set_item("guard", guard.ast_to_object(vm, source_file), vm) |
| 21 | .unwrap(); |
| 22 | dict.set_item("body", body.ast_to_object(vm, source_file), vm) |
| 23 | .unwrap(); |
| 24 | node.into() |
| 25 | } |
| 26 | |
| 27 | fn ast_from_object( |
| 28 | vm: &VirtualMachine, |
nothing calls this directly
no test coverage detected