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

Documentation on docstrings #3773

Merged
merged 12 commits into from
Apr 6, 2023
Merged

Conversation

davidcok
Copy link
Collaborator

@davidcok davidcok commented Mar 21, 2023

Accompanies PR 3756. Fixes #3771.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

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

Tiny changes

by IDEs and documentation generation tools to present information to users.

In Dafny programs.
* Documentation comments are recommended to begin with `/**`, though some
Copy link
Member

Choose a reason for hiding this comment

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

Actually, documentation must start with "/**" if it placed before, but we don't have such recommendation for docstrings placed after signature. It's even easier to write just "//" like for variable declarations. So I would rephrase it accordingly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rephrased

Comment on lines 191 to 192
* If doc-comments are in both places the content is concatenated.
* Doc-comments after the declaration are preferred.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* If doc-comments are in both places the content is concatenated.
* Doc-comments after the declaration are preferred.
* If doc-comments are in both places the content is concatenated.
* Doc-comments after the declaration are preferred.

If doc comments are in both places, only the one below/after is considered.
Single-line comments are concatenated only if they are on the same side of the docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

docs/DafnyRef/Grammar.md Outdated Show resolved Hide resolved
@davidcok davidcok enabled auto-merge (squash) April 6, 2023 16:12
@davidcok davidcok merged commit a9d4827 into dafny-lang:master Apr 6, 2023
@davidcok davidcok deleted the cok-3771-docstrings branch April 29, 2023 13:24
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.

Document docstrings in RM
3 participants