From f321905b1436e888c99b4863e3943f090cbadce1 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 17 Apr 2017 14:36:25 +0200 Subject: Add debug instruction for non-destructive printing of the whole stack --- source/primitives/core.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/primitives/core.d b/source/primitives/core.d index ce3eee2..971f495 100644 --- a/source/primitives/core.d +++ b/source/primitives/core.d @@ -31,6 +31,7 @@ bool handle(string word) { case "false" : nullary_op_value_bool(false); break; case "<" : binary_cond_lt; break; case "=" : binary_cond_eq; break; + case "#" : debug_print_stack; break; default : return false; } @@ -130,4 +131,8 @@ void binary_cond_eq() { stack.push(a == b); } +void debug_print_stack() { + writeln(stack[]); +} + } -- cgit v1.2.3