8000 Fortran: component selector (%) not shown (Origin: bugzilla #787076) · Issue #6247 · doxygen/doxygen · GitHub
[go: up one dir, main page]

Skip to content
Fortran: component selector (%) not shown (Origin: bugzilla #787076) #6247
@doxygen

Description

@doxygen

status NEW severity normal in component general for ---
Reported in version 1.8.14-GIT on platform Other
Assigned to: Dimitri van Heesch

On 2017-08-31 11:19:37 +0000, janus@gcc.gnu.org wrote:

Simple Fortran example (basically a transcription of one of the C++ examples
from https://www.stack.nl/~dimitri/doxygen/manual/autolink.html):


!> This module defines a type ::coord and
!> a function ::add for adding two coords.
module CoordModule

   !> A coordinate pair
   type :: coord
      real :: x    !< The x coordinate
      real :: y    !< The y coordinate
   end type

contains

   !> This function returns the addition of \a c1 and \a c2,
   !> i.e (c1%x+c2%x, c1%y+c2%y)
   type(coord) function add(c1, c2)
      type(coord), intent(in) :: c1, c2
      add = Coord(c1%x+c2%x, c1%y+c2%y)
   end function

end module


The primary problem here is that for expressions like "c1%x", the component
selector (%) is not shown in the generated html page. Instead it just shows
up as "c1x".

The Fortran component selector '%' is analogous to '.' or '->' in C/C++.

Another small problem I just noticed: "::coord" is not being linkified in
the module header, in contrast to "::add", which works fine (or am I just
using the wrong syntax here?).

On 2017-09-01 18:16:06 +0000, albert wrote:

In the documentation it is stated:
24.177 \%
This command writes the % character to the output. This character has to be
escaped in some cases, because it is
used to prevent auto-linking to word that is also a documented class or
struct.

when using this in the Fortran documentation this helps, but it is a bit
unnatural as the % sign has the component selector meaning. In this case it
might even have an advantage that it would link to the component of the type
(will be hard as the component can be in different types and then it would
be hard to distinguish.

A similar problem will appear in C (at is a bit a sought example though!):
/** the static variable */
static int x  = 5;

/**
  *  \brief small test on mod operator fie for calculating y%x
  */
void fie(int y)
{
  return y%x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0