Skip to content

Commit

Permalink
021224
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Dec 24, 2002
1 parent e274c3a commit ee9d5d4
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 16 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Tue Dec 24 17:02:46 2002 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (rb_undefined): use NoMethodError instead of fatal.

Tue Dec 24 02:12:45 2002 Akinori MUSHA <knu@iDaemons.org>

* lib/README: Synchronize with reality.
Expand Down
2 changes: 1 addition & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -4465,7 +4465,7 @@ rb_undefined(obj, id, argc, argv, call_status)
POP_FRAME();
}
else if (id == ID_ALLOCATOR) {
rb_fatal("allocator undefined for %s", rb_class2name(obj));
rb_raise(rb_eNoMethodError, "allocator undefined for %s", rb_class2name(obj));
}

nargv = ALLOCA_N(VALUE, argc+1);
Expand Down
46 changes: 44 additions & 2 deletions numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,39 @@
#include <float.h>
#endif

/* use IEEE 64bit values if not defined */
#ifndef FLT_RADIX
#define FLT_RADIX 2
#endif
#ifndef FLT_ROUNDS
#define FLT_ROUNDS 1
#endif
#ifndef DBL_MIN
#define DBL_MIN 2.2250738585072014e-308
#endif
#ifndef DBL_MAX
#define DBL_MAX 1.7976931348623157e+308
#endif
#ifndef DBL_MIN_EXP
#define DBL_MIN_EXP (-1021)
#endif
#ifndef DBL_MAX_EXP
#define DBL_MAX_EXP 1024
#endif
#ifndef DBL_MIN_10_EXP
#define DBL_MIN_10_EXP (-307)
#endif
#ifndef DBL_MAX_10_EXP
#define DBL_MAN_10_EXP 308
#endif
#ifndef DBL_DIG
#define DBL_DIG 15
#endif
#ifndef DBL_MANT_DIG
#define DBL_MANT_DIG 53
#endif
#ifndef DBL_EPSILON
#define DBL_EPSILON 2.2204460492503131E-16
#define DBL_EPSILON 2.2204460492503131e-16
#endif

static ID id_coerce, id_to_i, id_div;
Expand Down Expand Up @@ -1767,6 +1798,18 @@ Init_Numeric()
rb_define_singleton_method(rb_cFloat, "induced_from", rb_flo_induced_from, 1);
rb_include_module(rb_cFloat, rb_mPrecision);

rb_define_const(rb_cFloat, "ROUNDS", INT2FIX(FLT_ROUNDS));
rb_define_const(rb_cFloat, "RADIX", INT2FIX(FLT_RADIX));
rb_define_const(rb_cFloat, "MANT_DIG", INT2FIX(DBL_MANT_DIG));
rb_define_const(rb_cFloat, "DIG", INT2FIX(DBL_DIG));
rb_define_const(rb_cFloat, "MIN_EXP", INT2FIX(DBL_MIN_EXP));
rb_define_const(rb_cFloat, "MAX_EXP", INT2FIX(DBL_MAX_EXP));
rb_define_const(rb_cFloat, "MIN_10_EXP", INT2FIX(DBL_MIN_10_EXP));
rb_define_const(rb_cFloat, "MAX_10_EXP", INT2FIX(DBL_MAX_10_EXP));
rb_define_const(rb_cFloat, "MIN", rb_float_new(DBL_MIN));
rb_define_const(rb_cFloat, "MAX", rb_float_new(DBL_MAX));
rb_define_const(rb_cFloat, "EPSILON", rb_float_new(DBL_EPSILON));

rb_define_method(rb_cFloat, "to_s", flo_to_s, 0);
rb_define_method(rb_cFloat, "coerce", flo_coerce, 1);
rb_define_method(rb_cFloat, "-@", flo_uminus, 0);
Expand Down Expand Up @@ -1801,4 +1844,3 @@ Init_Numeric()
rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0);
rb_define_method(rb_cFloat, "finite?", flo_is_finite_p, 0);
}

18 changes: 9 additions & 9 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define ID_JUNK 0x07
#define ID_INTERNAL ID_JUNK

#define is_notop_id(id) ((id)>LAST_TOKEN)
#define is_notop_id(id) ((id)>tLAST_TOKEN)
#define is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
#define is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
#define is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
Expand Down Expand Up @@ -286,7 +286,7 @@ static void top_local_setup();
* precedence table
*/

%nonassoc LOWEST
%nonassoc tLOWEST
%nonassoc tLBRACE_ARG

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

%token LAST_TOKEN
%token tLAST_TOKEN

%%
program : {
Expand Down Expand Up @@ -631,7 +631,7 @@ cmd_brace_block : tLBRACE_ARG
}
;

command : operation command_args %prec LOWEST
command : operation command_args %prec tLOWEST
{
$$ = new_fcall($1, $2);
fixpos($$, $2);
Expand All @@ -648,7 +648,7 @@ command : operation command_args %prec LOWEST
}
fixpos($$, $2);
}
| primary_value '.' operation2 command_args %prec LOWEST
| primary_value '.' operation2 command_args %prec tLOWEST
{
$$ = new_call($1, $3, $4);
fixpos($$, $1);
Expand All @@ -665,7 +665,7 @@ command : operation command_args %prec LOWEST
}
fixpos($$, $1);
}
| primary_value tCOLON2 operation2 command_args %prec LOWEST
| primary_value tCOLON2 operation2 command_args %prec tLOWEST
{
$$ = new_call($1, $3, $4);
fixpos($$, $1);
Expand Down Expand Up @@ -5550,7 +5550,7 @@ Init_sym()
sym_rev_tbl = st_init_numtable_with_size(200);
}

static ID last_id = LAST_TOKEN;
static ID last_id = tLAST_TOKEN;

static ID
internal_id()
Expand Down Expand Up @@ -5608,7 +5608,7 @@ rb_intern(name)
strncpy(buf, name, last);
buf[last] = '\0';
id = rb_intern(buf);
if (id > LAST_TOKEN && !is_attrset_id(id)) {
if (id > tLAST_TOKEN && !is_attrset_id(id)) {
id = rb_id_attrset(id);
goto id_regist;
}
Expand Down Expand Up @@ -5640,7 +5640,7 @@ rb_id2name(id)
{
char *name;

if (id < LAST_TOKEN) {
if (id < tLAST_TOKEN) {
int i = 0;

for (i=0; op_tbl[i].token; i++) {
Expand Down
15 changes: 11 additions & 4 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#define RUBY_VERSION "1.7.3"
#define RUBY_RELEASE_DATE "2002-12-20"
#define RUBY_VERSION_CODE 173
#define RUBY_RELEASE_CODE 20021220
#define RUBY_VERSION "1.8.0"
#define RUBY_RELEASE_DATE "2002-12-24"
#define RUBY_VERSION_CODE 180
#define RUBY_RELEASE_CODE 20021224

#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2002
#define RUBY_RELEASE_MONTH 12
#define RUBY_RELEASE_DAY 24

0 comments on commit ee9d5d4

Please sign in to comment.