Skip to content

Commit ee9d5d4

Browse files
author
matz
committed
021224
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e274c3a commit ee9d5d4

File tree

5 files changed

+69
-16
lines changed

5 files changed

+69
-16
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Tue Dec 24 17:02:46 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* eval.c (rb_undefined): use NoMethodError instead of fatal.
4+
15
Tue Dec 24 02:12:45 2002 Akinori MUSHA <knu@iDaemons.org>
26

37
* lib/README: Synchronize with reality.

eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4465,7 +4465,7 @@ rb_undefined(obj, id, argc, argv, call_status)
44654465
POP_FRAME();
44664466
}
44674467
else if (id == ID_ALLOCATOR) {
4468-
rb_fatal("allocator undefined for %s", rb_class2name(obj));
4468+
rb_raise(rb_eNoMethodError, "allocator undefined for %s", rb_class2name(obj));
44694469
}
44704470

44714471
nargv = ALLOCA_N(VALUE, argc+1);

numeric.c

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,39 @@
2222
#include <float.h>
2323
#endif
2424

25+
/* use IEEE 64bit values if not defined */
26+
#ifndef FLT_RADIX
27+
#define FLT_RADIX 2
28+
#endif
29+
#ifndef FLT_ROUNDS
30+
#define FLT_ROUNDS 1
31+
#endif
32+
#ifndef DBL_MIN
33+
#define DBL_MIN 2.2250738585072014e-308
34+
#endif
35+
#ifndef DBL_MAX
36+
#define DBL_MAX 1.7976931348623157e+308
37+
#endif
38+
#ifndef DBL_MIN_EXP
39+
#define DBL_MIN_EXP (-1021)
40+
#endif
41+
#ifndef DBL_MAX_EXP
42+
#define DBL_MAX_EXP 1024
43+
#endif
44+
#ifndef DBL_MIN_10_EXP
45+
#define DBL_MIN_10_EXP (-307)
46+
#endif
47+
#ifndef DBL_MAX_10_EXP
48+
#define DBL_MAN_10_EXP 308
49+
#endif
50+
#ifndef DBL_DIG
51+
#define DBL_DIG 15
52+
#endif
53+
#ifndef DBL_MANT_DIG
54+
#define DBL_MANT_DIG 53
55+
#endif
2556
#ifndef DBL_EPSILON
26-
#define DBL_EPSILON 2.2204460492503131E-16
57+
#define DBL_EPSILON 2.2204460492503131e-16
2758
#endif
2859

2960
static ID id_coerce, id_to_i, id_div;
@@ -1767,6 +1798,18 @@ Init_Numeric()
17671798
rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1);
17681799
rb_include_module(rb_cFloat, rb_mPrecision);
17691800

1801+
rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS));
1802+
rb_define_const(rb_cFloat, "RADIX", INT2FIX(FLT_RADIX));
1803+
rb_define_const(rb_cFloat, "MANT_DIG", INT2FIX(DBL_MANT_DIG));
1804+
rb_define_const(rb_cFloat, "DIG", INT2FIX(DBL_DIG));
1805+
rb_define_const(rb_cFloat, "MIN_EXP", INT2FIX(DBL_MIN_EXP));
1806+
rb_define_const(rb_cFloat, "MAX_EXP", INT2FIX(DBL_MAX_EXP));
1807+
rb_define_const(rb_cFloat, "MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP));
1808+
rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP));
1809+
rb_define_const(rb_cFloat, "MIN", rb_float_new(DBL_MIN));
1810+
rb_define_const(rb_cFloat, "MAX", rb_float_new(DBL_MAX));
1811+
rb_define_const(rb_cFloat, "EPSILON", rb_float_new(DBL_EPSILON));
1812+
17701813
rb_define_method(rb_cFloat, "to_s", flo_to_s, 0);
17711814
rb_define_method(rb_cFloat, "coerce", flo_coerce, 1);
17721815
rb_define_method(rb_cFloat, "-@", flo_uminus, 0);
@@ -1801,4 +1844,3 @@ Init_Numeric()
18011844
rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0);
18021845
rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0);
18031846
}
1804-

