def register(*objects)
objects.flatten.each do |object|
next unless object.is_a?(CodeObjects::Base)
begin
ensure_loaded!(object.namespace)
object.namespace.children << object
rescue NamespaceMissingError
end
yield(object) if block_given?
object.add_file(parser.file, statement.line, statement.comments)
object.docstring = statement.comments if statement.comments
object.docstring.hash_flag = statement.comments_hash_flag
object.docstring.line_range = statement.comments_range
if statement.group
unless object.namespace.is_a?(Proxy)
object.namespace.groups |= [statement.group]
end
object.group = statement.group
end
Tags::Library.transitive_tags.each do |tag|
next if object.namespace.is_a?(Proxy)
next unless object.namespace.has_tag?(tag)
next if object.has_tag?(tag)
object.docstring.add_tag(*object.namespace.tags(tag))
end
unless object.is_a?(NamespaceObject)
object.source ||= statement
end
object.dynamic = true if owner != namespace
end
objects.size == 1 ? objects.first : objects
end