diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-12 15:23:47 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-12 15:25:06 +0900 |
commit | 9593e76ac2cfd9366b8b904df3fc3e1047af3aee (patch) | |
tree | ae2db800ff4bc1e7235f4efd3aaf9f801f7352c0 /lib | |
parent | 8354cfd03b1e9961266e1fe56fca481450679b98 (diff) | |
download | ruby-9593e76ac2cfd9366b8b904df3fc3e1047af3aee.tar.gz |
Ripper::Lexer: fallback parse error token to the previous one
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/color.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb index fa8502c5d1..b942299789 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -137,7 +137,7 @@ module IRB # :nodoc: Ripper::Lexer.new(code).scan.each do |elem| str = elem.tok - next if allow_last_error and elem.message&.end_with?('meets end of file') + next if allow_last_error and /meets end of file|unexpected end-of-input/ =~ elem.message next if ([elem.pos[0], elem.pos[1] + str.bytesize] <=> pos) <= 0 str.each_line do |line| |