diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 14:51:55 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 14:51:55 +0100 |
| commit | cf9ad28eb0a62c2c89f2f679157a54eded97c1cf (patch) | |
| tree | 3aec0cbf020c0e6e55f066269326d2613aed58a0 /src/error.rs | |
| parent | 6c631112c5dc05f861100471d97023dddaa17283 (diff) | |
| download | sylt-cf9ad28eb0a62c2c89f2f679157a54eded97c1cf.tar.gz | |
If-statements
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 22e0d1a..d79a5fb 100644 --- a/src/error.rs +++ b/src/error.rs @@ -7,6 +7,8 @@ use crate::tokenizer::Token; pub enum ErrorKind { TypeError(Op, Vec<Value>), AssertFailed(Value, Value), + InvalidProgram, + SyntaxError(usize, Token), } @@ -33,6 +35,9 @@ impl fmt::Display for ErrorKind { ErrorKind::SyntaxError(line, token) => { write!(f, "Syntax error on line {} at token {:?}", line, token) } + ErrorKind::InvalidProgram => { + write!(f, "[!!!] Invalid program") + } } } } |
