git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-12-12 07:42:35 +00:00
Родитель 2322a13127
Коммит 3a7020854d
9 изменённых файлов: 68 добавлений и 27 удалений

Просмотреть файл

@ -1,3 +1,33 @@
Tue Dec 12 15:45:42 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (newline_node): cancel newline unification.
Mon Dec 11 23:01:57 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (yylex): supports cases `?' precedes EOF and newline.
Mon Dec 11 12:11:25 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (call_end_proc): some frame members were left
uninitialized.
Mon Dec 11 01:14:58 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_fptr_finalize): do not fclose stdin, stdout and
stderr at exit.
Sat Dec 9 17:34:48 2000 Tachino Nobuhiro <tachino@open.nm.fujitsu.co.jp>
* time.c (time_cmp): should check with kind_of?, not instance_of?
* time.c (time_eql): ditto.
* time.c (time_minus): ditto.
Fri Dec 8 17:23:25 2000 Tachino Nobuhiro <tachino@open.nm.fujitsu.co.jp>
* sprintf.c (rb_f_sprintf): proper string precision treat.
Fri Dec 8 10:44:05 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* variable.c (rb_mod_remove_cvar): Module#remove_class_variable

5
ToDo
Просмотреть файл

@ -28,6 +28,7 @@ Language Spec.
+ variables appears within block may have independent values.
* Regexp: make /o thread safe.
* decide if begin with rescue or ensure make do..while loop.
* a +1 to be a+1, not a(+1).
Hacking Interpreter
@ -98,7 +99,9 @@ Standard Libraries
* IO#for_fd in general
* Array#&, Array#| to allow duplication. ???
- fork_and_kill_other_threads.
* way to specify immortal (fork endurance) thread.
* way to specify immortal (fork endurance) thread;
* or raise ForkException to every thread but fork caller.
* Array#fetch
Extension Libraries

Просмотреть файл

@ -1437,9 +1437,8 @@ rb_ary_diff(ary1, ary2)
}
static VALUE
ary_make_hash(ary1, ary2, func)
ary_make_hash(ary1, ary2)
VALUE ary1, ary2;
int (*func)();
{
VALUE hash = rb_hash_new();
int i, n;

3
eval.c
Просмотреть файл

@ -5635,6 +5635,9 @@ call_end_proc(data)
{
PUSH_ITER(ITER_NOT);
PUSH_FRAME();
ruby_frame->self = ruby_frame->prev->self;
ruby_frame->last_func = 0;
ruby_frame->last_class = 0;
proc_call(data, Qundef);
POP_FRAME();
POP_ITER();

20
io.c
Просмотреть файл

@ -1013,13 +1013,10 @@ fptr_finalize(fptr)
}
}
void
rb_io_fptr_finalize(fptr)
static void
rb_io_fptr_cleanup(fptr)
OpenFile *fptr;
{
if (!fptr) return;
if (!fptr->f && !fptr->f2) return;
if (fptr->finalize) {
(*fptr->finalize)(fptr);
}
@ -1034,6 +1031,17 @@ rb_io_fptr_finalize(fptr)
}
}
void
rb_io_fptr_finalize(fptr)
OpenFile *fptr;
{
if (!fptr) return;
if (!fptr->f && !fptr->f2) return;
if (fileno(fptr->f) < 3) return;
rb_io_fptr_cleanup(fptr);
}
static void
rb_io_fptr_close(fptr)
OpenFile *fptr;
@ -1044,7 +1052,7 @@ rb_io_fptr_close(fptr)
if (!fptr->f && !fptr->f2) return;
fd = fileno(fptr->f);
rb_io_fptr_finalize(fptr);
rb_io_fptr_cleanup(fptr);
rb_thread_fd_close(fd);
}

15
parse.y
Просмотреть файл

@ -1914,7 +1914,6 @@ yyerror(msg)
}
static int heredoc_end;
static int last_newline;
int ruby_in_compile = 0;
int ruby__end__seen;
@ -1954,7 +1953,6 @@ yycompile(f, line)
ruby__end__seen = 0;
ruby_eval_tree = 0;
heredoc_end = 0;
last_newline = 0;
ruby_sourcefile = f;
ruby_in_compile = 1;
n = yyparse();
@ -2814,7 +2812,7 @@ yylex()
/* white spaces */
case ' ': case '\t': case '\f': case '\r':
case '\13': /* '\v' */
space_seen = 1;
space_seen++;
goto retry;
case '#': /* it's a comment */
@ -2982,6 +2980,10 @@ yylex()
return '?';
}
c = nextc();
if (c == -1 || c == 10) {
rb_compile_error("incomplete character syntax");
return 0;
}
if (lex_state == EXPR_ARG && ISSPACE(c)){
pushback(c);
lex_state = EXPR_BEG;
@ -3294,8 +3296,8 @@ yylex()
}
pushback(c);
if (lex_state == EXPR_ARG && space_seen) {
arg_ambiguous();
if (!ISSPACE(c)) {
arg_ambiguous();
return parse_regx('/', '/');
}
}
@ -3847,10 +3849,9 @@ newline_node(node)
{
NODE *nl = 0;
if (node) {
if (nd_line(node) == last_newline) return node;
nl = NEW_NEWLINE(node);
fixpos(nl, node);
last_newline = nl->nd_nth = nd_line(node);
nl->nd_nth = nd_line(node);
}
return nl;
}
@ -4645,7 +4646,7 @@ top_local_setup()
i = ruby_scope->local_tbl?ruby_scope->local_tbl[0]:0;
if (i < len) {
if (i == 0 || ruby_scope->flag == SCOPE_ALLOCA) {
if (i == 0 || (ruby_scope->flag & SCOPE_MALLOC) == 0) {
VALUE *vars = ALLOC_N(VALUE, len+1);
if (ruby_scope->local_vars) {
*vars++ = ruby_scope->local_vars[-1];

Просмотреть файл

@ -320,10 +320,7 @@ rb_f_sprintf(argc, argv)
len = RSTRING(str)->len;
if (flags&FPREC) {
if (prec < len) {
CHECK(prec);
memcpy(&buf[blen], RSTRING(str)->ptr, prec);
blen += prec;
break;
len = prec;
}
}
if (flags&FWIDTH) {

6
st.c
Просмотреть файл

@ -62,10 +62,10 @@ static void rehash();
#define alloc(type) (type*)xmalloc((unsigned)sizeof(type))
#define Calloc(n,s) (char*)xcalloc((n),(s))
#define EQUAL(table, x, y) ((*table->type->compare)(x, y) == 0)
#define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)
#define do_hash(key, table) (unsigned int)(*(table)->type->hash)((key))
#define do_hash_bin(key, table) (do_hash(key, table)&(table)->num_bins)
#define do_hash(key,table) (unsigned int)(*(table)->type->hash)((key))
#define do_hash_bin(key,table) (do_hash(key, table)&(table)->num_bins)
/*
* MINSIZE is the minimum size of a dictionary.

8
time.c
Просмотреть файл

@ -469,7 +469,7 @@ time_cmp(time1, time2)
}
}
if (rb_obj_is_instance_of(time2, rb_cTime)) {
if (rb_obj_is_kind_of(time2, rb_cTime)) {
GetTimeval(time2, tobj2);
if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return INT2FIX(0);
@ -492,7 +492,7 @@ time_eql(time1, time2)
struct time_object *tobj1, *tobj2;
GetTimeval(time1, tobj1);
if (rb_obj_is_instance_of(time2, rb_cTime)) {
if (rb_obj_is_kind_of(time2, rb_cTime)) {
GetTimeval(time2, tobj2);
if (tobj1->tv.tv_sec == tobj2->tv.tv_sec) {
if (tobj1->tv.tv_usec == tobj2->tv.tv_usec) return Qtrue;
@ -676,7 +676,7 @@ time_minus(time1, time2)
double f;
GetTimeval(time1, tobj);
if (rb_obj_is_instance_of(time2, rb_cTime)) {
if (rb_obj_is_kind_of(time2, rb_cTime)) {
struct time_object *tobj2;
GetTimeval(time2, tobj2);
@ -945,7 +945,7 @@ static VALUE
time_s_times(obj)
VALUE obj;
{
#ifdef HAVE_TIMES
#if defined(HAVE_TIMES) && !defined(__CHECKER__)
#ifndef HZ
# ifdef CLK_TCK
# define HZ CLK_TCK