# File lib/asciidoctor/extensions.rb, line 1293
    def register *args, &block
      argc = args.length
      resolved_group = if block_given?
        block
      elsif !(group = args.pop)
        raise ::ArgumentError.new %(Extension group to register not specified)
      else
        # QUESTION should we instantiate the group class here or defer until
        # activation??
        case group
        when ::Class
          group
        when ::String
          class_for_name group
        when ::Symbol
          class_for_name group.to_s
        else
          group
        end
      end
      name = args.pop || generate_name
      unless args.empty?
        raise ::ArgumentError.new %(Wrong number of arguments (#{argc} for 1..2))
      end
      groups[name] = resolved_group
    end