From 62147f625e2a51a405c1c7ea5ca2ef4d96b8e7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 10 Mar 2021 18:02:16 +0100 Subject: rework run_file --- src/vm.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/vm.rs') diff --git a/src/vm.rs b/src/vm.rs index c5e2d68..792dc36 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -60,8 +60,8 @@ pub struct VM { constants: Vec, strings: Vec, - pub print_blocks: bool, - pub print_ops: bool, + pub print_bytecode: bool, + pub print_exec: bool, runtime: bool, @@ -89,8 +89,8 @@ impl VM { constants: Vec::new(), strings: Vec::new(), - print_blocks: false, - print_ops: false, + print_bytecode: false, + print_exec: false, runtime: false, extern_functions: Vec::new() @@ -437,7 +437,7 @@ impl VM { error!(self, ErrorKind::ArgumentCount(args.len(), num_args)); } - if self.print_blocks { + if self.print_bytecode { inner.debug_print(); } self.frames.push(Frame { @@ -525,13 +525,13 @@ impl VM { /// Simulates the program. pub fn run(&mut self) -> Result { - if self.print_blocks { + if self.print_bytecode { println!("\n [[{}]]\n", "RUNNING".red()); self.frame().block.borrow().debug_print(); } loop { - if self.print_ops { + if self.print_exec { self.print_stack() } @@ -835,7 +835,7 @@ impl VM { ip: 0 }); - if self.print_blocks { + if self.print_bytecode { println!("\n [[{} - {}]]\n", "TYPECHECKING".purple(), self.frame().block.borrow().name); self.frame().block.borrow().debug_print(); } @@ -847,7 +847,7 @@ impl VM { break; } - if self.print_ops { + if self.print_exec { self.print_stack() } -- cgit v1.2.1