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

Adds a possibility to access the first Token of a SyntaxNode. #904

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

suzizecat
Copy link
Contributor

Addressing #900 (and, by extension #898 )

This PR adds the getChildPtr, getTokenPtr, getFirstTokenPtr and getLastTokenPtr functions as well as required backend.

Please let me know how to ensure the tests are still relevant and everything is covered if required.

suzizecat and others added 5 commits March 1, 2024 15:57
In order to add a getFirstToken() as a modifiable value, this structure
will allows retrieving a token by address rather than by value.

There is no real need to get a constptr though so it is not implemented.
Allows to retrieve a mutable version of a token of any SyntaxNode, and
in particular the first and last token.
Adds the getTokenPtr function.
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 93.67%. Comparing base (13e2f12) to head (906bd47).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
- Coverage   93.76%   93.67%   -0.10%     
==========================================
  Files         189      189              
  Lines       47139    47187      +48     
==========================================
  Hits        44201    44201              
- Misses       2938     2986      +48     
Files Coverage Δ
include/slang/syntax/SyntaxNode.h 82.30% <0.00%> (-9.15%) ⬇️
source/syntax/SyntaxNode.cpp 63.30% <0.00%> (-29.95%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13e2f12...906bd47. Read the comment docs.

@suzizecat suzizecat force-pushed the 900-get-first-token branch from ff6bafc to a5c3f07 Compare March 1, 2024 15:32
@MikePopoloski
Copy link
Owner

Nice, lgtm.

@MikePopoloski MikePopoloski merged commit f0cd4e5 into MikePopoloski:master Mar 1, 2024
15 checks passed
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.

2 participants