fix(repl): history

This commit is contained in:
2025-05-11 12:55:56 +08:00
parent be0c416c13
commit 07b486848f

View File

@@ -26,12 +26,12 @@ fn main() -> Result<()> {
if expr.trim().is_empty() { if expr.trim().is_empty() {
continue; continue;
} }
rl.add_history_entry(expr.as_str())?;
let downgraded = unwrap!(downgrade( let downgraded = unwrap!(downgrade(
rnix::Root::parse(expr.as_str()).tree().expr().unwrap() rnix::Root::parse(expr.as_str()).tree().expr().unwrap()
)); ));
let prog = compile(downgraded); let prog = compile(downgraded);
println!("{}", unwrap!(run(prog))); println!("{}", unwrap!(run(prog)));
rl.add_history_entry(expr.as_str())?;
} }
Err(ReadlineError::Interrupted) => { Err(ReadlineError::Interrupted) => {
println!("CTRL-C"); println!("CTRL-C");