module YARD::Handlers::Ruby::DSLHandlerMethods

def handle_comments

def handle_comments
  return if IGNORE_METHODS[caller_method]
  @docstring = statement.comments || ""
  @docstring = @docstring.join("\n") if @docstring.is_a?(Array)
  attaching = false
  if @docstring =~ /^@!?macro\s+\[[^\]]*attach/
    register_docstring(nil)
    @docstring = ""
    attaching = true
  end
  macro = find_attached_macro
  if macro
    txt = macro.expand([caller_method, *call_params], statement.source)
    @docstring += "\n" + txt
    # macro may have a directive
    return register_docstring(nil) if !attaching && txt.match(/^\s*@!/)
  elsif !statement.comments_hash_flag && !implicit_docstring?
    return register_docstring(nil)
  end
  # ignore DSL definitions if @method/@attribute directive is used
  if @docstring =~ /^@!?(method|attribute)\b/
    return register_docstring(nil)
  end
  register MethodObject.new(namespace, method_name, scope) do |o|
    o.signature = method_signature
  end
end