Skip to content

Commit

Permalink
Actually cleaned up implementation this time
Browse files Browse the repository at this point in the history
Now it's perfectly testable and isn't a massive pile of spaghetti
  • Loading branch information
rben01 committed Dec 4, 2024
1 parent e2163b4 commit ff33886
Show file tree
Hide file tree
Showing 2 changed files with 342 additions and 312 deletions.
14 changes: 10 additions & 4 deletions numbat-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,22 @@ impl Cli {

rl.add_history_entry(&line)?;

match cmd_runner.try_run_line(
match cmd_runner.run_command(
&line,
CommandContext {
ctx: self.context.lock().unwrap(),
editor: rl,
},
) {
CommandControlFlow::Continue => continue,
CommandControlFlow::Return => return Ok(()),
CommandControlFlow::NotACommand => {}
Ok(cf) => match cf {
CommandControlFlow::Continue => continue,
CommandControlFlow::Return => return Ok(()),
CommandControlFlow::NotACommand => {}
},
Err(err) => {
self.context.lock().unwrap().print_diagnostic(*err);
continue;
}
}

let ParseEvaluationOutcome {
Expand Down
Loading

0 comments on commit ff33886

Please sign in to comment.