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

Issue with missing loop condition. #309

Open
hlim1 opened this issue Jul 12, 2019 · 3 comments
Open

Issue with missing loop condition. #309

hlim1 opened this issue Jul 12, 2019 · 3 comments
Assignees

Comments

@hlim1
Copy link
Contributor

hlim1 commented Jul 12, 2019

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.

@adarshp
Copy link
Collaborator

adarshp commented Feb 16, 2020

@hlim1 @skdebray Is this issue resolved?

@hlim1
Copy link
Contributor Author

hlim1 commented Feb 16, 2020

@adarshp I'm afraid it is not handled yet. I've opened this issue and totally forgotten about it. Although this seems not a difficult problem to solve, I will soon handle it and close this issue.
Thank you!

@adarshp
Copy link
Collaborator

adarshp commented Feb 16, 2020

@hlim1 sounds good, thanks!

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

3 participants