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

37 lines
898 B
Ruby
Raw Normal View History

module Mutant
class Mutator
class Node
2013-07-22 03:33:35 -04:00
# Generic mutator
class Generic < self
# These nodes still need a dedicated mutator,
# your contribution is that close!
handle(
:ensure, :redo, :regopt, :retry, :arg_expr,
2013-07-24 00:58:10 -04:00
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
2013-08-02 19:36:13 -04:00
:alias, :for, :xstr, :back_ref, :class,
:sclass, :match_with_lvasgn, :while_post,
2014-01-10 16:05:32 -05:00
:until_post, :preexe, :postexe, :iflipflop, :eflipflop, :kwsplat,
:shadowarg
)
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|
mutate_child(index) if child.kind_of?(Parser::AST::Node)
end
end
2013-06-04 17:44:32 -04:00
2013-07-16 17:09:04 -04:00
end # Generic
2013-06-04 17:44:32 -04:00
end # Node
end # Mutator
end # Mutant