feat(tvix/eval): thread codemap through to disassembler

If the disassembler feature is enabled, make sure that an Rc of the
codemap is available through the chunk.

Change-Id: I700f27ab665a704f73457b19bd2d7efc93828a16
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6414
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-02 17:44:31 +03:00 committed by tazjin
parent a3b19ad8be
commit cc526a2c87
4 changed files with 47 additions and 5 deletions

View file

@ -39,7 +39,14 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
println!("{:?}", root_expr);
}
let result = crate::compiler::compile(root_expr, location, &file, global_builtins())?;
let result = crate::compiler::compile(
root_expr,
location,
&file,
global_builtins(),
#[cfg(feature = "disassembler")]
std::rc::Rc::new(codemap),
)?;
#[cfg(feature = "disassembler")]
crate::disassembler::disassemble_chunk(&result.lambda.chunk);