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 domain rewrite #7319
Merged
Merged
C domain rewrite #7319
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jakobandersen
added
type:bug
type:enhancement
enhance or introduce a new feature
domains:c
labels
Mar 15, 2020
tk0miya
approved these changes
Mar 16, 2020
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.
Unfortuantely, I don't have time to understand the new implementation of the C domain. But it would go well because you're author :-) +1 for merging.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Subject: essentially a rewrite of the C domain to fix issues and enable further development
Feature or Bugfix
Purpose
The original implementation of the C domain relied on regex matching to parse signatures. While it works for many cases, there is a limit. This rewrite is in the same style as the C++ domain, and some details are shared between the two domains. It is naturally a large breaking change, but I believe it is necessary for furture improvement of the domain. In order to make some simple kind of judgement of the changes I have updated the cpython documentation as best as possible: https://github.com/jakobandersen/cpython/tree/doc_fixes
c:type
directive seemed to have been a catch-all for many signatures which made it difficult to parse and generate appropriate output. It has been changed to be much stricter and only allow either a name or a typedef-like declaration.:py:*
roles can refer python objects even if objtype not matched. #7243 is not yet fixed yet)c:expr
role has been added to typeset a type of an expression in text. In particular while one before could write... a :c:type:`int` and then ...
or... a :c:type:`char*` and then ...
this will now trigger an error as thec:type
strictly is for cross-referencing. Instead one should use thec:expr
role.signode['names'].append(targetname)
thing. However, the ID generation is now guaranteed to produce different IDs for different declarations, and they are produced from parsed input (i.e., no arbitrary code injection).Detail