aboutsummaryrefslogtreecommitdiffstats
path: root/src/vm.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-10 18:02:16 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-03-10 18:02:16 +0100
commit62147f625e2a51a405c1c7ea5ca2ef4d96b8e7f6 (patch)
tree7098a1f54e44603705c376fd24ec5c186738c4fe /src/vm.rs
parentf671ecc40626e9fbac452981a87636b6f00d7e15 (diff)
downloadsylt-62147f625e2a51a405c1c7ea5ca2ef4d96b8e7f6.tar.gz
rework run_file
Diffstat (limited to 'src/vm.rs')
-rw-r--r--src/vm.rs18
1 files changed, 9 insertions, 9 deletions
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<Value>,
strings: Vec<String>,
- 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<OpResult, Error> {
- 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()
}