You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a.f90:6:8: error: expected '('
real :: x(10,:)
^
a.f90:6:3: in the context: statement function definition
real :: x(10,:)
^
a.f90:6:3: in the context: declaration construct
a.f90:6:3: in the context: specification part
a.f90:5:1: in the context: SUBROUTINE subprogram
subroutine s(x)
^
In this case the user has combined valid shape-specs (10 and :) in a way that makes an invalid array-spec. But the error messages aren't very helpful to figure that out.
Here are some other examples that get a similar error message:
real :: x(*,10)
real :: x(10,..)
real :: x(:,*)
One fix would be for the parser to accept any sequence of shape-specs and then leave it to semantics to report bad combinations. We already have to detect valid array-specs that are used in the wrong context.
The text was updated successfully, but these errors were encountered:
Another approach to a fix would be to perform custom error recovery on array-specs, and just accept any list of token sequences with properly nested parentheses.
Test program:
Compiler output:
In this case the user has combined valid shape-specs (
10
and:
) in a way that makes an invalid array-spec. But the error messages aren't very helpful to figure that out.Here are some other examples that get a similar error message:
One fix would be for the parser to accept any sequence of shape-specs and then leave it to semantics to report bad combinations. We already have to detect valid array-specs that are used in the wrong context.
The text was updated successfully, but these errors were encountered: