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

def merge_forks!(forks)

Syncs our state
Modifies in place `forks`
def merge_forks!(forks)
  sub_compilers = forks.keys
  if !node.variadic? # e.g {a b | c d}
    @cur_index = sub_compilers.first.cur_index # all cur_index should be equivalent
  elsif use_index_from_end
    # nothing to do
  else
    # can't use index from end, so we must sync all forks
    @cur_index = :variadic_mode
    forks.each do |sub, code|
      sub.sync { |sync_code| forks[sub] = "#{code} && #{sync_code}" }
    end
  end
  @in_sync = sub_compilers.all?(&:in_sync)
end