From 47427428802ebfdcc077145b4efae2a3f38572bf Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 2 Aug 2004 02:59:17 +0000 Subject: Bugfix: looping on some toplevel symbols. Added SWIG support git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ lib/rdoc/code_objects.rb | 2 +- lib/rdoc/parsers/parse_c.rb | 7 ++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc38c75074..d6a78fada6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Aug 2 11:53:06 2004 Dave Thomas + + * 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 + + * 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 17:40:16 2004 Nobuyoshi Nakada * misc/ruby-mode.el (ruby-expr-beg, ruby-parse-partial, diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb index 9bacab8f6d..82872db14d 100644 --- a/lib/rdoc/code_objects.rb +++ b/lib/rdoc/code_objects.rb @@ -325,7 +325,7 @@ module RDoc result = nil case symbol when /^::(.*)/ - result = toplevel.find_symbol(symbol) + result = toplevel.find_symbol($1) when /::/ modules = symbol.split(/::/) unless modules.empty? diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb index 31c1106406..c42fbb2e11 100644 --- a/lib/rdoc/parsers/parse_c.rb +++ b/lib/rdoc/parsers/parse_c.rb @@ -254,7 +254,8 @@ module RDoc handle_class_module(var_name, "module", class_name, nil, nil) 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* @@ -280,7 +281,7 @@ module RDoc handle_class_module(var_name, "module", class_name, nil, in_module) end - @body.scan(/(\w+)\s* = \s*rb_define_class_under + @body.scan(/([\w\.]+)\s* = \s*rb_define_class_under \( \s*(\w+), \s*"(\w+)", @@ -304,7 +305,7 @@ module RDoc module_function | private_method ) - \(\s*(\w+), + \(\s*([\w\.]+), \s*"([^"]+)", \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?, \s*(-?\w+)\s*\) -- cgit v1.2.3