Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reminder: the PHP::processAdditional()` method walks _back_ from the end of the file to the beginning. The type handling retokenization layer is triggered for each `&`, `|` and `)` the tokenizer encounters. When something is recognized as a valid type declaration, the relevant tokens will all be retokenized in one go the first time the type handling layer is triggered, which means that - as the type tokens will have been retokenized already -, the type handling layer will not be triggered again for any of the other type related tokens in the type. However, if the type is *not* recognized as a valid type, the type handling layer will keep getting retriggered and will (correctly) keep concluding this is not a valid type. The change in this PR, prevents the type handling layer from doing any work when it is retriggered on a token which was previously already seen and concluded to be, either not part of a type or part of an invalid type. This should make the tokenizer marginally faster for complex types containing an error, like `(A&B|(C&D)|(E&F)`.
- Loading branch information