Skip to content

Commit

Permalink
Compiler: js-parser: tune parens in js output
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Dec 18, 2023
1 parent 774ac80 commit c456ac0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler/lib/js_output.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ struct
(match e1 with
| Left e ->
(* Should not starts with "let [" *)
parenthesized_expression ~let_identifier:true Expression f e
parenthesized_expression ~let_identifier:true LeftHandSideExpression f e
| Right (k, v) -> for_binding f k v);
PP.space f;
PP.string f "in";
Expand All @@ -1337,15 +1337,15 @@ struct
parenthesized_expression
~let_identifier:true
~async_identifier:true
Expression
LeftHandSideExpression
f
e
| Right (k, v) -> for_binding f k v);
PP.space f;
PP.string f "of";
PP.break f;
PP.space f;
expression Expression f e2;
expression AssignementExpression f e2;
PP.string f ")";
PP.end_group f;
PP.end_group f;
Expand All @@ -1361,13 +1361,13 @@ struct
(match e1 with
| Left e ->
(* Should not starts with "let" *)
parenthesized_expression ~let_identifier:true Expression f e
parenthesized_expression ~let_identifier:true LeftHandSideExpression f e
| Right (k, v) -> for_binding f k v);
PP.space f;
PP.string f "of";
PP.break f;
PP.space f;
expression Expression f e2;
expression AssignementExpression f e2;
PP.string f ")";
PP.end_group f;
PP.end_group f;
Expand Down Expand Up @@ -1740,7 +1740,7 @@ struct
PP.space f;
PP.string f "extends";
PP.space f;
expression Expression f e;
expression LeftHandSideExpression f e;
PP.space f);
PP.end_group f;
PP.start_group f 2;
Expand Down Expand Up @@ -1770,7 +1770,7 @@ struct
PP.string f "=";
PP.space f;
output_debug_info f loc;
expression Expression f e);
expression AssignementExpression f e);
PP.string f ";";
PP.end_group f
| CEStaticBLock l ->
Expand Down

0 comments on commit c456ac0

Please sign in to comment.