MikePopoloski / slang

SystemVerilog compiler and language services
MIT License
592 stars 132 forks source link

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

Closed suzizecat closed 7 months ago

suzizecat commented 7 months ago

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.

codecov[bot] commented 7 months ago

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](https://app.codecov.io/gh/MikePopoloski/slang/pull/904/graphs/tree.svg?width=650&height=150&src=pr&token=sS5JjK9091&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski)](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski) ```diff @@ 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](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski) | Coverage Δ | | |---|---|---| | [include/slang/syntax/SyntaxNode.h](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski#diff-aW5jbHVkZS9zbGFuZy9zeW50YXgvU3ludGF4Tm9kZS5o) | `82.30% <0.00%> (-9.15%)` | :arrow_down: | | [source/syntax/SyntaxNode.cpp](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski#diff-c291cmNlL3N5bnRheC9TeW50YXhOb2RlLmNwcA==) | `63.30% <0.00%> (-29.95%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski). Last update [13e2f12...906bd47](https://app.codecov.io/gh/MikePopoloski/slang/pull/904?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Michael+Popoloski).
MikePopoloski commented 7 months ago

Nice, lgtm.