Rewrite the PHP parser as a real full token-based parser, instead of using regexes. This is more complex but allows for way better parsing.
Tags are generated for:
* constants (both "const FOO" and "define('FOO', ...)");
* local variables (disabled by default, need to enable the "l" kind);
* namespaces (both syntax);
* global (like locals, but in the root scope) and member variables.
Visible changes from current regex-based parser:
* Scope is reported for each tag;
* Visibility is reported for members and methods;
* Implementation is reported for classes, interfaces and methods;
* Traits are reported;
* Namespaces are reported;
* Separate global and local variables (local ones being disabled by default);
* Constructs outside PHP tags are completely omitted;
* "jsfunction" are not reported any more;
* Function arguments spanning several lines or including comments are properly reported;
* Commented-out code no longer generates tags.
About the patch:
The attached patch is the complete patch against trunk. If you want, I can either provide the individual patches (I did 22 patches to get here), or the
new version of each file, just tell me what you prefer.