Skip to content

Commit

Permalink
Remove parens around hidden functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Negabinary committed Aug 27, 2024
1 parent 5e4a981 commit f784b0f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/haz3lweb/view/dhcode/layout/DHDoc_Exp.re
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ let precedence_bin_string_op = (bso: Operators.op_bin_string) =>
| Concat => DHDoc_common.precedence_Plus
| Equals => DHDoc_common.precedence_Equals
};
let rec precedence = (~show_casts: bool, d: DHExp.t) => {
let precedence' = precedence(~show_casts);
let rec precedence = (~show_function_bodies, ~show_casts: bool, d: DHExp.t) => {
let precedence' = precedence(~show_function_bodies, ~show_casts);
switch (DHExp.term_of(d)) {
| Var(_)
| Invalid(_)
Expand Down Expand Up @@ -73,6 +73,8 @@ let rec precedence = (~show_casts: bool, d: DHExp.t) => {
| ListConcat(_) => DHDoc_common.precedence_Plus
| Tuple(_) => DHDoc_common.precedence_Comma
| TypFun(_)
| Fun(_) when !show_function_bodies => DHDoc_common.precedence_const
| TypFun(_)
| Fun(_) => DHDoc_common.precedence_max
| Let(_)
| TyAlias(_)
Expand Down Expand Up @@ -117,7 +119,11 @@ let mk =
d: DHExp.t,
)
: DHDoc.t => {
let precedence = precedence(~show_casts=settings.show_casts);
let precedence =
precedence(
~show_casts=settings.show_casts,
~show_function_bodies=settings.show_fn_bodies,
);
let rec go =
(
d: DHExp.t,
Expand Down

0 comments on commit f784b0f

Please sign in to comment.