From dcbe29d2aefa5304af443e13a156c80850f47ea5 Mon Sep 17 00:00:00 2001 From: manga_osyo Date: Tue, 23 Nov 2021 23:07:02 +0900 Subject: [PATCH] [ruby/irb] Fix bug infinite loop when pasting multilines fo code in Ruby 2.6 Fix bug infinite loop when pasting multilines fo code in Ruby 2.6. This is not reproduced in Ruby 2.7. Changes added in https://github.com/ruby/irb/pull/242/files#diff-612b926e42ed78aed1a889ac1944f7d22229b3a489cc08f837a7f75eca3d3399R155 are also reflected in Ruby 2.6. https://github.com/ruby/irb/commit/0a77f75bf0 --- lib/irb/ruby-lex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index f5361e16a2..751d6ec526 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -167,7 +167,7 @@ class RubyLex end end else - tokens = lexer.parse + tokens = lexer.parse.reject { |it| it.pos.first == 0 } end end tokens