* regparse.c (add_code_range_to_buf0): fix false negative
warning when given range is just before previous range. [ruby-dev:41406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
415be47593
commit
81c5ede3ca
@ -1,3 +1,9 @@
|
|||||||
|
Tue May 25 14:00:51 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* regparse.c (add_code_range_to_buf0): fix false negative
|
||||||
|
warning when given range is just before previous range.
|
||||||
|
[ruby-dev:41406]
|
||||||
|
|
||||||
Tue May 25 16:37:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue May 25 16:37:39 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* misc/ruby-style.el (ruby-style-version): take revision if
|
* misc/ruby-style.el (ruby-style-version): take revision if
|
||||||
|
@ -1750,12 +1750,11 @@ add_code_range_to_buf0(BBuf** pbuf, ScanEnv* env, OnigCodePoint from, OnigCodePo
|
|||||||
return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;
|
return ONIGERR_TOO_MANY_MULTI_BYTE_RANGES;
|
||||||
|
|
||||||
if (inc_n != 1) {
|
if (inc_n != 1) {
|
||||||
|
if (checkdup && to >= data[low*2]) CC_DUP_WARN(env);
|
||||||
if (from > data[low*2])
|
if (from > data[low*2])
|
||||||
from = data[low*2];
|
from = data[low*2];
|
||||||
else if (checkdup) CC_DUP_WARN(env);
|
|
||||||
if (to < data[(high - 1)*2 + 1])
|
if (to < data[(high - 1)*2 + 1])
|
||||||
to = data[(high - 1)*2 + 1];
|
to = data[(high - 1)*2 + 1];
|
||||||
else if (checkdup) CC_DUP_WARN(env);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inc_n != 0 && (OnigCodePoint )high < n) {
|
if (inc_n != 0 && (OnigCodePoint )high < n) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
require_relative 'envutil'
|
||||||
|
|
||||||
class TestRegexp < Test::Unit::TestCase
|
class TestRegexp < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@ -816,4 +817,10 @@ class TestRegexp < Test::Unit::TestCase
|
|||||||
bug2547 = '[ruby-core:27374]'
|
bug2547 = '[ruby-core:27374]'
|
||||||
assert_raise(SyntaxError, bug2547) {eval('/#{"\\\\"}y/')}
|
assert_raise(SyntaxError, bug2547) {eval('/#{"\\\\"}y/')}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_dup_warn
|
||||||
|
assert_in_out_err('-w', 'x=/[\u3042\u3041]/', [], /\A\z/)
|
||||||
|
assert_in_out_err('-w', 'x=/[\u3042\u3042]/', [], /duplicated/)
|
||||||
|
assert_in_out_err('-w', 'x=/[\u3042\u3041-\u3043]/', [], /duplicated/)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user