From e4fadfaaf8b7e821b77ce4dc41b915ff83f8e240 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 27 Aug 2022 00:20:52 +0300 Subject: 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 --- tvix/eval/src/eval.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs index add621af6cc3..d61e51e6afc2 100644 --- a/tvix/eval/src/eval.rs +++ b/tvix/eval/src/eval.rs @@ -42,7 +42,11 @@ pub fn interpret(code: &str, location: Option) -> EvalResult { } 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() { -- cgit 1.4.1