Skip to content

Commit

Permalink
RDoc description updated
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
kosako committed Mar 24, 2006
1 parent 50091c9 commit 2025346
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Fri Mar 24 21:11:02 2006 K.Kosako <sndgk393 AT ybb.ne.jp>

* re.c (match_aref): RDoc description updated.

* string.c (rb_str_sub): ditto.

* string.c (rb_str_gsub): ditto.

Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp>

* re.c (rb_reg_regsub): prohibit \1, \2 ...\9 in replaced string
Expand Down
9 changes: 7 additions & 2 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$Author$
created at: Mon Aug 9 18:24:49 JST 1993
Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 1993-2006 Yukihiro Matsumoto
**********************************************************************/

Expand Down Expand Up @@ -1177,9 +1177,10 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, char* name, char

/*
* call-seq:
* mtch[i] => obj
* mtch[i] => str or nil
* mtch[start, length] => array
* mtch[range] => array
* mtch[name] => str or nil
*
* Match Reference---<code>MatchData</code> acts as an array, and may be
* accessed using the normal array indexing techniques. <i>mtch</i>[0] is
Expand All @@ -1192,6 +1193,10 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, char* name, char
* m[1, 2] #=> ["H", "X"]
* m[1..3] #=> ["H", "X", "113"]
* m[-3, 2] #=> ["X", "113"]
*
* m = /(?<foo>a+)b/.match("ccaaab")
* m["foo"] #=> "aaa"
* m[:foo] #=> "aaa"
*/

static VALUE
Expand Down
23 changes: 13 additions & 10 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
$Date$
created at: Mon Aug 9 17:12:58 JST 1993
Copyright (C) 1993-2003 Yukihiro Matsumoto
Copyright (C) 1993-2006 Yukihiro Matsumoto
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
Expand Down Expand Up @@ -1887,7 +1887,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
* If the method call specifies <i>replacement</i>, special variables such as
* <code>$&</code> will not be useful, as substitution into the string occurs
* before the pattern match starts. However, the sequences <code>\1</code>,
* <code>\2</code>, etc., may be used.
* <code>\2</code>, <code>\k<group_name></code>, etc., may be used.
*
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
Expand All @@ -1897,9 +1897,10 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
* The result inherits any tainting in the original string or any supplied
* replacement string.
*
* "hello".sub(/[aeiou]/, '*') #=> "h*llo"
* "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
* "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello"
* "hello".sub(/[aeiou]/, '*') #=> "h*llo"
* "hello".sub(/([aeiou])/, '<\1>') #=> "h<e>llo"
* "hello".sub(/./) {|s| s[0].to_s + ' ' } #=> "104 ello"
* "hello".sub(/(?<foo>[aeiou])/, '*\k<foo>*') #=> "h*e*llo"
*/

static VALUE
Expand Down Expand Up @@ -2066,8 +2067,9 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
* If a string is used as the replacement, special variables from the match
* (such as <code>$&</code> and <code>$1</code>) cannot be substituted into it,
* as substitution into the string occurs before the pattern match
* starts. However, the sequences <code>\1</code>, <code>\2</code>, and so on
* may be used to interpolate successive groups in the match.
* starts. However, the sequences <code>\1</code>, <code>\2</code>,
* <code>\k<group_name></code>, and so on may be used to interpolate
* successive groups in the match.
*
* In the block form, the current match string is passed in as a parameter, and
* variables such as <code>$1</code>, <code>$2</code>, <code>$`</code>,
Expand All @@ -2077,9 +2079,10 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
* The result inherits any tainting in the original string or any supplied
* replacement string.
*
* "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
* "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
* "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 "
* "hello".gsub(/[aeiou]/, '*') #=> "h*ll*"
* "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
* "hello".gsub(/./) {|s| s[0].to_s + ' '} #=> "104 101 108 108 111 "
* "hello".gsub(/(?<foo>[aeiou])/, '{\k<foo>}') #=> "h{e}ll{o}"
*/

static VALUE
Expand Down
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2006-03-23"
#define RUBY_RELEASE_DATE "2006-03-24"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20060323
#define RUBY_RELEASE_CODE 20060324

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2006
#define RUBY_RELEASE_MONTH 3
#define RUBY_RELEASE_DAY 23
#define RUBY_RELEASE_DAY 24

RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];
Expand Down

0 comments on commit 2025346

Please sign in to comment.