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
|
case node
|
||||||
when BlockNode, DefNode, LambdaNode
|
when BlockNode, DefNode, LambdaNode
|
||||||
names = node.locals
|
names = node.locals
|
||||||
params =
|
params = nil
|
||||||
if node.is_a?(DefNode)
|
|
||||||
node.parameters
|
if node.is_a?(DefNode)
|
||||||
elsif node.parameters.is_a?(NumberedParametersNode)
|
params = node.parameters
|
||||||
nil
|
elsif node.parameters.is_a?(NumberedParametersNode)
|
||||||
else
|
# nothing
|
||||||
node.parameters&.parameters
|
elsif node.parameters.is_a?(ItParametersNode)
|
||||||
end
|
names << AnonymousLocal
|
||||||
|
else
|
||||||
|
params = node.parameters&.parameters
|
||||||
|
end
|
||||||
|
|
||||||
# prism places parameters in the same order that they appear in the
|
# prism places parameters in the same order that they appear in the
|
||||||
# source. CRuby places them in the order that they need to appear
|
# source. CRuby places them in the order that they need to appear
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue