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

def compile_union_forks

Returns:
  • (Hash) - of {subcompiler => code}
def compile_union_forks
  compiler.each_union(node.children).map do |child|
    subsequence_terms = child.is_a?(Node::Subsequence) ? child.children : [child]
    fork = dup
    code = fork.compile_terms(subsequence_terms, @remaining_arity)
    @in_sync = false if @cur_index != :variadic_mode
    [fork, code]
  end.to_h # we could avoid map if RUBY_VERSION >= 2.6...
end