aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/error.rs6
-rw-r--r--src/vm.rs6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/error.rs b/src/error.rs
index b42db3f..b897c80 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -64,7 +64,7 @@ impl fmt::Display for ErrorKind {
let given = b
.iter()
.fold(String::new(), |a, v| { format!("{}{:?}, ", a, v) });
- write!(f, "Argument types don't match, expected [{:?}] but got [{:?}]",
+ write!(f, "Argument types do not match, expected [{:?}] but got [{:?}]",
expected, given)
}
ErrorKind::IndexOutOfBounds(value, len, slot) => {
@@ -85,10 +85,10 @@ impl fmt::Display for ErrorKind {
write!(f, "Assertion failed")
}
ErrorKind::SyntaxError(line, token) => {
- write!(f, "{} on line {} at token {:?}", "Syntax Error".bold(), line, token)
+ write!(f, "Syntax Error on line {} at token {:?}", line, token)
}
ErrorKind::Unreachable => {
- write!(f, "{}", "Unreachable".bold())
+ write!(f, "Reached unreachable code.")
}
ErrorKind::InvalidProgram => {
write!(f, "{}", "[!!] Invalid program [!!]".bold())
diff --git a/src/vm.rs b/src/vm.rs
index 791bebe..a5b4af6 100644
--- a/src/vm.rs
+++ b/src/vm.rs
@@ -432,7 +432,7 @@ impl VM {
let inner = block.borrow();
let args = inner.args();
if args.len() != num_args {
- error!(self, ErrorKind::ArgumentCount(num_args, args.len()));
+ error!(self, ErrorKind::ArgumentCount(args.len(), num_args));
}
if self.print_blocks {
@@ -646,7 +646,7 @@ impl VM {
let ret = inner.ret();
if Type::from(&a) != *ret {
error!(self, ErrorKind::TypeMismatch(a.into(), ret.clone()),
- "Value match return type.");
+ "Value does not match return type.");
}
}
@@ -701,7 +701,7 @@ impl VM {
let inner = block.borrow();
let args = inner.args();
if args.len() != num_args {
- error!(self, ErrorKind::ArgumentCount(num_args, args.len()));
+ error!(self, ErrorKind::ArgumentCount(args.len(), num_args));
}
let stack_args = &self.stack[self.stack.len() - args.len()..];