aboutsummaryrefslogtreecommitdiff
path: root/repl.d
diff options
context:
space:
mode:
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) {