From fec60bc7c4f851d0cf1c4670ef8f2d9c597b7598 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 29 Mar 2003 02:56:18 +0000 Subject: * eval.c (avalue_to_svalue): use rb_check_array_type() again. Clarify how "to_ary" and "to_a" work. [ruby-talk:68155] * eval.c (svalue_to_avalue): ditto. * eval.c (svalue_to_mrhs): ditto. * eval.c (rb_eval): unary splat to use to_a, but we need a hack to exclude Object#to_a until it's removed. * object.c (rb_Array): check obj.respond_to?("to_a"). Currently all object respond_to "to_a", but Object#to_a will be removed. * range.c (Init_Range): undefine to_ary. * re.c (Init_Regexp): ditto. * regex.c (re_compile_pattern): do not warn if "-" is at the top or last of character class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'regex.c') diff --git a/regex.c b/regex.c index 90f86f46c9..655d2f077e 100644 --- a/regex.c +++ b/regex.c @@ -1487,7 +1487,7 @@ re_compile_pattern(pattern, size, bufp) } had_char_class = 0; - if (c == '-') + if (c == '-' && p != p0 + 1 && *p != ']') re_warning("character class has `-' without escape"); if (c == '[' && *p != ':') re_warning("character class has `[' without escape"); -- cgit v1.2.3