free_mutant/lib/mutant/mutator/node/const.rb
Markus Schirp 2ce02af8aa Fix style
2014-12-22 01:32:51 +00:00

29 lines
616 B
Ruby

module Mutant
class Mutator
class Node
# Mutation emitter to handle const nodes
class Const < self
handle(:const)
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
emit_singletons unless parent_node && n_const?(parent_node)
emit_type(nil, *children.drop(1))
children.each_with_index do |child, index|
mutate_child(index) if child.instance_of?(Parser::AST::Node)
end
end
end # Const
end # Node
end # Mutator
end # Mutant