From efb6466919464e616faf1847675a261d1d571e2a Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Sat, 4 Nov 2023 14:40:16 -0500 Subject: [PATCH] was ognna do homework but then osu happened --- bidir/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bidir/src/main.rs b/bidir/src/main.rs index 0a9e1f3..9bdd70a 100644 --- a/bidir/src/main.rs +++ b/bidir/src/main.rs @@ -1,11 +1,12 @@ use anyhow::Result; use bidir::{bidir::synthesize, data::Context, parser::TermParser}; -use rustyline::DefaultEditor; +use rustyline::{Config, DefaultEditor}; fn main() -> Result<()> { let term_parser = TermParser::new(); - let mut rl = DefaultEditor::new()?; + let rl_config = Config::builder().auto_add_history(true).build(); + let mut rl = DefaultEditor::with_config(rl_config)?; loop { let line = match rl.readline(">> ") { @@ -17,7 +18,7 @@ fn main() -> Result<()> { let parsed_term = match term_parser.parse(&line) { Ok(term) => term, Err(err) => { - eprintln!("SHIET sucks bro: {err}"); + eprintln!("parser error: {err}"); continue; } };