method
do_aliases
v1_9_3_125 -
Show latest stable
- Class:
RDoc::Parser::C
do_aliases()public
Scans #content for rb_define_alias
# File lib/rdoc/parser/c.rb, line 163
def do_aliases
@content.scan(/rb_define_alias\s*\(
\s*(\w+),
\s*"(.+?)",
\s*"(.+?)"
\s*\)/m) do |var_name, new_name, old_name|
class_name = @known_classes[var_name]
unless class_name then
warn "Enclosing class/module %p for alias %s %s not known" % [
var_name, new_name, old_name]
next
end
class_obj = find_class var_name, class_name
al = RDoc::Alias.new '', old_name, new_name, ''
al.singleton = @singleton_classes.key? var_name
comment = find_alias_comment var_name, new_name, old_name
comment = strip_stars comment
al.comment = comment
al.record_location @top_level
class_obj.add_alias al
@stats.add_alias al
end
end Related methods
- Instance methods
- do_aliases
- do_attrs
- do_classes
- do_constants
- do_includes
- do_methods
- find_alias_comment
- find_attr_comment
- find_body
- find_class
- find_class_comment
- find_const_comment
- find_modifiers
- find_override_comment
- handle_attr
- handle_class_module
- handle_constants
- handle_ifdefs_in
- handle_method
- handle_singleton
- handle_tab_width
- look_for_directives_in
- rb_scan_args
- remove_commented_out_lines
- remove_private_comments
- scan
- Class methods
- new
- reset