Skip to content

Issue with missing loop condition. #309

Description

@hlim1

In Fortran, missing loop condition is a valid open-ended syntax.
For example,

      program odd_number
      implicit none
      integer :: N, k
      N = 19
      WRITE(*,*) 'Odd number between 0 and ', N
      k = 0
      DO
        k = k + 1
        if (k > N) EXIT
        if (mod(k,2) .eq. 0) CYCLE
        WRITE(*,*) k, ' is an odd number between 0 and ', N
      END DO
      end program odd_number

The above code's XML AST won't hold header element.

<loop type="do-label">
      <body>
      </body>
</loop>

which in existing condition case will look like:

<loop type="do-label">
      <header>
           <operation>
            ...
      </header>
      <body>
      </body>
</loop>

This may require handling at the level of rectifying to generate the header and its subelements as a default when it's missing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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