about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/spans.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-09-18 r/4907 refactor(tvix/eval): clone the Arc<codemap::File> for the compilerVincent Ambo1-2/+2
This disconnects ownership of the `File` reference in a compiler from the calling scope, which is required for when we implement `import`. `import` will need to carry an `Rc<RefCell<CodeMap>>` (or maybe, in the future, Arc) to give us the ability to add new detected code files at runtime. Note that the choice of `Arc` over `Rc` here is not ours - it's the codemap crate's. Change-Id: I3aeca4ffc167acbd1701846a332d93550b56ba7d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6630 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-09-17 r/4883 feat(tvix/eval): introduce `ToSpan` trait in compiler moduleVincent Ambo1-0/+84
This trait can be used to convert most structures from rnix-parser into a codemap::Span. It uses a macro to implement the trait for the various expression types in the rnix AST, as Rust's silly semantic versioning restriction stops us from doing a blanket implementation. This will be used in the next commit to clean up the span handling in the compiler a bit. Change-Id: I0a437034e5fa203b5a49c6f25c45932a9f3b2bca Reviewed-on: https://cl.tvl.fyi/c/depot/+/6615 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>