stfc / PSyclone

Domain-specific compiler and code transformation system for Finite Difference/Volume/Element Earth-system models in Fortran
BSD 3-Clause "New" or "Revised" License
104 stars 27 forks source link

Fortran array syntax not recognized #2721

Open hbrunie opened 1 week ago

hbrunie commented 1 week ago
@pytest.mark.xfail
def test_psyclone_special_array_notation():
    code = """subroutine foo(a, n)
  integer :: n
  real*8, dimension(5) :: a

  a = (/2, 3, 4, 1/)

end subroutine foo\n"""
    reader = FortranReader()
    psyir_tree: Node = reader.psyir_from_source(code)
    assert len(psyir_tree.walk(CodeBlock)) == 0, psyir_tree.walk(CodeBlock)[
        0
    ].debug_string()
    writer = FortranWriter()
    output = writer(psyir_tree)
    assert code == output