#1023 Fortran 90, "end forall" breaks symbol browser

None
closed-fixed
nobody
v1.23.1
5
2014-02-15
2014-01-14
Adam
No

It seems that as far as the symbol browser is concerned, END FORALL counts as END MODULE.

If you have a module CONTAINing several functions or subroutines, as soon as one of them uses END FORALL, all the later functions/subroutines show up as "outside" that module in the symbol browser (see attachment "outside.png").

If you comment out the END FORALL statement, clearly this makes the program wrong (in the cases where the FORALL block contains multiple statements, at least), but the symbol browser then correctly parses the document (see attachment "inside.png").

As I said, END FORALL isn't necessary (as far as the Fortran language is concerned) when you're only performing one operation using it (e.g. attachment "single_line.png"), but it is when you're using the FORALL as a block containing several statements.

1 Attachments

Discussion

  • Adam

    Adam - 2014-01-14

    In fact, there are a few other cases I've noticed which seem to break the symbol browser and make it prematurely place subsequent functions etc. "outside" the current module. They also have the quirk of making the immediately-following function/subroutine disappear from the symbol browser.

    1. continuation characters at the end of indented comment lines cause subsequent functions to become invisible unless you either delete the indent, or have another & at the beginning of the line immediately after the first & (see comment_newlines.f90)

    2. arrays of derived type cause subsequent functions to become invisible (specifically, the comma separating array elements; see derived_type_arrays.f90)

    3. This also causes duplicate and nonsense variables to appear if the derived-type array spans over multiple lines, I think the type constructor is being misrecognised as a declaration of a new type or new variable.

    So if anything, this bug report should really be a more general "Symbol Browser parsing issues with Fortran 90+"...

     
  • Adam

    Adam - 2014-01-15

    Aha, I noticed that the symbol-browser issue with arrays of derived types spanning across multiple lines only occurs if the arrays are using the Fortran 2003+ square-brackets [ ], rather than the classic (/ /).

     
  • Adam

    Adam - 2014-02-14

    ...this happens with END ASSOCIATE too!

    Just thought I'd touch base with that.

     
  • Adam

    Adam - 2014-02-14

    Notice that in THIS attachment, the bug makes it look like it's only ignoring the & when the comment character (!) is in column 1. It should ignore it anyway because it's AFTER a !.

    It makes it look like it's being processed by 'fixed form' F77 logic rather than 'free form' F90 logic...

     
    Last edit: Adam 2014-02-14
  • Colomban Wendling

    • labels: fortran --> fortran, parser
    • status: open --> closed-fixed
     

Log in to post a comment.