ConradIrwin/ruby_parser — comment on commit abf9e03784f61604b0ece985188f46b52f30d507
File:  line 0
By ConradIrwin:

Hi @Confusion. Unfortunately this patch doesn't handle the case where the end of the opening line of the HEREDOC is a string (or string-like construct) i.e.:

puts <<-HD, "

HD
fooo"

I think it would be possible to fix that, but not in a very nice way (simply checking for lex_resume at every place the string parsing can handle a newline would be fine, but there are quite a lot of those places).

ruby_parser version 2.3.1 has added a workaround for the bug this causes, https://github.com/seattlerb/ruby_parser/commit/705272813396e1f6cb5ce27add900e98840b76a4#L5R750, and some of this patch is already incorporated: https://github.com/seattlerb/ruby_parser/commit/2f3b25dde713bbbdc655648847fbae39a785a98d

If you want to fix the bug I described feel free to submit the request in your name :)