use std::fmt;
use super::LineCol;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SyntaxError {
pub message: String,
pub at: LineCol,
pub offset: usize,
}
impl fmt::Display for SyntaxError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}: {}", self.at, self.message)
}
}
impl std::error::Error for SyntaxError {}