Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#20 Labelled Exits #36

Merged
merged 7 commits into from
Mar 7, 2022

Conversation

bilal-chughtai
Copy link
Contributor

@bilal-chughtai bilal-chughtai commented Feb 25, 2022

Implemented the rule outlined in #20 , along with some tests for it. One could also check for labels on do statements, though this is redundant, as code will not compile if an exit statement label exists without a matching do statement label.

Some background on the reason for wanting this via @AdamVoysey: The behaviour of unlabeled exit statements has subtly changed between different versions of the Fortran standard as new functionality has been added. So rather than say something like "if you're using Fortran 2003 you have to label these cases; if you are using Fortran 2008 you also have to label these" etc. we decided it was just easier to label everything, as that is not ambiguous or dependant on which compiler settings you use.

Copy link
Collaborator

@MatthewHambley MatthewHambley left a comment

Choose a reason for hiding this comment

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

Change looks good. Please respond to comments with changes or explinations.

unit-tests/fortran_labelled_exit_test.py Outdated Show resolved Hide resolved
source/stylist/fortran.py Outdated Show resolved Hide resolved
unit-tests/fortran_labelled_exit_test.py Outdated Show resolved Hide resolved
unit-tests/fortran_labelled_exit_test.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@MatthewHambley MatthewHambley left a comment

Choose a reason for hiding this comment

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

Everything looks fine for a a final merge.

@MatthewHambley MatthewHambley merged commit cd2a606 into MetOffice:master Mar 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants