From fd2139ce31a07b2abc56fdf7f15d4fcd1de46c81 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Feb 2021 13:02:16 +0200 Subject: chore(tazjin/rlox): Add stack printing when 'disassemble' is on Change-Id: I71ae83101002f8fead3fa6cbd4cb229a2d6e3902 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2568 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/rlox/src/bytecode/vm.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'users/tazjin') 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); } } } -- cgit 1.4.1