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

C++, fix spacing issue in east-const notation #7489

Closed
wants to merge 2 commits into from

Conversation

jbab
Copy link
Contributor

@jbab jbab commented Apr 15, 2020

Subject: Fix a spacing issue which occurs when using east-const notation

Feature or Bugfix

  • Bugfix

Purpose

Documenting a function in this way

cpp:function:: int foo(Type const& param)

renders output like this

int foo(Typeconst &param)

That is, a space between Type and the following const is missing.

This PR fixes this bug.

Detail

The bugfix is a modification of the ASTDeclSpecs.describe_signature method, which did not properly insert a space between trailingTypeSpec and rightSpecs.

Note that the ASTDeclSpecs._stringify method does not have the same problem, it behaves correctly. Therefore the problem is not observable in the unit tests in test_domain_cpp.py.

The problem was observed and the fix tested with HTML output.

@jakobandersen
Copy link
Contributor

Thanks for the PR! If you by chance have time, could you check if the same issue exist in the C domain? If so, feel free to fix it in this PR as well.

@jbab
Copy link
Contributor Author

jbab commented Apr 16, 2020

Thanks for the PR! If you by chance have time, could you check if the same issue exist in the C domain? If so, feel free to fix it in this PR as well.

Looking at the code of ASTDeclSpecs.describe_signature in c.py I am certain that the same problem does not exist there. The rightSpecs are added to an extra list, modifiers, instead of directly tosignode. If len(modifiers) > 0 a space is properly inserted and then the modifiers added to signode.

@jakobandersen
Copy link
Contributor

Great, thanks.

@jakobandersen jakobandersen added this to the 3.0.2 milestone Apr 17, 2020
jakobandersen added a commit that referenced this pull request Apr 17, 2020
@jakobandersen
Copy link
Contributor

I rebased (and squashed) the PR onto the 3.0.x branch to get it out in 3.0.2 (PR #7496). Thanks again.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants