forked from AbleScript/ablescript
Added history (session based)
This commit is contained in:
parent
eb91aa96fa
commit
241f2261d1
|
@ -13,12 +13,14 @@ pub fn repl(ast_print: bool) {
|
||||||
// end of the string if stdin is connected to a file
|
// end of the string if stdin is connected to a file
|
||||||
// or unsupported terminal; this can interfere with
|
// or unsupported terminal; this can interfere with
|
||||||
// error printing.
|
// error printing.
|
||||||
|
rl.add_history_entry(&line);
|
||||||
let line = line.trim_end();
|
let line = line.trim_end();
|
||||||
|
|
||||||
if line == "exit" {
|
if line == "exit" {
|
||||||
println!("bye");
|
println!("bye");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut parser = Parser::new(&line);
|
let mut parser = Parser::new(&line);
|
||||||
let value = parser.init().and_then(|ast| {
|
let value = parser.init().and_then(|ast| {
|
||||||
if ast_print {
|
if ast_print {
|
||||||
|
|
Loading…
Reference in a new issue