Commit c1e25238 authored by Dimitri van Heesch's avatar Dimitri van Heesch
Browse files

Merge branch 'feature/bug_625601' of https://github.com/albert-github/doxygen...

Merge branch 'feature/bug_625601' of https://github.com/albert-github/doxygen into albert-github-feature/bug_625601
parents 31a72d0a 2dec1060
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -460,11 +460,18 @@ settings where overruled.
When using doxygen for Fortran code you should
When using doxygen for Fortran code you should
set \ref cfg_optimize_for_fortran "OPTIMIZE_FOR_FORTRAN" to \c YES.
set \ref cfg_optimize_for_fortran "OPTIMIZE_FOR_FORTRAN" to \c YES.


The parser tries to guess wheter the source code is fixed format Fortran or
free format Fortran code. This is not always correct, in the later case 
one should use \ref cfg_extension_mapping "EXTENSION_MAPPING" to correct this.
By setteing `EXTENSION_MAPPING =  f=FortranFixed f90=FortranFree` files with
extension \c f90 are interpreted as fixed format Fortran code and files with
extension \c f are interpreted as free format Fortran code.

For Fortran "!>" or "!<" starts a comment and "!!" or "!>" can be used to 
For Fortran "!>" or "!<" starts a comment and "!!" or "!>" can be used to 
continue an one line comment into a multi-line comment.
continue an one line comment into a multi-line comment.


Here is an example of a documented Fortran subroutine:
Here is an example of a documented Fortran subroutine:
\verbatim
\code{.f}
  !> Build the restriction matrix for the aggregation 
  !> Build the restriction matrix for the aggregation 
  !! method.
  !! method.
  !! @param aggr information about the aggregates
  !! @param aggr information about the aggregates
@@ -474,18 +481,20 @@ Here is an example of a documented Fortran subroutine:
    Type(SpMtx), intent(in) :: A !< our fine level matrix
    Type(SpMtx), intent(in) :: A !< our fine level matrix
    Type(Aggrs), intent(in) :: aggr
    Type(Aggrs), intent(in) :: aggr
    Type(SpMtx), intent(out) :: Restrict !< Our restriction matrix
    Type(SpMtx), intent(out) :: Restrict !< Our restriction matrix
\endverbatim
    !...
  end subroutine
\endcode


As an alternative you can also use comments in fixed format code:
As an alternative you can also use comments in fixed format code:


\verbatim
\code{.f}
C> Function comment
C> Function comment
C> another line of comment
C> another line of comment
      function A(i)
      function A(i)
C> input parameter
C> input parameter
        integer i
        integer i
      end function A
      end function A
\endverbatim
\endcode


\subsection tclblocks Comment blocks in Tcl
\subsection tclblocks Comment blocks in Tcl


+4 −1
Original line number Original line Diff line number Diff line
@@ -588,7 +588,10 @@ Go to the <a href="commands.html">next</a> section or return to the
 Doxygen has a built-in mapping, but you can override or extend it using this tag.
 Doxygen has a built-in mapping, but you can override or extend it using this tag.
 The format is <code>ext=language</code>, where \c ext is a file extension, and language is one of
 The format is <code>ext=language</code>, where \c ext is a file extension, and language is one of
 the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
 the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
 Objective-C, Python, Fortran, VHDL. 
 Objective-C, Python, Fortran (fixed format Fortran: FortranFixed,
 free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In
 the later case the parser tries to guess whether the code is fixed or free
 formatted code, this is the default for Fortran type files), VHDL. 


 For instance to make doxygen treat
 For instance to make doxygen treat
 <code>.inc</code> files as Fortran files (default is PHP), and <code>.f</code> files as C (default is Fortran),
 <code>.inc</code> files as Fortran files (default is PHP), and <code>.f</code> files as C (default is Fortran),
