Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Prism::DesugarCompiler#desugar_operator_write_node
desugar_operator_write_node(node, read_class, write_class, *arguments)
lib/prism/desugar_compiler.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/prism/desugar_compiler.rb, line 155
def desugar_operator_write_node(node, read_class, write_class, *arguments)
write_class.new(
*arguments,
node.name_loc,
CallNode.new(
0,
read_class.new(*arguments, node.name_loc),
nil,
node.operator_loc.slice.chomp("="),
node.operator_loc.copy(length: node.operator_loc.length - 1),
nil,
ArgumentsNode.new(0, [node.value], node.value.location),
nil,
nil,
node.location
),
node.operator_loc.copy(start_offset: node.operator_loc.end_offset - 1, length: 1),
node.location
)
end
Desugar ‘x += y` to `x = x + y`