diff options
author | Akshay <[email protected]> | 2021-03-31 15:52:04 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-03-31 15:52:04 +0100 |
commit | 733a7df549aa7bb7a7bb727a25235f25db875ecd (patch) | |
tree | 72eb4709a548613591ba8e5ee26c1008d9e84098 /src/lisp/error.rs | |
parent | d1b33826bcc94e1feec4eb99f5781506223e3676 (diff) |
introduce basic canvas primitive functions
Diffstat (limited to 'src/lisp/error.rs')
-rw-r--r-- | src/lisp/error.rs | 3 |
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 @@ | |||
1 | use crate::lisp::{ | 1 | use 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 | ||
6 | use std::{fmt, io}; | 7 | use 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 | } |