Skip to main content

Module compile

Module compile 

Source
Expand description

LOGOS Compilation Pipeline for CLI

Re-exports the compilation API from logicaffeine_compile.

This module provides access to the core compilation functions without requiring a direct dependency on the compile crate. The key export is compile_project, which transforms LOGOS source into Rust code.

§Architecture

The compilation pipeline is implemented in the logicaffeine_compile crate. This module simply re-exports those types for convenience within the CLI.

§Example

use std::path::Path;
use logicaffeine_cli::compile::compile_project;

let rust_code = compile_project(Path::new("src/main.lg"))?;
println!("Generated {} bytes of Rust", rust_code.rust_code.len());

Structs§

CompileOutput
Full compilation output including generated Rust code and extracted dependencies.
CrateDependency
A declared external crate dependency from a ## Requires block.

Enums§

CompileError
Errors that can occur during the LOGOS compilation pipeline.

Functions§

compile_and_run
Compile and run a LOGOS program end-to-end.
compile_file
Compile a LOGOS source file. For single-file compilation without dependencies.
compile_program_full
Compile LOGOS source and return full output including dependency metadata.
compile_project
Compile a multi-file LOGOS project with dependency resolution.
compile_to_dir
Compile LOGOS source and write output to a directory as a Cargo project.
compile_to_rust
Compile LOGOS source to Rust source code.
compile_to_rust_checked
Compile LOGOS source to Rust with ownership checking enabled.
copy_runtime_crates
Copy the runtime crates to the output directory. Copies logicaffeine_data and logicaffeine_system.