Doxygen: Rewrite mwdoc-filter to fix bug with slashes in comments
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 23 Nov 2015 22:38:31 +0000 (22:38 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 23 Nov 2015 23:02:13 +0000 (23:02 +0000)
commit222ef664fc653fbe5f1cd06f9636c6fb3e316bd4
treecba0c0c153e15cc8597b21487aea311a6a7714d1
parent95d5448ad5c6250cadbfc0f2913cc63ce8618c32
Doxygen: Rewrite mwdoc-filter to fix bug with slashes in comments

The behaviour stays the same (extract type from @var comment and
insert into source code between e.g. "protected" and "$name") but
implemented using PHP's tokenizer instead of global regexes.

This fixes the problem with slashes being found inside the
documentation comment and various other edge cases, such as use
of slashes inside comments.

Also fix the problem with PHP namespaces being misinterpreted
as a Doxygen /command by escaping slashes automatically. This
shouldn't conflict with actual commands, since we use '@' for
all commands (e.g. @param, @return, @since etc.)

Change-Id: Ic03a8fc9d4b4851f66c2e975d9955ba20ab92f0e
maintenance/mwdoc-filter.php