+9 −7
Original line number Original line Diff line number Diff line
@@ -9880,6 +9880,8 @@ void initDoxygen()
  Doxygen::parserManager->registerParser("c",            new CLanguageScanner, TRUE);
  Doxygen::parserManager->registerParser("c",            new CLanguageScanner, TRUE);
  Doxygen::parserManager->registerParser("python",       new PythonLanguageScanner);
  Doxygen::parserManager->registerParser("python",       new PythonLanguageScanner);
  Doxygen::parserManager->registerParser("fortran",      new FortranLanguageScanner);
  Doxygen::parserManager->registerParser("fortran",      new FortranLanguageScanner);
  Doxygen::parserManager->registerParser("fortranfree",  new FortranLanguageScannerFree);
  Doxygen::parserManager->registerParser("fortranfixed", new FortranLanguageScannerFixed);
  Doxygen::parserManager->registerParser("vhdl",         new VHDLLanguageScanner);
  Doxygen::parserManager->registerParser("vhdl",         new VHDLLanguageScanner);
  Doxygen::parserManager->registerParser("dbusxml",      new DBusXMLScanner);
  Doxygen::parserManager->registerParser("dbusxml",      new DBusXMLScanner);
  Doxygen::parserManager->registerParser("tcl",          new TclLanguageScanner);
  Doxygen::parserManager->registerParser("tcl",          new TclLanguageScanner);
+1 −1
Original line number Original line Diff line number Diff line
@@ -28,7 +28,7 @@ void parseFortranCode(CodeOutputInterface &,const char *,const QCString &,
            bool ,const char *,FileDef *fd,
            bool ,const char *,FileDef *fd,
            int startLine,int endLine,bool inlineFragment,
            int startLine,int endLine,bool inlineFragment,
            MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
            MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
            bool collectRefs);
            bool collectRefs, FortranKind codeType);
void resetFortranCodeParserState();
void resetFortranCodeParserState();
void codeFreeScanner();
void codeFreeScanner();


+5 −3
Original line number Original line Diff line number Diff line
@@ -154,11 +154,13 @@ static int bracketCount = 0;


// simplified way to know if this is fixed form
// simplified way to know if this is fixed form
// duplicate in fortranscanner.l
// duplicate in fortranscanner.l
static bool recognizeFixedForm(const char* contents)
static bool recognizeFixedForm(const char* contents, FortranKind codeType)
{
{
  int column=0;
  int column=0;
  bool skipLine=FALSE;
  bool skipLine=FALSE;


  if (codeType == FORTRAN_FIXED) return TRUE;
  if (codeType == FORTRAN_FREE) return FALSE;
  for (int i=0;;i++) 
  for (int i=0;;i++) 
  {
  {
    column++;
    column++;
@@ -1108,7 +1110,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
                  bool exBlock, const char *exName,FileDef *fd,
                  bool exBlock, const char *exName,FileDef *fd,
		  int startLine,int endLine,bool inlineFragment,
		  int startLine,int endLine,bool inlineFragment,
		  MemberDef *memberDef,bool,Definition *searchCtx,
		  MemberDef *memberDef,bool,Definition *searchCtx,
                  bool collectXRefs)
                  bool collectXRefs, FortranKind codeType)
{
{
  //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);
  //printf("***parseCode() exBlock=%d exName=%s fd=%p\n",exBlock,exName,fd);


@@ -1122,7 +1124,7 @@ void parseFortranCode(CodeOutputInterface &od,const char *className,const QCStri
  g_code = &od;
  g_code = &od;
  g_inputString   = s;
  g_inputString   = s;
  g_inputPosition = 0;
  g_inputPosition = 0;
  g_isFixedForm = recognizeFixedForm((const char*)s);
  g_isFixedForm = recognizeFixedForm((const char*)s,codeType);
  g_currentFontClass = 0;
  g_currentFontClass = 0;
  g_needsTermination = FALSE;
  g_needsTermination = FALSE;
  g_searchCtx = searchCtx;
  g_searchCtx = searchCtx;
Loading