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

outer-shared-do-construct and inner-shared-do-construct not created #422

Open rupertford opened 1 year ago

rupertford commented 1 year ago

In fparser2, the implementation of f2003 rule 835 <nonblock-do-stmt> = <action-term-do-construct>|<outer-shared-do-construct> checks for action-term-do-construct first and this appears to return a valid tree even if there are nested loops.

The obvious solution would be to re-order the order of rule checking. However, the implementation of outer-shared-do-construct and inner-shared-do-construct do not restore the reader if they fail to match, which will cause parse failures, so this also needs fixing at the same time.

When this is fixed then f2008 do concurrent support for these two classes should also be added.