diff options
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") + } } } } |
