mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-16 02:15:01 +01:00
add pretty print
This commit is contained in:
parent
1a77e710d5
commit
76af14a9f4
11 changed files with 114 additions and 5 deletions
|
|
@ -63,7 +63,14 @@ fn process_ast(program: &str, ast: &Program, mut runtime: RtAlloc, cfg: &mut Con
|
|||
match bytecode {
|
||||
Ok(code) => {
|
||||
if cfg.debug {
|
||||
println!("Bytecode:\n{:#?}\n", code);
|
||||
#[cfg(feature = "pretty")]
|
||||
{
|
||||
println!("Bytecode:\n{}\n", debug2::pprint(code));
|
||||
}
|
||||
#[cfg(not(feature = "pretty"))]
|
||||
{
|
||||
println!("Bytecode:\n{:#?}\n", code);
|
||||
}
|
||||
}
|
||||
|
||||
let result = vm::execute(&code, runtime, cfg.stdout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue