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 630645 - \cond keyword enhancement
\cond keyword enhancement
Status: VERIFIED FIXED
Product: doxygen
Classification: Other
Component: general
unspecified
Other Windows
: Normal enhancement
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-09-26 18:15 UTC by albert
Modified: 2013-01-05 13:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PATCH: entension of logical expersions for @if, @cond etc. (20.24 KB, patch)
2012-09-09 17:59 UTC, albert
none Details | Review

Description albert 2010-09-26 18:15:16 UTC
In the Doxygen maillist (subject: \cond keword) there has been a discussion after the following initial posting:


In Doxygen it is possible to have some documentation depending of the setting of ENABLED_SECTIONS by means of the kewords:
\if, \ifnot, \else, \elseif, \endif these keywords work within one documentation block;
\cond and \endcond work in different comment blocks.

In the current project I need a \condnot (analogous to \ifnot).

I would therefore propose to add the keyword \condend to Doxygen. For completeness I would also propose to add \elseifnot 

The result of the discussion is that an enhancement would be the best in the form:

I think a better approach is to allow simple constant C-style expressions, i.e.

\if !SOME_SECTION_NAME
...
\endif

or even:

\if SOME_SECTION_NAME && (!THIS_ALTERNATIVE || THAT_ALTERNATIVE)
...
\endif

The same could be done for \cond. 

Where compatibility (\ifnot) has to be considered.
Comment 1 albert 2012-09-02 17:38:36 UTC
This bug has been split into 2 parts:
- bug_683215 for the \condnot keyword
- extension of the logical expression with \cons and \if (this bug)
Comment 2 albert 2012-09-09 17:59:01 UTC
Created attachment 223857 [details] [review]
PATCH: entension of logical expersions for @if, @cond etc.

This patch, for my convenience put in doxygen.cpp and doxygen.h, enables the possibility to use logical expressions with the commands like @if, @cond etc.
A logical expressing consisting of ENABLED_SECTION names having the value TRUE and a missing section names having the value FALSE. These values can be used in combination with the logical operators & (AND), | (OR) and ! (NOT). Furthermore round brackets are possible to change the order of evaluation inside the expression.

This patch is based on the C++ expression parser by Jos de Jong, http://www.speqmath.com which again is based on the example "A mini C++ Interpreter" from the book "The art of C++" by Herbert Schildt.
Comment 3 Dimitri van Heesch 2012-10-07 12:42:13 UTC
Thanks, I'll include the patch in the next subversion update, but decided to restructure it quite a bit to bring it more in line with the rest of the code.
Comment 4 Dimitri van Heesch 2012-12-26 16:09:05 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.3. 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.
Comment 5 albert 2013-01-05 13:28:20 UTC
Tested and works as expected.