Skip to content

Commit

Permalink
Separate parse errors (#39)
Browse files Browse the repository at this point in the history
* Separate parse errors if requested

* Revert CLI change
  • Loading branch information
Forgind committed Sep 12, 2023
1 parent 1393d79 commit aa860b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ fn main() -> Result<(), String> {
let source = cli::read_source(args)?;

let ast = parser::parse(source.as_str());
interpreter::evaluate(ast.unwrap(), io::stdin().lock(), io::stdout())

match ast {
Ok(t) => interpreter::evaluate(t, io::stdin().lock(), io::stdout()),
Err(e) => Err(format!("Error encountered while parsing: {}", e).to_string()),
}
}

0 comments on commit aa860b1

Please sign in to comment.