From d448294b57180be9525502454be5c5185a0d3efe Mon Sep 17 00:00:00 2001 From: Vidar Hokstad Date: Fri, 13 Oct 2023 05:07:23 +0100 Subject: [PATCH] Fixes #360 by adding missing HEREDOC handling --- lib/unparser/emitter/op_assign.rb | 5 +++++ test/corpus/semantic/opasgn.rb | 1 + 2 files changed, 6 insertions(+) create mode 100644 test/corpus/semantic/opasgn.rb diff --git a/lib/unparser/emitter/op_assign.rb b/lib/unparser/emitter/op_assign.rb index 52d3d117..affd028a 100644 --- a/lib/unparser/emitter/op_assign.rb +++ b/lib/unparser/emitter/op_assign.rb @@ -35,6 +35,11 @@ class OpAssign < self children :target, :operator, :value + def emit_heredoc_reminders + emitter(target).emit_heredoc_reminders + emitter(value).emit_heredoc_reminders + end + private def dispatch diff --git a/test/corpus/semantic/opasgn.rb b/test/corpus/semantic/opasgn.rb new file mode 100644 index 00000000..de66f430 --- /dev/null +++ b/test/corpus/semantic/opasgn.rb @@ -0,0 +1 @@ +y += "#{42}\n"