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

Support nullsafe operator #1015

Open
SlowFox71 opened this issue May 13, 2024 · 2 comments
Open

Support nullsafe operator #1015

SlowFox71 opened this issue May 13, 2024 · 2 comments

Comments

@SlowFox71
Copy link

PHP supports the nullsafe operator ?-> since version 8, so it would be fine, if this were reflected in Smarty as well. A rather simple patch should suffice, see attachment (but I am not a parser expert, as in the suggestions a couple of days ago).

patch.txt

@SlowFox71
Copy link
Author

SlowFox71 commented May 13, 2024

More thought needs to put into this. For one thing, the patch above is wrong: The lexer needs to be touched, too as otherwise whitespace would be permitted ? -> which is wrong; this is corrected by using the files attached here.

The other thing is that I did not consider registered objects, which I should have done. However, this needs changes in ObjectMethodCallCompiler.php which is beyond my confidence.
lexer.txt
parser.txt

@wisskid
Copy link
Contributor

wisskid commented May 15, 2024

Also see #633 and the related PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants