diff options
Diffstat (limited to 'lib/yard/mruby/handlers/source/method_handler.rb')
| -rw-r--r-- | lib/yard/mruby/handlers/source/method_handler.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/yard/mruby/handlers/source/method_handler.rb b/lib/yard/mruby/handlers/source/method_handler.rb new file mode 100644 index 0000000..f3eab8c --- /dev/null +++ b/lib/yard/mruby/handlers/source/method_handler.rb @@ -0,0 +1,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 |
