Skip to content

Commit 067fe15

Browse files
committed
Different approach
1 parent 88e841d commit 067fe15

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

jscomp/syntax/src/res_printer.ml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2646,21 +2646,24 @@ and printExpression ~state (e : Parsetree.expression) cmtTbl =
26462646
( Nolabel,
26472647
None,
26482648
{ppat_desc = Ppat_var {txt = "__x"}},
2649-
{pexp_desc = Pexp_apply _} )
2649+
{pexp_desc = Pexp_apply _} ) ->
2650+
printExpressionWithComments ~state
2651+
(ParsetreeViewer.rewriteUnderscoreApply e)
2652+
cmtTbl
26502653
| Pexp_construct
26512654
( {txt = Lident "Function$"},
26522655
Some
2653-
{
2654-
pexp_desc =
2655-
Pexp_fun
2656-
( Nolabel,
2657-
None,
2658-
{ppat_desc = Ppat_var {txt = "__x"}},
2659-
{pexp_desc = Pexp_apply _} );
2660-
} ) ->
2656+
({
2657+
pexp_desc =
2658+
Pexp_fun
2659+
( Nolabel,
2660+
None,
2661+
{ppat_desc = Ppat_var {txt = "__x"}},
2662+
{pexp_desc = Pexp_apply _} );
2663+
} as e_fun) ) ->
26612664
(* (__x) => f(a, __x, c) -----> f(a, _, c) *)
26622665
printExpressionWithComments ~state
2663-
(ParsetreeViewer.rewriteUnderscoreApply e)
2666+
(ParsetreeViewer.rewriteUnderscoreApply e_fun)
26642667
cmtTbl
26652668
| Pexp_construct ({txt = Lident "Function$"}, Some expr) -> (
26662669
let nonGhostAttrs =

0 commit comments

Comments
 (0)