Project

General

Profile

Bug #9344

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

File 'test.rb' contains: 

 ~~~ruby 
 
   $-w = 2 
 
   code = <<-RUBY 
   
     x = /]]/ 
   
     y = /[a-z]+*/ 
 
   RUBY 
 
   instance_eval code, 'foo.rb' 
 ~~~ 

 The execution reports: 

 ~~~ 
 
   foo.rb:1: warning: regular expression has ']' without escape: /]]/ 
 
   test.rb:6: warning: nested repeat operator + and * was replaced with '*': /[a-z]+*/ 
 ~~~ 

 The last line should state '`foo.rb:2`' 'foo.rb:2' instead of '`test.rb:6`'. 'test.rb:6'. 

 The bug is also present in: ruby 2.0.0p353 (2013-11-22) [i386-mingw32] 

Back