Skip to content

Commit

Permalink
Remove parens around hidden functions (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus- authored Aug 27, 2024
2 parents 5e4a981 + f784b0f commit 2208cd3
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 2208cd3

Please sign in to comment.