Sha256: 6bb5e018cdceb5310c4d7f4b45aa4e5dfcfff6f1da8c097ea2534c4c21a19379

Contents?: true

Size: 1.15 KB

Versions: 52

Compression:

Stored size: 1.15 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+)\)?,
                   \s*(-?\w+)\s*\)}xm
  MATCH2 = %r{rb_define_global_function\s*\(
                \s*"([^"]+)",
                \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\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

52 entries across 37 versions & 5 rubygems

Version Path
challah-0.7.0.pre2 vendor/bundle/gems/yard-0.8.2.1/lib/yard/handlers/c/method_handler.rb
challah-0.7.0.pre vendor/bundle/gems/yard-0.8.2.1/lib/yard/handlers/c/method_handler.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/c/method_handler.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/method_handler.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.2.1/lib/yard/handlers/c/method_handler.rb
yard-0.8.2.1 lib/yard/handlers/c/method_handler.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/c/method_handler.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.2/lib/yard/handlers/c/method_handler.rb
yard-0.8.2 lib/yard/handlers/c/method_handler.rb
challah-0.6.0 vendor/bundle/gems/yard-0.8.1/lib/yard/handlers/c/method_handler.rb
yard-0.8.1 lib/yard/handlers/c/method_handler.rb
yard-0.8.0 lib/yard/handlers/c/method_handler.rb