зеркало из https://github.com/github/ruby.git
[ruby/prism] Fix block_pass for []=
https://github.com/ruby/prism/commit/bf79206220
This commit is contained in:
Родитель
429338a20c
Коммит
13301587cf
|
@ -253,12 +253,15 @@ module Prism
|
||||||
return visit_block(builder.index(visit(node.receiver), token(node.opening_loc), visit_all(arguments), token(node.closing_loc)), block)
|
return visit_block(builder.index(visit(node.receiver), token(node.opening_loc), visit_all(arguments), token(node.closing_loc)), block)
|
||||||
when :[]=
|
when :[]=
|
||||||
if node.message != "[]=" && node.arguments && block.nil? && !node.safe_navigation?
|
if node.message != "[]=" && node.arguments && block.nil? && !node.safe_navigation?
|
||||||
|
arguments = node.arguments.arguments[...-1]
|
||||||
|
arguments << node.block if node.block
|
||||||
|
|
||||||
return visit_block(
|
return visit_block(
|
||||||
builder.assign(
|
builder.assign(
|
||||||
builder.index_asgn(
|
builder.index_asgn(
|
||||||
visit(node.receiver),
|
visit(node.receiver),
|
||||||
token(node.opening_loc),
|
token(node.opening_loc),
|
||||||
visit_all(node.arguments.arguments[...-1]),
|
visit_all(arguments),
|
||||||
token(node.closing_loc),
|
token(node.closing_loc),
|
||||||
),
|
),
|
||||||
srange_find(node.message_loc.end_offset, node.arguments.arguments.last.location.start_offset, ["="]),
|
srange_find(node.message_loc.end_offset, node.arguments.arguments.last.location.start_offset, ["="]),
|
||||||
|
|
|
@ -46,7 +46,6 @@ module Prism
|
||||||
# These files are either failing to parse or failing to translate, so we'll
|
# These files are either failing to parse or failing to translate, so we'll
|
||||||
# skip them for now.
|
# skip them for now.
|
||||||
skip_all = %w[
|
skip_all = %w[
|
||||||
arrays.txt
|
|
||||||
constants.txt
|
constants.txt
|
||||||
dash_heredocs.txt
|
dash_heredocs.txt
|
||||||
dos_endings.txt
|
dos_endings.txt
|
||||||
|
|
Загрузка…
Ссылка в новой задаче