improve printer: constructors with no arguments
This commit is contained in:
parent
40474dcc68
commit
dfb82aa479
@ -44,7 +44,8 @@ let op ppf = {
|
|||||||
| VariantInstance { constructor ; _ } ->
|
| VariantInstance { constructor ; _ } ->
|
||||||
if constructor.cf_new_fold needs_parens false
|
if constructor.cf_new_fold needs_parens false
|
||||||
then fprintf ppf "%s (%a)" constructor.cf.name (fun _ppf -> constructor.cf_continue) ()
|
then fprintf ppf "%s (%a)" constructor.cf.name (fun _ppf -> constructor.cf_continue) ()
|
||||||
else fprintf ppf "%s %a" constructor.cf.name (fun _ppf -> constructor.cf_continue) ()
|
else let spc = if String.equal constructor.cf.type_ "" then "" else " " in
|
||||||
|
fprintf ppf "%s%s%a" constructor.cf.name spc (fun _ppf -> constructor.cf_continue) ()
|
||||||
| PolyInstance { poly=_; arguments=_; poly_continue } ->
|
| PolyInstance { poly=_; arguments=_; poly_continue } ->
|
||||||
(poly_continue ())
|
(poly_continue ())
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user