GNOME Bugzilla – Bug 607305
Support PHP heredoc syntax
Last modified: 2011-12-03 18:23:02 UTC
Use of the PHP heredoc syntax can result in functions not being recognised and variables internal to functions being documented. Output of JavaScript code within a heredoc block is particularly problematic as the curly brackets seem to be interpreted as end-of-function marker.
Doxygen version 1.7.5.1 From my experiements it's obvious that Doxygen is processing the contents within the heredoc. Guaranteed Breaker: <<<FRED @<a[\s]+[^>]*?href[\s]?=[\s\""\']+(.*?)[\""\']+.*?>([^<]+|.*?)?<\/a>@ FRED; It all comes down to the parsing of the quotes causing an error and doxygen stops processing the file. Things to replicate the behaviour. ================================== - the following two examples WILL Break doxygen ----------------------------------------------- // single double quote <<<FRED " FRED; // and // a single single quote <<<FRED ' FRED; - the following two examples WORK ----------------------------------- // two happy double quotes <<<FRED "" FRED; // and // two happy single quotes <<<FRED '' FRED; If Doxygen does not see a pair of single or double quotes inside the heredoc, it fails the parser. Suggestion: =========== Do not Parse any content inside a heredoc statement. In the Case of certain regex as I have used, it can break it.
Changing version field based on text information of the bug.
A workaround in this case is to use the commands htmlonly and endhtmlonly So wrapping my piece of offending code like this... /** @htmlonly */ $pat = <<<FRED @<a[\s]+[^>]*?href[\s]?=[\s\""\']+(.*?)[\""\']+.*?>([^<]+|.*?)?<\/a>@ FRED; /** @endhtmlonly */ Makes doxygen happy. These are obviously not the correct commands but it they have the desired affect of ignoring what is encapsulated. If there is ( and I would expect ) a command set to perform the same action, I'd love to know. So Doxygen has the ability to ignore code, it'd just have to have a lot of extra parsing for these "exceptions" to trigger it. I'm happy to use this workaround. Cheers
Confirmed. I'll add heredoc and nowdoc support in the next subversion update.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.7.6. 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.