summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-30 16:38:32 +0000
commite8c88007403d6892df7464ad443bd6bacab0546d (patch)
tree05fc392080ae4257df67782f72ad344e500307bb /re.c
parentfbfe706aee4f10560f669e48b51a942aaa206e73 (diff)
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
Diffstat (limited to 're.c')
-rw-r--r--re.c27
1 files changed, 26 insertions, 1 deletions
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,
+ * <code>#inspect</code> actually produces the more natural version of
+ * the string than <code>#to_s</code>.
+ *
+ * /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;
@@ -1592,6 +1610,13 @@ rb_reg_match_m(re, str)
}
/*
+ * Document-method: compile
+ *
+ * Synonym for <code>Regexp.new</code>
+ */
+
+
+/*
* call-seq:
* Regexp.new(string [, options [, lang]]) => regexp
* Regexp.new(regexp) => 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);
}