added simple history support

pull/5/head
ondra05 2022-02-14 00:17:55 +01:00
parent e37931111f
commit 41db71cb81
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ pub fn repl(ast_print: bool) {
match rl.readline(if partial.is_some() { ">> " } else { ":: " }) {
Ok(readline) => {
let readline = readline.trim_end();
rl.add_history_entry(readline);
let partial_data = match partial {
Some(line) => line + &readline,
None => readline.to_owned(),