()
| 205 | pub fn set_current_source_path(&mut self, path: Option<impl Into<PathBuf>>) { |
| 206 | self.current_source_path = path.map(Into::into); |
| 207 | } |
| 208 | |
| 209 | fn config_source_file(&self) -> Option<String> { |
| 210 | self.current_source_path |
| 211 | .as_ref() |
| 212 | .map(|p| p.to_string_lossy().into_owned()) |
| 213 | } |
| 214 | |
| 215 | /// Set the resolver mapping `import("name")` to that module's source (default: the |
| 216 | /// `PROGRAMS`-backed lookup). Pass `None` to disable import resolution entirely. |
| 217 | pub fn set_module_resolver(&mut self, resolver: Option<ModuleResolver>) { |
| 218 | self.module_resolver = resolver; |
| 219 | } |
| 220 | |
| 221 | /// Enable or disable per-module symbol mangling in `compile_program_closure` (default on). |
| 222 | pub fn set_module_mangling(&mut self, enabled: bool) { |
| 223 | self.mangle_in_closure = enabled; |
| 224 | } |
| 225 | |
| 226 | fn module_key(path: &str) -> &str { |
| 227 | path.trim_start_matches("./") |
| 228 | } |
| 229 | |
| 230 | // The mangling prefix: file stem for path imports, else the registry key, |
| 231 | // sanitized to an identifier. |
| 232 | fn module_prefix(key: &str, source_path: Option<&Path>) -> String { |
| 233 | let raw = source_path |
nothing calls this directly
no outgoing calls
no test coverage detected