Class: YARD::Handlers::C::MethodHandler
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base ,
::YARD::Handlers::Base
|
|
Instance Chain:
|
|
Inherits: |
YARD::Handlers::C::Base
|
Defined in: | lib/yard/handlers/c/method_handler.rb |
Overview
Constant Summary
-
MATCH1 =
/rb_define_ ( singleton_method | method | module_function | private_method ) \s*\(\s*([\w\.]+)\s*, \s*"([^"]+)"\s*, \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(\w+\))?(\w+)\)?\s*, \s*(-?\w+)\s*\)/xm
-
MATCH2 =
/rb_define_global_function\s*\( \s*"([^"]+)", \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(\w+\))?(\w+)\)?, \s*(-?\w+)\s*\)/xm
-
MATCH3 =
/define_filetest_function\s*\( \s*"([^"]+)", \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(\w+\))?(\w+)\)?, \s*(-?\w+)\s*\)/xm
::YARD::CodeObjects
- Included
BUILTIN_ALL, BUILTIN_CLASSES, BUILTIN_EXCEPTIONS, BUILTIN_EXCEPTIONS_HASH, BUILTIN_MODULES, CONSTANTMATCH, CONSTANTSTART, CSEP, CSEPQ, ISEP, ISEPQ, METHODMATCH, METHODNAMEMATCH, NAMESPACEMATCH, NSEP, NSEPQ, PROXY_MATCH
Base
- Inherited
Class Attribute Summary
::YARD::Handlers::Base
- Inherited
.namespace_only | Declares that the handler should only be called when inside a |
.namespace_only? |
Class Method Summary
Base
- Inherited
::YARD::Handlers::Base
- Inherited
.clear_subclasses | Clear all registered subclasses. |
.handlers, | |
.handles | Declares the statement type which will be processed by this handler. |
.handles? | This class is implemented by |
.in_file | Declares that a handler should only be called when inside a filename by its basename or a regex match for the full path. |
.inherited, .matches_file?, .new, | |
.process | Generates a #process method, equivalent to +def process; ... |
.subclasses | Returns all registered handler subclasses. |
Instance Attribute Summary
::YARD::Handlers::Base
- Inherited
#extra_state | Share state across different handlers inside of a file. |
#globals |
|
#namespace, #namespace=, #owner, #owner=, #parser, #scope, #scope=, #statement, #visibility, #visibility= |
Instance Method Summary
-
#process ⇒ void
Main processing callback.
Base
- Inherited
HandlerMethods
- Included
#handle_alias, #handle_attribute, #handle_class, #handle_constants, #handle_method, #handle_module, #find_constant_docstring, #find_method_body, #record_parameters |
::YARD::Handlers::Common::MethodHandler
- Included
::YARD::Handlers::Base
- Inherited
#abort! | Aborts a handler by raising |
#call_params, #caller_method, | |
#ensure_loaded! | Ensures that a specific |
#parse_block | Parses the semantic "block" contained in the statement node. |
#process | The main handler method called by the parser on a statement that matches the |
#push_state | Executes a given block with specific state values for |
#register | Do some post processing on a list of code objects. |
#register_docstring | Registers any docstring found for the object and expands macros. |
#register_dynamic | Registers the object as dynamic if the object is defined inside a method or block (owner != namespace). |
#register_ensure_loaded | Ensures that the object's namespace is loaded before attaching it to the namespace. |
#register_file_info | Registers the file/line of the declaration with the object. |
#register_group | Registers the object as being inside a specific group. |
#register_module_function | Registers the same method information on the module function, if the object was defined as a module function. |
#register_source, | |
#register_transitive_tags | Registers any transitive tags from the namespace on the object. |
#register_visibility | Registers visibility on a method object. |
Constructor Details
This class inherits a constructor from YARD::Handlers::Base
Instance Method Details
#process ⇒ void
This method returns an undefined value.
Main processing callback
# File 'lib/yard/handlers/c/method_handler.rb', line 27
process do statement.source.scan(MATCH1) do |type, var_name, name, func_name, _param_count| break if var_name == "ruby_top_self" break if var_name == "nstr" break if var_name == "envtbl" var_name = "rb_cObject" if var_name == "rb_mKernel" handle_method(type, var_name, name, func_name) end statement.source.scan(MATCH2) do |name, func_name, _param_count| handle_method("method", "rb_mKernel", name, func_name) end statement.source.scan(MATCH3) do |name, func_name, _param_count| handle_method("singleton_method", "rb_cFile", name, func_name) end end