diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-18 20:44:38 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-01-18 21:44:31 +0100 |
| commit | 7a521528e6821adcece06c857243bf3648ead3ba (patch) | |
| tree | 5041c7041af7f77be9ce1b483296b5d680ecc279 | |
| parent | 7573917c9c14e53f6e45805aa5b59bfa20d16fa2 (diff) | |
| download | sylt-7a521528e6821adcece06c857243bf3648ead3ba.tar.gz | |
Fix errors
| -rw-r--r-- | src/lib.rs | 2 | ||||
| -rw-r--r-- | src/vm.rs | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -41,7 +41,7 @@ mod tests { #[macro_export] macro_rules! assert_errs { ($result:expr, [ $( $kind:pat ),* ]) => { - println!("{} => {:?}", stringify!($result), $result); + eprintln!("{} => {:?}", stringify!($result), $result); assert!(matches!( $result.unwrap_err().as_slice(), &[$($crate::error::Error { @@ -527,6 +527,8 @@ impl VM { fn check_op(&mut self, op: Op) -> Result<(), Error> { match op { + Op::Unreachable => {} + Op::Jmp(_line) => {} Op::Return => { @@ -679,7 +681,7 @@ mod tests { test_string!(wrong_params, " f : fn -> int = fn a: int -> int {}", - [ErrorKind::TypeError(_, _)]); + [ErrorKind::TypeError(_, _), ErrorKind::TypeError(_, _)]); test_string!(wrong_ret, " f : fn -> int = fn {}", |
