Skip to content

Commit

Permalink
fix(repl): add new line for last popped element to have proper inlini…
Browse files Browse the repository at this point in the history
…ng with print statements
  • Loading branch information
taizu-jin committed Sep 25, 2023
1 parent 7bc8620 commit a39fa09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()?;
Expand Down

0 comments on commit a39fa09

Please sign in to comment.