about summary refs log tree commit diff
path: root/tvix/eval/src/eval.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r--tvix/eval/src/eval.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index 98e7520e8b2e..c72e40c75d34 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -43,18 +43,19 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
 
     for warning in result.warnings {
         eprintln!(
-            "warning: {:?} at `{:?}`[{:?}]",
+            "warning: {:?} at `{}`[line {}]",
             warning.kind,
-            warning.node.text(),
-            warning.node.text_range().start()
+            file.source_slice(warning.span),
+            file.find_line(warning.span.low()) + 1
         )
     }
 
     for error in &result.errors {
         eprintln!(
-            "compiler error: {:?} at {:?}",
+            "compiler error: {:?} at `{}`[line {}]",
             error.kind,
-            error.node.as_ref().map(|node| node.text())
+            file.source_slice(error.span.expect("TODO: non-optional")),
+            file.find_line(error.span.unwrap().low()) + 1
         );
     }