Skip to content

Support every argument syntax for clone() #1092

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

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

TimWolla
Copy link
Contributor

@TimWolla TimWolla commented Jul 2, 2025

@TimWolla TimWolla force-pushed the clone-all-syntax branch from 432f3d9 to aa09deb Compare July 2, 2025 12:50

non_empty_clone_argument_list:
expr ',' argument
{ init(new Node\Arg($1, false, false, stackAttributes(#1)), $3); }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a !!positions test to check the two cases using stackAttributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have my computer at hand, but the positions are already implicitly tested by the test verifying that the pretty-printer round-trips. The initial implementation had init(Node\Arg[$1, false, false], $3) and similarly for the other case and that resulted in clone($x, ) being stringified as clone($x, )$x, ) or similar.

Shall I nevertheless add a dedicated test?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think that's good enough.

@nikic nikic merged commit dc47765 into nikic:master Jul 2, 2025
10 checks passed
@TimWolla TimWolla deleted the clone-all-syntax branch July 2, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants