From 39e960daa67d3cebb033f0490e570dbbcd9dffa0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 1 Sep 2022 15:52:48 +0300 Subject: chore(tvix/eval): add codemap dependency This will be used to track source spans when emitting bytecode. The codemap is a data structure which tracks *all* the source files visited by an evaluation, and makes it possible to represent locations across all of the files using a simple span (i.e. pair of offsets). When reporting errors, this even contains enough information to reconstruct the rnix AST to create fancier reporting in certain cases if desired. Change-Id: I4ae98620b9b150fb5a389bd7f1e12670e3192c62 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6374 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/Cargo.lock | 7 +++++++ tvix/eval/Cargo.toml | 1 + 2 files changed, 8 insertions(+) diff --git a/tvix/eval/Cargo.lock b/tvix/eval/Cargo.lock index 4732d1b00220..c20999ab0efa 100644 --- a/tvix/eval/Cargo.lock +++ b/tvix/eval/Cargo.lock @@ -83,6 +83,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "codemap" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24" + [[package]] name = "countme" version = "3.0.1" @@ -872,6 +878,7 @@ dependencies = [ name = "tvix-eval" version = "0.1.0" dependencies = [ + "codemap", "criterion", "dirs", "itertools", diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml index dc5d10c8e883..5dac97149843 100644 --- a/tvix/eval/Cargo.toml +++ b/tvix/eval/Cargo.toml @@ -12,6 +12,7 @@ dirs = "4.0.0" path-clean = "0.1" tabwriter = { version = "1.2", optional = true } rowan = "*" # pinned by rnix +codemap = "0.1.3" # rnix has not been released in a while (as of 2022-08-22), we will # use it from git. -- cgit 1.4.1