Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eneoli committed Dec 7, 2024
1 parent a635245 commit 58eb4c3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/kernel/proof_term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,22 @@ impl Display for ProofTerm {
let parent_precedence = self.precedence();
let child_precedence = body.precedence();

let should_wrap = (parent_precedence > child_precedence)
|| (parent_precedence == child_precedence && body.left_associative());
// let should_wrap = (parent_precedence > child_precedence)
// || (parent_precedence == child_precedence && body.left_associative());

let should_wrap = match **body {
ProofTerm::ProjectFst(_)
| ProofTerm::ProjectSnd(_)
| ProofTerm::Function(_)
| ProofTerm::Application(_)
| ProofTerm::LetIn(_)
| ProofTerm::OrLeft(_)
| ProofTerm::OrRight(_)
| ProofTerm::Case(_)
| ProofTerm::Abort(_)
| ProofTerm::TypeAscription(_) => true,
_ => false,
};

if should_wrap {
return write!(f, "{} ({})", function_name, body);
Expand Down

0 comments on commit 58eb4c3

Please sign in to comment.