diff options
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/errors.rs')
-rw-r--r-- | users/tazjin/rlox/src/bytecode/errors.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/errors.rs b/users/tazjin/rlox/src/bytecode/errors.rs index 89ab1867a4e6..c7871bc384f2 100644 --- a/users/tazjin/rlox/src/bytecode/errors.rs +++ b/users/tazjin/rlox/src/bytecode/errors.rs @@ -1,3 +1,5 @@ +use std::fmt; + #[derive(Debug)] pub enum ErrorKind { // CompileError, @@ -10,4 +12,10 @@ 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>; |