diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-08-29 09:17:34 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-08-29 20:12:57 +0000 |
commit | b435161404ed960e02fadfd1c3d983d1fbfb91a0 (patch) | |
tree | 17addc8461de3886f8ac85ec6adc9798defe9f03 /lib | |
parent | 455153705c81fc1561317279da54daa5e5b479b3 (diff) |
[ruby/yarp] Add instance variable names to the constant pool
https://github.com/ruby/yarp/commit/f049932c44
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yarp/desugar_visitor.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/yarp/desugar_visitor.rb b/lib/yarp/desugar_visitor.rb index 3f901630b0..83a9bb5336 100644 --- a/lib/yarp/desugar_visitor.rb +++ b/lib/yarp/desugar_visitor.rb @@ -173,8 +173,8 @@ module YARP # @foo && @foo = bar def visit_instance_variable_and_write_node(node) AndNode.new( - InstanceVariableReadNode.new(node.name_loc), - InstanceVariableWriteNode.new(node.name_loc, node.value, node.operator_loc, node.location), + InstanceVariableReadNode.new(node.name, node.name_loc), + InstanceVariableWriteNode.new(node.name, node.name_loc, node.value, node.operator_loc, node.location), node.operator_loc, node.location ) @@ -187,8 +187,8 @@ module YARP # @foo || @foo = bar def visit_instance_variable_or_write_node(node) OrNode.new( - InstanceVariableReadNode.new(node.name_loc), - InstanceVariableWriteNode.new(node.name_loc, node.value, node.operator_loc, node.location), + InstanceVariableReadNode.new(node.name, node.name_loc), + InstanceVariableWriteNode.new(node.name, node.name_loc, node.value, node.operator_loc, node.location), node.operator_loc, node.location ) @@ -200,7 +200,7 @@ module YARP # # @foo = @foo + bar def visit_instance_variable_operator_write_node(node) - desugar_operator_write_node(node, InstanceVariableWriteNode, InstanceVariableReadNode) + desugar_operator_write_node(node, InstanceVariableWriteNode, InstanceVariableReadNode, arguments: [node.name]) end # foo &&= bar |