Skip to content

Commit

Permalink
Format inline records with parens in outcome printer (#2370)
Browse files Browse the repository at this point in the history
This is a followup to the syntax change added in #2363, but for the
outcome printer
  • Loading branch information
anmonteiro authored and jordwalke committed Apr 1, 2019
1 parent a24bd82 commit e056c37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions formatTest/oprintTests/expected_output/inlineRecord.re
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type t0 = T0 { t0: int, };
type t1 = A { x: int, } | B | C { c1: string, c2: string, };
type t0 = T0({ t0: int, });
type t1 = A({ x: int, }) | B | C({ c1: string, c2: string, });
type t2(_) =
D { x: int, }: t2(int)
| E { f: int => int, }: t2(int => int)
D({ x: int, }): t2(int)
| E({ f: int => int, }): t2(int => int)
| F(unit): t2(unit);
4 changes: 2 additions & 2 deletions src/reason-parser/reason_oprint.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ and print_out_constr ppf (name, tyl,ret_type_opt) =
| [] ->
pp_print_string ppf name
| [Otyp_record lbls] ->
fprintf ppf "@[<2>%s {%a@;<1 -2>}@]" name
fprintf ppf "@[<2>%s({%a@;<1 -2>})@]" name
(print_list_init print_out_label (fun ppf -> fprintf ppf "@ ")) lbls
| _ ->
fprintf ppf "@[<2>%s(%a)@]" name
Expand All @@ -817,7 +817,7 @@ and print_out_constr ppf (name, tyl,ret_type_opt) =
| [] ->
fprintf ppf "@[<2>%s:@ %a@]" name print_simple_out_type ret_type
| [Otyp_record lbls] ->
fprintf ppf "@[<2>%s {%a@;<1 -2>}: %a@]" name
fprintf ppf "@[<2>%s({%a@;<1 -2>}): %a@]" name
(print_list_init print_out_label (fun ppf -> fprintf ppf "@ ")) lbls
print_simple_out_type ret_type
| _ ->
Expand Down

0 comments on commit e056c37

Please sign in to comment.