Skip to content

Support initial procedure pointer (=>target) declaration under F2008 #508

@perazz

Description

@perazz

fparser rejects valid Fortran 2008 procedure declaration when a procedure pointer is given an initial non-null target (null target is supported):

procedure(foo_cb), pointer, nopass :: eval => dummy_output

Parsing this with std='f2008' raises a FortranSyntaxError, while gfortran -std=f2008 runs it fine.

I have proposed a fix at #502. I found one reference of why that should be supported part of the F2008 language specs at J3 working document 10-007r1 §12.4.3.6:

R1214  proc-decl           is procedure-entity-name [ => proc-pointer-init ]
R1216  proc-pointer-init   is null-init
                           or initial-proc-target
R1217  initial-proc-target is procedure-name
C1219 (R1214) If => appears in proc-decl, the procedure entity shall
              have the POINTER attribute.
F2003 R1214 was procedure-entity-name [ => null-init ] - same rule number, narrower body. C1219 is unchanged between standards.

Thank you for the excellent work on fparser,
Federico

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions