diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 21:34:01 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 21:34:01 +0000 |
commit | a928cfed87c27f180ce9f76ffb8448282d629fc4 (patch) | |
tree | c9e9a9aa0fd386d76e352dd0bd4d16cdc105a15f /lib/rdoc/parsers | |
parent | dc03b05a7e8461793963346bc73964dbc675b605 (diff) | |
download | ruby-a928cfed87c27f180ce9f76ffb8448282d629fc4.tar.gz |
Handle aliases in C files
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parsers')
-rw-r--r-- | lib/rdoc/parsers/parse_c.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb index d97e08bf4d..2b12411ae9 100644 --- a/lib/rdoc/parsers/parse_c.rb +++ b/lib/rdoc/parsers/parse_c.rb @@ -165,6 +165,7 @@ module RDoc do_classes do_methods do_includes + do_aliases @top_level end @@ -321,6 +322,19 @@ module RDoc end ############################################################ + + def do_aliases + @body.scan(%r{rb_define_alias\(\s*(\w+),\s*"([^"]+)",\s*"([^"]+)"\s*\)}m) do + |var_name, new_name, old_name| + @stats.num_methods += 1 + class_name = @known_classes[var_name] || var_name + class_obj = find_class(var_name, class_name) + + class_obj.add_alias(Alias.new("", old_name, new_name, "")) + end + end + + ############################################################ def handle_method(type, var_name, meth_name, meth_body, param_count, source_file = nil) |