(
&self,
source: &str,
mode: Mode,
module_name: String,
compiler: &dyn Compiler,
origin: F,
)
| 58 | |
| 59 | impl CompilationSource { |
| 60 | fn compile_string<D: core::fmt::Display, F: FnOnce() -> D>( |
| 61 | &self, |
| 62 | source: &str, |
| 63 | mode: Mode, |
| 64 | module_name: String, |
| 65 | compiler: &dyn Compiler, |
| 66 | origin: F, |
| 67 | ) -> Result<CodeObject, Diagnostic> { |
| 68 | compiler.compile(source, mode, module_name).map_err(|err| { |
| 69 | Diagnostic::spans_error( |
| 70 | self.span, |
| 71 | format!("Python compile error from {}: {}", origin(), err), |
| 72 | ) |
| 73 | }) |
| 74 | } |
| 75 | |
| 76 | fn compile( |
| 77 | &self, |
no test coverage detected