summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1994-10-14 13:22:18 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:30 +0900
commit173976c97c9426aa8d96e53aef6c0e570c5fdfda (patch)
tree88aeb3cd71db04436cfe10515400d53d7ecb3bd9 /eval.c
parenteed5c920dd5429bac6075e9bc98d82360392b424 (diff)
version 0.52v0_52
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.51-0.52.diff.gz Fri Oct 14 13:22:18 1994 Yukihiro Matsumoto (matz@ix-02) * version 0.52: ……なんてこったい. * eval.c(rb_call): returnの処理が間違っていたので, マシンによって はreturnで関数を終了するだけでなくtoplevelまでつき抜けていた. * object.c: Builtinクラスを新設. 組み込み関数をKernelから移した. nilが組み込み関数を理解するとトラブルの元である. * dbm.c: Dictと同様にeachが[key,value]を返すように.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/eval.c b/eval.c
index 4a7241e..21f7ecd 100644
--- a/eval.c
+++ b/eval.c
@@ -3,7 +3,7 @@
eval.c -
$Author: matz $
- $Date: 1994/08/24 09:25:28 $
+ $Date: 1994/10/14 10:00:53 $
created at: Thu Jun 10 14:22:17 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
@@ -1139,7 +1139,9 @@ rb_exit(status)
int status;
{
last_val = INT2FIX(status);
- JUMP_TAG(TAG_EXIT);
+ if (prot_tag)
+ JUMP_TAG(TAG_EXIT);
+ exit(FIX2UINT(last_val));
}
VALUE
@@ -1519,7 +1521,6 @@ rb_call(class, recv, mid, argc, argv)
int argc;
ID mid;
{
- int state, go_out;
NODE *body;
VALUE result;
VALUE saved_self = Qself;
@@ -1655,6 +1656,8 @@ rb_call(class, recv, mid, argc, argv)
}
}
else {
+ int state;
+
PUSH_ENV();
the_env->local_vars = Qnil;
@@ -1670,10 +1673,13 @@ rb_call(class, recv, mid, argc, argv)
#endif
PUSH_TAG();
- switch (state = EXEC_TAG()) {
- case 0:
+ state = EXEC_TAG();
+ if (state == 0) {
result = rb_eval(body);
- go_out=0;
+ }
+ POP_TAG();
+ switch (state) {
+ case 0:
break;
case TAG_CONTINUE:
Fatal("unexpected continue");
@@ -1691,11 +1697,9 @@ rb_call(class, recv, mid, argc, argv)
result = last_val;
break;
default:
- go_out=1;
+ JUMP_TAG(state);
}
- POP_TAG();
POP_ENV();
- if (go_out) JUMP_TAG(state);
}
Qself = saved_self;
the_env->iterator = saved_ilevel;
@@ -2004,7 +2008,7 @@ addpath(path)
Init_load()
{
- extern VALUE C_Kernel;
+ extern VALUE C_Builtin;
extern VALUE rb_check_str();
char *path;
@@ -2015,6 +2019,6 @@ Init_load()
addpath(getenv("RUBYLIB"));
addpath(RUBY_LIB);
- rb_define_method(C_Kernel, "load", Fload, 1);
- rb_define_method(C_Kernel, "require", Frequire, 1);
+ rb_define_method(C_Builtin, "load", Fload, 1);
+ rb_define_method(C_Builtin, "require", Frequire, 1);
}