about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-02-28T11·02+0200
committertazjin <mail@tazj.in>2021-02-28T11·14+0000
commitfd2139ce31a07b2abc56fdf7f15d4fcd1de46c81 (patch)
tree2ef7a5d5cdd45eb6e4f48864181f3b305540a14d /users/tazjin/rlox/src/bytecode
parent47c1a9a2804ebbc5acb83ab40ef75beb319f28e3 (diff)
chore(tazjin/rlox): Add stack printing when 'disassemble' is on r/2249
Change-Id: I71ae83101002f8fead3fa6cbd4cb229a2d6e3902
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2568
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/bytecode')
-rw-r--r--users/tazjin/rlox/src/bytecode/vm.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/vm.rs b/users/tazjin/rlox/src/bytecode/vm.rs
index 4ed0d25cf794..87c2aa440bf4 100644
--- a/users/tazjin/rlox/src/bytecode/vm.rs
+++ b/users/tazjin/rlox/src/bytecode/vm.rs
@@ -59,6 +59,9 @@ impl VM {
                 OpCode::OpMultiply => binary_op!(self, *),
                 OpCode::OpDivide => binary_op!(self, /),
             }
+
+            #[cfg(feature = "disassemble")]
+            println!("=> {:?}", self.stack);
         }
     }
 }