Code:
def foo
<<~Q
Qend
JRuby:
nil
#<Ripper::Lexer::Elem: on_kw@1:0:FNAME: "def">
#<Ripper::Lexer::Elem: on_sp@1:3:FNAME: " ">
#<Ripper::Lexer::Elem: on_ident@1:4:ENDFN: "foo">
#<Ripper::Lexer::Elem: on_nl@1:7:BEG: "\n">
#<Ripper::Lexer::Elem: on_sp@2:0:BEG: " ">
#<Ripper::Lexer::Elem: on_parse_error@2:2:END: "<<~Q": syntax error, unexpected end-of-file>
#<Ripper::Lexer::Elem: on_parse_error@2:2:END: "<<~Q": syntax error, unexpected end-of-file>
#<Ripper::Lexer::Elem: on_heredoc_beg@2:2:BEG: "<<~Q">
#<Ripper::Lexer::Elem: on_tstring_content@3:0:BEG: " Qend\n">
MRI:
#<Ripper::Lexer::Elem: on_kw@1:0:FNAME: "def">
#<Ripper::Lexer::Elem: on_sp@1:3:FNAME: " ">
#<Ripper::Lexer::Elem: on_ident@1:4:ENDFN: "foo">
#<Ripper::Lexer::Elem: on_nl@1:7:BEG: "\n">
#<Ripper::Lexer::Elem: on_sp@2:0:BEG: " ">
#<Ripper::Lexer::Elem: on_heredoc_beg@2:2:BEG: "<<~Q">
#<Ripper::Lexer::Elem: compile_error@2:5:BEG: "Q": can't find string "Q" anywhere before EOF>
#<Ripper::Lexer::Elem: on_parse_error@2:6:BEG: "\n": syntax error, unexpected end-of-input, expecting `end'>
#<Ripper::Lexer::Elem: on_nl@2:6:BEG: "\n">
#<Ripper::Lexer::Elem: on_tstring_content@3:0:BEG: " Qend\n">
Linked from jruby/jruby#7640