marianoguerra/wap/resolve does not have a README file

    Loader

    pub(open) trait Loader {
    fn load(Self, String) -> String?
    }

    Where a module's source comes from.

    path is the dotted path as written -- import collections.hashing asks for "collections.hashing" -- and None means the loader does not have it. What that path denotes is entirely the loader's business: a directory layout, a zip entry, a database row, a literal map.

    ResolveError

    pub(all) suberror ResolveError {
    ResolveError(
    Report
    )
    }

    A resolution failure, as a ready-to-render report.

    ResolveError::report

    The report inside the error.

    MapLoader

    pub struct MapLoader {
    sources : Map[String, String]
    }

    A loader over sources already in memory.

    This is the one a test, a playground or a code generator wants, and it is also the proof that the resolver does not need a filesystem: nothing else in this package would change if it did.
    impl Loader for MapLoader

    MapLoader::add

    fn MapLoader::add(self : MapLoader, path : String, src : String) -> Unit

    Add or replace one module's source.

    MapLoader::new

    fn MapLoader::new(entries? : Array[(String, String)]) -> MapLoader

    A loader over the given (path, source) pairs.

    Program

    A whole program: every module it needs, in dependency order.

    Program::entry

    fn Program::entry(self : Program) -> String

    The entry module's name.

    Program::sources

    The source registry every diagnostic points into.

    Program::units

    The modules, dependencies first, ready for @lower.lower_program.

    resolve

    fn resolve(path : String, loader : &Loader) -> Program raise ResolveError

    Resolve a program by asking the loader for the entry module too.

    resolve_source

    fn resolve_source(path : String, src : String, loader : &Loader) -> Program raise ResolveError

    Resolve a program from source already in hand.

    The entry module is not asked of the loader -- a caller compiling a buffer has it already -- and everything it imports is.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io