Page MenuHomePhabricator

Single quote in comment derails doxygen
Closed, ResolvedPublic

Description

HTMLForm.php (r85166) contains in lines 76..78 a comment using #. The comment contains an apostrophe which derails doxygen. The # should be changed into //.


Version: 1.18.x
Severity: trivial

Details

Reference
bz28389

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:30 PM
bzimport set Reference to bz28389.
bzimport added a subscriber: Unknown Object (MLST).

happy.melon.wiki wrote:

So you're saying that

if( $wgRequest->wasPosted() ){
    # Ok, so we got a POST submission asking us to reblock a user...
    # confirm checkbox; the user will only see it if they haven't previously
    $fields['Confirm']['type'] = 'check';
}

is broken because of the apostrophe in "haven't"; but that

if( $wgRequest->wasPosted() ){
    // Ok, so we got a POST submission asking us to reblock a user...
    // confirm checkbox; the user will only see it if they haven't previously
    $fields['Confirm']['type'] = 'check';
}

would be fine? What happens to doxygen in the former case?

(In reply to comment #1)

would be fine? What happens to doxygen in the former case?

I could not find your code, I am talking about http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/HTMLForm.php?view=markup&pathrev=85166#l76

However, yours is probably a candidate, too.
The problem is, that doxygen interprets the apostrophe as a string start and consequently ignores the following code (or tries to cope with it somehow). See http://svn.wikimedia.org/doc/HTMLForm_8php_source.html.

happy.melon.wiki wrote:

Then why doesn't, for instance, the apostrophe at http://svn.wikimedia.org/doc/Title_8php_source.html#l00562 trigger the same behaviour? I think it's that it doesn't like the comments inside the array declaration, rather than it not liking the syntax of the comment. Thoughts?

Moving the comment out of the array declaration worked, so it seems to be the combination. The doxygen PHP parser is based on the C parser, AFAIK. Can't remember what a # signifies in C, but it's probably not a comment. This might explain, why it's unexpected in an array declaration, but works alright outside.

(In reply to comment #4)

Can't remember what a # signifies in C, but it's probably not a comment.

  1. introduces pre-processor directives like #include and #define.

I can see // being used on line 117..119, seems the bug is fixed.

Spage claimed this task.
Spage subscribed.

I can't see this particular problem in latest generated doc of HTMLForm.php or classHTMLForm, so I'm closing this.