aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-17 22:54:21 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-19 18:02:45 +0100
commit98001dd938b4fc176a7ce9b044415ca0b581cad7 (patch)
tree3c51edeb48f533bf29e533c3f9142a45ed2a6f95 /src
parent79f8e81b7b4d89231fcff207ff2c13e4c24cde56 (diff)
downloadsylt-98001dd938b4fc176a7ce9b044415ca0b581cad7.tar.gz
fix minor typos
Diffstat (limited to 'src')
-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()..];