aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs2
-rw-r--r--src/vm.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 170bb5d..971e42c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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 {
diff --git a/src/vm.rs b/src/vm.rs
index c9a1dd5..3041628 100644
--- a/src/vm.rs
+++ b/src/vm.rs
@@ -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 {}",