diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-22T20·20+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-01T21·40+0000 |
commit | 2662376941367d88687b3ebc4e4b941b266cee42 (patch) | |
tree | 9202de6ecebcb9d03e7940d0ddf8227f6a4ef1e1 /tvix/eval/src/eval.rs | |
parent | 51be6542c98158feb89e0e2d89f6b5165a070914 (diff) |
feat(tvix/eval): carry optional SyntaxNode in error type r/4571
This starts paving the way for nicer, source-code based error reporting. Right now the code paths in the VM do not emit annotated errors, as we do not yet preserve that structure from the compiler. However, error emitting code paths in the compiler have been amended to include known nodes. Change-Id: I1b74410ffd891c40cd913361bd73c4336ec8aa5b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6235 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r-- | tvix/eval/src/eval.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs index cd11d3289b12..8f2946e6cc84 100644 --- a/tvix/eval/src/eval.rs +++ b/tvix/eval/src/eval.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use rnix; use crate::{ - errors::{Error, EvalResult}, + errors::{ErrorKind, EvalResult}, value::Value, }; @@ -15,7 +15,7 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> { for err in errors { eprintln!("parse error: {}", err); } - return Err(Error::ParseErrors(errors.to_vec())); + return Err(ErrorKind::ParseErrors(errors.to_vec()).into()); } // If we've reached this point, there are no errors. |