From: Yusuke Endoh Date: 2010-04-08T23:17:18+09:00 Subject: [ruby-dev:40935] [Bug #1969] irb will be stuck with long variable name with completion.rb チケット #1969 が更新されました。 (by Yusuke Endoh) 担当者 Keiju Ishitsukaにセット 遠藤です。 2009年8月21日2:56 Yoshimasa Niwa : > Requiring "irb/completion", we then hit Tab after a long variable name, irb will be stuck. > > % irb > irb(main):001:0> require 'irb/completion' > => true > irb(main):002:0> a.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[Hit Tab key] > (Nothing happen, just eating CPU) > irb(main):002:0> ::A::BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB[Hit Tab key] > (Nothing happen, just eating CPU) > > I attached the patches to fix this issue. > This issue seems to be caused by a problem of longest matching of regular expressions. > These patches are based on Haruo Nanki 's good suggestions. > > irbでirb/completionがrequireされているときに、長い変数名、クラス名の後でTabを押すと固まります。 > 正規表現の最長一致の問題と思われます。 > 南木さんの指摘をもとに作成したパッチを添付しますのでご確認ください。 遅い反応ですみません。 再現しました。頂いたパッチはたぶん問題ないと思います。 いしつかさん、取り込んでいいでしょうか。 # (\.?[^.]+)+ は .+ と同値な気もしますが -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1969 ---------------------------------------- http://redmine.ruby-lang.org