chore(tvix/eval): print node representation for compiler errors

Better for development flow.

Change-Id: I038efb39caca804f28a44fd4c83457e90abbcee4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6290
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-27 00:20:52 +03:00 committed by tazjin
parent 1163ef3e41
commit e4fadfaaf8

View file

@ -42,7 +42,11 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
}
for error in &result.errors {
eprintln!("compiler error: {:?} at {:?}", error.kind, error.node,);
eprintln!(
"compiler error: {:?} at {:?}",
error.kind,
error.node.as_ref().map(|node| node.text())
);
}
if let Some(err) = result.errors.last() {