Slide 209
Slide 209 text
>
source_code = %q{
string = <<~EOM
"I am a here doc" if true
EOM
}
Ripper.lex(source_code)
[[[1, 0], :on_ignored_nl, "\n", BEG],
[[2, 0], :on_ident, "string", CMDARG],
[[2, 6], :on_sp, " ", CMDARG],
[[2, 7], :on_op, "=", BEG],
[[2, 8], :on_sp, " ", BEG],
[[2, 9], :on_heredoc_beg, "<<~EOM", BEG],
[[2, 15], :on_nl, "\n", BEG],
[[3, 0], :on_tstring_content,
" \"I am a here doc\" if true\n",
BEG],
[[4, 0], :on_tstring_content, "EOM \n",
BEG]]