summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--eval.c2
-rw-r--r--numeric.c46
-rw-r--r--parse.y18
-rw-r--r--version.h15
5 files changed, 69 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 960964b133..cfc0e0c597 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index 2036c3efda..e363b20930 100644
--- a/eval.c
+++ b/eval.c
@@ -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);
diff --git a/numeric.c b/numeric.c
index 73fa329479..4fb2f38fb8 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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;
@@ -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);
@@ -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);
}
-
diff --git a/parse.y b/parse.y
index 5db815e122..8e76254a77 100644
--- a/parse.y
+++ b/parse.y
@@ -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)
@@ -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
@@ -309,7 +309,7 @@ static void top_local_setup();
%right '!' '~' tUPLUS tUMINUS
%right tPOW
-%token LAST_TOKEN
+%token tLAST_TOKEN
%%
program : {
@@ -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);
@@ -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);
@@ -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);
@@ -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()
@@ -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;
}
@@ -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++) {
diff --git a/version.h b/version.h
index 536779bc3b..e2acc413ce 100644
--- a/version.h
+++ b/version.h
@@ -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