marianoguerra/wap/lower does not have a README file

    Input

    pub(all) struct Input {
    module_ :
    Module

    source : ModuleSource
    }

    A module and where it came from: what lower_program compiles.

    Lowered

    A lowered module: Wax AST, plus whatever went wrong producing it.

    Lowered::diagnostics

    Problems found while lowering. Wax's own checker runs afterwards and adds its own.

    ModuleSource

    pub(all) struct ModuleSource {
    fname : String
    text : String
    src :
    SourceId

    }

    Where a module's text came from, so that a Wax type error found later can name the right file and line.

    A generator that built the AST rather than parsing it passes an empty text, and every node in that module gets a fresh synthetic location instead.

    lower_module

    fn lower_module(m :
    Module
    , text? : String, fname? : String, src? :
    SourceId
    ) -> Lowered

    Lower a wap module to Wax AST.

    text is the source the spans index into, so that a Wax type error lands on the wap line that caused it. A generator with no source passes "" and gets synthetic locations.

    lower_program

    fn lower_program(units : Array[Input]) -> Lowered

    Lower a whole program -- several wap modules -- into one Wax module.

    One wasm module comes out, with one flat namespace, because that is what wasm has. What the module system does is decide the names in it: a declaration in hashing is emitted as hashing__name, and a reference to it from elsewhere is written hashing.name.

    The modules must arrive in dependency order, which is what marianoguerra/wap/resolve produces.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io