diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 15:13:52 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-11 15:13:52 +0100 |
| commit | 3a488562804af56f5df47e887a884b80acaa0f81 (patch) | |
| tree | aa908c588e458734ba02d66168695098906859a6 /src/error.rs | |
| parent | b81e250fab7f54838a9b205e51a49bd5b932c618 (diff) | |
| download | sylt-3a488562804af56f5df47e887a884b80acaa0f81.tar.gz | |
Unreachable statement
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index d79a5fb..abf8810 100644 --- a/src/error.rs +++ b/src/error.rs @@ -8,6 +8,7 @@ pub enum ErrorKind { TypeError(Op, Vec<Value>), AssertFailed(Value, Value), InvalidProgram, + Unreachable, SyntaxError(usize, Token), } @@ -35,6 +36,9 @@ impl fmt::Display for ErrorKind { ErrorKind::SyntaxError(line, token) => { write!(f, "Syntax error on line {} at token {:?}", line, token) } + ErrorKind::Unreachable => { + write!(f, "Reached unreachable code.") + } ErrorKind::InvalidProgram => { write!(f, "[!!!] Invalid program") } |
