diff options
| -rw-r--r-- | src/compiler.rs | 3 | ||||
| -rw-r--r-- | src/lib.rs | 6 | ||||
| -rw-r--r-- | src/vm.rs | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index 9ab868f..e83c269 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -596,8 +596,7 @@ impl Compiler { /// The line of the current token. fn line(&self) -> usize { if self.section().tokens.len() == 0 { - // unreachable!("An error occured without a section."); - 666666 + 0 } else { self.section().tokens[std::cmp::min(self.current_token, self.section().tokens.len() - 1)].1 } @@ -877,11 +877,11 @@ impl Block { for (i, s) in self.ops.iter().enumerate() { println!("{}{}", if self.line_offsets.contains_key(&i) { - format!("{:5} ", self.line_offsets[&i].red()) + format!("{:5} ", self.line_offsets[&i].blue()) } else { - format!(" {} ", "|".red()) + format!(" {} ", "|".blue()) }, - format!("{:05} {:?}", i.blue(), s) + format!("{:05} {:?}", i.red(), s) ); } println!(); @@ -498,8 +498,8 @@ impl VM { println!("]"); println!("{:5} {:05} {:?}", - self.frame().block.borrow().line(self.frame().ip).red(), - self.frame().ip.blue(), + self.frame().block.borrow().line(self.frame().ip).blue(), + self.frame().ip.red(), self.frame().block.borrow().ops[self.frame().ip]); } |
