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.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lisp/error.rs b/src/lisp/error.rs
index 53681d8..f905e6d 100644
--- a/src/lisp/error.rs
+++ b/src/lisp/error.rs
@@ -1,5 +1,5 @@
1use crate::lisp::{ 1use crate::lisp::{
2 expr::Arity, 2 expr::{Arity, LispExpr},
3 lex::{Span, SpanDisplay}, 3 lex::{Span, SpanDisplay},
4}; 4};
5 5
@@ -98,6 +98,7 @@ pub enum EvalError {
98 TypeMismatch, 98 TypeMismatch,
99 NoFileName, 99 NoFileName,
100 AccessEmptyList, 100 AccessEmptyList,
101 AssertionError { expected: LispExpr, got: LispExpr },
101 ScriptLoadError(io::Error), 102 ScriptLoadError(io::Error),
102 CustomInternal(&'static str), 103 CustomInternal(&'static str),
103 Custom(String), 104 Custom(String),
@@ -124,6 +125,9 @@ impl fmt::Display for EvalError {
124 Self::DivByZero => write!(f, "attempt to divide by zero"), 125 Self::DivByZero => write!(f, "attempt to divide by zero"),
125 Self::NoFileName => write!(f, "no file name specified"), 126 Self::NoFileName => write!(f, "no file name specified"),
126 Self::AccessEmptyList => write!(f, "attempted to access empty list"), 127 Self::AccessEmptyList => write!(f, "attempted to access empty list"),
128 Self::AssertionError { expected, got } => {
129 write!(f, "assertion error: expected `{}` got `{}`", expected, got)
130 }
127 Self::ScriptLoadError(s) => write!(f, "error while loading script: {}", s), 131 Self::ScriptLoadError(s) => write!(f, "error while loading script: {}", s),
128 Self::CustomInternal(s) => write!(f, "{}", s), 132 Self::CustomInternal(s) => write!(f, "{}", s),
129 Self::Custom(s) => write!(f, "error: {}", s), 133 Self::Custom(s) => write!(f, "error: {}", s),