Bugfix: looping on some toplevel symbols. Added SWIG support

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
dave 2004-08-02 02:59:17 +00:00
parent fd404f03cb
commit ee580a5a92
3 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,13 @@
Mon Aug 2 11:53:06 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/code_objects.rb (RDoc::Context::find_symbol): Fix infinite recursion
looking up some top level symbols (batsman)
Mon Aug 2 11:48:29 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_methods): Allow '.'s in
variable names to support SWIG generated files (Hans Fugal)
Sat Jul 31 23:08:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org> Sat Jul 31 23:08:00 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (is_defined): stupid mistakes fixed. [ruby-dev:24006] * eval.c (is_defined): stupid mistakes fixed. [ruby-dev:24006]

View File

@ -325,7 +325,7 @@ module RDoc
result = nil result = nil
case symbol case symbol
when /^::(.*)/ when /^::(.*)/
result = toplevel.find_symbol(symbol) result = toplevel.find_symbol($1)
when /::/ when /::/
modules = symbol.split(/::/) modules = symbol.split(/::/)
unless modules.empty? unless modules.empty?

View File

@ -254,7 +254,8 @@ module RDoc
handle_class_module(var_name, "module", class_name, nil, nil) handle_class_module(var_name, "module", class_name, nil, nil)
end end
@body.scan(/(\w+)\s* = \s*rb_define_class # The '.' lets us handle SWIG-generated files
@body.scan(/([\w\.]+)\s* = \s*rb_define_class
\( \(
\s*"(\w+)", \s*"(\w+)",
\s*(\w+)\s* \s*(\w+)\s*
@ -280,7 +281,7 @@ module RDoc
handle_class_module(var_name, "module", class_name, nil, in_module) handle_class_module(var_name, "module", class_name, nil, in_module)
end end
@body.scan(/(\w+)\s* = \s*rb_define_class_under @body.scan(/([\w\.]+)\s* = \s*rb_define_class_under
\( \(
\s*(\w+), \s*(\w+),
\s*"(\w+)", \s*"(\w+)",
@ -304,7 +305,7 @@ module RDoc
module_function | module_function |
private_method private_method
) )
\(\s*(\w+), \(\s*([\w\.]+),
\s*"([^"]+)", \s*"([^"]+)",
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?, \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
\s*(-?\w+)\s*\) \s*(-?\w+)\s*\)