From 281fc9c6358d9bc198e94f8a5aaf5379a25135f4 Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 29 Jul 2021 22:48:36 +0200 Subject: [PATCH] Added history (session based) --- src/repl.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/repl.rs b/src/repl.rs index 29486c3..a8afae0 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -13,12 +13,14 @@ pub fn repl(ast_print: bool) { // end of the string if stdin is connected to a file // or unsupported terminal; this can interfere with // error printing. + rl.add_history_entry(&line); let line = line.trim_end(); if line == "exit" { println!("bye"); break; } + let mut parser = Parser::new(&line); let value = parser.init().and_then(|ast| { if ast_print {