instance method
Prism::Translation::Ripper#visit_call_node_arguments
visit_call_node_arguments(arguments_node, block_node, trailing_comma)
lib/prism/translation/ripper.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/translation/ripper.rb, line 1147
def visit_call_node_arguments(arguments_node, block_node, trailing_comma)
arguments = arguments_node&.arguments || []
block = block_node
if block.is_a?(BlockArgumentNode)
arguments << block
block = nil
end
[
if arguments.length == 1 && arguments.first.is_a?(ForwardingArgumentsNode)
visit(arguments.first)
elsif arguments.any?
args = visit_arguments(arguments)
if block_node.is_a?(BlockArgumentNode) || arguments.last.is_a?(ForwardingArgumentsNode) || command?(arguments.last) || trailing_comma
args
else
bounds(arguments.first.location)
on_args_add_block(args, false)
end
end,
visit(block)
]
end
Visit the arguments and block of a call node and return the arguments and block as they should be used.