1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Check the end token of heredoc correctly

This commit is contained in:
aycabta 2019-05-30 15:34:41 +09:00
parent 5a229b0a88
commit 55c34b994b

View file

@ -147,6 +147,8 @@ class RubyLex
return false
elsif !@tokens.empty? and @tokens.last[2] == "\\\n"
return true
elsif @tokens.size >= 1 and @tokens[-1][1] == :on_heredoc_end # "EOH\n"
return false
elsif @tokens.size >= 2 and @tokens[-2][3].anybits?(continued_bits)
# end of literal except for regexp
return true