summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--eval.c8
-rw-r--r--ext/tk/lib/tk.rb13
-rw-r--r--instruby.rb2
-rw-r--r--sample/irb.rb3
5 files changed, 27 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 821fc10874d..23539266be0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jul 14 12:49:50 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
+
+ * eval.c (rb_eval): should preserve errinfo even if return, break,
+ etc. is called in rescue clause.
+
+ * instruby.rb: install irb too.
+
Wed Jul 12 15:32:57 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* variable.c (rb_const_get): constants for builtin classes must
@@ -10,7 +17,7 @@ Wed Jul 12 15:06:28 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_eval): use rb_const_get_at().
- * variable.c (rb_const_get_at): retrieve toplevel constants only,
+ * variable.c (top_const_get): retrieve toplevel constants only,
not ones of Object (and its included modules) in general.
Wed Jul 12 15:04:11 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
diff --git a/eval.c b/eval.c
index 3003139dae8..8a2072322bc 100644
--- a/eval.c
+++ b/eval.c
@@ -2219,13 +2219,13 @@ rb_eval(self, n)
result = rb_eval(self, resq->nd_body);
}
POP_TAG();
- if (state == 0) {
- ruby_errinfo = e_info;
- }
- else if (state == TAG_RETRY) {
+ if (state == TAG_RETRY) {
state = 0;
goto retry_entry;
}
+ if (state != TAG_RAISE) {
+ ruby_errinfo = e_info;
+ }
break;
}
resq = resq->nd_head; /* next rescue */
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index b495a2e2d11..4b1c21f40a0 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -219,6 +219,17 @@ module TkComm
end
private :_get_eval_string
+ def ruby2tcl(v)
+ if v.kind_of?(Hash)
+ v = hash_kv(v)
+ v.flatten!
+ v.collect{|e|ruby2tcl(e)}
+ else
+ _get_eval_string(v)
+ end
+ end
+ private :ruby2tcl
+
Tk_IDs = [0, 0] # [0]-cmdid, [1]-winid
def _curr_cmd_id
id = format("c%.4d", Tk_IDs[0])
@@ -541,7 +552,7 @@ module TkCore
def tk_call(*args)
print args.join(" "), "\n" if $DEBUG
- args.collect! {|x|_get_eval_string(x)}
+ args.collect! {|x|ruby2tcl(x)}
args.compact!
args.flatten!
begin
diff --git a/instruby.rb b/instruby.rb
index 601debfa1e5..809ab86f3f7 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -69,6 +69,8 @@ else
end
Dir.chdir CONFIG["srcdir"]
+File.install "sample/irb.rb", "#{bindir}/irb", 0755, true
+
Find.find("lib") do |f|
next unless /\.rb$/ =~ f
dir = rubylibdir+"/"+File.dirname(f[4..-1])
diff --git a/sample/irb.rb b/sample/irb.rb
index 38d184dfd0b..6746c59d429 100644
--- a/sample/irb.rb
+++ b/sample/irb.rb
@@ -19,8 +19,7 @@ if __FILE__ == $0
IRB.start(__FILE__)
else
# check -e option
- tmp = ENV["TMP"] || ENV["TMPDIR"] || "/tmp"
- if %r|#{tmp}/rb| =~ $0
+ if /^-e$/ =~ $0
IRB.start(__FILE__)
else
IRB.initialize(__FILE__)