class Crispr::Mutations::Symbol

def mutations_for(node)

Returns:
  • (Array) -

Parameters:
  • node (Parser::AST::Node) --
def mutations_for(node)
  return [] unless node.type == :sym
  value = node.children.first
  mutations = []
  # Change the symbol to an empty symbol
  mutations << s(:sym, :"") unless value == :""
  # Change the symbol to a different symbol
  mutations << s(:sym, :mutated) unless value == :mutated
  # Remove the symbol node entirely (i.e., replace with nil)
  mutations << s(:nil)
  mutations
end