summaryrefslogtreecommitdiff
path: root/lib/irb/color.rb
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-04-05 22:40:34 +0100
committergit <svn-admin@ruby-lang.org>2023-04-05 21:40:40 +0000
commit2f8e5c80e65a14b3a9298b6cae7ee7fc53890540 (patch)
treeca1b18b39c4a0d95017361207b635d71a173a639 /lib/irb/color.rb
parent1587494b0b5f64a9976dcf0bd94dfe98123c2c27 (diff)
[ruby/irb] Drop Ruby 2.6 support
(https://github.com/ruby/irb/pull/555) * Remove all Ruby 2.6 support * Drop Ruby 2.6 specific testing conditions * Only run Ruby 2.7+ on CI * Bump Ruby requirement to 2.7+ https://github.com/ruby/irb/commit/3f714b616c
Diffstat (limited to 'lib/irb/color.rb')
-rw-r--r--lib/irb/color.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index 52d6240910..fa99ed6fd6 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -197,15 +197,9 @@ module IRB # :nodoc:
end
end
- if lexer.respond_to?(:scan) # Ruby 2.7+
- lexer.scan.each do |elem|
- next if allow_last_error and /meets end of file|unexpected end-of-input/ =~ elem.message
- on_scan.call(elem)
- end
- else
- lexer.parse.sort_by(&:pos).each do |elem|
- on_scan.call(elem)
- end
+ lexer.scan.each do |elem|
+ next if allow_last_error and /meets end of file|unexpected end-of-input/ =~ elem.message
+ on_scan.call(elem)
end
# yield uncolorable DATA section
yield(nil, inner_code.byteslice(byte_pos...inner_code.bytesize), nil) if byte_pos < inner_code.bytesize