Skip to content

Commit

Permalink
Dispatch on_tlambda and on_tlambeg
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Mar 6, 2024
1 parent a7ab3a4 commit 1ca58e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/prism/translation/ripper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ module Translation
# * on_semicolon
# * on_sp
# * on_symbeg
# * on_tlambda
# * on_tlambeg
# * on_tstring_beg
# * on_tstring_end
#
Expand Down Expand Up @@ -2243,6 +2241,9 @@ def visit_keyword_rest_parameter_node(node)

# -> {}
def visit_lambda_node(node)
bounds(node.operator_loc)
on_tlambda(node.operator)

parameters =
if node.parameters.is_a?(BlockParametersNode)
# Ripper does not track block-locals within lambdas, so we skip
Expand All @@ -2267,6 +2268,11 @@ def visit_lambda_node(node)
end

braces = node.opening == "{"
if braces
bounds(node.opening_loc)
on_tlambeg(node.opening)
end

body =
case node.body
when nil
Expand Down

0 comments on commit 1ca58e0

Please sign in to comment.