From 800701fb48c2e10a2ea297b737e03e3ac958b37d Mon Sep 17 00:00:00 2001 From: yilabs Date: Tue, 3 Oct 2023 12:55:36 -0400 Subject: [PATCH 1/2] fix build for DMD v2.102.2 --- source/orelang/operator/SystemOperator.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/orelang/operator/SystemOperator.d b/source/orelang/operator/SystemOperator.d index ae8a8dc..06cd48f 100644 --- a/source/orelang/operator/SystemOperator.d +++ b/source/orelang/operator/SystemOperator.d @@ -21,7 +21,7 @@ class SystemOperator : IOperator { auto pid = spawnProcess(args_strs);//execute(args_strs.join(" ")); return new Value(wait(pid)); - } catch { + } catch (Throwable) { return new Value(-1); } } From 1c0cee27be041888cd59f91aa778c6403966dc9e Mon Sep 17 00:00:00 2001 From: yilabs Date: Tue, 3 Oct 2023 12:55:58 -0400 Subject: [PATCH 2/2] handle Ctrl-D, and exit more nicely --- source/orelang/Interpreter.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/orelang/Interpreter.d b/source/orelang/Interpreter.d index 65af905..15ca7cd 100644 --- a/source/orelang/Interpreter.d +++ b/source/orelang/Interpreter.d @@ -71,7 +71,8 @@ class Interpreter { while (true) { string input = readln.chomp; - if (input == "exit" || input == "(exit)") { + if (stdin.eof() || input == "exit" || input == "(exit)") { // stdin.eof() for Ctrl-D + writeln("bye!"); // print newline, so do not mess up the screen break; }