From 8b0b7304f77dc74d59f0d9c765566f3ee1a4aa4b Mon Sep 17 00:00:00 2001 From: Franklin Delehelle Date: Thu, 9 Nov 2023 08:44:50 +0000 Subject: [PATCH] fix[debug]: render permutations & domains --- src/exporters/debugger.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/exporters/debugger.rs b/src/exporters/debugger.rs index 0cd9200..3bce797 100644 --- a/src/exporters/debugger.rs +++ b/src/exporters/debugger.rs @@ -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()); } @@ -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);