summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/handlers/c/source/method_handler.rb
blob: b744f54f9343e52d187073fb40b37aa210e99dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module YARD::MRuby::Handlers::C::Source
  class MethodHandler < Base
    MATCH1 = /mrb_define_(
        method |
        singleton_method |
        module_function
      )
      \s*\(
      \s*\w+\s*,
      \s*(\w+)\s*,
      \s*"(\w+)"\s*,
      \s*(\w+)\s*,
    /mx

    handles MATCH1
    statement_class BodyStatement

    process do
      statement.source.scan(MATCH1) do |type,var_name, name, func_name|
        handle_method(type, var_name, name, func_name)
      end
    end

  end
end