Nikita Popov
Nikita Popov
I've chosen to normalize CRLF to LF in getReformattedText() in https://github.com/nikic/PHP-Parser/commit/ad8daa12b2de5f4aed2a7eb821d2744b22f75e46, which should effectively fix this issue (for CRLF, I don't care about CR newlines).
PHP-Parser 5.0 will be using the new object-based token representation, so I'm going to close this one.
Going to close this, as I think it's unlikely I'm ever going to implement the remaining bit here...
Is this reproducible without FrankenPHP? At least I don't see a crash for a plain phpinfo call with a ZTS build. The serializer registration mechanism is certainly not thread-safe, but...
A problem I ran into here is that the current NodeVisitor interface isn't flexible enough to handle all possible cases here. For example, let's say you have one visitor that...
> I don't think it is this library's job to reconcile visitors with conflicting ideas about what to do. Tree rewriting is Turing complete. If one visitor can modify the...
> > So you're suggesting that if in the InterleavedVisitor, the first one returns a new node, and the second one return DONT_TRAVERSE_CHILDREN (or similar), that would be considered user...
There is no time travel involved. The actions are sequential, not overriding. If one visitor returns a new node, that's the node the next visitor is going to see, which...
I think I'm going to drop this change. I thought this design would make things simpler overall, but in practice this turns out to be a significant complication.
I agree that we should not do this in IR.