Skip to content

Commit c1872d7

Browse files
committed
Clearer errors when library files are missing
1 parent 455c1ec commit c1872d7

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lwhlisp"
3-
version = "0.12.0"
3+
version = "0.12.1"
44
edition = "2021"
55
authors = ["Khaïs COLIN"]
66
default-run = "lwhlisp"

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use chumsky::Parser as _;
44
use clap::Parser as _;
5-
use color_eyre::Result;
5+
use color_eyre::{eyre::Context, Result};
66
use gc::Gc;
77
use lwhlisp::{atom::Atom, env::Env, parsing::parser, print_parse_errs, read_file_to_string};
88

@@ -47,7 +47,7 @@ fn main() -> Result<()> {
4747
}
4848

4949
for library_path in args.library {
50-
let src = read_file_to_string(&library_path)?;
50+
let src = read_file_to_string(&library_path).context("While opening library file")?;
5151

5252
let (atoms, errs) = parser().parse_recovery_verbose(src.trim());
5353
print_parse_errs(errs, src.trim());
@@ -132,7 +132,6 @@ fn eval_and_print_result(atoms: Vec<Atom>, env: &mut Env) {
132132
let result = Atom::eval(atom.clone(), env);
133133
match result {
134134
Ok(result) => {
135-
println!("{}", atom);
136135
println!("=> {}", result);
137136
}
138137
Err(e) => {

0 commit comments

Comments
 (0)