lib/roda/plugins/backtracking_array.rb
# When matching for a single array, after a successful
# array element match, attempt to match all remaining
# elements.  If the remaining elements could not be
# matched, reset the state and continue to the next
# entry in the array.
When matching for a single array, after a successful
array element match, attempt to match all remaining
elements.  If the remaining elements could not be
matched, reset the state and continue to the next
entry in the array.
When matching for a single array after a successful array element match attempt to match all remaining elements . If the remaining elements could not be matched reset the state and continue to the next entry in the array .
def _match_array(arg, rest)
          path = @remaining_path
          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
              captures.replace(caps)
              @remaining_path = path
            end
          end
          false
        end
def _match_array ( arg , rest ) path = @remaining_path 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 captures . replace ( caps ) @remaining_path = path end end false end
When matching for a single array, after a successful
array element match, attempt to match all remaining
elements.
When matching for a single array after a successful array element match attempt to match all remaining elements .
# Matching all remaining elements failed, reset state
arg
rest