refactor(tvix/eval): introduce source::SourceCode type

This type hides away the lower-level handling of most codemap data
structures, especially to library consumers (see corresponding changes
in tvixbolt).

This will help with implement `import` by giving us central control
over how the codemap works.

Change-Id: Ifcea36776879725871b30c518aeb96ab5fda035a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6855
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
This commit is contained in:
Vincent Ambo 2022-10-04 17:05:34 +03:00 committed by tazjin
parent 2ff764ceb7
commit 3530404a4a
8 changed files with 105 additions and 57 deletions

View file

@ -5,6 +5,7 @@ mod errors;
mod eval;
pub mod observer;
mod opcode;
mod source;
mod upvalues;
mod value;
mod vm;
@ -22,5 +23,6 @@ pub use crate::builtins::global_builtins;
pub use crate::compiler::compile;
pub use crate::errors::EvalResult;
pub use crate::eval::{interpret, Options};
pub use crate::source::SourceCode;
pub use crate::value::Value;
pub use crate::vm::run_lambda;