From c084006f44ff4cbfe305b3e4006138510743a615 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Wed, 2 Oct 2024 12:59:50 +1000 Subject: [PATCH 01/11] #320 Added support for 2008 standard of the Stop_Code definition. --- src/fparser/two/Fortran2008/__init__.py | 3 +- src/fparser/two/Fortran2008/stop_code_r857.py | 50 ++++++++++++++++ .../tests/fortran2008/test_stop_code_r857.py | 60 +++++++++++++++++++ 3 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 src/fparser/two/Fortran2008/stop_code_r857.py create mode 100644 src/fparser/two/tests/fortran2008/test_stop_code_r857.py diff --git a/src/fparser/two/Fortran2008/__init__.py b/src/fparser/two/Fortran2008/__init__.py index 3a04c8a4..fe135021 100644 --- a/src/fparser/two/Fortran2008/__init__.py +++ b/src/fparser/two/Fortran2008/__init__.py @@ -1,7 +1,7 @@ # ----------------------------------------------------------------------------- # BSD 3-Clause License # -# Copyright (c) 2023, Science and Technology Facilities Council. +# Copyright (c) 2023-2024, Science and Technology Facilities Council. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -66,6 +66,7 @@ from fparser.two.Fortran2008.loop_control_r818 import Loop_Control from fparser.two.Fortran2008.if_stmt_r837 import If_Stmt from fparser.two.Fortran2008.error_stop_stmt_r856 import Error_Stop_Stmt +from fparser.two.Fortran2008.stop_code_r857 import Stop_Code from fparser.two.Fortran2008.specification_part_c1112 import Specification_Part_C1112 from fparser.two.Fortran2008.implicit_part_c1112 import Implicit_Part_C1112 from fparser.two.Fortran2008.implicit_part_stmt_c1112 import Implicit_Part_Stmt_C1112 diff --git a/src/fparser/two/Fortran2008/stop_code_r857.py b/src/fparser/two/Fortran2008/stop_code_r857.py new file mode 100644 index 00000000..5628f861 --- /dev/null +++ b/src/fparser/two/Fortran2008/stop_code_r857.py @@ -0,0 +1,50 @@ +# ----------------------------------------------------------------------------- +# BSD 3-Clause License +# +# Copyright (c) 2024, Science and Technology Facilities Council. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- + +""" + Module containing Fortran2008 Error_Stop_Stmt rule R857 +""" +from fparser.two.utils import Base + + +class Stop_Code(Base): # R857 + """ + Fortran2008 rule R867. Changes the allowed stop code type. + + stop-code is scalar-default-char-constant-expr + or scalar-int-constant-expr + """ + + subclass_names = ["Scalar_Default_Char_Expr", "Scalar_Int_Expr"] + use_names = ["Stop_Code"] diff --git a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py new file mode 100644 index 00000000..afc06e5e --- /dev/null +++ b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py @@ -0,0 +1,60 @@ +# Copyright (c) 2024 Science and Technology Facilities Council + +# All rights reserved. + +# Modifications made as part of the fparser project are distributed +# under the following license: + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: + +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. + +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Test Fortran 2008 rule R856 + + error-stop-stmt is ERROR STOP [ stop-code ] +""" + +import pytest +from fparser.two.utils import NoMatchError +from fparser.two.Fortran2008 import Stop_Code + + +@pytest.mark.usefixtures("f2008_create") +@pytest.mark.parametrize("string", ["1", "- 1", '"abc"', "'abc'", + "'abc' // 'def'"]) +def test_simple_stop_code(string): + """Test that error-stop matches the expected valid """ + result = Stop_Code(string) + assert str(result) == string + + +@pytest.mark.usefixtures("f2008_create") +@pytest.mark.parametrize("string", ["call sub()", "do i", "1, 2, 3"]) +def test_simple_stop_code_errors(string): + """Test that invalid stop codes are handled.""" + with pytest.raises(NoMatchError) as err: + Stop_Code(string) + assert f"Stop_Code: '{string}'" in str(err.value) From 5143e91505511b126741d6f1c9be441de35da624 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Wed, 2 Oct 2024 13:01:48 +1000 Subject: [PATCH 02/11] #320 Added extension support for stop_code. --- src/fparser/two/Fortran2003.py | 9 +++++++-- src/fparser/two/tests/test_fortran2003.py | 8 ++++++++ src/fparser/two/utils.py | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/fparser/two/Fortran2003.py b/src/fparser/two/Fortran2003.py index a714f405..ec7912d1 100644 --- a/src/fparser/two/Fortran2003.py +++ b/src/fparser/two/Fortran2003.py @@ -8504,14 +8504,19 @@ class Stop_Code(StringBase): # R850 = | [ [ [ [ ] ] ] ] - + Extension: + | Level_3_Expr """ subclass_names = ["Scalar_Char_Constant"] @staticmethod def match(string): - return StringBase.match(pattern.abs_label, string) + result = StringBase.match(pattern.abs_label, string) + if result or not "extended-stop-format" in EXTENSIONS(): + return result + # This will allow statements like `stop -1` and `stop str1//str2` + return Level_3_Expr(string) # diff --git a/src/fparser/two/tests/test_fortran2003.py b/src/fparser/two/tests/test_fortran2003.py index 1993ae9d..f106ab4c 100644 --- a/src/fparser/two/tests/test_fortran2003.py +++ b/src/fparser/two/tests/test_fortran2003.py @@ -2110,6 +2110,14 @@ def test_stop_stmt(): # R849 assert isinstance(obj, tcls), repr(obj) assert str(obj) == "STOP 'hey you'" + obj = tcls('stop "123"//"456"') + assert isinstance(obj, tcls), repr(obj) + assert str(obj) == 'STOP "123" // "456"' + + obj = tcls("stop -321") + assert isinstance(obj, tcls), repr(obj) + assert str(obj) == "STOP - 321" + # # SECTION 9 diff --git a/src/fparser/two/utils.py b/src/fparser/two/utils.py index 04c65005..64887e34 100644 --- a/src/fparser/two/utils.py +++ b/src/fparser/two/utils.py @@ -114,6 +114,11 @@ # when reading/writing data using unformatted IO. _EXTENSIONS += ["open-convert"] +# While non-standard, many compilers support negative numbers, and string +# operations in stop statements, e.g. `stop -1` or `stop str1//str2`. +# With this extension, these statements will be allowed. +_EXTENSIONS += ["extended-stop-format"] + def EXTENSIONS(): """ From 503205b5051f58f49bc434aea014580453dd3316 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Wed, 2 Oct 2024 13:12:17 +1000 Subject: [PATCH 03/11] #320 Updated documentation. --- doc/source/fparser2.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/source/fparser2.rst b/doc/source/fparser2.rst index 3adf1d33..eba78971 100644 --- a/doc/source/fparser2.rst +++ b/doc/source/fparser2.rst @@ -374,6 +374,19 @@ This extension is supported by (at least) the Gnu, Intel and Cray compilers but is not a part of any Fortran standard. More details can be found at https://gcc.gnu.org/onlinedocs/gfortran/CONVERT-specifier.html +Extended arguments for STOP ++++++++++++++++++++++++++++ + +May compiler support extended arguments for the STOP statement before Fortran 2008. +Examples are negative numbers, and string operations:: + + STOP -1 + STOP str1 // str2 + +This extension will accept these expressions in Fortran 2003. Note that the +Fortran 2008 standard changes the definition of the stop code to accept even +more flexible expressions. + Classes ------- From 926d58166b2452298aaca4cfa80f37db9ade7825 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Wed, 2 Oct 2024 14:17:29 +1000 Subject: [PATCH 04/11] #320 Fixed black and typo. --- src/fparser/two/tests/fortran2008/test_stop_code_r857.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py index afc06e5e..e65f99fe 100644 --- a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py +++ b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py @@ -43,10 +43,9 @@ @pytest.mark.usefixtures("f2008_create") -@pytest.mark.parametrize("string", ["1", "- 1", '"abc"', "'abc'", - "'abc' // 'def'"]) +@pytest.mark.parametrize("string", ["1", "- 1", '"abc"', "'abc'", "'abc' // 'def'"]) def test_simple_stop_code(string): - """Test that error-stop matches the expected valid """ + """Test that error-stop matches the expected valid values.""" result = Stop_Code(string) assert str(result) == string From bf5ac0658c5754e555e408bdf7f2ff6b42ff4ad8 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Fri, 11 Oct 2024 13:35:36 +1100 Subject: [PATCH 05/11] #320 Replaced tabs with spaces. --- doc/source/developers_guide.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/developers_guide.rst b/doc/source/developers_guide.rst index c58cf220..44218df2 100644 --- a/doc/source/developers_guide.rst +++ b/doc/source/developers_guide.rst @@ -403,7 +403,7 @@ and for Fortran2008 it is R202 program-unit is main-program or external-subprogram or module - or submodule + or submodule or block-data Therefore to implement the Fortran2008 version of this class, the @@ -1009,7 +1009,7 @@ f2003_create -- Sets-up the class hierarchy for the Fortran2003 parser. f2003_parser `Fortran2003.Program` Sets-up the class hierarchy for the Fortran2003 parser and returns the - top-level Program object. + top-level Program object. clear_symbol_table -- Removes all stored symbol tables. fake_symbol_table -- Creates a fake scoping region and associated symbol table. From b4eef57bd6a33aacfcc219e587b2d127f52bcefe Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Sat, 12 Oct 2024 00:40:07 +1100 Subject: [PATCH 06/11] #320 Renamed extended-stop-format to extended-stop-args. --- src/fparser/two/Fortran2003.py | 2 +- src/fparser/two/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fparser/two/Fortran2003.py b/src/fparser/two/Fortran2003.py index ec7912d1..3068efbd 100644 --- a/src/fparser/two/Fortran2003.py +++ b/src/fparser/two/Fortran2003.py @@ -8513,7 +8513,7 @@ class Stop_Code(StringBase): # R850 @staticmethod def match(string): result = StringBase.match(pattern.abs_label, string) - if result or not "extended-stop-format" in EXTENSIONS(): + if result or not "extended-stop-args" in EXTENSIONS(): return result # This will allow statements like `stop -1` and `stop str1//str2` return Level_3_Expr(string) diff --git a/src/fparser/two/utils.py b/src/fparser/two/utils.py index 64887e34..3745697c 100644 --- a/src/fparser/two/utils.py +++ b/src/fparser/two/utils.py @@ -117,7 +117,7 @@ # While non-standard, many compilers support negative numbers, and string # operations in stop statements, e.g. `stop -1` or `stop str1//str2`. # With this extension, these statements will be allowed. -_EXTENSIONS += ["extended-stop-format"] +_EXTENSIONS += ["extended-stop-args"] def EXTENSIONS(): From e0ab61e55e1739632301d12c4a36d697ae153f7a Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Sat, 12 Oct 2024 00:40:31 +1100 Subject: [PATCH 07/11] #320 Updated documentation. --- doc/source/fparser2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/fparser2.rst b/doc/source/fparser2.rst index eba78971..34e1de45 100644 --- a/doc/source/fparser2.rst +++ b/doc/source/fparser2.rst @@ -377,7 +377,7 @@ https://gcc.gnu.org/onlinedocs/gfortran/CONVERT-specifier.html Extended arguments for STOP +++++++++++++++++++++++++++ -May compiler support extended arguments for the STOP statement before Fortran 2008. +Many compilers support extended arguments for the STOP statement before Fortran 2008. Examples are negative numbers, and string operations:: STOP -1 From 442fc01c7c4ad29550af6a7c883a28099e5067be Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Sat, 12 Oct 2024 00:41:37 +1100 Subject: [PATCH 08/11] #320 Added more tests as requested in review. --- .../tests/fortran2008/test_stop_code_r857.py | 38 +++++++++++++++ src/fparser/two/tests/test_fortran2003.py | 47 +++++++++++++++---- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py index e65f99fe..5832397b 100644 --- a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py +++ b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py @@ -39,8 +39,12 @@ import pytest from fparser.two.utils import NoMatchError +from fparser.two import Fortran2003, utils from fparser.two.Fortran2008 import Stop_Code +from fparser.api import get_reader +from fparser.two.utils import NoMatchError, walk + @pytest.mark.usefixtures("f2008_create") @pytest.mark.parametrize("string", ["1", "- 1", '"abc"', "'abc'", "'abc' // 'def'"]) @@ -57,3 +61,37 @@ def test_simple_stop_code_errors(string): with pytest.raises(NoMatchError) as err: Stop_Code(string) assert f"Stop_Code: '{string}'" in str(err.value) + + +@pytest.mark.parametrize("string", ["1", "12345"]) +def test_stop_stmt_2003_stop_code(f2008_parser, string): + """Test that 'stop' parsing works in real code, and returns a 2003 + StopCode. This is the case if the stop code is between one and + five digits only: + """ + code = f""" + subroutine dummy() + stop {string} + end subroutine dummy + """ + tree = f2008_parser(get_reader(code)) + stop_code = walk(tree, Fortran2003.Stop_Code)[0] + assert str(stop_code) == string + + +@pytest.mark.parametrize("string", ["1234567", "12 .AND. 34"]) +def test_stop_stmt_2008(f2008_parser, string, monkeypatch): + """Test that stop parsing works in real code when using F2008 + only (i.e. not F2003) statements. Note that '12 .and. 34' is a + level-5-expr, and as such would not be accepted by the F2003 + "extended-stop-args" extension in fparser. + """ + monkeypatch.setattr(utils, "_EXTENSIONS", []) + code = f""" + subroutine dummy() + stop {string} + end subroutine dummy + """ + tree = f2008_parser(get_reader(code)) + stop_stmt = walk(tree, Fortran2003.Stop_Stmt)[0] + assert str(stop_stmt.children[1]) == string diff --git a/src/fparser/two/tests/test_fortran2003.py b/src/fparser/two/tests/test_fortran2003.py index f106ab4c..f1105b6e 100644 --- a/src/fparser/two/tests/test_fortran2003.py +++ b/src/fparser/two/tests/test_fortran2003.py @@ -1,4 +1,4 @@ -# Modified work Copyright (c) 2017-2023 Science and Technology +# Modified work Copyright (c) 2017-2024 Science and Technology # Facilities Council. # Original work Copyright (c) 1999-2008 Pearu Peterson # @@ -68,10 +68,12 @@ """ import pytest + from fparser.two.Fortran2003 import * from fparser.two import Fortran2003 from fparser.two.symbol_table import SYMBOL_TABLES from fparser.two.utils import NoMatchError +from fparser.two import utils from fparser.api import get_reader @@ -2096,7 +2098,17 @@ def test_continue_stmt(): # R848 assert repr(obj) == "Continue_Stmt('CONTINUE')" -def test_stop_stmt(): # R849 +@pytest.mark.parametrize("standard_only", [True, False]) +def test_stop_stmt_standard_2003(standard_only, monkeypatch): + '''Test that stop statements are parsed correctly [R849]. + It tests both pure 2003 standard compliance, but also + that negative numbers and string concatenations are accepted. + ''' + if standard_only: + # Disable the stop-stmt extension for this test to verify + # that really only standard expressions are accepted + monkeypatch.setattr(utils, "_EXTENSIONS", []) + tcls = Stop_Stmt obj = tcls("stop") assert isinstance(obj, tcls), repr(obj) @@ -2110,13 +2122,32 @@ def test_stop_stmt(): # R849 assert isinstance(obj, tcls), repr(obj) assert str(obj) == "STOP 'hey you'" - obj = tcls('stop "123"//"456"') - assert isinstance(obj, tcls), repr(obj) - assert str(obj) == 'STOP "123" // "456"' + # This should not be accepted even with the extension enabled: + with pytest.raises(NoMatchError) as excinfo: + tcls("stop 12 .and. 34") + assert "Stop_Stmt: 'stop 12 .and. 34'" in str(excinfo.value) + + if standard_only: + # This should not be accepted according to F2003 + with pytest.raises(NoMatchError) as excinfo: + tcls('stop "123"//"456"') + assert "Stop_Stmt: 'stop \"123\"//\"456\"" in str(excinfo.value) + + # This should not be accepted according to F2003 + with pytest.raises(NoMatchError) as excinfo: + tcls("stop -321") + assert "Stop_Stmt: 'stop -321'" in str(excinfo.value) + + else: + # Test the F2003 standard extensions, which should + # accept these expressions + obj = tcls('stop "123"//"456"') + assert isinstance(obj, tcls), repr(obj) + assert str(obj) == 'STOP "123" // "456"' - obj = tcls("stop -321") - assert isinstance(obj, tcls), repr(obj) - assert str(obj) == "STOP - 321" + obj = tcls("stop -321") + assert isinstance(obj, tcls), repr(obj) + assert str(obj) == "STOP - 321" # From 815503b307c0fd26237466279895532e5df17ba1 Mon Sep 17 00:00:00 2001 From: Joerg Henrichs Date: Sat, 12 Oct 2024 00:42:31 +1100 Subject: [PATCH 09/11] #320 Black for codestyle improvements. --- src/fparser/two/tests/test_fortran2003.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fparser/two/tests/test_fortran2003.py b/src/fparser/two/tests/test_fortran2003.py index f1105b6e..e1cc78fc 100644 --- a/src/fparser/two/tests/test_fortran2003.py +++ b/src/fparser/two/tests/test_fortran2003.py @@ -2100,10 +2100,10 @@ def test_continue_stmt(): # R848 @pytest.mark.parametrize("standard_only", [True, False]) def test_stop_stmt_standard_2003(standard_only, monkeypatch): - '''Test that stop statements are parsed correctly [R849]. + """Test that stop statements are parsed correctly [R849]. It tests both pure 2003 standard compliance, but also that negative numbers and string concatenations are accepted. - ''' + """ if standard_only: # Disable the stop-stmt extension for this test to verify # that really only standard expressions are accepted @@ -2131,7 +2131,7 @@ def test_stop_stmt_standard_2003(standard_only, monkeypatch): # This should not be accepted according to F2003 with pytest.raises(NoMatchError) as excinfo: tcls('stop "123"//"456"') - assert "Stop_Stmt: 'stop \"123\"//\"456\"" in str(excinfo.value) + assert 'Stop_Stmt: \'stop "123"//"456"' in str(excinfo.value) # This should not be accepted according to F2003 with pytest.raises(NoMatchError) as excinfo: From 6b5da16effb37ecea68d73c318f765d8bf8f9ef6 Mon Sep 17 00:00:00 2001 From: Andrew Porter Date: Mon, 14 Oct 2024 16:04:02 +0100 Subject: [PATCH 10/11] #320 tidy import lines in test --- src/fparser/two/tests/fortran2008/test_stop_code_r857.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py index 5832397b..12424cfd 100644 --- a/src/fparser/two/tests/fortran2008/test_stop_code_r857.py +++ b/src/fparser/two/tests/fortran2008/test_stop_code_r857.py @@ -38,12 +38,11 @@ """ import pytest -from fparser.two.utils import NoMatchError -from fparser.two import Fortran2003, utils -from fparser.two.Fortran2008 import Stop_Code from fparser.api import get_reader from fparser.two.utils import NoMatchError, walk +from fparser.two import Fortran2003, utils +from fparser.two.Fortran2008 import Stop_Code @pytest.mark.usefixtures("f2008_create") From 17a1078db19695e3513342329d5f28c755ab4ca0 Mon Sep 17 00:00:00 2001 From: Andrew Porter Date: Mon, 14 Oct 2024 16:05:34 +0100 Subject: [PATCH 11/11] #320 update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 981e5a55..9407774a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ Modifications by (in alphabetical order): * P. Vitt, University of Siegen, Germany * A. Voysey, UK Met Office +14/10/2024 PR #451 for #320. Adds an extension to Fortran2003 to support non-standard STOP + expressions and adds support for them in 2008. + 11/10/2024 PR #450 for #448. Adds an example script for removing all protected/private attributes from a parse tree.