Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify EscaperNodeVisitor code #4479

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Nov 28, 2024

This PR simplifies how we escape the ternary operator, and simplifies the whole strategy.
Instead of replacing the PrintNodes, we instead "just" wrap the inner expressions.

For the ternary operator, the InlinePrint expression is useless and even weird as printing something in the middle of an expression looks very wrong. This is not done anymore and the node is deprecated.

Overall, this PR makes fewer changes to the Node tree which should make things use a bit less memory.

@fabpot fabpot merged commit ae82e8b into twigphp:3.x Nov 28, 2024
49 of 50 checks passed
@fabpot fabpot deleted the escaper-node-visitor-simplification branch November 28, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants