lehit 0.2.0

Embeddable Lehit language frontend and Cranelift JIT runtime
Documentation
use crate::{core_lib::core_namespace, rust_lib::Script};

/// Canonical module path of the compiler primitive declarations.
pub const PRIMITIVE_MODULE_FILE_PATH: &str = concat!(core_namespace!(), "primitive.lt");

/// Single source of truth for primitive types and their trait implementations.
pub const PRIMITIVE_MODULE_FILE_CONTENT: &str = include_str!("primitive.lt");

/// Builds the primitive source module.
///
/// Primitive declarations intentionally live only in `primitive.lt`. Physical
/// layouts and compiler intrinsics are derived by the semantic/runtime layers;
/// duplicating them in `Script::types` previously allowed the two descriptions
/// to drift apart.
pub fn generate_primitive_module() -> Script {
    Script {
        content: PRIMITIVE_MODULE_FILE_CONTENT.to_owned(),
        ..Script::default()
    }
}