summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/debug.rb7
-rw-r--r--lib/delegate.rb2
-rw-r--r--lib/tk.rb21
3 files changed, 22 insertions, 8 deletions
diff --git a/lib/debug.rb b/lib/debug.rb
index 432c7b4d19..2e3a29aa9e 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -11,6 +11,8 @@ class DEBUGGER__
@scripts = {}
end
+ DEBUG_LAST_CMD = []
+
def interrupt
@stop_next = 1
end
@@ -40,6 +42,11 @@ class DEBUGGER__
STDOUT.flush
while input = STDIN.gets
input.chop!
+ if input == ""
+ input = DEBUG_LAST_CMD[0]
+ else
+ DEBUG_LAST_CMD[0] = input
+ end
case input
when /^b(reak)?\s+(([^:\n]+:)?.+)/
pos = $2
diff --git a/lib/delegate.rb b/lib/delegate.rb
index c73a3bd8a0..bc6f876212 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -7,7 +7,7 @@
#
# Usage:
# foo = Object.new
-# foo = SimpleDelegator.new(foo)
+# foo2 = SimpleDelegator.new(foo)
# foo.hash == foo2.hash # => true
class Delegator
diff --git a/lib/tk.rb b/lib/tk.rb
index 8c361c03e5..213fc54de7 100644
--- a/lib/tk.rb
+++ b/lib/tk.rb
@@ -113,7 +113,6 @@ module TkComm
end
end
def list(val)
- p val
tk_split_list(val).to_a
end
def window(val)
@@ -274,7 +273,7 @@ module TkCore
end
def _get_eval_string(str)
- return str if str == None
+ return nil if str == None
if str.kind_of?(Hash)
str = hash_kv(str).join(" ")
elsif str == nil
@@ -294,10 +293,20 @@ module TkCore
def tk_call(*args)
print args.join(" "), "\n" if $DEBUG
args.filter {|x|_get_eval_string(x)}
- args.delete!(None)
- args.flatten!
args.compact!
- res = INTERP._invoke(*args)
+ args.flatten!
+ begin
+ res = INTERP._invoke(*args)
+ rescue NameError
+ err = $!
+ begin
+ args.unshift "unknown"
+ res = INTERP._invoke(*args)
+ rescue
+ raise unless /^invalid command/ =~ $!
+ raise err
+ end
+ end
if INTERP._return_value() != 0
fail RuntimeError, res, error_at
end
@@ -819,8 +828,6 @@ class TkObject<TkKernel
if (args.length == 1)
configure id.id2name, args[0]
else
- p caller
- p id.id2name
$@ = error_at
super
end