Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support type specification in array constructors (Fortran 2003) #99

Open
jme52 opened this issue Apr 8, 2019 · 0 comments
Open

Support type specification in array constructors (Fortran 2003) #99

jme52 opened this issue Apr 8, 2019 · 0 comments

Comments

@jme52
Copy link

jme52 commented Apr 8, 2019

I believe that the following is a valid Fortran 2003 program:

program tsac
  implicit none

  write(*,"(A,'#')") [ character(len=6) :: 'Rome', 'London' ]

end program

It uses an array constructor with a type specification, which in many cases is optional, but here is required due to the different lengths of 'Rome' and 'London'. You may find more information on this feature, introduced in Fortran 2003, in section 4.7 of the 2003 standard, in particular rule R466 (and related statements and constraints).

Compilers such as gfortran (8.2.0) and Intel Fortran (19.0.2.187) correctly compile it. However, the current master version of fortran-src (9af8a45) seems unable to parse the type specification of the array constructor:

$ stack exec camfort -- count -F03 tsac.f90
Getting project config file from STACK_YAML environment
Counting variable declarations in 'tsac.f90'
Successfully parsed 0 precompiled file(s).
tsac.f90, 4:43: tsac.f90: parsing failed. 
Last parsed token: TDoubleColon (4:41)-(4:42).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant