Skip to content

Commit a35eadc

Browse files
committed
Fix up blocks for index nodes in ripper translation
1 parent 37db4d8 commit a35eadc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/prism/translation/ripper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ def visit_in_node(node)
15381538
# ^^^^^^^^^^^^^^^
15391539
def visit_index_operator_write_node(node)
15401540
receiver = visit(node.receiver)
1541-
arguments = visit(node.arguments)
1541+
arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc))
15421542

15431543
bounds(node.location)
15441544
target = on_aref_field(receiver, arguments)
@@ -1555,7 +1555,7 @@ def visit_index_operator_write_node(node)
15551555
# ^^^^^^^^^^^^^^^^
15561556
def visit_index_and_write_node(node)
15571557
receiver = visit(node.receiver)
1558-
arguments = visit(node.arguments)
1558+
arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc))
15591559

15601560
bounds(node.location)
15611561
target = on_aref_field(receiver, arguments)
@@ -1572,7 +1572,7 @@ def visit_index_and_write_node(node)
15721572
# ^^^^^^^^^^^^^^^^
15731573
def visit_index_or_write_node(node)
15741574
receiver = visit(node.receiver)
1575-
arguments = visit(node.arguments)
1575+
arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc))
15761576

15771577
bounds(node.location)
15781578
target = on_aref_field(receiver, arguments)
@@ -1589,7 +1589,7 @@ def visit_index_or_write_node(node)
15891589
# ^^^^^^^^
15901590
def visit_index_target_node(node)
15911591
receiver = visit(node.receiver)
1592-
arguments = visit(node.arguments)
1592+
arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc))
15931593

15941594
bounds(node.location)
15951595
on_aref_field(receiver, arguments)

test/prism/ripper_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class RipperTest < TestCase
2929
]
3030

3131
skips = incorrect | %w[
32-
arrays.txt
3332
dos_endings.txt
3433
embdoc_no_newline_at_end.txt
3534
heredocs_leading_whitespace.txt

0 commit comments

Comments
 (0)