Skip to content

Commit

Permalink
Fix block parameters and it for RubyParser
Browse files Browse the repository at this point in the history
  • Loading branch information
presidentbeef committed Jan 14, 2025
1 parent a0571d9 commit 7a93a30
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/prism/translation/ruby_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ def visit_block(node, sexp, block)
else
parameters =
case block.parameters
when nil, NumberedParametersNode
when nil, ItParametersNode, NumberedParametersNode
0
else
visit(block.parameters)
Expand Down
3 changes: 3 additions & 0 deletions test/prism/fixtures/it.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
x do
it
end
31 changes: 31 additions & 0 deletions test/prism/snapshots/it.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7a93a30

Please sign in to comment.