GNOME Bugzilla – Bug 722112
'static' and 'throw' C++ keywords not colored
Last modified: 2016-12-29 18:46:02 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 }; }
Seems that both problems are related with the combination of: - last argument argument have no name - the 'throw' keyword in declaration
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.
Created attachment 269319 [details] src + config + image for bug 722112 PNG image highlights the reported problems.
Comment on attachment 269319 [details] src + config + image for bug 722112 On the config file set the 2 given files in the INPUT.
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)
(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.
I've just pushed a proposed patch to github (pull request 521)
Source code has been integrated in master on github.
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).