use Result;
use CodeGenerator;
use parse_source;
/// A convenience function to compile VibeLang source code directly into Rust code.
///
/// This function encapsulates the parsing (AST creation) and code generation steps.
///
/// # Arguments
/// * `source` - A string slice containing the VibeLang source code.
/// * `as_lib` - A boolean flag indicating whether to generate as a library crate (true) or binary crate (false).
///
/// # Returns
/// A `Result` containing the generated Rust code as a `String`, or an error if
/// parsing or code generation fails.