fortran_parsing (!9) follow up

Description

@lewisjarednz in hindsight I should have just done it this way from the start i.e. focussed on big structural things in !9 (merged) then left lower-level clarifications etc. for a follow-up MR after I could sit and play with it properly. A good lesson for next time.

I think I worked out the thing that really confused me in !9 (merged). I didn't read the Fortran spec properly so I didn't follow get what was going on (there is a comment next to the helpful lines asking if we should move them for bozos like me who don't read). Having read these lines, it was much clearer.

I also noticed that we were flipping between declaration and statement everywhere. These terms have precise meanings in the Fortran specification so I tried to use them consistently throughout, which I think makes it easier to know what you're looking at and what part of the processing is happening at different stages (you start with a type declaration, which gets split into a type specification and attribute specifications and is mostly the level we work at, but occasionally we put it back together to get the full type declaration again). It's a lot of changes and renaming of things (see the news fragments), but I think it does make things clearer.

I also just tried to make things more consistent in general, for example using specification everywhere rather than spec in some places and specification in others.

One other question: did we used to have a docstring linter? There were a few places where we had """start of docstring rather than having a newline between the """ and the text. This feels like the kind of thing that it would be great to have a linter or pre-commit hook for and I thought we used to but maybe I am forgetting. If anything comes to mind quickly let me know, otherwise I'll make an issue in our copier template instead where I can propose some options.

Merge Request Steps

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/.
Edited by Zebedee Nicholls

Merge request reports

Loading