mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
23fc0fc22d
commit
12fa76b3e5
1 changed files with 11 additions and 8 deletions
|
@ -140,14 +140,17 @@ module Prism
|
|||
case node
|
||||
when BlockNode, DefNode, LambdaNode
|
||||
names = node.locals
|
||||
params =
|
||||
if node.is_a?(DefNode)
|
||||
node.parameters
|
||||
elsif node.parameters.is_a?(NumberedParametersNode)
|
||||
nil
|
||||
else
|
||||
node.parameters&.parameters
|
||||
end
|
||||
params = nil
|
||||
|
||||
if node.is_a?(DefNode)
|
||||
params = node.parameters
|
||||
elsif node.parameters.is_a?(NumberedParametersNode)
|
||||
# nothing
|
||||
elsif node.parameters.is_a?(ItParametersNode)
|
||||
names << AnonymousLocal
|
||||
else
|
||||
params = node.parameters&.parameters
|
||||
end
|
||||
|
||||
# prism places parameters in the same order that they appear in the
|
||||
# source. CRuby places them in the order that they need to appear
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue