aboutsummaryrefslogtreecommitdiff
path: root/repl.d
diff options
context:
space:
mode:
authorAdrian Kummerlaender2017-04-12 16:47:45 +0200
committerAdrian Kummerlaender2017-04-12 16:47:45 +0200
commit900c223ed40e36ffedce95e9a987d9a3c0309271 (patch)
tree36796ac25968a20a3d8b1d217392e59a25cc4f33 /repl.d
parent45e4fe29a237ae5cda4147c803046ff5f6793770 (diff)
downloadslang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar.gz
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar.bz2
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar.lz
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar.xz
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.tar.zst
slang-900c223ed40e36ffedce95e9a987d9a3c0309271.zip
Implementent conditional primitive
Diffstat (limited to 'repl.d')
-rw-r--r--repl.d9
1 files changed, 8 insertions, 1 deletions
diff --git a/repl.d b/repl.d
index 89c3104..4938a11 100644
--- a/repl.d
+++ b/repl.d
@@ -12,7 +12,14 @@ static import src.definition;
static import src.primitives;
void process(int x) {
- stack.push(x);
+ try {
+ if ( !src.primitives.evaluate(x) ) {
+ stack.push(x);
+ }
+ }
+ catch (Exception ex) {
+ writeln("Error: ", ex.msg);
+ }
}
void process(string word) {