swamp-compile

Crates.ioswamp-compile
lib.rsswamp-compile
version0.2.26
created_at2025-03-29 17:13:43.76961+00
updated_at2025-08-18 11:26:57.268983+00
descriptionMain driver for the Swamp compiler, orchestrating bootstrapping, dependency loading, parsing, and semantic analysis phases.
homepage
repositoryhttps://github.com/swamp/swamp
max_upload_size
id1611469
size52,702
Peter Bjorklund (piot)

documentation

README

Swamp Compile

The main orchestrator for the Swamp programming language compilation pipeline.

Overview

This crate ties together various stages of the Swamp compiler to transform source code into a fully analyzed program representation (swamp_semantic::Program). It manages the overall process, including setting up the environment, resolving dependencies, and invoking the semantic analyzer.

Key Responsibilities

  • Bootstrapping: Initializes the core library (swamp-core) and the default symbol table.
  • Source Map Setup: Creates and manages the SourceMap for tracking file locations.
  • Dependency Resolution & Parsing: Uses swamp-dep-loader to parse the main module and its dependencies, determining the correct analysis order.
  • Analysis Orchestration: Uses swamp-program-analyzer to drive the semantic analysis (swamp-analyzer) of all modules in the correct order.
  • Error Reporting: Integrates with swamp-error-report to display compilation errors with source context.
  • High-Level API: Provides functions like bootstrap_and_compile to run the entire pipeline.

Installation

This crate is typically used as the main entry point for compiling Swamp code, either as a library or within a command-line tool.

[dependencies]
swamp-compile = "0.2.26"
Commit count: 802

cargo fmt