diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-25 07:07:43 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-25 07:07:43 +0000 |
commit | f33958990a43b8a20ad7ed7eb1d30ec211b46f85 (patch) | |
tree | f962530dd96d7c293cba9d8f4bd6318d688c33f2 /eval.c | |
parent | d65fac5daa6838c9c56c6b6dd2f3127fe229d4e8 (diff) |
* eval.c (ruby_run): should set toplevel visibility again here.
* eval.c (rb_eval): should not rely on ruby_class == rb_cObject
check. Besides allow implicit publicity for attribute set
methods.
* parse.y (primary): need not to check class_nest, just set
whether method is an attrset or not.
* string.c (rb_str_each_line): p might be at the top of the
string.
* variable.c (rb_path2class): should not use rb_eval_string().
* parse.y (str_extend): expression substitution can contain string
terminator again.
* parse.y (yylex): the warning message "invalid
character syntax" was never issued.
* file.c (rb_find_file): $LOAD_PATH must not be empty.
* file.c (rb_find_file_ext): ditto.
* range.c (range_eq): class check should be based on range.class,
instead of Range to work with Range.dup.
* range.c (range_eql): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1216,6 +1216,8 @@ ruby_run() Init_stack(&tmp); PUSH_TAG(PROT_NONE); PUSH_ITER(ITER_NOT); + /* default visibility is private at toplevel */ + SCOPE_SET(SCOPE_PRIVATE); if ((state = EXEC_TAG()) == 0) { eval_node(ruby_top_self, ruby_eval_tree); } @@ -2995,15 +2997,15 @@ rb_eval(self, n) } } - if (SCOPE_TEST(SCOPE_PRIVATE) || node->nd_mid == init) { + if (node->nd_noex == NOEX_PUBLIC) { + noex = NOEX_PUBLIC; /* means is is an attrset */ + } + else if (SCOPE_TEST(SCOPE_PRIVATE) || node->nd_mid == init) { noex = NOEX_PRIVATE; } else if (SCOPE_TEST(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } - else if (ruby_class == rb_cObject) { - noex = node->nd_noex; - } else { noex = NOEX_PUBLIC; } @@ -3159,8 +3161,8 @@ rb_eval(self, n) } else { module = rb_define_module_id(node->nd_cname); - rb_const_set(ruby_class, node->nd_cname, module); rb_set_class_path(module,ruby_class,rb_id2name(node->nd_cname)); + rb_const_set(ruby_class, node->nd_cname, module); } if (ruby_wrapper) { rb_extend_object(module, ruby_wrapper); @@ -7946,7 +7948,7 @@ void rb_thread_wait_for(time) struct timeval time; { - double date; + double limit; if (rb_thread_critical || curr_thread == curr_thread->next || @@ -7986,9 +7988,9 @@ rb_thread_wait_for(time) } } - date = timeofday() + (double)time.tv_sec + (double)time.tv_usec*1e-6; + limit = timeofday() + (double)time.tv_sec + (double)time.tv_usec*1e-6; curr_thread->status = THREAD_STOPPED; - curr_thread->delay = date; + curr_thread->delay = limit; curr_thread->wait_for = WAIT_TIME; rb_thread_schedule(); } |