def render(*args)
      return ''.freeze if @root.nil?

      context = case args.first
      when Liquid::Context
        c = args.shift

        if @rethrow_errors
          c.exception_renderer = ->(e) { raise }
        end

        c
      when Liquid::Drop
        drop = args.shift
        drop.context = Context.new([drop, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)
      when Hash
        Context.new([args.shift, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)
      when nil
        Context.new(assigns, instance_assigns, registers, @rethrow_errors, @resource_limits)
      else
        raise ArgumentError, "Expected Hash or Liquid::Context as parameter"
      end

      case args.last
      when Hash
        options = args.pop

        registers.merge!(options[:registers]) if options[:registers].is_a?(Hash)

        apply_options_to_context(context, options)
      when Module, Array
        context.add_filters(args.pop)
      end

      # Retrying a render resets resource usage
      context.resource_limits.reset

      begin
        # render the nodelist.
        # for performance reasons we get an array back here. join will make a string out of it.
        result = with_profiling(context) do
          @root.render(context)
        end
        result.respond_to?(:join) ? result.join : result
      rescue Liquid::MemoryError => e
        context.handle_error(e)
      ensure
        @errors = context.errors
      end
    end
def render(*args)
      return ''.freeze if @root.nil?

      context = case args.first
      when Liquid::Context
        c = args.shift

        if @rethrow_errors
          c.exception_renderer = ->(e) { raise }
        end

        c
      when Liquid::Drop
        drop = args.shift
        drop.context = Context.new([drop, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)
      when Hash
        Context.new([args.shift, assigns], instance_assigns, registers, @rethrow_errors, @resource_limits)
      when nil
        Context.new(assigns, instance_assigns, registers, @rethrow_errors, @resource_limits)
      else
        raise ArgumentError, "Expected Hash or Liquid::Context as parameter"
      end

      case args.last
      when Hash
        options = args.pop

        registers.merge!(options[:registers]) if options[:registers].is_a?(Hash)

        apply_options_to_context(context, options)
      when Module, Array
        context.add_filters(args.pop)
      end

      # Retrying a render resets resource usage
      context.resource_limits.reset

      begin
        # render the nodelist.
        # for performance reasons we get an array back here. join will make a string out of it.
        result = with_profiling(context) do
          @root.render(context)
        end
        result.respond_to?(:join) ? result.join : result
      rescue Liquid::MemoryError => e
        context.handle_error(e)
      ensure
        @errors = context.errors
      end
    end
Render takes a hash with local variables.

 if you use the same filters over and over again consider registering them globally
 with <tt>Template.register_filter</tt>

 if profiling was enabled in <tt>Template#parse</tt> then the resulting profiling information
 will be available via <tt>Template#profiler</tt>

 Following options can be passed:

  * <tt>filters</tt> : array with local filters
  * <tt>registers</tt> : hash with register variables. Those can be accessed from
    filters and tags and might be useful to integrate liquid more with its host application