-
Notifications
You must be signed in to change notification settings - Fork 71
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
invalid ast for silent
#247
Comments
Same problem for @$i / 0;
@($i / 0); |
It's about node precedence, I'll take a look |
i've started a fix on this, it resolves your case but may not work on other nodes like retif, cast or propertylookup - needs more tests but didn't had enough time. I'll be back next week ✋ |
@ichiriac thanks for amazing work, it is really help to improve our prettier plugin for PHP, we try to update to latest commit and check on regressions |
/cc @ichiriac friendly ping, can we solve some high priority issues (include this)? 😄 |
/cc @ichiriac friendly ping again 😞 We need help with this |
Hi @evilebottnawi, $> ping ichiriac
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 12days Sorry dude, had a lot of work to finish, I'm back on the project this week |
I have some time this summer to fix some issues. This bug is ready to release unless I'm missing some test. Here my tests : it("test silent node / bin", function() {
shouldBeSame("@foo() || @foo();", "(@foo()) || (@foo());");
});
it("test silent node / div", function() {
shouldBeSame("@$i / 0;", "@($i) / 0;");
});
it("test silent node / ret if", function() {
shouldBeSame("@$i == true ? @$foo : @$bar;", "@($i) == true ? @($foo) : @($bar);");
});
it("test silent node / cast", function() {
shouldBeSame("@(int)$i + 1;", "@((int)$i) + 1;");
});
it("test silent node / property lookup", function() {
shouldBeSame("@$foo->bar;", "@($foo)->bar;");
}); |
Will be great if we fix some major bugs |
Input:
silent
node should be beforecall
, now it is beforebin
Right output from
php
parser:But
Output valid ast.
Very high priority.
The text was updated successfully, but these errors were encountered: