able-script/src/error.rs
Erin 3e2dc5fba9 Added function/variable parsing
- Added block support
- TODO: Tidy it up
2021-04-18 22:33:55 +02:00

20 lines
352 B
Rust

use std::ops::Range;
#[derive(Debug, Clone)]
pub struct Error {
pub kind: ErrorKind,
pub position: Range<usize>,
}
#[derive(Debug, Clone)]
pub enum ErrorKind {
SyntaxError,
}
impl Error {
pub fn panic(&self, span: &str) {
println!("{:?} occured at {:?}", self.kind, self.position);
println!(" {}", &span);
}
}