[前][次][番号順一覧][スレッド一覧]

ruby-changes:60768

From: Kazuhiro <ko1@a...>
Date: Tue, 14 Apr 2020 12:39:44 +0900 (JST)
Subject: [ruby-changes:60768] c79e3a5957 (master): Add {Regexp, String}#match with block to call-seq [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=c79e3a5957

From c79e3a5957ac57d2d4e9ecd82648c7ecca7929d2 Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA <zn@m...>
Date: Tue, 14 Apr 2020 12:38:30 +0900
Subject: Add {Regexp,String}#match with block to call-seq [ci skip]


diff --git a/re.c b/re.c
index a429c33..11f7e61 100644
--- a/re.c
+++ b/re.c
@@ -3265,8 +3265,8 @@ rb_reg_match2(VALUE re) https://github.com/ruby/ruby/blob/trunk/re.c#L3265
 
 /*
  *  call-seq:
- *     rxp.match(str)       -> matchdata or nil
- *     rxp.match(str,pos)   -> matchdata or nil
+ *     rxp.match(str, pos=0)                   -> matchdata or nil
+ *     rxp.match(str, pos=0) {|match| block }  -> obj
  *
  *  Returns a MatchData object describing the match, or
  *  <code>nil</code> if there was no match. This is equivalent to
diff --git a/string.c b/string.c
index ca21e00..c64b273 100644
--- a/string.c
+++ b/string.c
@@ -3841,8 +3841,8 @@ static VALUE get_pat(VALUE); https://github.com/ruby/ruby/blob/trunk/string.c#L3841
 
 /*
  *  call-seq:
- *     str.match(pattern)        -> matchdata or nil
- *     str.match(pattern, pos)   -> matchdata or nil
+ *     str.match(pattern, pos=0)                   -> matchdata or nil
+ *     str.match(pattern, pos=0) {|match| block }  -> obj
  *
  *  Converts <i>pattern</i> to a Regexp (if it isn't already one),
  *  then invokes its <code>match</code> method on the receiver.
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]