free_mutant/lib/mutant/mutator/node/generic.rb

41 lines
1.1 KiB
Ruby
Raw Normal View History

module Mutant
class Mutator
class Node
# Generic mutator
class Generic < self
handle(:self)
# These nodes still need a dedicated mutator,
# your contribution is that close!
handle(
:zsuper, :not, :or, :and, :defined,
:next, :break, :match, :gvar, :cvar, :ensure,
:dstr, :dsym, :yield, :rescue, :redo, :defined?,
2013-07-15 16:25:09 -04:00
:lvar, :const, :blockarg, :block_pass, :op_asgn, :and_asgn,
:regopt, :ivar, :restarg, :casgn, :resbody, :retry, :arg_expr,
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :cbase, :empty,
:alias, :for, :xstr, :back_ref, :nth_ref, :class,
:sclass, :match_with_lvasgn, :match_current_line, :or_asgn, :kwbegin
)
2013-04-17 23:31:21 -04:00
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
2013-07-05 13:17:17 -04:00
children.each_with_index do |child, index|
next unless child.kind_of?(Parser::AST::Node)
mutate_child(index)
end
end
2013-06-04 17:44:32 -04:00
2013-06-14 14:54:02 -04:00
end # Noop
2013-06-04 17:44:32 -04:00
end # Node
end # Mutator
end # Mutant