class RuboCop::NodePattern::Compiler

def compile_wildcard(cur_node, name, seq_head)

def compile_wildcard(cur_node, name, seq_head)
  if name.empty?
    'true'
  elsif @unify.key?(name)
    # we have already seen a wildcard with this name before
    # so the value it matched the first time will already be stored
    # in a temp. check if this value matches the one stored in the temp
    "(#{cur_node}#{'.type' if seq_head} == temp#{@unify[name]})"
  else
    n = @unify[name] = next_temp_value
    # double assign to temp#{n} to avoid "assigned but unused variable"
    "(temp#{n} = temp#{n} = #{cur_node}#{'.type' if seq_head}; true)"
  end
end