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

39 lines
949 B
Ruby
Raw Normal View History

# encoding: utf-8
module Mutant
class Mutator
class Node
2013-07-22 00:33:35 -07:00
# Generic mutator
class Generic < self
# These nodes still need a dedicated mutator,
# your contribution is that close!
handle(
:ensure, :redo, :defined?, :regopt, :retry, :arg_expr,
2013-07-23 21:58:10 -07:00
:kwrestarg, :kwoptarg, :kwarg, :undef, :module, :empty,
2013-08-03 01:36:13 +02:00
:alias, :for, :xstr, :back_ref, :class,
:sclass, :match_with_lvasgn, :match_current_line, :while_post,
2014-01-10 22:05:32 +01:00
:until_post, :preexe, :postexe, :iflipflop, :eflipflop, :kwsplat,
:shadowarg
)
2013-04-17 20:31:21 -07:00
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
2013-07-05 19:17:17 +02:00
children.each_with_index do |child, index|
mutate_child(index) if child.kind_of?(Parser::AST::Node)
end
end
2013-06-04 23:44:32 +02:00
2013-07-16 23:09:04 +02:00
end # Generic
2013-06-04 23:44:32 +02:00
end # Node
end # Mutator
end # Mutant