#[derive(Debug, thiserror::Error)]
#[error("Parse error at {location}: expected {expected}")]
pub struct ParseError {
pub location: String,
pub expected: String,
}
impl From<peg::error::ParseError<peg::str::LineCol>> for ParseError {
fn from(err: peg::error::ParseError<peg::str::LineCol>) -> Self {
ParseError {
location: format!("{}", err.location),
expected: format!("{}", err.expected),
}
}
}