Project

General

Profile

Actions

Bug #9344

closed

warning origin incorrect with instance_eval

Added by thyresias (Thierry Lambert) almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.3p484 (2013-11-22) [i386-mingw32]
[ruby-core:59468]

Description

File 'test.rb' contains:

$-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' instead of 'test.rb:6'.

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


Files

9344.patch (3.55 KB) 9344.patch srawlins (Sam Rawlins), 03/04/2014 06:49 AM
9344-v2.patch (1.87 KB) 9344-v2.patch srawlins (Sam Rawlins), 03/04/2014 08:20 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0