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

mod dsa;

pub fn compiler_backend(
    ext: &str,
    ast: &Program,
    is_lib: bool,
) -> Result<String, CompilerError> {
    match ext {
        "dsa" => Ok(dsa::generate_code(ast, is_lib)?),
        _ => Err(CompilerError::Generic(format!(
            "File type {} not supported",
            ext
        ))),
    }
}
