aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2017-04-17 14:36:25 +0200
committerAdrian Kummerlaender2017-04-17 14:36:45 +0200
commitf321905b1436e888c99b4863e3943f090cbadce1 (patch)
tree1d46aa8d1653fc00385693824df14196ff35ee80
parentdda2af16ce4ea439ee90390526dbd7f2b8971128 (diff)
downloadslang-f321905b1436e888c99b4863e3943f090cbadce1.tar
slang-f321905b1436e888c99b4863e3943f090cbadce1.tar.gz
slang-f321905b1436e888c99b4863e3943f090cbadce1.tar.bz2
slang-f321905b1436e888c99b4863e3943f090cbadce1.tar.lz
slang-f321905b1436e888c99b4863e3943f090cbadce1.tar.xz
slang-f321905b1436e888c99b4863e3943f090cbadce1.tar.zst
slang-f321905b1436e888c99b4863e3943f090cbadce1.zip
Add debug instruction for non-destructive printing of the whole stack
-rw-r--r--source/primitives/core.d5
1 files changed, 5 insertions, 0 deletions
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[]);
+}
+
}