aboutsummaryrefslogtreecommitdiff
path: root/src/lisp/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp/error.rs')
-rw-r--r--src/lisp/error.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lisp/error.rs b/src/lisp/error.rs
index 9e9dc90..7bde872 100644
--- a/src/lisp/error.rs
+++ b/src/lisp/error.rs
@@ -1,7 +1,10 @@
1use crate::lisp::{ 1use crate::{
2 expr::{Arity, LispExpr}, 2 keybind::KeybindError,
3 lex::{Span, SpanDisplay}, 3 lisp::{
4 number::LispNumber, 4 expr::{Arity, LispExpr},
5 lex::{Span, SpanDisplay},
6 number::LispNumber,
7 },
5}; 8};
6 9
7use std::{fmt, io}; 10use std::{fmt, io};
@@ -104,6 +107,7 @@ pub enum EvalError {
104 AssertionError { expected: LispExpr, got: LispExpr }, 107 AssertionError { expected: LispExpr, got: LispExpr },
105 ScriptLoadError(io::Error), 108 ScriptLoadError(io::Error),
106 CustomInternal(&'static str), 109 CustomInternal(&'static str),
110 KeybindError(KeybindError),
107 Custom(String), 111 Custom(String),
108} 112}
109 113
@@ -134,6 +138,7 @@ impl fmt::Display for EvalError {
134 write!(f, "assertion error: expected `{}` got `{}`", expected, got) 138 write!(f, "assertion error: expected `{}` got `{}`", expected, got)
135 } 139 }
136 Self::ScriptLoadError(s) => write!(f, "error while loading script: {}", s), 140 Self::ScriptLoadError(s) => write!(f, "error while loading script: {}", s),
141 Self::KeybindError(k) => write!(f, "keybind error: {}", k),
137 Self::CustomInternal(s) => write!(f, "{}", s), 142 Self::CustomInternal(s) => write!(f, "{}", s),
138 Self::Custom(s) => write!(f, "error: {}", s), 143 Self::Custom(s) => write!(f, "error: {}", s),
139 } 144 }