refactor(tvix/eval): store spans instead of nodes in Warning/Error

Another step towards being able to report accurate errors. The codemap
spans contain strictly more accessible information, as they now retain
information about which input file something came from.

This required some shuffling around in the compiler to thread all the
right information to the right places.

Change-Id: I18ccfb20f07b0c33e1c4f51ca00cd09f7b2d19c6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6404
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-01 19:57:55 +03:00 committed by tazjin
parent 8033300900
commit 55d21a1389
5 changed files with 92 additions and 90 deletions

View file

@ -52,13 +52,13 @@ pub enum ErrorKind {
#[derive(Clone, Debug)]
pub struct Error {
pub node: Option<rnix::SyntaxNode>,
pub kind: ErrorKind,
pub span: Option<codemap::Span>,
}
impl From<ErrorKind> for Error {
fn from(kind: ErrorKind) -> Self {
Error { node: None, kind }
Error { span: None, kind }
}
}