[前][次][番号順一覧][スレッド一覧]

ruby-changes:70026

From: manga_osyo <ko1@a...>
Date: Fri, 3 Dec 2021 00:42:37 +0900 (JST)
Subject: [ruby-changes:70026] dcbe29d2ae (master): [ruby/irb] Fix bug infinite loop when pasting multilines fo code in Ruby 2.6

https://git.ruby-lang.org/ruby.git/commit/?id=dcbe29d2ae

From dcbe29d2aefa5304af443e13a156c80850f47ea5 Mon Sep 17 00:00:00 2001
From: manga_osyo <manga.osyo@g...>
Date: Tue, 23 Nov 2021 23:07:02 +0900
Subject: [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 f5361e16a2b..751d6ec526d 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -167,7 +167,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L167
           end
         end
       else
-        tokens = lexer.parse
+        tokens = lexer.parse.reject { |it| it.pos.first == 0 }
       end
     end
     tokens
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]