Geany-INFO: 11:12:09.088: Geany 1.34.1, en_US.UTF-8 Geany-INFO: 11:12:09.088: GTK 3.22.30, GLib 2.56.3 OS: Linux(Ubuntu 18.10) Filetype: Fortran
For Fortran modules the first function/subroutine contained in the module is not displayed in the Symbols list.
Can you provide a MWE?
the problem occurs if there is a non fortran variable type this doesn't work:
module test use hello_mod implicit none Hello :: h integer :: i contains function test1() end function test1 function test2() end function test2 end module test
while this does
module test use hello_mod implicit none integer :: i contains function test1() end function test1 function test2() end function test2 end module test
I guess the undefined `Hello` is confusing the parser which manages to get itself sort of back in sync at the `end function` so the next function is recognised, but not as part of the module. Note the integer `i` is not recognised either when the `Hello` is present.
I presume `Hello` is defined in `hello_mod`, but since Geany has no information where to find that then `Hello` is undefined. Since `Hello` is not defined the program is erroneous.
The parsers have only a limited ability to handle erroneous input, so I think its not doing badly actually recognising the second function at all.
The problem occurs with upstream [uctags](https://github.com/universal-ctags/ctags) too, `readtags -l` gives:
``` test /tmp/untitled.f90 /^module test$/ test2 /tmp/untitled.f90 /^function test2(/ ```
and
``` i /tmp/untitled.f90 /^in/ test /tmp/untitled.f90 /^module test$/ test1 /tmp/untitled.f90 /^function test1(/ test2 /tmp/untitled.f90 /^function test2(/ ```
with the `Hello :: h` line commented out.
@negf please raise an issue on upstream ctags so you can communicate directly if they have any questions (Geany is not populated by Fortranists) and post the issue reference here.
As far as my short studying, ``` Hello :: h ``` is incorrect (in meaning of syntax) fortran code. See http://www.icl.utk.edu/~mgates3/docs/fortran.html#Variable for an example.
For such garbage input, u-ctags emits garbage.
ctags captures i, test1, test2 and h itself If you put the `Hello` in `type()`: ``` module test use hello_mod implicit none type(Hello) :: h integer :: i contains function test1() end function test1 function test2() end function test2 end module test ```
I took three hours to get this result.
I think we should ask the reporter to show the description in a language reference or something that probes the input is valid.
Yeah, Seems not valid even in Fortran 2018 so marking invalid and closing, if the OP can post references for validity can re-open.
Closed #2115.
github-comments@lists.geany.org