[ruby/prism] Fix parser translator for pinned expression

https://github.com/ruby/prism/commit/eeae07193b
This commit is contained in:
Kevin Newton 2024-02-26 09:26:31 -05:00 committed by git
parent af3145bb24
commit 99d0f687fc

View File

@ -1271,7 +1271,8 @@ module Prism
# foo => ^(bar)
# ^^^^^^
def visit_pinned_expression_node(node)
builder.pin(token(node.operator_loc), visit(node.expression))
expression = builder.begin(token(node.lparen_loc), visit(node.expression), token(node.rparen_loc))
builder.pin(token(node.operator_loc), expression)
end
# foo = 1 and bar => ^foo