use crate::model::{CompilerError, Program};

mod codegen;
mod instruction;
mod registers;
mod scope;

pub fn generate_code(ast: &Program, is_lib: bool) -> Result<String, CompilerError> {
    let mut codegen = codegen::CodeGenerator::new(ast.clone(), is_lib);
    codegen.generate()
}
