module Roda::RodaPlugins::BacktrackingArray::RequestMethods

def _match_array(arg, rest=nil)

entry in the array.
matched, reset the state and continue to the next
elements. If the remaining elements could not be
array element match, attempt to match all remaining
When matching for a single array, after a successful
def _match_array(arg, rest=nil)
  return super unless rest
  unless path = @remaining_path
    e = @env
    script = e[SCRIPT_NAME]
    path = e[PATH_INFO]
  end
  captures = @captures
  caps = captures.dup
  arg.each do |v|
    if match(v, rest)
      if v.is_a?(String)
        captures.push(v)
      end
      if match_all(rest)
        return true
      end
      # Matching all remaining elements failed, reset state
      captures.replace(caps)
      if @remaining_path
        @remaining_path = path
      else
        e[SCRIPT_NAME] = script
        e[PATH_INFO] = path
      end
    end
  end
  false
end