diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-13 16:21:59 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-14 19:49:06 +0100 |
| commit | 4a6643964278aa67f0dbaf1ce28eabf46e5785e5 (patch) | |
| tree | a303dcdfc2986dfd671c6a76ae3194f146dce03d /src/error.rs | |
| parent | 92f18d8f4278a6e6322c4162f78494762ba7cbb6 (diff) | |
| download | sylt-4a6643964278aa67f0dbaf1ce28eabf46e5785e5.tar.gz | |
Add functions
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs index abf8810..979ca07 100644 --- a/src/error.rs +++ b/src/error.rs @@ -6,7 +6,7 @@ use crate::tokenizer::Token; #[derive(Debug, Clone)] pub enum ErrorKind { TypeError(Op, Vec<Value>), - AssertFailed(Value, Value), + Assert, InvalidProgram, Unreachable, @@ -30,8 +30,8 @@ impl fmt::Display for ErrorKind { .fold(String::new(), |a, v| { format!("{}, {:?}", a, v) }); write!(f, "Cannot apply {:?} to values {}", op, values) } - ErrorKind::AssertFailed(a, b) => { - write!(f, "Assertion failed, {:?} != {:?}.", a, b) + ErrorKind::Assert => { + write!(f, "Assertion failed.") } ErrorKind::SyntaxError(line, token) => { write!(f, "Syntax error on line {} at token {:?}", line, token) |
