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

    handles MATCH1
    statement_class BodyStatement

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

  end
end