Skip to main content

resolve_file

Function resolve_file 

Source
pub fn resolve_file(
    root: &Path,
    import_path: &[String],
) -> Result<PathBuf, ModuleError>
Expand description

Resolve an import path to a source file, searching from the given root directory.

Search order:

  1. <root>/<path_joined_by_slash>.cjcl (e.g., math/linalg.cjcl)
  2. <root>/<path_joined_by_slash>/mod.cjcl (e.g., math/linalg/mod.cjcl)

Returns the absolute path if found, or ModuleError::FileNotFound.