| 2 | use rustpython_compiler_core::SourceFile; |
| 3 | |
| 4 | pub(crate) trait Node: Sized { |
| 5 | fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef; |
| 6 | fn ast_from_object( |
| 7 | vm: &VirtualMachine, |
| 8 | source_file: &SourceFile, |
| 9 | object: PyObjectRef, |
| 10 | ) -> PyResult<Self>; |
| 11 | |
| 12 | /// Used in `Option::ast_from_object`; if `true`, that impl will return None. |
| 13 | fn is_none(&self) -> bool { |
| 14 | false |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | impl<T: Node> Node for Vec<T> { |
| 19 | fn ast_to_object(self, vm: &VirtualMachine, source_file: &SourceFile) -> PyObjectRef { |
no outgoing calls
no test coverage detected