Fortran: ctags does not handle =>null() correctly
Brought to you by:
dhiebert
Running ctags on the example fortran95 program attached, there is no reference in the tags file for variable 'y'.
Indeed, it seems that ctags ignores everything that comes after '=> null)()'
Contents of tags file:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.7 //
a t.f90 /^real/;" v program:p
p t.f90 /^pr/;" p
x t.f90 /^real :: x$/;" v program:p
(not a patch.)
the attached file (t.f) contains only the following:
program t
print *,'hello'
end
did you attach the wrong file?
the attached file (t.f) contains only the following:
program t
print *,'hello'
end
did you attach the wrong file?
the attached file (t.f) contains only the following:
program t
print *,'hello'
end
did you attach the wrong file?
f90 example
Sorry, indeed, I attached the wrong file, I attached now a better one.
The ctags command I used was:
ctags --Fortran-kinds=+Lvi t.f90
File Added: t.f90
The new example is slightly different from the previous one, here is the output of
ctags --Fortran-kinds=+Lvi t.f90
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.7 //
one t.f90 /^ module one$/;" m
x t.f90 /^ real x$/;" v module:one
y t.f90 /^ integer, dimension(:), pointer :: y /;" v module:one
In this case, after the declaration of y (using the '=> NULL()' construct, the declaration of 'z' is ignored.
for those of us who don't know fortran, can you provide a link to some documentation about => and what can come after it?
Change fortran.c:1337 from
else if (strcmp (vStringValue (token->string), "=") == 0)
to
else if (strcmp (vStringValue (token->string), "=") == 0
|| strcmp (vStringValue (token->string), "=>") == 0) .
That should fix it.