-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add a documentation tokens to pps #281
Add a documentation tokens to pps #281
Conversation
f466a83
to
842097a
Compare
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.
Very nice job!
I think I found two corner cases that it would be nice to cover before merging.
- a Documentation token with positions and contents - an Empty_documentation with just ending position The Empty_documentation token correspond to `(**)`
842097a
to
e757498
Compare
e757498
to
293ab83
Compare
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.
Very nice job!
I managed to find two minor points just to quibble :-) but LGTM.
293ab83
to
8126292
Compare
These printers turns the documentation comments into documentation attributes. We will want to use them when the documentation appears between an OCaml declaration and gospel specifications.
Capture all the cases spacing-wise where a documentation comment appears between an OCaml declaration and a gospel specification.
Dune 3 enables cram tests by default
This PR proposes a fix for #288
It adds two new tokens to the lexer:
Documentation
token with starting and ending position and the contentsEmpty_documentation
token with the ending positionBoth are printed as documentation attributes when they appears between an Ocaml declaration and a gospel specification (the case where the documentation comments is considered as detached by the OCaml parser)
Tests are added to check that the documentation is not considered as detached anymore and to make sure that original position is preserved.