dlang-community / libdparse

Library for lexing and parsing D source code
https://libdparse.dlang.io
Boost Software License 1.0
114 stars 56 forks source link

fix(parser): attributes are not always propagated/populated #466

Open ljmf00 opened 1 year ago

ljmf00 commented 1 year ago

Co-authored-by: Eyal Lotem eyal@weka.io Signed-off-by: Luís Ferreira contact@lsferreira.net


Adapted from https://github.com/weka/libdparse/commit/caac5e48884992aebddf1f3bd051f5c128d505d6 to upstream. CC @EyalIO .

Fixes #370 and somewhat related to #73.

ljmf00 commented 1 year ago

Still requires testing.

codecov[bot] commented 1 year ago

Codecov Report

Merging #466 (b717b20) into master (19a8489) will increase coverage by 0.03%. The diff coverage is 100.00%.

Additional details and impacted files [![Impacted file tree graph](https://codecov.io/gh/dlang-community/libdparse/pull/466/graphs/tree.svg?width=650&height=150&src=pr&token=VHoPCaUjPZ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community)](https://codecov.io/gh/dlang-community/libdparse/pull/466?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community) ```diff @@ Coverage Diff @@ ## master #466 +/- ## ========================================== + Coverage 83.17% 83.20% +0.03% ========================================== Files 11 11 Lines 8338 8338 ========================================== + Hits 6935 6938 +3 + Misses 1403 1400 -3 ``` | [Impacted Files](https://codecov.io/gh/dlang-community/libdparse/pull/466?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community) | Coverage Δ | | |---|---|---| | [src/dparse/parser.d](https://codecov.io/gh/dlang-community/libdparse/pull/466/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community#diff-c3JjL2RwYXJzZS9wYXJzZXIuZA==) | `91.39% <100.00%> (+0.08%)` | :arrow_up: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/dlang-community/libdparse/pull/466?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community). > **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=dlang-community) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/dlang-community/libdparse/pull/466?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community). Last update [19a8489...b717b20](https://codecov.io/gh/dlang-community/libdparse/pull/466?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dlang-community). 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=dlang-community).
WebFreak001 commented 1 year ago

we have the XPath based testing framework setup for this, I think that's the easiest way to test for an AST modification like this.