aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-30 15:34:41 +0900
committeraycabta <aycabta@gmail.com>2019-05-30 15:34:41 +0900
commit55c34b994b40db4d9fdbc29d9d8521745a56fdfd (patch)
treeb85e2a2a36e86d0a1365111ad216f8811be38d65
parent5a229b0a88679529a18aa3ef87317bdbd1783c58 (diff)
downloadruby-55c34b994b40db4d9fdbc29d9d8521745a56fdfd.tar.gz
Check the end token of heredoc correctly
-rw-r--r--lib/irb/ruby-lex.rb2
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