-
Notifications
You must be signed in to change notification settings - Fork 91
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
including doc comments in ast.ml
#336
including doc comments in ast.ml
#336
Conversation
Signed-off-by: Paul-Elliot <peada@free.fr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for this super nice docs-experience improvement, both in the compiler and here! I know it must have been a little bit tedious at some parts and really appreciate the outcome! Just a couple of comments:
You need to replace the occurrences of case list
with cases
(and we should update the comments at the beginning of ast.ml
to reflect that). I've marked that in some of the occurrences below, but not in all. Once you've done that, let's see if dune build @lint
keeps on complaining or if that's the only adjustment needed.
The next "comment" is more of a question out of curiosity: why have you also modified astlib/ast_414.ml
?
And last thing: when running ocamlformat on this, I get the warning
Warning: Invalid documentation comment:
File "ast/ast.ml", line 643, characters 42-43:
'.' is not allowed in '{ul ...}' (bulleted list).
Suggestion: move '.' into a list item, '{li ...}' or '{- ...}'.
Have you also seen that already?
ast/ast.ml
Outdated
{{!Asttypes.rec_flag.Nonrecursive} [Nonrecursive]}, | ||
- [let rec P1 = E1 and ... and Pn = EN in E] when [flag] is | ||
{{!Asttypes.rec_flag.Recursive} [Recursive]}. *) | ||
| Pexp_function of case list (** [function P1 -> E1 | ... | Pn -> En] *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Pexp_function of case list (** [function P1 -> E1 | ... | Pn -> En] *) | |
| Pexp_function of cases (** [function P1 -> E1 | ... | Pn -> En] *) |
ast/ast.ml
Outdated
argument). | ||
|
||
Invariant: [n > 0] *) | ||
| Pexp_match of expression * case list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Pexp_match of expression * case list | |
| Pexp_match of expression * cases |
ast/ast.ml
Outdated
Invariant: [n > 0] *) | ||
| Pexp_match of expression * case list | ||
(** [match E0 with P1 -> E1 | ... | Pn -> En] *) | ||
| Pexp_try of expression * case list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Pexp_try of expression * case list | |
| Pexp_try of expression * cases |
Lo he hecho.
I figured that the workflow for updating
Of course I could not start the process directly at stage 2 with the compiler
Yes, I will investigate this. I suspect a bug on the |
Signed-off-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
b832094
to
7b6d31b
Compare
Why can't I read the line number? Anyway that's fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks again! It looks all good and I think this is a great UX improvement.
While no changes have been made to the AST type since #320 has been merged, the comments have been lifted to doc-comments in ocaml/ocaml#11107.
This PR updates
ast_414.ml
andast.ml
to include the doc-comments. This will make it possible to link the rendering of these comments it in the ppxlib manual, instead of prompting the reader to open the file in<path-to-opam-switch>/lib/ocaml/compiler-libs/parsetree.mli