From e8c88007403d6892df7464ad443bd6bacab0546d Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 30 Dec 2003 16:38:32 +0000 Subject: Add RDoc for kernel functions, and tidy up git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- re.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 're.c') diff --git a/re.c b/re.c index 577a9ad745..307017c858 100644 --- a/re.c +++ b/re.c @@ -386,6 +386,17 @@ rb_reg_source(re) return str; } +/* + * call-seq: + * rxp.inspect => string + * + * Produce a nicely formatted string-version of _rxp_. Perhaps surprisingly, + * #inspect actually produces the more natural version of + * the string than #to_s. + * + * /ab+c/ix.to_s #=> /ab+c/ix +*/ + static VALUE rb_reg_inspect(re) VALUE re; @@ -1416,6 +1427,13 @@ rb_reg_cur_kcode(re) return 0; } +/* + * call-seq: + * rxp.hash => fixnum + * + * Produce a hash based on the text and options of this regular expression. + */ + static VALUE rb_reg_hash(re) VALUE re; @@ -1591,6 +1609,13 @@ rb_reg_match_m(re, str) return result; } +/* + * Document-method: compile + * + * Synonym for Regexp.new + */ + + /* * call-seq: * Regexp.new(string [, options [, lang]]) => regexp @@ -2267,6 +2292,6 @@ Init_Regexp() rb_define_method(rb_cMatch, "pre_match", rb_reg_match_pre, 0); rb_define_method(rb_cMatch, "post_match", rb_reg_match_post, 0); rb_define_method(rb_cMatch, "to_s", match_to_s, 0); - rb_define_method(rb_cMatch, "inspect", rb_any_to_s, 0); + rb_define_method(rb_cMatch, "inspect", rb_any_to_s, 0); // in object.c rb_define_method(rb_cMatch, "string", match_string, 0); } -- cgit v1.2.3