Skip to content

Commit

Permalink
fix[debug]: render permutations & domains
Browse files Browse the repository at this point in the history
  • Loading branch information
delehef committed Nov 9, 2023
1 parent a6eae91 commit 8b0b730
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/exporters/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,19 @@ fn render_constraints(
match c {
Constraint::Vanishes {
handle,
domain: _,
domain,
expr,
} => {
let mut tty = Tty::new().with_guides();
println!("\n{} :=", handle.pretty());
println!(
"\n{}{} :=",
handle.pretty(),
if let Some(domain) = domain {
domain.to_string()
} else {
String::new()
}
);
pretty_expr(expr, None, &mut tty, show_types);
println!("{}", tty.page_feed());
}
Expand All @@ -223,7 +231,16 @@ fn render_constraints(
.join(", "),
)
}
Constraint::Permutation { .. } => (),
Constraint::Permutation {
handle, from, to, ..
} => {
println!("\n{}", handle.pretty());
println!(
"[{}] perm. [{}]",
to.iter().map(|c| c.pretty()).join(", "),
from.iter().map(|c| c.pretty()).join(", ")
)
}
Constraint::InRange { handle, exp, max } => {
let mut tty = Tty::new().with_guides();
pretty_expr(exp, None, &mut tty, false);
Expand Down

0 comments on commit 8b0b730

Please sign in to comment.