2023-07-22 03:48:05 +00:00
|
|
|
pub mod date;
|
2023-07-03 14:26:20 +00:00
|
|
|
pub mod go;
|
|
|
|
pub mod tree;
|
2023-06-22 14:04:52 +00:00
|
|
|
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
pub enum Warning {}
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Error)]
|
|
|
|
pub enum ParseError {
|
|
|
|
#[error("An unknown error was found")]
|
2023-06-23 13:46:05 +00:00
|
|
|
NomError(nom::error::Error<String>),
|
2023-06-22 14:04:52 +00:00
|
|
|
}
|
|
|
|
|
2023-06-23 03:58:16 +00:00
|
|
|
impl From<nom::error::Error<&str>> for ParseError {
|
2023-06-23 13:46:05 +00:00
|
|
|
fn from(err: nom::error::Error<&str>) -> Self {
|
|
|
|
Self::NomError(nom::error::Error {
|
|
|
|
input: err.input.to_owned(),
|
|
|
|
code: err.code.clone(),
|
|
|
|
})
|
2023-06-23 03:58:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-23 13:46:05 +00:00
|
|
|
/*
|
|
|
|
impl From<(&str, VerboseErrorKind)> for
|
|
|
|
|
|
|
|
impl From<nom::error::VerboseError<&str>> for ParseError {
|
|
|
|
fn from(err: nom::error::VerboseError<&str>) -> Self {
|
|
|
|
Self::NomErrors(
|
|
|
|
err.errors
|
|
|
|
.into_iter()
|
|
|
|
.map(|err| ParseError::from(err))
|
|
|
|
.collect(),
|
|
|
|
)
|
|
|
|
/*
|
|
|
|
Self::NomError(nom::error::Error {
|
|
|
|
input: err.input.to_owned(),
|
|
|
|
code: err.code.clone(),
|
|
|
|
})
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|