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