Sha256: 46f90e2668dcfcb7b170f43a1331c146d97426c0798ee3ae10f19c448e347db3

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

class YARD::Handlers::C::MethodHandler < YARD::Handlers::C::Base
  MATCH1 = %r{rb_define_
                 (
                    singleton_method |
                    method           |
                    module_function  |
                    private_method
                 )
                 \s*\(\s*([\w\.]+),
                   \s*"([^"]+)",
                   \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(\w+\))?(\w+)\)?,
                   \s*(-?\w+)\s*\)}xm
  MATCH2 = %r{rb_define_global_function\s*\(
                \s*"([^"]+)",
                \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\(|\(\w+\))?(\w+)\)?,
                \s*(-?\w+)\s*\)}xm
  handles MATCH1
  handles MATCH2
  statement_class BodyStatement

  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
  end
end

Version data entries

16 entries across 15 versions & 3 rubygems

Version Path
yard-0.8.7.6 lib/yard/handlers/c/method_handler.rb
yard-0.8.7.5 lib/yard/handlers/c/method_handler.rb
climine-0.0.7 vendor/bundle/ruby/2.1.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.7 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.6 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.5 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
yard-0.8.7.4 lib/yard/handlers/c/method_handler.rb
climine-0.0.4 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.3 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.2 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
climine-0.0.1 vendor/bundle/ruby/2.0.0/gems/yard-0.8.7.3/lib/yard/handlers/c/method_handler.rb
yard-0.8.7.3 lib/yard/handlers/c/method_handler.rb
yard-0.8.7.2 lib/yard/handlers/c/method_handler.rb