Sign in

    wac

    WAC language tooling for MoonBit

    webassembly
    wac
    parser
    ast
    cst
    Download zip
    Author
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    5 days ago
    Downloads
    32

    No dependencies

    #moonrockz/wac

    WAC language tooling for MoonBit.

    Source positions, structured diagnostics, a lossless scanner, typed immutable ASTs/CSTs and a recovering parser, immutable traversal, rewrites, canonical printing and comment-preserving formatting are implemented. Install with moon add moonrockz/wac@0.1.0.

    #Scope

    Package/targets directives, WIT-style definitions supported by the WAC reference, imports, let bindings, instantiations, access expressions, spread arguments and exports.

    Syntax parsing is separate from semantic resolution. Cross-file/package loading, name resolution, registry access and composition evaluation belong in later semantic tooling. The syntax parser must not perform I/O.

    #Packages

    PackageResponsibility
    spanSource text, positions and documented Unicode offset units
    diagnosticStable codes, severity, source labels and recovery details
    scannerLossless tokens, comments and whitespace
    astImmutable typed nodes and child collections
    cstImmutable lossless concrete structure, including malformed input
    parserRecovering source-to-AST/CST parsing with diagnostics
    traversalExplicit-stack walks, folds, reductions, events, cursors and immutable rewrites
    printerStack-safe canonical AST-to-source emission
    formatterStack-safe CST formatting that preserves comments and meaning

    #Validation

    • Upstream valid and invalid fixtures pinned to the reference linked in the root README.
    • Exact scanner/CST reconstruction, including Unicode, comments and malformed text.
    • Diagnostic recovery, progress through arbitrary input and no-panic properties.
    • Deep types, groups and instantiations on every target.

    Traversal tests cover canonical event order, prune/stop, cursors, immutable rewrites and all 46 node kinds. Printer round trips and formatter idempotence/token-preservation laws cover all corpus files and deep WAC composition expressions. The parser profile documents the pinned corpus and WIT grammar differences.

    See root Beads epic wasm-devkit-p5m for implementation work.

    version

    fn version() -> String

    Development version, maintained from the workspace root by scripts/versions.mbtx.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io