fix(tvix/eval): print code even if runtime fails
Change-Id: I357c9adf939cb6001afa73ad02282d94ee22d0ba Reviewed-on: https://cl.tvl.fyi/c/depot/+/6088 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
2ed38a7cdb
commit
865717a8db
1 changed files with 2 additions and 6 deletions
|
@ -1,5 +1,4 @@
|
||||||
use rnix::{self, types::TypedNode};
|
use rnix::{self, types::TypedNode};
|
||||||
use std::fmt::Write;
|
|
||||||
|
|
||||||
use crate::errors::EvalResult;
|
use crate::errors::EvalResult;
|
||||||
|
|
||||||
|
@ -11,14 +10,11 @@ pub fn interpret(code: String) -> EvalResult<String> {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut out = String::new();
|
|
||||||
println!("{}", ast.root().dump());
|
println!("{}", ast.root().dump());
|
||||||
|
|
||||||
let code = crate::compiler::compile(ast)?;
|
let code = crate::compiler::compile(ast)?;
|
||||||
writeln!(out, "code: {:?}", code).ok();
|
println!("code: {:?}", code);
|
||||||
|
|
||||||
let value = crate::vm::run_chunk(code)?;
|
let value = crate::vm::run_chunk(code)?;
|
||||||
writeln!(out, "value: {:?}", value).ok();
|
Ok(format!("value: {:?}", value))
|
||||||
|
|
||||||
Ok(out)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue