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
63 stars 29 forks source link

#443 Support flag that triggers fparser to read code in OpenMP conditional sentinels #444

Closed hiker closed 5 months ago

hiker commented 6 months ago

Fixed #443, and is important for FAB to detect dependencies in omp sentinels.

The implementation is (unfortunately) on two different levels:

  1. Fixed format is handled on a line by line basis, since a continued conditional sentinel can be detected with an easy regexp.
  2. Free format continued conditional sentinels can only be reliably detected if the previous line had a conditional sentinel, any simple reg.exp cannot distinguish this from e.g. !$omp (since a '&' and esp. spaces around that are all optional), so it's handled on higher up when combining multiple lines.

Moving the fixed format handling up (to the level where the free format is handled) seems to be more difficult, since free format is handled in many different ways when combining lines (strict format, fixed, f77) - so I opted for the two different levels.

I can confirm that this with changes fab now (when supplying the required optional flag) detects dependencies in conditional omp sentinels.

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.07%. Comparing base (1259f8a) to head (338bd07).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #444 +/- ## ========================================== + Coverage 91.99% 92.07% +0.08% ========================================== Files 85 85 Lines 13678 13825 +147 ========================================== + Hits 12583 12730 +147 Misses 1095 1095 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hiker commented 5 months ago

Ready for next review.

arporter commented 5 months ago

Hi @hiker, github isn't showing any commits since the last review?

hiker commented 5 months ago

Dang, yes, I missed that you updated this branch, so my push didn't go through, and I didn't notice. Now something should be there :)

hiker commented 5 months ago

Ready for next review.

sergisiso commented 5 months ago

@hiker @arporter and the Codecov status check is working again 🥳 (after we reinstalled the github app). I will close the codecov issue now.