summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-03 05:17:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-03 05:17:39 +0000
commit6a6d0ad22009c437217eb6aeb4c3750f7a3aaa6d (patch)
tree4ab0fd67ef12ea789ccb12df06654057f5ee6f87 /lib
parent0cd0eab641a16d6e59f424ab3f5fad3550fa54b5 (diff)
* parse.y (arg): parse 'lhs = a rescue b' as 'lhs=(a rescue b)'.
* io.c (rb_io_fread): should not clearerr() if there's no filled buffer (i.e. rb_io_fread() returning zero). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date.rb4
-rw-r--r--lib/debug.rb18
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 51cc95ee18..e04f0b01b0 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -365,7 +365,7 @@ class Date
when Numeric; return @ajd <=> other
when Date; return @ajd <=> other.ajd
end
- raise TypeError, 'expected numeric or date'
+ nil
end
def === (other)
@@ -373,7 +373,7 @@ class Date
when Numeric; return jd == other
when Date; return jd == other.jd
end
- raise TypeError, 'expected numeric or date'
+ false
end
def >> (n)
diff --git a/lib/debug.rb b/lib/debug.rb
index 74e06e010c..8f2999a3ab 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -158,10 +158,9 @@ class Context
def debug_eval(str, binding)
begin
val = eval(str, binding)
- val
- rescue StandardError, ScriptError
- at = eval("caller(0)", binding)
- stdout.printf "%s:%s\n", at.shift, $!.to_s.sub(/\(eval\):1:(in `.*?':)?/, '') #`
+ rescue StandardError, ScriptError => e
+ at = eval("caller(1)", binding)
+ stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
for i in at
stdout.printf "\tfrom %s\n", i
end
@@ -297,6 +296,12 @@ class Context
stdout.print "Trace off.\n"
end
+ when /^\s*b(?:reak)?\s+(.+)[#.](.+)$/
+ pos = $2.intern.id2name
+ file = debug_eval($1, binding)
+ break_points.push [true, 0, file, pos]
+ stdout.printf "Set breakpoint %d at %s.%s\n", break_points.size, file, pos
+
when /^\s*b(?:reak)?\s+(?:(.+):)?(.+)$/
pos = $2
file = File.basename($1 || file)
@@ -646,7 +651,7 @@ EOHELP
def check_break_points(file, pos, binding, id)
return false if break_points.empty?
- file = File.basename(file)
+# file = File.basename(file)
n = 1
for b in break_points
if b[0]
@@ -709,7 +714,8 @@ EOHELP
when 'call'
@frames.unshift [binding, file, line, id]
if check_break_points(file, id.id2name, binding, id) or
- check_break_points(klass.to_s, id.id2name, binding, id)
+ check_break_points(klass.to_s, id.id2name, binding, id) or
+ check_break_points(klass, id.id2name, binding, id)
suspend_all
debug_command(file, line, id, binding)
end