Skip to main content

harn_vm/compiler/
error.rs

1/// Compile error.
2#[derive(Debug)]
3pub struct CompileError {
4    pub message: String,
5    pub line: u32,
6}
7
8impl std::fmt::Display for CompileError {
9    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10        write!(f, "Compile error at line {}: {}", self.line, self.message)
11    }
12}
13
14impl std::error::Error for CompileError {}