method
do_methods
v2_1_10 -
Show latest stable
- Class:
RDoc::Parser::C
do_methods()public
Scans #content for rb_define_method, rb_define_singleton_method, rb_define_module_function, rb_define_private_method, rb_define_global_function and define_filetest_function
# File lib/rdoc/parser/c.rb, line 459
def do_methods
@content.scan(%rb_define_
(
singleton_method |
method |
module_function |
private_method
)
\s*\(\s*([\w\.]+),
\s*"([^"]+)",
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(METHOD\))?(\w+)\)?,
\s*(-?\w+)\s*\)
(?:;\s*/[*/]\s+in\s+(\w+?\.(?:cpp|c|y)))?
%m) do |type, var_name, meth_name, function, param_count, source_file|
# Ignore top-object and weird struct.c dynamic stuff
next if var_name == "ruby_top_self"
next if var_name == "nstr"
var_name = "rb_cObject" if var_name == "rb_mKernel"
handle_method(type, var_name, meth_name, function, param_count,
source_file)
end
@content.scan(%rb_define_global_function\s*\(
\s*"([^"]+)",
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
\s*(-?\w+)\s*\)
(?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
%m) do |meth_name, function, param_count, source_file|
handle_method("method", "rb_mKernel", meth_name, function, param_count,
source_file)
end
@content.scan(/define_filetest_function\s*\(
\s*"([^"]+)",
\s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
\s*(-?\w+)\s*\)/m) do |meth_name, function, param_count|
handle_method("method", "rb_mFileTest", meth_name, function, param_count)
handle_method("singleton_method", "rb_cFile", meth_name, function,
param_count)
end
end Related methods
- Instance methods
- deduplicate_call_seq
- deduplicate_method_name
- do_aliases
- do_attrs
- do_boot_defclass
- do_classes
- do_constants
- do_define_class
- do_define_class_under
- do_define_module
- do_define_module_under
- do_includes
- do_methods
- do_missing
- do_modules
- do_singleton_class
- do_struct_define_without_accessor
- 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
- load_variable_map
- look_for_directives_in
- rb_scan_args
- remove_commented_out_lines
- scan
- Class methods
- new