Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldoc: fix the printing of (::) #9427

Merged
merged 1 commit into from Sep 8, 2020

Conversation

Octachron
Copy link
Member

Currently,

type t = (::)

is printed by ocamldoc as

type t = ::

This small PR fixes this issue in all ocamldoc backends by using directly (::) in the ocamldoc description of variant constructors.

Closes #9421 .

(There is no parentheses needed for the four other non-UIDENT constructors: true, false, [] and () )

| "::" ->
(* The only infix constructor is always printed (::) *)
"(::)"
| s -> s in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight formatting quibble, it looks like in is usually on its own line for multi-line bindings...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, and it's the style used right above this let-binding.

Suggested change
| s -> s in
| s -> s
in

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

@damiendoligez damiendoligez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, modulo the formatting nitpick.

| "::" ->
(* The only infix constructor is always printed (::) *)
"(::)"
| s -> s in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, and it's the style used right above this let-binding.

Suggested change
| s -> s in
| s -> s
in

@Octachron Octachron merged commit 9f804a2 into ocaml:trunk Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ocamldoc is rendering list variant constructors without parentheses
3 participants