From: nagachika00@... Date: 2014-09-10T14:32:44+00:00 Subject: [ruby-core:64934] [ruby-trunk - Bug #9344] warning origin incorrect with instance_eval Issue #9344 has been updated by Tomoyuki Chikanaga. Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: DONE merge partially r46831 into `ruby_2_1` branch at r47519. The patch was derived from https://github.com/k-takata/Onigmo/commit/bdfc1997aa15b6baddaf9a482c6610b32504bd86 ---------------------------------------- Bug #9344: warning origin incorrect with instance_eval https://bugs.ruby-lang.org/issues/9344#change-48825 * Author: Thierry Lambert * Status: Closed * Priority: Normal * Assignee: Ken Takata * Category: regexp * Target version: current: 2.2.0 * ruby -v: ruby 1.9.3p484 (2013-11-22) [i386-mingw32] * Backport: 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: DONE ---------------------------------------- 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`' 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-v2.patch (1.87 KB) -- https://bugs.ruby-lang.org/