#235 Fortran: ctags does not handle =>null() correctly

open
None
5
2008-12-13
2008-08-11
No

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

Discussion

  • Elliott Hughes

    Elliott Hughes - 2008-12-13

    (not a patch.)

     
  • Elliott Hughes

    Elliott Hughes - 2008-12-13
    • assigned_to: nobody --> elliotth
     
  • Elliott Hughes

    Elliott Hughes - 2008-12-13

    the attached file (t.f) contains only the following:

    program t
    print *,'hello'
    end

    did you attach the wrong file?

     
  • Elliott Hughes

    Elliott Hughes - 2008-12-13

    the attached file (t.f) contains only the following:

    program t
    print *,'hello'
    end

    did you attach the wrong file?

     
  • Elliott Hughes

    Elliott Hughes - 2008-12-13

    the attached file (t.f) contains only the following:

    program t
    print *,'hello'
    end

    did you attach the wrong file?

     
  • Willem Vermin

    Willem Vermin - 2008-12-15

    f90 example

     
  • Willem Vermin

    Willem Vermin - 2008-12-15

    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

     
  • Willem Vermin

    Willem Vermin - 2008-12-15

    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.

     
  • Elliott Hughes

    Elliott Hughes - 2008-12-16

    for those of us who don't know fortran, can you provide a link to some documentation about => and what can come after it?

     
  • Hendrik Merx

    Hendrik Merx - 2009-03-27

    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.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks