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

DO LABEL WHILE not supported #34

Closed
dorchard opened this issue Aug 11, 2016 · 1 comment
Closed

DO LABEL WHILE not supported #34

dorchard opened this issue Aug 11, 2016 · 1 comment
Assignees

Comments

@dorchard
Copy link
Member

Fortran 90 standard allows the following kind of thing:

      program dowhile
      implicit none
      integer :: i = 0
      DO  200  WHILE (i .lt. 10)
         i = i + 1
  200  write (*,*), i
      end

We can't parse a DO WHILE with a label in it yet. Should we allow this in F77 extended too as well as F90?

@dorchard dorchard assigned dorchard and madgen and unassigned dorchard Aug 11, 2016
@raehik
Copy link
Collaborator

raehik commented Jul 28, 2021

Resurrecting this because the parsers indicate that this should be supported:

EXECUTABLE_STATEMENT :: { Statement A0 }
...
| do INTEGER_LITERAL MAYBE_COMMA while '(' EXPRESSION ')'
  { StDoWhile () (getTransSpan $1 $7) Nothing (Just $2) $6 }
...

Lexing your passage shows that the lexer fails to lex to a TWhile, instead finding a TId _ "while". It appears to be because a TWhile can only be lexed following a TDo (whereas here it follows a TIntegerLiteral _ "200").

Fixed with a test case in #164 .

@raehik raehik assigned raehik and unassigned madgen Jul 28, 2021
@raehik raehik closed this as completed Jul 28, 2021
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