diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-01-30 12:10:49 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-01-30 12:10:49 +0100 |
| commit | e93e9e7ff4a73bc98a0dcd410eff87dffff3aa1c (patch) | |
| tree | 992024e5df64d7735618d2b0d0f85bbc313c6416 /src/error.rs | |
| parent | 674695d7e28f03218aa5a3facd933b87d508ea7d (diff) | |
| download | sylt-e93e9e7ff4a73bc98a0dcd410eff87dffff3aa1c.tar.gz | |
external functions proc macro
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 d8d4664..b489cd1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,7 @@ use crate::vm::{Op, Value}; #[derive(Debug, Clone)] pub enum ErrorKind { TypeError(Op, Vec<Type>), + ExternTypeMismatch(String, Vec<Type>), RuntimeTypeError(Op, Vec<Value>), Assert, InvalidProgram, @@ -36,6 +37,9 @@ impl fmt::Display for ErrorKind { .fold(String::new(), |a, v| { format!("{}{:?}, ", a, v) }); write!(f, "{} Cannot apply {:?} to types {}", "Type Error".bold(), op, types) } + ErrorKind::ExternTypeMismatch(name, types) => { + write!(f, "{} Extern function '{}' doesn't accept argument(s) with type(s) {:?}", "Type Error".bold(), name, types) + } ErrorKind::RuntimeTypeError(op, values) => { let values = values .iter() |
