tolerant-php-parser
tolerant-php-parser copied to clipboard
Diagnostics - general tracking issue
The parser currently emits few diagnostics beyond general syntax errors, but it has always been the plan to walk the tree and emit more. We may want to bring it up to par with nikic/php-parser, at least.
For examples, search nikic/php-parser for emitError. e.g. in this file: https://github.com/nikic/PHP-Parser/blob/a32e3797d411590841ae06dd559ddb867d376aff/lib/PhpParser/ParserAbstract.php
I also saw that the diagnostic code uses Reflection to get the Token name, that is very slow.
I also saw that the diagnostic code uses Reflection to get the Token name, that is very slow.
For tracking purposes: That was fixed in #187 (Instead of using Reflection every time, tolerant-php-parser only uses Reflection the first time, and caches that)