use crate::parser::error::{Error, InternalError};
pub(crate) type InternalLexError<'a> = InternalError<super::LexInput<'a>, LexErrorKind>;
pub type LexError = Error<LexErrorKind>;
#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum LexErrorKind {
#[error("expected {0:?}")]
ExpectedString(&'static str),
#[error("expected {0:?} (case-insensitive)")]
ExpectedCaseInsensitiveString(&'static str),
#[error("expected {0}")]
ExpectedContext(&'static str),
#[error("expected character: '{0}'")]
ExpectedChar(char),
#[error("unexpected EOF while parsing")]
UnexpectedEOF,
#[error("malformed number literal: {0}")]
BadNumber(#[from] lexical::Error),
}