aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs4
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")
}