Skip to content

Commit b268c73

Browse files
author
matz
committed
* array.c (rb_ary_pop): may cause realloc oscillation. a patch
from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>. [ruby-dev:29028] * parse.y (then): we'd like to reserve colon here for the future. warning added. * ruby.h: export rb_cMethod. [ruby-talk:201259] * ext/bigdecimal/bigdecimal.c: Allows '_' to appear within digits. [ruby-dev:28872] * ext/bigdecimal/lib/bigdecimal/util.rb: Bug in to_r reported by [ruby-list:42533] fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 3f6444f commit b268c73

File tree

6 files changed

+46
-6
lines changed

6 files changed

+46
-6
lines changed

ChangeLog

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Fri Jul 14 00:10:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* array.c (rb_ary_pop): may cause realloc oscillation. a patch
4+
from MORITA Naoyuki <mlgetter at kidou.sakura.ne.jp>.
5+
[ruby-dev:29028]
6+
17
Thu Jul 13 22:23:56 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
28

39
* ext/tk/lib/tk/composite.rb: improve handling of the classname on the
@@ -8,6 +14,15 @@ Thu Jul 13 20:32:19 2006 Kouhei Sutou <kou@cozmixng.org>
814
* lib/rss/parser.rb: updated documents by a patch from
915
Hugh Sasse <hgs at dmu.ac.uk>. [ruby-core:8194]
1016

17+
Wed Jul 12 13:54:09 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
18+
19+
* parse.y (then): we'd like to reserve colon here for the future.
20+
warning added.
21+
22+
Tue Jul 11 20:58:18 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
23+
24+
* ruby.h: export rb_cMethod. [ruby-talk:201259]
25+
1126
Tue Jul 11 19:13:33 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
1227

1328
* ext/tk/lib/multi-tk.rb: remove restriction on the class of
@@ -21,6 +36,14 @@ Tue Jul 11 17:33:39 2006 NAKAMURA Usaku <usa@ruby-lang.org>
2136

2237
* string.c (rb_str_dump): need to extend len for \b.
2338

39+
Mon Jul 10 22:00:00 2006 Shigeo Kobayashi <shigek@ruby-lang.org>
40+
41+
* ext/bigdecimal/bigdecimal.c: Allows '_' to appear within
42+
digits. [ruby-dev:28872]
43+
44+
* ext/bigdecimal/lib/bigdecimal/util.rb: Bug in to_r reported by
45+
[ruby-list:42533] fixed.
46+
2447
Mon Jul 10 19:22:19 2006 Tanaka Akira <akr@fsij.org>
2548

2649
* gc.c (gc_sweep): expand heap earlier.

eval.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ static VALUE rb_f_binding _((VALUE));
234234
static void rb_f_END _((void));
235235
static VALUE rb_f_block_given_p _((void));
236236
static VALUE block_pass _((VALUE,NODE*));
237-
static VALUE rb_cMethod;
237+
238+
VALUE rb_cMethod;
238239
static VALUE method_call _((int, VALUE*, VALUE));
239240
static VALUE rb_cUnboundMethod;
240241
static VALUE umethod_bind _((VALUE, VALUE));

ext/bigdecimal/bigdecimal.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,14 +2496,25 @@ VpAlloc(U_LONG mx, char *szVal)
24962496
return vp;
24972497
}
24982498

2499-
/* Skip all spaces */
2499+
/* Skip all '_' after digit: 2006-6-30 */
2500+
ni = 0;
25002501
psz = ALLOCA_N(char,strlen(szVal)+1);
25012502
i = 0;
25022503
ipn = 0;
25032504
while(psz[i]=szVal[ipn]) {
2504-
if(ISSPACE(szVal[ipn])) {ipn++;continue;}
2505+
if(ISDIGIT(psz[i])) ++ni;
2506+
if(psz[i]=='_') {
2507+
if(ni>0) {ipn++;continue;}
2508+
psz[i]=0;
2509+
break;
2510+
}
25052511
++i; ++ipn;
25062512
}
2513+
/* Skip trailing spaces */
2514+
while((--i)>0) {
2515+
if(ISSPACE(psz[i])) psz[i] = 0;
2516+
else break;
2517+
}
25072518
szVal = psz;
25082519

25092520
/* Check on Inf & NaN */

ext/bigdecimal/lib/bigdecimal/util.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ def to_r
4646
numerator = sign*digits.to_i
4747
denomi_power = power - digits.size # base is always 10
4848
if denomi_power < 0
49-
denominator = base ** (-denomi_power)
49+
Rational(numerator,base ** (-denomi_power))
5050
else
51-
denominator = base ** denomi_power
51+
Rational(numerator * (base ** denomi_power),1)
5252
end
53-
Rational(numerator,denominator)
5453
end
5554
end
5655

parse.y

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,11 @@ primary_value : primary
17311731

17321732
then : term
17331733
| ':'
1734+
{
1735+
rb_warn("colon will be obsoleted; use semicolon");
1736+
value_expr($1);
1737+
$$ = $1;
1738+
}
17341739
| kTHEN
17351740
| term kTHEN
17361741
;

ruby.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ RUBY_EXTERN VALUE rb_cFloat;
592592
RUBY_EXTERN VALUE rb_cHash;
593593
RUBY_EXTERN VALUE rb_cInteger;
594594
RUBY_EXTERN VALUE rb_cIO;
595+
RUBY_EXTERN VALUE rb_cMethod;
595596
RUBY_EXTERN VALUE rb_cModule;
596597
RUBY_EXTERN VALUE rb_cNilClass;
597598
RUBY_EXTERN VALUE rb_cNumeric;

0 commit comments

Comments
 (0)