mathic 0.2.0

A compiler with builtin support of symbolic operations, built with LLVM/MLIR
use std::num::ParseIntError;

use thiserror::Error;

#[derive(Debug, Error)]
pub enum CodegenError {
    #[error("Missing main function")]
    MissingMainFunction,

    #[error(transparent)]
    MeliorError(#[from] melior::Error),
    #[error("LLVM error: {0}")]
    LLVMError(String),
    #[error(transparent)]
    ParseIntError(#[from] ParseIntError),
    #[error("Couldn't not parse attribute")]
    ParseAttributeError,

    #[error("Invalid type index")]
    InvalidTypeIndex(usize),
    #[error("Invalid ADT index")]
    InvalidAdtIndex(usize),

    #[error("{0}")]
    Custom(String),

    #[error(transparent)]
    Io(#[from] std::io::Error),
}