New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHP heredoc syntax (Origin: bugzilla #607305) #3637

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.7.5.1 on platform Other
Assigned to: Dimitri van Heesch

On 2010-01-18 14:17:27 +0000, Brent Smith wrote:

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.

On 2011-09-18 03:27:39 +0000, Tim Brownlaw wrote:

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.

On 2011-09-19 02:21:32 +0000, Kevin McBride wrote:

Changing version field based on text information of the bug.

On 2011-09-25 06:30:08 +0000, Tim Brownlaw wrote:

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

On 2011-10-13 18:47:26 +0000, Dimitri van Heesch wrote:

Confirmed. I'll add heredoc and nowdoc support in the next subversion update.

On 2011-12-03 18:23:02 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment