-
Notifications
You must be signed in to change notification settings - Fork 12
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
Doccursor #217
Doccursor #217
Commits on Nov 16, 2023
-
docstring: add more dedicated _get_header_lines() methods
At the risk of duplication, add more dedicated _get_header_line() to make it easier to understand what is needed where.
Configuration menu - View commit details
-
Copy full SHA for 1984b99 - Browse repository at this point
Copy the full SHA 1984b99View commit details -
doccursor: move all parser helpers to a new file
We want to wrap these in an object, but we'll try to do so incrementally. By moving this code into our own `doccursor` module, it makes sense that we import `CursorKind` and `TokenKind` from it instead of from Clang's library despite them being the same by design.
Configuration menu - View commit details
-
Copy full SHA for 4772c5a - Browse repository at this point
Copy the full SHA 4772c5aView commit details -
doccursor: stub our shiny new cursor class
As a 1st step, we make a _very_ shallow wrapper around the Clang cursor. There is of course no point to it yet, but with this simple trick we are now using `DocCursor`s everywhere past `parse()`. The only effect of this commit is to worsen performance very slightly due to needless invocation of path specific code on all cursors. Running the full test suit is now ~9% slower on my machine. We shall revisit this later when it actually matters.
Configuration menu - View commit details
-
Copy full SHA for 5fc388c - Browse repository at this point
Copy the full SHA 5fc388cView commit details -
doccursor: move helpers inside the class
Another baby step, which is again mostly cosmetic. In doing this, we can remove plenty of the attributes we defined just to get cursor compatibility. We may want to expose some of this again later, but likely through a better API. For now we simplify the code as much as possible. After we should start thinking of how this will play out with docstring and improving these methods / attributes to provide a nice API for the new cursor.
Configuration menu - View commit details
-
Copy full SHA for ebcb26a - Browse repository at this point
Copy the full SHA ebcb26aView commit details -
doccursor: always use the Clang cursor internally
We want to start improving the API in ways that will no longer mimic the Clang's cursor one. We need to prevent (e.g.) our cursor `type` property turns out to mean something different than Clang's own namesake (spoiler: it will!). There might be a few cases where the result might be the same, but that will not be obvious most of the times and it may still pose a performance issue anyway. As a rule, we stick to using the Clang cursor everywhere we can.
Configuration menu - View commit details
-
Copy full SHA for 67adbba - Browse repository at this point
Copy the full SHA 67adbbaView commit details -
doccursor: simplify API for current docstring behaviour
We want to do better than this later on, but for now we need to simplify the parser so that we focus instead on API alone with docstring as the biggest consumer. In order to do that the easy way, we will start by providing an API that reflects the current docstring API, then pass the cursor to docstring directly simplifying its own API and finally isolating the parser from docstring entirely. The idea is _not_ to mimic Clang's cursor any more! Any similarity in attributes and property names is coincidental from now on. By this point we've also made up the lost performance from the stub commit!
Configuration menu - View commit details
-
Copy full SHA for 34282b3 - Browse repository at this point
Copy the full SHA 34282b3View commit details
Commits on Nov 18, 2023
-
docstring: use cursor as input
Finally, we get to make the parser completely oblivious to the rendering layer! Hopefully docstring and doccursor can now evolve to something better. Closes jnikula#180. Though a lot of the potential is still to be realized.
Configuration menu - View commit details
-
Copy full SHA for 0cd1f59 - Browse repository at this point
Copy the full SHA 0cd1f59View commit details