diff options
author | aycabta <aycabta@gmail.com> | 2019-05-30 15:34:41 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-30 15:34:41 +0900 |
commit | 55c34b994b40db4d9fdbc29d9d8521745a56fdfd (patch) | |
tree | b85e2a2a36e86d0a1365111ad216f8811be38d65 /lib/irb/ruby-lex.rb | |
parent | 5a229b0a88679529a18aa3ef87317bdbd1783c58 (diff) |
Check the end token of heredoc correctly
Diffstat (limited to 'lib/irb/ruby-lex.rb')
-rw-r--r-- | lib/irb/ruby-lex.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index b3985fb838..5e8f3235d6 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -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 |