Skip to content

Conversation

@etiennebarrie
Copy link
Contributor

Fixes #379

Previously lambda blocks inside a Command/CommandCall were always using braces, even when multiline.

This removes the special handling of multiline lambda blocks, that was forcing curly braces when any of the parents were a Command or CommandCall.

I don't understand why that was there so I can't tell if it's somehow important, but no tests failed and it made the two added fixtures pass.

Previously lambda blocks inside a Command/CommandCall were always using
braces, even when multiline.
@kddnewton
Copy link
Member

For the life of me I can't figure out why that is there.

I think it was in there when the lambda was an argument? As in

foo -> { bar } do end

but that appears to be fine. Maybe it wasn't in 2.6 when I made this? Not sure. Either way, thanks for the PR!

@kddnewton kddnewton merged commit 909b45a into ruby-syntax-tree:main Jun 1, 2023
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

Successfully merging this pull request may close these issues.

Multiline blocks sometimes use braces, sometimes do/end

2 participants