From bbb3672ebc74ff8fafdf0bcdb58ac2b968c34f93 Mon Sep 17 00:00:00 2001 From: Loren Segal Date: Sat, 22 Mar 2014 14:05:12 -0700 Subject: [PATCH] Mark C methods as explicit but also remove explicit check in stats. Given the use of macros and directives to define methods, the explicit check should not be used to rule out objects in method counts of stats. Fixes #727 --- lib/yard/cli/stats.rb | 2 +- lib/yard/handlers/c/handler_methods.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/yard/cli/stats.rb b/lib/yard/cli/stats.rb index 205fe2668..61d9438d5 100644 --- a/lib/yard/cli/stats.rb +++ b/lib/yard/cli/stats.rb @@ -128,7 +128,7 @@ def stats_for_constants # Statistics for methods def stats_for_methods objs = all_objects.select {|m| m.type == :method } - objs.reject! {|m| m.is_alias? || !m.is_explicit? } + objs.reject! {|m| m.is_alias? } undoc = objs.select {|m| m.docstring.blank? } @undoc_list |= undoc if @undoc_list output "Methods", objs.size, undoc.size diff --git a/lib/yard/handlers/c/handler_methods.rb b/lib/yard/handlers/c/handler_methods.rb index 1026b6829..0d8d21912 100644 --- a/lib/yard/handlers/c/handler_methods.rb +++ b/lib/yard/handlers/c/handler_methods.rb @@ -55,6 +55,7 @@ def handle_method(scope, var_name, name, func_name, source_file = nil) register MethodObject.new(namespace, name, scope) do |obj| register_visibility(obj, visibility) find_method_body(obj, func_name) + obj.explicit = true obj.add_tag(Tags::Tag.new(:return, '', 'Boolean')) if name =~ /\?$/ end end