use thiserror::Error;

use crate::ast::err::ParseError;

#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum LexingError {
    #[error("invalid int literal")]
    InvalidIntLiteral,
    #[error("invalid ident")]
    InvalidIdent,
    #[error("comment unterminated")]
    UnterminatedComment,
    #[error("unrecognized token: {0}")]
    UnrecognizedToken(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum FrontendError {
    #[error(transparent)]
    Lexing(#[from] LexingError),
    #[error(transparent)]
    Parse(#[from] ParseError),
}
