(
vm: &VirtualMachine,
source_file: &SourceFile,
object: PyObjectRef,
)
| 25 | } |
| 26 | |
| 27 | fn ast_from_object( |
| 28 | vm: &VirtualMachine, |
| 29 | source_file: &SourceFile, |
| 30 | object: PyObjectRef, |
| 31 | ) -> PyResult<Self> { |
| 32 | Ok(Self { |
| 33 | node_index: Default::default(), |
| 34 | pattern: Node::ast_from_object( |
| 35 | vm, |
| 36 | source_file, |
| 37 | get_node_field(vm, &object, "pattern", "match_case")?, |
| 38 | )?, |
| 39 | guard: get_node_field_opt(vm, &object, "guard")? |
| 40 | .map(|obj| Node::ast_from_object(vm, source_file, obj)) |
| 41 | .transpose()?, |
| 42 | body: Node::ast_from_object( |
| 43 | vm, |
| 44 | source_file, |
| 45 | get_node_field(vm, &object, "body", "match_case")?, |
| 46 | )?, |
| 47 | range: Default::default(), |
| 48 | }) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // sum |
nothing calls this directly
no test coverage detected