parse.y

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#define ID_JUNK 0x07
4242
#define ID_INTERNAL ID_JUNK
4343

44-
#define is_notop_id(id) ((id)>LAST_TOKEN)
44+
#define is_notop_id(id) ((id)>tLAST_TOKEN)
4545
#define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
4646
#define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
4747
#define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
@@ -286,7 +286,7 @@ static void top_local_setup();
286286
* precedence table
287287
*/
288288

289-
%nonassoc LOWEST
289+
%nonassoc tLOWEST
290290
%nonassoc tLBRACE_ARG
291291

292292
%left kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
@@ -309,7 +309,7 @@ static void top_local_setup();
309309
%right '!' '~' tUPLUS tUMINUS
310310
%right tPOW
311311

312-
%token LAST_TOKEN
312+
%token tLAST_TOKEN
313313

314314
%%
315315
program : {
@@ -631,7 +631,7 @@ cmd_brace_block : tLBRACE_ARG
631631
}
632632
;
633633

634-
command : operation command_args %prec LOWEST
634+
command : operation command_args %prec tLOWEST
635635
{
636636
$$ = new_fcall($1, $2);
637637
fixpos($$, $2);
@@ -648,7 +648,7 @@ command : operation command_args %prec LOWEST
648648
}
649649
fixpos($$, $2);
650650
}
651-
| primary_value '.' operation2 command_args %prec LOWEST
651+
| primary_value '.' operation2 command_args %prec tLOWEST
652652
{
653653
$$ = new_call($1, $3, $4);
654654
fixpos($$, $1);
@@ -665,7 +665,7 @@ command : operation command_args %prec LOWEST
665665
}
666666
fixpos($$, $1);
667667
}
668-
| primary_value tCOLON2 operation2 command_args %prec LOWEST
668+
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
669669
{
670670
$$ = new_call($1, $3, $4);
671671
fixpos($$, $1);
@@ -5550,7 +5550,7 @@ Init_sym()
55505550
sym_rev_tbl = st_init_numtable_with_size(200);
55515551
}
55525552

5553-
static ID last_id = LAST_TOKEN;
5553+
static ID last_id = tLAST_TOKEN;
55545554

55555555
static ID
55565556
internal_id()
@@ -5608,7 +5608,7 @@ rb_intern(name)
56085608
strncpy(buf, name, last);
56095609
buf[last] = '\0';
56105610
id = rb_intern(buf);
5611-
if (id > LAST_TOKEN && !is_attrset_id(id)) {
5611+
if (id > tLAST_TOKEN && !is_attrset_id(id)) {
56125612
id = rb_id_attrset(id);
56135613
goto id_regist;
56145614
}
@@ -5640,7 +5640,7 @@ rb_id2name(id)
56405640
{
56415641
char *name;
56425642

5643-
if (id < LAST_TOKEN) {
5643+
if (id < tLAST_TOKEN) {
56445644
int i = 0;
56455645

56465646
for (i=0; op_tbl[i].token; i++) {

version.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
#define RUBY_VERSION "1.7.3"
2-
#define RUBY_RELEASE_DATE "2002-12-20"
3-
#define RUBY_VERSION_CODE 173
4-
#define RUBY_RELEASE_CODE 20021220
1+
#define RUBY_VERSION "1.8.0"
2+
#define RUBY_RELEASE_DATE "2002-12-24"
3+
#define RUBY_VERSION_CODE 180
4+
#define RUBY_RELEASE_CODE 20021224
5+
6+
#define RUBY_VERSION_MAJOR 1
7+
#define RUBY_VERSION_MINOR 8
8+
#define RUBY_VERSION_TEENY 0
9+
#define RUBY_RELEASE_YEAR 2002
10+
#define RUBY_RELEASE_MONTH 12
11+
#define RUBY_RELEASE_DAY 24

0 commit comments

Comments
 (0)