From a81875b24b99ff59015e4a456c7e29f8027a8fcd Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Fri, 9 Aug 2019 16:08:36 +0200 Subject: [PATCH] REPL: checks if EOF Check if newline to not create empty println --- compiler/main.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/main.v b/compiler/main.v index 178697090e..2c26fe0655 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -1313,9 +1313,12 @@ fn run_repl() []string { continue } line = line.trim_space() - if line == '' || line == 'exit' { + if line.len == -1 || line == '' || line == 'exit' { break } + if line == '\n' { + continue + } // Save the source only if the user is printing something, // but don't add this print call to the `lines` array, // so that it doesn't get called during the next print.