summaryrefslogtreecommitdiffhomepage
path: root/lib/yard/mruby/handlers/c/header/function_handler.rb
diff options
context:
space:
mode:
authorSeba Gamboa <[email protected]>2015-09-29 12:26:52 -0300
committerSeba Gamboa <[email protected]>2015-09-29 12:26:52 -0300
commitb8602d593eff73609e2f2682375f546f61b58f73 (patch)
tree3628717151b604383024e5680928ddeea19a9a2c /lib/yard/mruby/handlers/c/header/function_handler.rb
parentbe49b0e4472afbc98c386f1c14afd1598ee14d16 (diff)
downloadyard-mruby-b8602d593eff73609e2f2682375f546f61b58f73.tar.gz
yard-mruby-b8602d593eff73609e2f2682375f546f61b58f73.zip
parse parameter types
Diffstat (limited to 'lib/yard/mruby/handlers/c/header/function_handler.rb')
-rw-r--r--lib/yard/mruby/handlers/c/header/function_handler.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/yard/mruby/handlers/c/header/function_handler.rb b/lib/yard/mruby/handlers/c/header/function_handler.rb
index 079f114..3d401a8 100644
--- a/lib/yard/mruby/handlers/c/header/function_handler.rb
+++ b/lib/yard/mruby/handlers/c/header/function_handler.rb
@@ -4,7 +4,7 @@ module YARD::MRuby::Handlers::C::Header
MRB_(API|INLINE)\s+
((struct\s+)?\w+(\s*\*)?)\s*
((\w+\s+)+)?(\w+)\s*
- \(([\w\s\*,])*\)
+ \(([\w\s\*,]*)\)
/mx
handles MATCH
@@ -17,15 +17,14 @@ module YARD::MRuby::Handlers::C::Header
def handle_function(statement)
header = self.header(statement.file)
-["API", "mrb_value", nil, nil, nil, nil, "sample_api_method"]
- statement.source.scan(MATCH) do |type, retype, _,_,_,_, name, *args|
- puts args.inspect
+ statement.source.scan(MATCH) do |type, retype, _,_,_,_, name, parameters|
register FunctionObject.new(header, name) do |obj|
if statement.comments
register_docstring(obj, statement.comments.source, statement)
end
obj.return_type = retype
+ obj.parse_parameter_types(parameters)
end
end