Skip to content

Argument names on unknown routines result in CodeBlocks #3268

@LonelyCat124

Description

@LonelyCat124

I guess as an issue, the following code:

subroutine test
        integer, dimension(100) :: x
        integer, dimension(100) :: y
        y = coshape(x, kind=4)
end subroutine test

creates:

FileContainer[]
    Routine[name:'test']
        0: Assignment[]
            Reference[name:'y']
            CodeBlock[[<class 'fparser.two.Fortran2003.Structure_Constructor'>]]

I guess this is an fparser issue - but we have quite a lot of IntrinsicCalls that fall through into PSyclone in unexpected ways - some of which just become ArrayReference, some of which become like the above. We should probably also fix this up and handle these as expected. I'll make an fparser issue and keep a list.

Originally posted by @LonelyCat124 in #2823

This behaviour would happen for any routine that isn't known by PSyclone (e.g. wildcard import) that has argument names.

The seen use cases (currently in tests for intrinsics) can be fixed by adding the intrinsics into Fparser, which has an open issue already, but is something to be generally aware of for the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions