Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Modifications by (in alphabetical order):
* P. Vitt, University of Siegen, Germany
* A. Voysey, UK Met Office

18/08/2026 PR #525 for #524. Fix Io_Implied_Do rejecting a minimal-length
io-implied-do such as "(i,i=1,n)" (off-by-one in the length guard).

16/07/2026 PR #520 for #519. Fix truncation of a character length expression that
contains a comma (e.g. the arguments to an intrinsic such as
MAX) when the kind appears before the length in a char-selector.
Expand Down
4 changes: 3 additions & 1 deletion src/fparser/two/Fortran2003.py
Original file line number Diff line number Diff line change
Expand Up @@ -9329,7 +9329,9 @@ class Io_Implied_Do(Base): # R917

@staticmethod
def match(string):
if len(string) <= 9 or string[0] != "(" or string[-1] != ")":
# The shortest possible io-implied-do, e.g. "(i,i=1,2)", is 9
# characters long.
if len(string) < 9 or string[0] != "(" or string[-1] != ")":
return
line, repmap = string_replace_map(string[1:-1].strip())
i = line.rfind("=")
Expand Down
5 changes: 5 additions & 0 deletions src/fparser/two/tests/test_fortran2003.py
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,11 @@ def test_io_implied_do(): # R917
assert isinstance(obj, tcls), repr(obj)
assert str(obj) == "(a, i = 1, 2)"

# Minimal-length (9-character) io-implied-do.
obj = tcls("(i,i=1,2)")
assert isinstance(obj, tcls), repr(obj)
assert str(obj) == "(i, i = 1, 2)"

obj = tcls("((i+j,j=3,4,1), i=1,2)")
assert isinstance(obj, tcls), repr(obj)
assert str(obj) == "((i + j, j = 3, 4, 1), i = 1, 2)"
Expand Down
Loading