1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix parsing problem with yield within block

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
dave 2004-05-03 00:49:33 +00:00
parent 6303dc4cc1
commit 47feb25704
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Mon May 3 09:47:24 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_method_or_yield_parameters):
Fix parsing bug if yield called within 1 line block
Sun May 2 01:04:38 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib, ext/tk: renewal Ruby/Tk

View file

@ -195,7 +195,7 @@ module RDoc
end
def add_alias(an_alias)
meth = find_method_named(an_alias.old_name)
meth = find_instance_method_named(an_alias.old_name)
if meth
new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
new_meth.is_alias_for = meth
@ -380,6 +380,11 @@ module RDoc
@method_list.find {|meth| meth.name == name}
end
# Find a named instance method, or return nil
def find_instance_method_named(name)
@method_list.find {|meth| meth.name == name && !meth.singleton}
end
# Find a named constant, or return nil
def find_constant_named(name)
@constants.find {|m| m.name == name}

View file

@ -2020,6 +2020,8 @@ module RDoc
when TkLBRACE
nest += 1
when TkRBRACE
# we might have a.each {|i| yield i }
unget_tk(tk) if nest.zero?
nest -= 1
break if nest <= 0
when TkLPAREN, TkfLPAREN