Skip to content

Ruby: Order synthetic children in PrintAST based on their index instead of location #12612

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
Mar 28, 2023

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Mar 21, 2023

This PR changes the order in which children of synthesized nodes are being rendered in Print AST, from using the location to using the index into their parent (i.e., evaluation order). Since blocks were previously using index -2, I had to change that to have blocks be printed after ordinary arguments.

I also spotted an off-by-one error, which has been fixed here as well.

@github-actions github-actions bot added the Ruby label Mar 21, 2023
@hvitved hvitved force-pushed the ruby/print-ast-desugar-reorder branch 3 times, most recently from f95e9c9 to 1352d21 Compare March 27, 2023 09:37
@hvitved hvitved force-pushed the ruby/print-ast-desugar-reorder branch from 1352d21 to f8c28be Compare March 27, 2023 09:38
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Mar 27, 2023
@hvitved hvitved marked this pull request as ready for review March 27, 2023 11:15
@hvitved hvitved requested a review from a team as a code owner March 27, 2023 11:15
Copy link
Contributor

@aibaars aibaars left a comment

Choose a reason for hiding this comment

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

LGTM

@hvitved hvitved merged commit e3799ad into github:main Mar 28, 2023
@hvitved hvitved deleted the ruby/print-ast-desugar-reorder branch March 28, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants