#[allow(clippy::module_inception)]
mod error;
mod input;
mod internal;
mod kind;
use super::lexer::{Command, Token};
pub use error::Error;
pub(crate) use input::ErrorInput;
pub use internal::GenericParseError;
pub(crate) use internal::InternalError;
pub use kind::ErrorKind;
pub(crate) type InternalParseError<'a> = InternalError<super::ParserInput<'a>, ParserErrorKind>;
pub type ParseError = Error<ParserErrorKind>;
#[allow(dead_code)]
#[derive(Debug, thiserror::Error, PartialEq)]
pub enum ParserErrorKind {
#[error("expected {0}, found EOF")]
UnexpectedEOF(&'static str),
#[error("expected {expected}, found {actual:?}")]
ExpectedToken { actual: Token, expected: String },
#[error("failed to parse arguments for {command}")]
InvalidCommand { command: Command },
#[error("expected a command or a gate")]
NotACommandOrGate,
#[error("reached end of input")]
EndOfInput,
#[error("instruction {0} is not yet supported by this parser")]
UnsupportedInstruction(Command),
#[error("using this literal will result in loss of precision")]
UnsupportedPrecision,
}