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 722112 - 'static' and 'throw' C++ keywords not colored
'static' and 'throw' C++ keywords not colored
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.6
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2014-01-13 15:39 UTC by Gerard Torrent
Modified: 2016-12-29 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
src + config + image for bug 722112 (156.40 KB, application/x-gzip)
2014-02-16 18:24 UTC, Gerard Torrent
Details
Smaller example showing the base of the problem (26.17 KB, application/octet-stream)
2014-02-19 19:19 UTC, albert
Details

Description Gerard Torrent 2014-01-13 15:39:39 UTC
In the HTML output of the given code (see below), the 'static' keyword preceding methods check(), push(), isValue(), getFunctionName() is colored in black when the green color is expected. The 'throw' keyword in methods next() and check() also lacks coloration (expected color = orange).

namespace XXX {

class Expr
{

  ... omited

  private:

    //! Check if the current token is a function
    static bool isFunction(const char *, token *, char **);
    //! Check if the current token is a constant
    static bool isConstant(const char *, token *, char **);
    //! Check if the current token is a operator
    static bool isOperator(const char *, token *, char **);
    //! Check if the current token is a number
    static bool isNumber(const char *, token *, char **);
    //! Check if the current token is a variable
    static bool isVariable(const char *, token *, char **, std::vector<variable> &);
    //! Parse the next token
    static void next(const char *, token *, char **, std::vector<variable> &) throw(Exception);
    //! Syntax checking
    static void check(token *, token *) throw(Exception);
    //! Push token to RPN instructions pile
    static void push(token &, std::vector<token> &tokens);
    //! Check if is a value (number or constant or variable)
    static bool isValue(TokenType type);
    //! Returns function name by ptr value
    static const char *getFunctionName(const void *ptr);
    //! Constructor (public constructor not allowed)
    Expr() { }


  public:

    //! Compile an expression
    static void compile(const char *, std::vector<variable> &variables, std::vector<token> &tokens) throw(Exception);
    //! Compile an expression
    static void compile(const std::string &, std::vector<variable> &variables, std::vector<token> &tokens) throw(Exception);
    //! Link an expression
    static int link(std::vector<token> &tokens, const std::vector<variable> &variables) throw(Exception);
    //! Evalue an expression
    static double eval(const std::vector<token> &tokens, size_t maxsize) throw(Exception);
    //! Evalue an expression
    static double eval(const token *tok, size_t maxsize) throw(Exception);
    //! trace RPN stack to stdout
    static void debug(const std::vector<token> &tokens, const std::vector<variable> &variables);

  ... omited

};

}
Comment 1 Gerard Torrent 2014-01-13 15:48:08 UTC
Seems that both problems are related with the combination of:
  - last argument argument have no name
  - the 'throw' keyword in declaration
Comment 2 albert 2014-02-16 13:56:14 UTC
I tried to reproduce the problem with the above example and setting SOURCE_BROWSER to YES in a further default Doxyfile, but I see all words 'static' and 'throw' in the right color.

Please supply a (small) self-contained example source+config file in a zip or tar) showing the problem.
Comment 3 Gerard Torrent 2014-02-16 18:24:37 UTC
Created attachment 269319 [details]
src + config + image for bug 722112

PNG image highlights the reported problems.
Comment 4 Gerard Torrent 2014-02-16 18:37:07 UTC
Comment on attachment 269319 [details]
src + config + image for bug 722112

On the config file set the 2 given files in the INPUT.
Comment 5 albert 2014-02-19 19:19:30 UTC
Created attachment 269727 [details]
Smaller example showing the base of the problem

I did some investigations but was not able to create a solution as I'm not sure about possible side effects. I've created a smaller example showing the problem.
It looks like there are a number of interfering problems in code.l.
- setting and resetting of being inside a body (g_insideBody) a.o. due to the struct definition. Question is should a class, namespace set g_insideBody?
- different handling of *) and *x) (lines 2958 and 2964 in code.l)
Comment 6 albert 2014-02-19 19:22:11 UTC
(In reply to comment #5)
> Created an attachment (id=269727) [details]
> Smaller example showing the base of the problem
> 
> I did some investigations but was not able to create a solution as I'm not sure
> about possible side effects. I've created a smaller example showing the
> problem.
> It looks like there are a number of interfering problems in code.l.
> - setting and resetting of being inside a body (g_insideBody) a.o. due to the
> struct definition. Question is should a class, namespace set g_insideBody?
> - different handling of *) and *x) (lines 2958 and 2964 in code.l)

Small note smaller example colors the word throw, when removing the x in both routine definitions the last definition is not colored.
Comment 7 albert 2016-09-11 16:50:26 UTC
I've just pushed a proposed patch to github (pull request 521)
Comment 8 albert 2016-10-02 16:03:04 UTC
Source code has been integrated in master on github.
Comment 9 Dimitri van Heesch 2016-12-29 18:46:02 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.13. 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 (preferably in the form of a self-contained example).