MCPcopy Index your code
hub / github.com/RustPython/RustPython / compile

Method compile

crates/derive-impl/src/compile_bytecode.rs:76–93  ·  view source on GitHub ↗
(
        &self,
        mode: Mode,
        module_name: String,
        compiler: &dyn Compiler,
    )

Source from the content-addressed store, hash-verified

74 }
75
76 fn compile(
77 &self,
78 mode: Mode,
79 module_name: String,
80 compiler: &dyn Compiler,
81 ) -> Result<HashMap<String, CompiledModule>, Diagnostic> {
82 match &self.kind {
83 CompilationSourceKind::Dir { base, rel_path } => {
84 self.compile_dir(base, &base.join(rel_path), String::new(), mode, compiler)
85 }
86 _ => Ok(hashmap! {
87 module_name.clone() => CompiledModule {
88 code: self.compile_single(mode, module_name, compiler)?,
89 package: false,
90 },
91 }),
92 }
93 }
94
95 fn compile_single(
96 &self,

Callers 2

compile_stringMethod · 0.45
impl_py_freezeFunction · 0.45

Calls 3

newFunction · 0.85
compile_dirMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected