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

Failed to parse this statement: write(6,'(10(e12.5,a))') ((array(i),' '), i=1,nb) #33

Open
uNouss opened this issue Apr 19, 2024 · 0 comments

Comments

@uNouss
Copy link
Collaborator

uNouss commented Apr 19, 2024

I have provided this code as an example.

      program main
      implicit none
      
      integer i
      integer nb
      parameter(nb=3)
      real array(nb)

*     -- initialize 'array'
      do i=1, nb
        array(i) = sin(real(i))
      enddo

*     -- print 'array' with '--' as separator
      write(6,'(10(f7.5,a))') ((array(i),'--'), i=1,nb)

      end

It's a Fortran77 code that I have retrieved and am working on.
I'd like to parse it with syntax and get the corresponding AST.

But I have an error on line $15$.

As far as I know, this statement is valid in fortran77 (see https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vnc5/index.html ).

If so, is it possible to take this type of expression into account in the parser as part of read, write and print?

Capture d’écran 2024-04-19 à 10 56 25
@uNouss uNouss assigned lsafina and unassigned lsafina May 7, 2024
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

2 participants