flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

Improve array element errors #1039

Closed tskeith closed 4 years ago

tskeith commented 4 years ago

When something is parsed as an array element it was sometimes intended to be a function call or structure constructor. So if the base name is not found the errors can be confusing. This is an attempt to improve them.

When the subscript list is empty, it was probably meant to be a function call, so report that the name is not a function.

If the base is a scalar but there are subscripts, report that it is not an array.