Skip to content

Commit 473c265

Browse files
author
Tadeusz Sośnierz
committed
Quit REPL and print a newline on ^D
This also works in Rakudo/nom, which makes RT #70297 fixed in nom.
1 parent f338bd8 commit 473c265

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/HLL/Compiler.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ class HLL::Compiler {
166166
my $code := $stdin.readline_interactive(~$prompt);
167167

168168
last if pir::isnull($code);
169+
unless pir::defined($code) {
170+
pir::print("\n");
171+
last;
172+
}
169173

170174
# Set the current position of stdout for autoprinting control
171175
my $*AUTOPRINTPOS := (pir::getinterp__P()).stdout_handle().tell();

0 commit comments

Comments
 (0)