From a39fa09147d558810cd643693934b8e1e37f321a Mon Sep 17 00:00:00 2001 From: taizu-jin Date: Mon, 25 Sep 2023 14:21:38 +0300 Subject: [PATCH] fix(repl): add new line for last popped element to have proper inlining with print statements --- src/repl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repl.rs b/src/repl.rs index 5faf4ec..03dc8c9 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -28,7 +28,7 @@ pub fn start() -> io::Result<()> { let program = parser.parse(); for error in parser.errors() { - write!(stderr, "{}", error)?; + writeln!(stderr, "{}", error)?; } let mut compiler = Compiler::with_state(constants, symbol_table); @@ -42,7 +42,7 @@ pub fn start() -> io::Result<()> { } let last_popped = vm.last_popped_stack_elem(); - writeln!(stdout, "{}", last_popped)?; + writeln!(stdout, "\n{}", last_popped)?; stderr.flush()?; stdout.flush()?;