about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/errors.rs
blob: c7871bc384f2bc875591331213f09f9b440ee6f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::fmt;

#[derive(Debug)]
pub enum ErrorKind {
    // CompileError,
    // RuntimeError,
    InternalError(&'static str),
}

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

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "[line NYI] Error: {:?}", self.kind)
    }
}

pub type LoxResult<T> = Result<T, Error>;