class RuboCop::AST::NodePattern::Compiler::SequenceSubcompiler

def preserve_union_start(forks)

Modifies in place `forks` to insure that `cur_{child|index}_var` are ok
def preserve_union_start(forks)
  return if @cur_index != :variadic_mode || forks.size <= 1
  compiler.with_temp_variables do |union_reset|
    cur = "(#{union_reset} = [#{@cur_child_var}, #{@cur_index_var}]) && "
    reset = "(#{@cur_child_var}, #{@cur_index_var} = #{union_reset}) && "
    forks.transform_values! do |code|
      code = "#{cur}#{code}"
      cur = reset
      code
    end
  end
end