After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625601 - FORTRAN: recognition free versus fixed formatted code
FORTRAN: recognition free versus fixed formatted code
Status: VERIFIED FIXED
Product: doxygen
Classification: Other
Component: general
1.7.1
Other Windows
: High normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
: 510983 617190 653356 657568 659173 664277 740366 (view as bug list)
Depends on:
Blocks: 623299
 
 
Reported: 2010-07-29 17:19 UTC by albert
Modified: 2014-11-22 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
EXTENSION_MAPPING for Fortran free and fixed format (12.95 KB, patch)
2010-11-07 19:04 UTC, albert
none Details | Review

Description albert 2010-07-29 17:19:58 UTC
When fixed formatted code has as a first line a line starting with an exclamation mark it is "recognized" as free formatted. There will be probably more examples (Character function in free formatted code, thus starting with a C in position 1).

Possible solutions:
- correct / improve recognition of type formatted code in routine recognizeFixedForm
- generate possibility to specify type of code by means of extension (i.e. through the available EXTENSION_MAPPING possibilities.
Comment 1 albert 2010-11-07 19:04:31 UTC
Created attachment 174008 [details] [review]
EXTENSION_MAPPING for Fortran free and fixed format

This patch extends the EXTENSION_MAPPING in respect to Fortran code.
It is now possible to specify by means of EXTENSION_MAPPING whether files with a certain extension are fixed or free formatted Fortran files (Fortran_Fixed, Fortran_Free. The default remains Fortran, the scanner makes a guess).
Comment 2 Dimitri van Heesch 2010-11-08 21:05:02 UTC
Hi Albert,

This patch is a dangerous one, as it undoes a number of changes I made!
I can manually edit the patch before applying it, but please check next time if the patch only contains the changes you made and nothing more.

As for the implementation: I would prefer an automatic detection of the format if possible. A general design goal of doxygen is to put the complexity in the tool when possible, instead of bothering the user with it. Do you think this is possible by improving the format recognition?
Comment 3 Dimitri van Heesch 2010-11-08 21:08:00 UTC
One more thing: in config.xml the trailing spaces are (ab)used in the wizard for the online help. Removing them will concatenate the last word with the first word on the next line!
Comment 4 albert 2010-11-08 21:15:02 UTC
(In reply to comment #2)
> Hi Albert,
> 
> This patch is a dangerous one, as it undoes a number of changes I made!
> I can manually edit the patch before applying it, but please check next time if
> the patch only contains the changes you made and nothing more.
> 
> As for the implementation: I would prefer an automatic detection of the format
> if possible. A general design goal of doxygen is to put the complexity in the
> tool when possible, instead of bothering the user with it. Do you think this is
> possible by improving the format recognition?

Hi Dimitri,

I thought I checked if the patch was only incorporating my changes, but I see that I undo at least one of your changes. Sorry for that.

I would also prefer an automatic detection, but I think it is quite complicated and require possible scanning of the input to a bigger extent.
Comment 5 albert 2010-11-08 21:17:46 UTC
(In reply to comment #3)
> One more thing: in config.xml the trailing spaces are (ab)used in the wizard
> for the online help. Removing them will concatenate the last word with the
> first word on the next line!

Sorry, this was unknown to me, but it makes sense in this file. I general I don't like spaces at the end of lines.
Comment 6 Daniel Franke 2010-12-22 19:30:33 UTC
*** Bug 617190 has been marked as a duplicate of this bug. ***
Comment 7 Daniel Franke 2010-12-22 19:35:00 UTC
To mention it: other tools use the extension as an indicator:

    fixed form: .f .for .ftn
    free form:  .f90 .f95 .f03 f.08

Capital letters for preprocessing. I.e .FOR a preprocessed fixed-form source, .f90 free-form without preprocessing.

Simple and widely recognized.
Comment 8 Daniel Franke 2010-12-22 19:46:00 UTC
*** Bug 623299 has been marked as a duplicate of this bug. ***
Comment 9 Daniel Franke 2011-01-19 23:46:03 UTC
Here's another bad case where free form is "recognized" as fixed form:

!>
!> @brief COMPLEX function.
!> 
COMPLEX FUNCTION f(z)
  COMPLEX, INTENT(in) :: z
  f = CONJG(z)
END FUNCTION

In particular (note the replaced 'C' of the function return type COMPLEX):
--accepting rule at line 288 ("!OMPLEX FUNCTION f(z)
")

This ends with:
********************************************************************
Error in file [...].f90 line: 10, state: 10
********************************************************************
Comment 10 Dimitri van Heesch 2011-07-17 13:02:43 UTC
*** Bug 653356 has been marked as a duplicate of this bug. ***
Comment 11 Dimitri van Heesch 2011-11-20 15:15:02 UTC
*** Bug 664277 has been marked as a duplicate of this bug. ***
Comment 12 Dimitri van Heesch 2012-02-19 21:07:24 UTC
*** Bug 510983 has been marked as a duplicate of this bug. ***
Comment 13 albert 2013-03-16 19:51:24 UTC
*** Bug 657568 has been marked as a duplicate of this bug. ***
Comment 14 albert 2013-04-14 12:32:29 UTC
*** Bug 659173 has been marked as a duplicate of this bug. ***
Comment 15 albert 2014-03-09 18:00:25 UTC
I've pushed the solution with EXTENSION_MAPPING to github (pull request 134)
Comment 16 Dimitri van Heesch 2014-03-15 19:25:06 UTC
Thanks, I've pull it in.
Comment 17 Dimitri van Heesch 2014-04-21 10:09:32 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.7. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information 
that you think can be relevant (preferrably in the form of a self-contained example).
Comment 18 albert 2014-06-19 15:54:40 UTC
dnm found a typo i the documentation. Pull request 185 has been submitted for this.
Comment 19 Dimitri van Heesch 2014-11-22 11:50:39 UTC
*** Bug 740366 has been marked as a duplicate of this bug. ***