Added history (session based)

pull/37/head
ondra05 2021-07-29 22:48:36 +02:00
parent c66e449d71
commit 837d78ea1b
1 changed files with 2 additions and 0 deletions

View File

@ -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 {