Skip to content

Conversation

@gold2718
Copy link
Collaborator

Improve parsing of Fortran array specifications

capgen was reporting odd errors when a semi-colon typo appeared in the middle of an
array specification.
This is due to the fact that the semi-colon is a Fortran special character used to separate statements making it possible to have multiple statements on a single source line.
This PR allows semi-colons to appear in parentheses in a statement.
To have this result in a more useful parsing error, some refactoring was done on how the Fortran parser collects and displays errors (an onion peel I have wanted to do for a while although there is plenty of onion left).

User interface changes?: No

Fixes: #362

Testing:
test removed:
unit tests:
system tests:
manual testing:

@gold2718 gold2718 self-assigned this Sep 20, 2025
@gold2718 gold2718 added the bugfix Fix for issue with 'bug' label. label Sep 20, 2025
@mkavulich
Copy link
Collaborator

@gold2718 Is this still a work in progress? I see that the CI is not passing.

Steve Goldhaber added 2 commits October 9, 2025 22:36
@gold2718
Copy link
Collaborator Author

gold2718 commented Oct 9, 2025

@mkavulich, sorry about that, I had forgotten about this. It turns out that a last piece of the development was never committed and uploaded. I did that and also merged up to develop to make sure this is (I hope) ready to go now.

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for fixing this!

@mkavulich
Copy link
Collaborator

@gold2718 Since #684 was merged there are two conflicts that need to be resolved, once that is done I think this can be merged.

@gold2718
Copy link
Collaborator Author

gold2718 commented Nov 5, 2025

@mkavulich, is this ready to move forward?

@gold2718 gold2718 linked an issue Nov 5, 2025 that may be closed by this pull request
@mkavulich mkavulich merged commit 5111df8 into NCAR:develop Nov 5, 2025
19 checks passed
@climbfuji climbfuji deleted the improve_fortran_parse_errors branch November 5, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix for issue with 'bug' label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fortran parser must report error in dimension string correctly

4 participants