free_mutant/lib/mutant/mutator/node/const.rb
Markus Schirp 017ccc1044 Add expression => self mutation
Also reorganizes parts of meta to align filenames to node name better.

Closes #191
2014-06-05 17:48:39 +00:00

31 lines
616 B
Ruby

# encoding: utf-8
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_type == :const
emit_type(nil, *children.drop(1))
children.each_with_index do |child, index|
mutate_child(index) if child.kind_of?(Parser::AST::Node)
end
end
end # Const
end # Node
end # Mutator
end # Mutant