diff --git a/src/res_printer.ml b/src/res_printer.ml index c1d947d4..ca442be3 100644 --- a/src/res_printer.ml +++ b/src/res_printer.ml @@ -3658,6 +3658,7 @@ and printBinaryExpression ~customLayout (expr : Parsetree.expression) cmtTbl = Doc.group (Doc.concat [ + printAttributes ~customLayout expr.pexp_attributes cmtTbl; lhsDoc; (match (lhsHasCommentBelow, op) with | true, "|." -> Doc.concat [Doc.softLine; Doc.text "->"] diff --git a/tests/printer/expr/expected/pipe.res.txt b/tests/printer/expr/expected/pipe.res.txt new file mode 100644 index 00000000..9818af75 --- /dev/null +++ b/tests/printer/expr/expected/pipe.res.txt @@ -0,0 +1,2 @@ +let ok = @foo optionMap(name, x => x) +let bad = @foo name->optionMap(x => x) diff --git a/tests/printer/expr/pipe.res b/tests/printer/expr/pipe.res new file mode 100644 index 00000000..0f848057 --- /dev/null +++ b/tests/printer/expr/pipe.res @@ -0,0 +1,2 @@ +let ok = @foo (optionMap(name, x => x)) +let bad = @foo (name->optionMap(x => x))