Closed vidarh closed 11 months ago
Found this "in the wild" when trying to parse toml-rb (lib/toml-rb/dumper.rb) which has a more complex use to test against.
Looking at #249 it seems likely to be a similar or the same issue.
Pull request: https://github.com/mbj/unparser/pull/351
@vidarh Fix released in v0.6.10.
If you parse code that produces an op_asgn node, such as e.g. a statement containing "+=" or "&=" etc., and the right hand side of that contains a string, and the string contains interpolation and a linefeed, the output ends up replacing the right hand side with a "<<- HEREDOC" but never outputs the HEREDOC.
Simplest test case I've found:
Test program:
Output: