stfc / fparser

This project maintains and develops a Fortran parser called fparser2 written purely in Python which supports Fortran 2003 and some Fortran 2008. A legacy parser fparser1 is also available but is not supported. The parsers were originally part of the f2py project by Pearu Peterson.
https://fparser.readthedocs.io
Other
64 stars 29 forks source link

(Closes #412) fix reader for include files #414

Closed arporter closed 1 year ago

arporter commented 1 year ago

Currently the reader reverses the lines it returns for an include file. This happens if a match fails and read lines are pushed into the FIFO. This PR is a small fix which just ensures that such lines are pushed into the FIFO of the current reader object rather than the top-level one.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 :tada:

Comparison is base (a0d8253) 91.76% compared to head (e2b499b) 91.80%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #414 +/- ## ========================================== + Coverage 91.76% 91.80% +0.04% ========================================== Files 37 37 Lines 13387 13390 +3 ========================================== + Hits 12284 12293 +9 + Misses 1103 1097 -6 ``` | [Impacted Files](https://app.codecov.io/gh/stfc/fparser/pull/414?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc) | Coverage Δ | | |---|---|---| | [src/fparser/common/readfortran.py](https://app.codecov.io/gh/stfc/fparser/pull/414?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvY29tbW9uL3JlYWRmb3J0cmFuLnB5) | `94.79% <100.00%> (+0.01%)` | :arrow_up: | | [src/fparser/common/tests/test\_readfortran.py](https://app.codecov.io/gh/stfc/fparser/pull/414?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc#diff-c3JjL2ZwYXJzZXIvY29tbW9uL3Rlc3RzL3Rlc3RfcmVhZGZvcnRyYW4ucHk=) | `99.15% <100.00%> (+0.01%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/stfc/fparser/pull/414/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=stfc)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

arporter commented 1 year ago

Ready for review. One for @sergisiso or @rupertford I think.

arporter commented 1 year ago

Right, ready for another look now. Hopefully the testing makes more sense this time!