method
do_constants
v2_1_10 -
Show latest stable
- Class:
RDoc::Parser::C
do_constants()public
Scans #content for rb_define_variable, rb_define_readonly_variable, rb_define_const and rb_define_global_const
# File lib/rdoc/parser/c.rb, line 338
def do_constants
@content.scan(%\Wrb_define_
( variable |
readonly_variable |
const |
global_const )
\s*\(
(?:\s*(\w+),)?
\s*"(\w+)",
\s*(.*?)\s*\)\s*;
%m) do |type, var_name, const_name, definition|
var_name = "rb_cObject" if !var_name or var_name == "rb_mKernel"
handle_constants type, var_name, const_name, definition
end
@content.scan(%
\Wrb_curses_define_const
\s*\(
\s*
(\w+)
\s*
\)
\s*;%m) do |consts|
const = consts.first
handle_constants 'const', 'mCurses', const, "UINT2NUM(#{const})"
end
@content.scan(%
\Wrb_file_const
\s*\(
\s*
"([^"]+)",
\s*
(.*?)
\s*
\)
\s*;%m) do |name, value|
handle_constants 'const', 'rb_mFConst', name, value
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