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>.cjc (e.g., math/linalg.cjc)
  2. <root>/<path_joined_by_slash>/mod.cjc (e.g., math/linalg/mod.cjc)

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