about summary refs log blame commit diff
path: root/users/tazjin/rlox/src/errors.rs
blob: 46c739ef2f465ec53adbd66d764d23954ccedf0e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                   
#[derive(Debug)]
pub enum ErrorKind {
    UnexpectedChar(char),
}

#[derive(Debug)]
pub struct Error {
    pub line: usize,
    pub kind: ErrorKind,
}

pub fn report(loc: &str, err: &Error) {
    eprintln!("[line {}] Error {}: {:?}", err.line, loc, err.kind);
}