diff options
author | Vincent Ambo <mail@tazj.in> | 2021-02-28T11·02+0200 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-02-28T11·14+0000 |
commit | fd2139ce31a07b2abc56fdf7f15d4fcd1de46c81 (patch) | |
tree | 2ef7a5d5cdd45eb6e4f48864181f3b305540a14d /users/tazjin | |
parent | 47c1a9a2804ebbc5acb83ab40ef75beb319f28e3 (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')
-rw-r--r-- | users/tazjin/rlox/src/bytecode/vm.rs | 3 |
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); } } } |