Project

General

Profile

Actions

Bug #4011

closed

Invalid parsing of regexp /abc/min in irb

Added by phasis68 (Heesob Park) about 14 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3dev (2010-11-01 trunk 29655) [i386-mswin32_90]
Backport:
[ruby-core:32988]

Description

=begin
When Regexp option is "min" or "xin", irb cannot detect end of statement.

C:\work>irb
irb(main):001:0> a = /abc/min
irb(main):002:0*

Here is a patch
--- ruby-lex.rb 2010-11-01 17:00:46.000000000 +0900
+++ ruby-lex.rb.new 2010-11-01 17:02:00.000000000 +0900
@@ -1068,7 +1068,7 @@
end
end
if @ltype == "/"

  •   if peek(0) =~ /i|m|x|o|e|s|u|n/
    
  •   while peek(0) =~ /i|m|x|o|e|s|u|n/
        getc
      end
     end
    

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0