class RuboCop::NodePattern::Compiler

def union_terms(tokens, temp_node, seq_head)

def union_terms(tokens, temp_node, seq_head)
  # we need to ensure that each branch of the {} contains the same
  # number of captures (since only one branch of the {} can actually
  # match, the same variables are used to hold the captures for each
  # branch)
  compile_expr_with_captures(tokens,
                             temp_node, seq_head) do |term, before, after|
    terms = [term]
    until tokens.first == '}'
      terms << compile_expr_with_capture_check(tokens, temp_node,
                                               seq_head, before, after)
    end
    tokens.shift
    terms
  end
end