1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* string.c (rb_str_concat): fix rdoc. (codepoint is integer)

* string.c (rb_str_each_codepoint): use UINT2NUM.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-09-16 13:23:16 +00:00
parent 025bd642a7
commit 8b31af74b7
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,9 @@
Tue Sep 16 22:21:33 2008 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (rb_str_concat): fix rdoc. (codepoint is integer)
* string.c (rb_str_each_codepoint): use UINT2NUM.
Tue Sep 16 21:48:55 2008 NARUSE, Yui <naruse@ruby-lang.org> Tue Sep 16 21:48:55 2008 NARUSE, Yui <naruse@ruby-lang.org>
* re.c (rb_reg_desc): Regexp#inspect should be US-ASCII. * re.c (rb_reg_desc): Regexp#inspect should be US-ASCII.

View file

@ -1712,13 +1712,13 @@ rb_str_append(VALUE str, VALUE str2)
/* /*
* call-seq: * call-seq:
* str << fixnum => str * str << integer => str
* str.concat(fixnum) => str * str.concat(integer) => str
* str << obj => str * str << obj => str
* str.concat(obj) => str * str.concat(obj) => str
* *
* Append---Concatenates the given object to <i>str</i>. If the object is a * Append---Concatenates the given object to <i>str</i>. If the object is a
* <code>Fixnum</code>, it is considered as a codepoint, and is converted * <code>Integer</code>, it is considered as a codepoint, and is converted
* to a character before concatenation. * to a character before concatenation.
* *
* a = "hello " * a = "hello "
@ -5523,7 +5523,7 @@ rb_str_each_char(VALUE str)
/* /*
* Document-method: each_codepoint * Document-method: each_codepoint
* call-seq: * call-seq:
* str.each_codepoint {|fixnum| block } => str * str.each_codepoint {|integer| block } => str
* *
* Passes the <code>Integer</code> ordinal of each character in <i>str</i>, * Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
* also known as a <i>codepoint</i> when applied to Unicode strings to the * also known as a <i>codepoint</i> when applied to Unicode strings to the
@ -5553,7 +5553,7 @@ rb_str_each_codepoint(VALUE str)
while (ptr < end) { while (ptr < end) {
c = rb_enc_codepoint(ptr, end, enc); c = rb_enc_codepoint(ptr, end, enc);
n = rb_enc_codelen(c, enc); n = rb_enc_codelen(c, enc);
rb_yield(INT2FIX(c)); rb_yield(UINT2NUM(c));
ptr += n; ptr += n;
} }
return str; return str;