aboutsummaryrefslogtreecommitdiffstats
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 4e2209e..337acab 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -12,14 +12,20 @@ use crate::tokenizer::Token;
#[derive(Debug, Clone)]
pub enum ErrorKind {
TypeError(Op, Vec<Type>),
+ TypeMismatch(Type, Type),
+ CannotInfer(Type, Type),
+ ArgumentType(Vec<Type>, Vec<Type>),
+ IndexError(Value, Type),
+
/// (External function, parameters)
ExternTypeMismatch(String, Vec<Type>),
ValueError(Op, Vec<Value>),
+ UnkownField(Value, String),
+ ArgumentCount(usize, usize),
/// (Indexed value, length, index)
IndexOutOfBounds(Value, usize, usize),
- /// Sanity checking errors
AssertFailed,
InvalidProgram,
Unreachable,
@@ -69,6 +75,9 @@ impl fmt::Display for ErrorKind {
ErrorKind::InvalidProgram => {
write!(f, "{}", "[!!] Invalid program [!!]".bold())
}
+ _ => {
+ write!(f, "{}", "[!!] UNHANDLED ERROR")
+ }
}
}
}